Re: [Mingw-w64-public] lrint on x64

2022-06-05 Thread Martin Storsjö
On Sun, 5 Jun 2022, Ozkan Sezer wrote: On 6/5/22, LIU Hao wrote: 在 2022-06-05 19:30, Ozkan Sezer 写道: On 6/5/22, LIU Hao wrote: 在 2022-06-03 22:03, Ozkan Sezer 写道: A quick x64 build ran under win10 yielded the same results. As far as I can tell, `CVTSD2SI` should be preferred to `FISTP`

Re: [Mingw-w64-public] lrint on x64

2022-06-05 Thread Ozkan Sezer
On 6/5/22, LIU Hao wrote: > 在 2022-06-05 19:30, Ozkan Sezer 写道: >> On 6/5/22, LIU Hao wrote: >>> 在 2022-06-03 22:03, Ozkan Sezer 写道: A quick x64 build ran under win10 yielded the same results. >>> >>> As far as I can tell, `CVTSD2SI` should be preferred to `FISTP` for >>> `float` >

Re: [Mingw-w64-public] lrint on x64

2022-06-05 Thread LIU Hao
在 2022-06-05 19:30, Ozkan Sezer 写道: On 6/5/22, LIU Hao wrote: 在 2022-06-03 22:03, Ozkan Sezer 写道: A quick x64 build ran under win10 yielded the same results. As far as I can tell, `CVTSD2SI` should be preferred to `FISTP` for `float` and `double`. The X87 implementation was added in 2007 a

Re: [Mingw-w64-public] lrint on x64

2022-06-05 Thread Ozkan Sezer
On 6/5/22, LIU Hao wrote: > 在 2022-06-03 22:03, Ozkan Sezer 写道: >> >> A quick x64 build ran under win10 yielded the same results. >> > > As far as I can tell, `CVTSD2SI` should be preferred to `FISTP` for `float` > and `double`. The X87 > implementation was added in 2007 and has not been updated s

Re: [Mingw-w64-public] lrint on x64

2022-06-05 Thread LIU Hao
在 2022-06-03 22:03, Ozkan Sezer 写道: A quick x64 build ran under win10 yielded the same results. As far as I can tell, `CVTSD2SI` should be preferred to `FISTP` for `float` and `double`. The X87 implementation was added in 2007 and has not been updated since ever. -- Best regards, LIU Hao

Re: [Mingw-w64-public] lrint on x64

2022-06-03 Thread Ozkan Sezer
>> 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 > #include > #include > #i

Re: [Mingw-w64-public] lrint on x64

2022-06-03 Thread Ozkan Sezer
On 6/3/22, Martin Storsjö wrote: > > For long double, I would presume that you'd still need to use x87, as SSE > can't handle 80 bit long doubles, right? (Or converting down to a plain > double first, then using SSE, probably also works - but I guess that also > might generate x87 instructions.)

Re: [Mingw-w64-public] lrint on x64

2022-06-03 Thread Martin Storsjö
On Fri, 3 Jun 2022, Ozkan Sezer wrote: Why are we using x87 asm instead of sse2 intrinsics for lrint/lrintf ? E.g.: why not do something like the following? diff --git a/mingw-w64-crt/math/lrintl.c b/mingw-w64-crt/math/lrintl.c index d710fac..9f1be51 100644 --- a/mingw-w64-crt/math/lrintl.c +++

[Mingw-w64-public] lrint on x64

2022-06-03 Thread Ozkan Sezer
Why are we using x87 asm instead of sse2 intrinsics for lrint/lrintf ? E.g.: why not do something like the following? diff --git a/mingw-w64-crt/math/lrint.c b/mingw-w64-crt/math/lrint.c index ec80e4e..7831446 100644 --- a/mingw-w64-crt/math/lrint.c +++ b/mingw-w64-crt/math/lrint.c @@ -5,10 +5,16