Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/arch/x86_64/gen/flt_rounds.S,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libc/arch/x86_64/gen/flt_rounds.S,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.5 retrieving revision 1.6 diff -u -p -r1.5 -r1.6 --- src/lib/libc/arch/x86_64/gen/flt_rounds.S 2011/09/29 22:55:45 1.5 +++ src/lib/libc/arch/x86_64/gen/flt_rounds.S 2011/09/30 17:42:34 1.6 @@ -1,4 +1,4 @@ -/* $NetBSD: flt_rounds.S,v 1.5 2011/09/29 22:55:45 christos Exp $ */ +/* $NetBSD: flt_rounds.S,v 1.6 2011/09/30 17:42:34 christos Exp $ */ #include @@ -12,8 +12,10 @@ _ALIGN_TEXT ENTRY(__flt_rounds) fnstcw -4(%rsp) - movl -4(%rsp), %eax - shrl $10, %eax + movl -4(%rsp), %ecx + shrl $9, %ecx + andl $6, %ecx + movl $0x2d, %eax /* 0x2d = 00.10.11.01 */ + sarl %cl, %eax /* 0,1,2,3 -> 1,3,2,0 */ andl $3, %eax - xorl $1, %eax /* map 0,1,2,3 -> 1,0,3,2 */ ret