allints = intpatterns + cintpatterns[2:] # skip the WRITE_RVC_xx ones
skip = '#define USING_NOREGS\n' \
- '#define REGS_PATTERN 0x0\n'
+ '#define REGS_PATTERN 0x0\n' \
+ '#define INSN_FLEN 0\n'
# this matches the order of the 5 predication arguments to
drlookup = { 'rd': 0, 'frd': 0, 'rs1': 1, 'rs2': 2, 'rs3': 3,
with open(fname) as f:
f = f.read()
dest_reg = None
+ flen = 0
+ if "f128(" in f:
+ flen = 128
+ elif "f64(" in f:
+ flen = 64
+ elif "f32(" in f:
+ flen = 32
for pattern in patterns:
x = f.find(pattern)
if x == -1:
if not res:
return skip
res.append('#define REGS_PATTERN 0x%x' % isintfloat)
+ res.append('#define INSN_FLEN %d' % flen)
predargs = ['dest_pred'] * 5
if immed_offset: # C.LWSP
reg_t target_pred = ~0x0;
bool zeroingtarg = false;
#endif
- sv_insn_t insn(p, sv_enabled, bits, floatintmap, xlen, PRED_ARGS, OFFS_ARGS,
+ sv_insn_t insn(p, sv_enabled, bits, floatintmap, xlen, INSN_FLEN,
+ PRED_ARGS, OFFS_ARGS,
#ifdef INSN_TYPE_SIGNED
true
#else
}
sv_insn_t::sv_insn_t(processor_t *pr, bool _sv_enabled,
- insn_bits_t bits, unsigned int f, int _xlen,
+ insn_bits_t bits, unsigned int f, int _xlen, int _flen,
uint64_t &p_rd, uint64_t &p_rs1, uint64_t &p_rs2, uint64_t &p_rs3,
uint64_t &p_sp, uint64_t *p_im,
int *o_rd, int *o_rs1, int *o_rs2, int *o_rs3, int *o_sp,
int *o_imm,
bool _sign) :
- insn_t(bits), p(pr), src_bitwidth(0), xlen(_xlen),
+ insn_t(bits), p(pr), src_bitwidth(0), xlen(_xlen), flen(_flen),
sv_enabled(_sv_enabled), signextended(_sign),
vloop_continue(false),
at_least_one_reg_vectorised(false), fimap(f),
{
public:
sv_insn_t(processor_t *pr, bool _sv_enabled, insn_bits_t bits, unsigned int f,
- int xlen,
+ int xlen, int flen,
uint64_t &p_rd, uint64_t &p_rs1, uint64_t &p_rs2, uint64_t &p_rs3,
uint64_t &p_sp, uint64_t *p_im,
int *o_rd, int *o_rs1, int *o_rs2, int *o_rs3, int *o_sp,
processor_t *p;
uint8_t src_bitwidth;
int xlen;
+ int flen;
bool sv_enabled;
bool signextended;