rabbitizer/include/instructions/RabbitizerInstructionRsp.h

50 lines
2.0 KiB
C
Raw Normal View History

2022-06-07 02:19:42 +00:00
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
/* SPDX-License-Identifier: MIT */
2022-06-08 06:17:35 +00:00
#ifndef RABBITIZER_INSTRUCTION_RSP_H
#define RABBITIZER_INSTRUCTION_RSP_H
2022-06-07 02:19:42 +00:00
#pragma once
#include "RabbitizerInstruction.h"
2022-06-07 02:19:42 +00:00
#define RAB_INSTR_RSP_GET_VS(self) (SHIFTR((self)->word, 11, 5))
#define RAB_INSTR_RSP_GET_VT(self) (SHIFTR((self)->word, 16, 5))
#define RAB_INSTR_RSP_GET_VD(self) (SHIFTR((self)->word, 6, 5))
2022-06-07 06:28:10 +00:00
#define RAB_INSTR_RSP_GET_elementhigh(self) (SHIFTR((self)->word, 21, 4))
#define RAB_INSTR_RSP_GET_elementlow(self) (SHIFTR((self)->word, 7, 4))
#define RAB_INSTR_RSP_GET_OFFSET_VECTOR_RAW(self) (SHIFTR((self)->word, 0, 7))
#define RAB_INSTR_RSP_GET_index(self) (SHIFTR((self)->word, 7, 4))
2022-07-03 23:28:13 +00:00
#define RAB_INSTR_RSP_PACK_vs(word, value) (BITREPACK((word), value, 11, 5))
#define RAB_INSTR_RSP_PACK_vt(word, value) (BITREPACK((word), value, 16, 5))
#define RAB_INSTR_RSP_PACK_vd(word, value) (BITREPACK((word), value, 6, 5))
2022-07-03 23:28:13 +00:00
#define RAB_INSTR_RSP_PACK_elementhigh(word, value) (BITREPACK((word), value, 16, 4))
#define RAB_INSTR_RSP_PACK_elementlow(word, value) (BITREPACK((word), value, 7, 4))
2022-07-03 23:28:13 +00:00
#define RAB_INSTR_RSP_PACK_index(word, value) (BITREPACK((word), value, 7, 4))
#define RAB_INSTR_RSP_PACK_offset(word, value) (BITREPACK((word), value, 0, 7))
2022-06-07 02:19:42 +00:00
void RabbitizerInstructionRsp_init(RabbitizerInstruction *self, uint32_t word);
void RabbitizerInstructionRsp_destroy(RabbitizerInstruction *self);
2022-06-07 02:19:42 +00:00
void RabbitizerInstructionRsp_processUniqueId_Normal(RabbitizerInstruction *self);
void RabbitizerInstructionRsp_processUniqueId_Special(RabbitizerInstruction *self);
void RabbitizerInstructionRsp_processUniqueId_Regimm(RabbitizerInstruction *self);
2022-06-07 02:42:22 +00:00
void RabbitizerInstructionRsp_processUniqueId(RabbitizerInstruction *self);
2022-06-07 02:19:42 +00:00
uint16_t RabbitizerInstructionRsp_GetOffsetVector(const RabbitizerInstruction *self);
2022-06-07 02:19:42 +00:00
uint8_t RabbitizerInstructionRsp_processVectorElement(const RabbitizerInstruction *self, uint8_t element);
2022-06-07 02:19:42 +00:00
#endif