rabbitizer/include/instructions/RabbitizerInstrDescriptor.h

64 lines
1.9 KiB
C
Raw Normal View History

2022-06-03 17:46:51 +00:00
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
/* SPDX-License-Identifier: MIT */
#ifndef RABBITIZER_INSTRDESCRIPTOR_H
#define RABBITIZER_INSTRDESCRIPTOR_H
#pragma once
#include <stdbool.h>
#include "RabbitizerOperandType.h"
2022-06-03 17:46:51 +00:00
#include "RabbitizerInstrId.h"
typedef enum RabbitizerInstrType {
RABBITIZER_INSTR_TYPE_UNKNOWN,
RABBITIZER_INSTR_TYPE_J,
RABBITIZER_INSTR_TYPE_I,
RABBITIZER_INSTR_TYPE_R,
RABBITIZER_INSTR_TYPE_REGIMM,
RABBITIZER_INSTR_TYPE_MAX,
} RabbitizerInstrType;
typedef struct RabbitizerInstrDescriptor {
RabbitizerOperandType operands[4];
2022-06-03 17:46:51 +00:00
RabbitizerInstrType instrType;
bool isBranch;
bool isBranchLikely;
bool isJump;
bool isTrap;
bool isFloat;
bool isDouble;
bool isUnsigned;
bool modifiesRt;
bool modifiesRd;
int mipsVersion;
} RabbitizerInstrDescriptor;
2022-06-03 18:19:43 +00:00
// TODO: less redundant name
2022-06-04 00:19:58 +00:00
extern const RabbitizerInstrDescriptor RabbitizerInstrDescriptor_Descriptors[];
2022-06-03 17:46:51 +00:00
2022-06-04 06:17:25 +00:00
2022-06-05 17:19:45 +00:00
bool RabbitizerInstrDescriptor_isJType(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_isIType(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_isRType(const RabbitizerInstrDescriptor *self);
2022-06-04 06:17:25 +00:00
2022-06-05 17:19:45 +00:00
bool RabbitizerInstrDescriptor_isBranch(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_isBranchLikely(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_isJump(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_isTrap(const RabbitizerInstrDescriptor *self);
2022-06-04 06:17:25 +00:00
2022-06-05 17:19:45 +00:00
bool RabbitizerInstrDescriptor_isFloat(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_isDouble(const RabbitizerInstrDescriptor *self);
2022-06-04 06:17:25 +00:00
2022-06-05 17:19:45 +00:00
bool RabbitizerInstrDescriptor_isUnsigned(const RabbitizerInstrDescriptor *self);
2022-06-04 06:17:25 +00:00
2022-06-05 17:19:45 +00:00
bool RabbitizerInstrDescriptor_modifiesRt(const RabbitizerInstrDescriptor *self);
bool RabbitizerInstrDescriptor_modifiesRd(const RabbitizerInstrDescriptor *self);
2022-06-04 06:17:25 +00:00
2022-06-03 17:46:51 +00:00
#endif