math/x32: correct lrintl.s for 32-bit long

Submitted by Alexander Monakov on Jan. 18, 2020, 4:15 p.m.

Details

Message ID 20200118161516.22758-1-amonakov@ispras.ru
State New
Series "math/x32: correct lrintl.s for 32-bit long"
Headers show

Commit Message

Alexander Monakov Jan. 18, 2020, 4:15 p.m.
---
Looks like the implementation copied from x86_64 was not adjusted for
32-bit 'long' on x32, but apart from failure to raise FE_INVALID this
error was harmless.

 src/math/x32/lrintl.s | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/math/x32/lrintl.s b/src/math/x32/lrintl.s
index ee97d1cf..d4355c32 100644
--- a/src/math/x32/lrintl.s
+++ b/src/math/x32/lrintl.s
@@ -2,6 +2,6 @@ 
 .type lrintl,@function
 lrintl:
 	fldt 8(%esp)
-	fistpll 8(%esp)
-	mov 8(%esp),%rax
+	fistpl 8(%esp)
+	movl 8(%esp),%eax
 	ret

Comments

Szabolcs Nagy Jan. 18, 2020, 4:51 p.m.
* Alexander Monakov <amonakov@ispras.ru> [2020-01-18 19:15:16 +0300]:
> ---
> Looks like the implementation copied from x86_64 was not adjusted for
> 32-bit 'long' on x32, but apart from failure to raise FE_INVALID this
> error was harmless.

fenv behaviour is wrong on out-of-range values, not just
because of missing invalid, but spurious inexact too.

thanks for finding this.

> 
>  src/math/x32/lrintl.s | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

> diff --git a/src/math/x32/lrintl.s b/src/math/x32/lrintl.s
> index ee97d1cf..d4355c32 100644
> --- a/src/math/x32/lrintl.s
> +++ b/src/math/x32/lrintl.s
> @@ -2,6 +2,6 @@
>  .type lrintl,@function
>  lrintl:
>  	fldt 8(%esp)
> -	fistpll 8(%esp)
> -	mov 8(%esp),%rax
> +	fistpl 8(%esp)
> +	movl 8(%esp),%eax
>  	ret
Alexander Monakov Jan. 25, 2020, 4:38 p.m.
Ping, doesn't appear to be applied yet.

On Sat, 18 Jan 2020, Alexander Monakov wrote:

> ---
> Looks like the implementation copied from x86_64 was not adjusted for
> 32-bit 'long' on x32, but apart from failure to raise FE_INVALID this
> error was harmless.
> 
>  src/math/x32/lrintl.s | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
>
Rich Felker Jan. 27, 2020, 6:03 p.m.
On Sat, Jan 25, 2020 at 07:38:07PM +0300, Alexander Monakov wrote:
> Ping, doesn't appear to be applied yet.
> 
> On Sat, 18 Jan 2020, Alexander Monakov wrote:
> 
> > ---
> > Looks like the implementation copied from x86_64 was not adjusted for
> > 32-bit 'long' on x32, but apart from failure to raise FE_INVALID this
> > error was harmless.
> > 
> >  src/math/x32/lrintl.s | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > 

Thanks for pinging! I'd missed that this was something that needed to
be applied now vs the other x86 math patches that are to be applied
after release. Applying now.

Rich