offs = *spec.offset;
shift = offs % nbytes;
offs /= nbytes;
+ fprintf(stderr, "writereg spec %ld bitwidth %d offs %d shift %d\n",
+ spec.reg, bitwidth, offs, shift);
reg += offs;
}
if (xlen != bitwidth)
wval = wval << (shift*bitwidth); // gets element within the reg-block
uint64_t ndata = data & (uint64_t)(~mask); // masks off the right bits
wval |= ndata;
- fprintf(stderr, "writereg %lx bitwidth %d offs %d shift %d %lx " \
+ fprintf(stderr, "writereg %ld bitwidth %d offs %d shift %d %lx " \
" %lx %lx %lx\n",
spec.reg, bitwidth, offs, shift, data,
ndata, mask, wval);
{
uint8_t bitwidth = _insn->src_bitwidth;
if (bitwidth == xlen) {
+ //fprintf(stderr, "add result %lx %lx %lx\n",
+ // (uint64_t)lhs, (uint64_t)rhs, (uint64_t)(lhs + rhs));
return lhs + rhs;
}
uint64_t vlhs = 0;
result = zext_bwid(result, bitwidth);
}
uint8_t reswidth = maxelwidth(lhs.get_elwidth(), rhs.get_elwidth());
+ //fprintf(stderr, "add result %ld\n", result);
return sv_reg_t(result, xlen, reswidth); // XXX TODO: bitwidth
}