sunflower-embedded-system-emulator
sunflower-embedded-system-emulator copied to clipboard
rv32d_fclass_d and rv32d_fclass_s contain non-portable code and might misbehave in default case of switch(class)
rv32d_fclass_d() and rv32d_fclass_s() contain non-portable code and might misbehave in default case of switch(class). @harrysarson, @rjlv2, or @SamuelmsWong, are you interested in looking at this after #132 has merged?
Code is: https://github.com/physical-computation/sunflower-simulator/blob/master/sim/op-riscv.c#L2222-L2270 and https://github.com/physical-computation/sunflower-simulator/blob/master/sim/op-riscv.c#L1628-L1677
And the spec says:

Can we rely on c using IEEE 754? The spec says it does not have to but in practice all architectures do.
If we can rely on an IEEE 754 encoding we can use https://www.doc.ic.ac.uk/~eedwards/compsys/float/nan.html