#define OFFSET_OF_CODE 0
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
extern size_t textbegin;
#define TORIGIN (unsigned int) textbegin
#define OP(x) (((union instruct *) (x))->f_1.op)
#define DISP30(x) (((union instruct *) (x))->f_1.disp30)
#define OP3(x) (((union instruct *) (x))->f_3c.op3)
#define RD(x) (((union instruct *) (x))->f_3c.rd)
#define IMMED(x) (((union instruct *) (x))->f_3c.i)
#define SIMM13(x) (((((union instruct *) (x))->f_3d.simm13) << 19) >> 19)
#define RS1(x) (((union instruct *) (x))->f_3c.rs1)
#define RS2(x) (((union instruct *) (x))->f_3c.rs2)
#define CALL 0x1
#define FMT3_0x10 0x2
#define JMPL 0x38
#define R_G0 0x0
#define R_O7 0xF
#define R_I7 0x1F
#define PC_VAL(x) ((x) - (unsigned long) textspace + TORIGIN)
struct f_1 {
unsigned long op:2,
disp30:30;
};
struct f_2a {
unsigned long op:2,
rd:5,
op2:3,
imm22:22;
};
struct f_2b {
unsigned long op:2,
a:1,
cond:4,
op2:3,
disp22:22;
};
struct f_3a {
unsigned long op:2,
ign1:1,
cond:4,
op3:6,
rs1:5,
i:1,
ign2:8,
rs2:5;
};
struct f_3b {
unsigned long op:2,
ign1:1,
cond:4,
op3:6,
rs1:5,
i:1,
simm13:13;
};
struct f_3c {
unsigned long op:2,
rd:5,
op3:6,
rs1:5,
i:1,
asi:8,
rs2:5;
};
struct f_3d {
unsigned long op:2,
rd:5,
op3:6,
rs1:5,
i:1,
simm13:13;
};
struct f_3e {
unsigned long op:2,
rd:5,
op3:6,
rs1:5,
opf:9,
rs2:5;
};
union instruct {
struct f_1 f_1;
struct f_2a f_2a;
struct f_2b f_2b;
struct f_3a f_3a;
struct f_3b f_3b;
struct f_3c f_3c;
struct f_3d f_3d;
struct f_3e f_3e;
};