Closed Trolldemorted closed 3 years ago
The vector registers are defined as one big register called _V, that's a vector of bitvectors. Originally R0-R31 were similar but I manually split them apart. In Sail/ASL there are accessor functions so you can write Q(n) = value
.
However when isla-lib executes the push it writes a Symbolic(Sym { id: 20084 }) to the stack, and I don't really know why. I wanted to look at Q0's value, but I didn't find any SIMD-registers in local_state.regs:
Probably just means we are representing its value in the SMT solver because it's more than 64 bits long. Rather than implement arbitrary precision bitvectors ourselves we just use Z3's arbitrary precision bitvectors. Currently I have support for either a max bitvector length (in Isla) of either 64-bits or 129-bits (for making CHERI capabilities a bit easier to work with), and everything larger is left to Z3.
So if the values are being split into smaller parts when they are being loaded, those will contain the correct values? That's neat!
My compiler is generating code that puts a 192bit (3x usize) struct into a Q register and pushes it on the stack:
I looked at the output and saw that the
ADRP
emulation causes two separate 8 byte reads:I verified with a debugger that
read_concrete
returns the correct byte_vec withOk(Val::Bits(B::from_bytes(&byte_vec)))
for both reads.However when isla-lib executes the push it writes a
Symbolic(Sym { id: 20084 })
to the stack, and I don't really know why. I wanted to look at Q0's value, but I didn't find any SIMD-registers inlocal_state.regs
:A
rg -i "register "
over the sail model suggest that those registers are not defined. Is that the case, and if yes shouldn't isla-lib return an exec error when they are erroneously being accessed?