rabbitizer/include/instructions/RabbitizerInstructionRsp.h

50 lines
2.2 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))
#define RAB_INSTR_RSP_SET_vs(self, value) ((self)->word = BITREPACK((self)->word, value, 11, 5))
#define RAB_INSTR_RSP_SET_vt(self, value) ((self)->word = BITREPACK((self)->word, value, 16, 5))
#define RAB_INSTR_RSP_SET_vd(self, value) ((self)->word = BITREPACK((self)->word, value, 6, 5))
#define RAB_INSTR_RSP_SET_elementhigh(self, value) ((self)->word = BITREPACK((self)->word, value, 16, 4))
#define RAB_INSTR_RSP_SET_elementlow(self, value) ((self)->word = BITREPACK((self)->word, value, 7, 4))
#define RAB_INSTR_RSP_SET_index(self, value) ((self)->word = BITREPACK((self)->word, value, 7, 4))
#define RAB_INSTR_RSP_SET_offset(self, value) ((self)->word = BITREPACK((self)->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