Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: FLT_ROUNDS failures ... gcc/binutils regression ?



On Thu, Sep 29, 2011 at 10:57:11PM +0000, Christos Zoulas wrote:
> In article <20110929171342.GB24332%lynche.sis.pasteur.fr@localhost>,
> Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
> >On Tue, Sep 27, 2011 at 02:39:40PM -0700, Matt Thomas wrote:
> >[...]
> >> you could recode it to extract two bits from 0x78 (01.11.10.00) which
> >> avoid a memory reference.  Something like:
> >> 
> >>         fnstcw     -4(%rsp)
> >>         movl       -4(%rsp),  %ecx
> >>    shrl    $9, %ecx
> >>         andl    $6, %ecx
> >>         movl    $120, %eax
> >>         sarl    %cl, %eax
> >>         andl    $3, %eax
> >>         ret
> >
> >It works, but with the inverted bits sequence :
> >
> >   00.10.11.01 = 0x2d = 45
> >
> 
> Or just:
>         fnstcw  -4(%rsp)
>         movl    -4(%rsp), %eax
>         shrl    $10, %eax
>         andl    $3, %eax
>         xorl    $1, %eax        /* map 0,1,2,3 -> 1,0,3,2 */
>         ret
> 
> Which is the version I committed.

The mapping is not quite right, it should be: 0,1,2,3 -> 1,3,2,0

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index