[BACK]Return to fpsetmask.S CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / arch / x86_64 / gen

Annotation of src/lib/libc/arch/x86_64/gen/fpsetmask.S, Revision 1.5

1.5     ! drochner    1: /*     $NetBSD: fpsetmask.S,v 1.4 2011/10/19 15:24:58 njoly Exp $      */
1.1       fvdl        2:
                      3: /*
1.3       fvdl        4:  * Written by Frank van der Linden at Wasabi Systems for NetBSD.
1.1       fvdl        5:  * Public domain.
                      6:  */
                      7:
                      8: #include <machine/asm.h>
                      9:
1.3       fvdl       10: /*
                     11:  * XXX set both the x87 control word and the SSE mxcsr register.
                     12:  * Applications should only set exception and round flags
                     13:  * via the fp*() interface, otherwise the status words
                     14:  * will get our of sync.
                     15:  */
                     16:
1.2       thorpej    17: #ifdef WEAK_ALIAS
                     18: WEAK_ALIAS(fpsetmask, _fpsetmask)
                     19: ENTRY(_fpsetmask)
                     20: #else
1.1       fvdl       21: ENTRY(fpsetmask)
1.2       thorpej    22: #endif
1.3       fvdl       23:        notl    %edi
1.4       njoly      24:        andl    $0x0000003f,%edi
1.3       fvdl       25:
1.4       njoly      26:        fnstcw  -4(%rsp)
                     27:        movl    -4(%rsp), %edx
                     28:        movl    %edx, %eax
                     29:        andl    $0xffffffc0, %edx
                     30:        orl     %edi, %edx
1.3       fvdl       31:        movl    %edx,-4(%rsp)
1.4       njoly      32:        fldcw   -4(%rsp)
1.3       fvdl       33:
1.4       njoly      34:        stmxcsr -4(%rsp)
                     35:        movl    -4(%rsp), %edx
1.5     ! drochner   36:        andl    $0xffffe07f, %edx
1.4       njoly      37:        sall    $7, %edi
                     38:        orl     %edi, %edx
                     39:        movl    %edx,-4(%rsp)
                     40:        ldmxcsr -4(%rsp)
1.3       fvdl       41:
1.4       njoly      42:        notl    %eax
                     43:        andl    $0x0000003f, %eax
1.1       fvdl       44:        ret

CVSweb <webmaster@jp.NetBSD.org>