>> For the other functions, do the SSE intrinsics honor the rounding
>> mode/direction that you've set fesetround()?
>>
>> // Martin
>
> Documentation [1] doesn't seem to have such detail.
>
> Haven't booted to windows, but ran the following on i686 linux:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <math.h>
> #include <fenv.h>
> #include <xmmintrin.h>
>
> static __inline long lrint_x87(double _x) {
> long val;
> __asm__ __volatile__ ("fistpl %0" : "=m" (val) : "t" (_x) : "st");
> return val;
> }
>
> int main (int argc, char **argv)
> {
> long x87, sse2;
> double d;
> if (argc != 2) return -1;
> d = atof(argv[1]);
> fesetround(FE_DOWNWARD);
> x87 = lrint_x87(d);
> sse2 = _mm_cvtsd_si32(_mm_load_sd(&d));
> printf("%ld, %ld\n", x87, sse2);
> return 0;
> }
>
> If I keep the fesetround(FE_DOWNWARD); line uncommented,
> it prints 1 for 1.999 instead of 2.
A quick x64 build ran under win10 yielded the same results.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public