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
|
|
|
|
|
2022-06-08 04:30:58 +00:00
|
|
|
#include "RabbitizerInstruction.h"
|
2022-06-07 02:19:42 +00:00
|
|
|
|
2022-10-04 11:31:02 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-06-07 02:19:42 +00:00
|
|
|
|
2022-08-22 20:27:51 +00:00
|
|
|
#define RAB_INSTR_RSP_GET_cop2t(self) (SHIFTR((self)->word, 16, 5))
|
|
|
|
#define RAB_INSTR_RSP_GET_cop2cd(self) (SHIFTR((self)->word, 11, 5))
|
|
|
|
|
|
|
|
#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
|
|
|
|
2022-07-03 12:34:26 +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))
|
2022-07-02 22:49:05 +00:00
|
|
|
|
2022-07-03 12:34:26 +00:00
|
|
|
#define RAB_INSTR_RSP_GET_index(self) (SHIFTR((self)->word, 7, 4))
|
2022-08-22 20:27:51 +00:00
|
|
|
#define RAB_INSTR_RSP_GET_de(self) (SHIFTR((self)->word, 11, 5))
|
|
|
|
|
2022-07-03 12:34:26 +00:00
|
|
|
|
2022-08-22 20:27:51 +00:00
|
|
|
#define RAB_INSTR_RSP_PACK_cop2t(word, value) (BITREPACK((word), value, 16, 5))
|
|
|
|
#define RAB_INSTR_RSP_PACK_cop2cd(word, value) (BITREPACK((word), value, 11, 5))
|
2022-07-03 12:34:26 +00:00
|
|
|
|
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 12:34:26 +00:00
|
|
|
|
2022-08-22 20:27:51 +00:00
|
|
|
#define RAB_INSTR_RSP_PACK_elementhigh(word, value) (BITREPACK((word), value, 21, 4))
|
2022-07-03 23:28:13 +00:00
|
|
|
#define RAB_INSTR_RSP_PACK_elementlow(word, value) (BITREPACK((word), value, 7, 4))
|
2022-07-03 12:34:26 +00:00
|
|
|
|
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-08-22 20:27:51 +00:00
|
|
|
#define RAB_INSTR_RSP_PACK_de(word, value) (BITREPACK((word), value, 11, 5))
|
2022-06-07 02:19:42 +00:00
|
|
|
|
|
|
|
|
2022-07-09 23:19:53 +00:00
|
|
|
NON_NULL(1)
|
2022-07-07 18:22:41 +00:00
|
|
|
void RabbitizerInstructionRsp_init(RabbitizerInstruction *self, uint32_t word, uint32_t vram);
|
2022-07-09 23:19:53 +00:00
|
|
|
NON_NULL(1)
|
2022-06-08 04:30:58 +00:00
|
|
|
void RabbitizerInstructionRsp_destroy(RabbitizerInstruction *self);
|
2022-06-07 02:19:42 +00:00
|
|
|
|
|
|
|
|
2022-07-09 23:19:53 +00:00
|
|
|
NON_NULL(1)
|
2022-06-08 04:30:58 +00:00
|
|
|
void RabbitizerInstructionRsp_processUniqueId_Normal(RabbitizerInstruction *self);
|
2022-07-09 23:19:53 +00:00
|
|
|
NON_NULL(1)
|
2022-06-08 04:30:58 +00:00
|
|
|
void RabbitizerInstructionRsp_processUniqueId_Special(RabbitizerInstruction *self);
|
2022-07-09 23:19:53 +00:00
|
|
|
NON_NULL(1)
|
2022-06-08 04:30:58 +00:00
|
|
|
void RabbitizerInstructionRsp_processUniqueId_Regimm(RabbitizerInstruction *self);
|
2022-06-07 02:42:22 +00:00
|
|
|
|
2022-07-09 23:19:53 +00:00
|
|
|
NON_NULL(1)
|
2022-06-08 04:30:58 +00:00
|
|
|
void RabbitizerInstructionRsp_processUniqueId(RabbitizerInstruction *self);
|
2022-06-07 02:19:42 +00:00
|
|
|
|
|
|
|
|
2022-07-09 23:19:53 +00:00
|
|
|
NODISCARD NON_NULL(1) PURE
|
2022-06-08 04:30:58 +00:00
|
|
|
uint16_t RabbitizerInstructionRsp_GetOffsetVector(const RabbitizerInstruction *self);
|
2022-06-07 02:19:42 +00:00
|
|
|
|
|
|
|
|
2022-10-04 11:31:02 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-06-07 02:19:42 +00:00
|
|
|
#endif
|