[libre-riscv-dev] spike-sv non-default element widths

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Oct 10 15:44:40 BST 2018


.... actually.. ah.... for signed and unsigned integers, is it
_actually_ the case that the size of the type will affect the answer,
if typecast down to e.g. int16_t/uint16_t or int8_t/uint8_t?

 by that i mean:

 uint64_t x = 0..255;
 uint64_t y = 0..255;
 uint8_t x1 = (uint8_t)x;
 uint8_t y1 = (uint8_t)y;

 assert (x / y) == (x1 / y1)

or any other operator.  will that hold for all possible values of x
and y?  i mean, i _could_ write a for-loop to check... :)

l.



More information about the libre-riscv-dev mailing list