[libre-riscv-dev] spike-sv elwidth integer operator macros

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri Nov 9 12:27:40 GMT 2018


ok so i have a series of macros which i am using to apply the variable
bitwidth rules, to integer operations: arithmetic, compare, shift and
mulh, they're all slightly different groups.

for FP i am "cheating" by actually having the operation be carried out
at the unmodified bitwidth (128, 64, 32), but over-riding the
entry/exit points from the register file, which is the conversion
routines. to f128, f64 and f32.  this approach was a *lot* easier than
overriding the actual floating-point operations themselves.

integer on the other hand actually changes the behaviour of the
operations (like you kindly pointed out a while back, jacob), so that
trick can't be done.  the regularity, however, of the rules regarding
how to elwidth-ify operations has allowed macros to be created.

i'm almost through them all, i just have to do 64-bit mulh/hu/hsu, and
then write some unit tests.  need that patch, daniel :)

l.



More information about the libre-riscv-dev mailing list