Displaying 2 results from an estimated 2 matches for "__absvsi2".
Did you mean:
__absvdi2
2015 Oct 24
2
[compiler-rt] Undefined negation in float emulation functions
...compiler-rt/test/builtins/Unit/absvti2_test.c: expected = -expected;
compiler-rt/test/builtins/Unit/absvdi2_test.c: expected = -expected;
I confess I don't fully understand the way these tests are written. E.g. compiler-rt/test/builtins/Unit/absvsi2_test.c:
int test__absvsi2(si_int a)
{
si_int x = __absvsi2(a);
si_int expected = a;
if (expected < 0)
expected = -expected;
if (x != expected || expected < 0)
printf("error in __absvsi2(0x%X) = %d, expected positive %d\n",...
2015 Oct 20
2
[compiler-rt] Undefined negation in float emulation functions
Hi,
I recently came across the following in __floatsidf in compiler-rt:
__floatsidf(int a) {
...
if (a < 0) {
...
a = -a;
In the case where a == INT_MIN, is this negation not undefined behaviour? AIUI this function is used for software
emulation on targets that have no hardware floating point support. Perhaps there is an in-built assumption