delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/05/23/07:12:30

Date: Tue, 23 May 2000 14:10:45 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Pierre Muller <muller AT cerbere DOT u-strasbg DOT fr>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Simple C program showing FPU problem !
In-Reply-To: <200005231107.NAA06048@cerbere.u-strasbg.fr>
Message-ID: <Pine.SUN.3.91.1000523140514.4858J-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 23 May 2000, Pierre Muller wrote:

>   	.global	___djgpp_npx_hdlr
>   ___djgpp_npx_hdlr:
>   	pushl	%eax
> +    fnstsw ___djgpp_fpu_status
> +    fnclex
>   	xorl	%eax,%eax
>   	outb	%al,$0x0f0
>   	movb	$0x20,%al

Shouldn't we access the I/O port *before* clearing the exceptions, like 
Intel says?

> ! 	xchgw   ___djgpp_fpu_status,%ax
> ! 	movzwl  %ax, %eax
> ! 	cmpl    %eax,%eax
> ! 	jne     L__clear87_end
>   	fstsw	%ax
>   	movzwl	%ax, %eax
>   	fclex
> + L__clear87_end:

Why do you avoid FCLEX if the status word is taken from the value saved 
by the interrupt handler?  This would make _clear87 incompatible with 
what it does today: the current version *always* clears the FPU.

Also, what about _status87: shouldn't it be changed as well?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019