Print this page




 200         subl    $8,%esp
 201         fstcw   (%esp)
 202         fldl    8(%esp)                 ///
 203         movw    (%esp),%cx
 204         orw     $0x0c00,%cx
 205         xorw    $0x0800,%cx
 206         movw    %cx,4(%esp)
 207         fldcw   4(%esp)                 / set RD = down
 208         frndint
 209         fstcw   4(%esp)                 / restore RD
 210         movw    4(%esp),%dx
 211         andw    $0xf3ff,%dx
 212         movw    (%esp),%cx
 213         andw    $0x0c00,%cx
 214         orw     %dx,%cx
 215         movw    %cx,(%esp)
 216         fldcw   (%esp)                  / restore RD
 217         addl    $8,%esp
 218         .end
 219 
 220 /
 221 /       branchless __isnan
 222 /       ((0x7ff00000-[((lx|-lx)>>31)&1]|ahx)>>31)&1 = 1 iff x is NaN
 223 /
 224         .inline __isnan,0
 225         movl    (%esp),%eax             /// eax <-- lo_32(x)
 226         movl    %eax,%ecx
 227         negl    %ecx                    / ecx <-- -lo_32(x)
 228         orl     %ecx,%eax
 229         shrl    $31,%eax                / 1 iff lx != 0
 230         movl    4(%esp),%ecx            /// ecx <-- hi_32(x)
 231         andl    $0x7fffffff,%ecx        / ecx <-- hi_32(abs(x))
 232         orl     %ecx,%eax
 233         subl    $0x7ff00000,%eax
 234         negl    %eax
 235         shrl    $31,%eax
 236         .end
 237 
 238         .inline __isnanf,0
 239         movl    (%esp),%eax
 240         andl    $0x7fffffff,%eax
 241         negl    %eax
 242         addl    $0x7f800000,%eax
 243         shrl    $31,%eax
 244         .end
 245 
 246         .inline __isinf,0
 247         movl    4(%esp),%eax            / eax <-- hi_32(x)
 248         andl    $0x7fffffff,%eax        / set first bit to 0
 249         cmpl    $0x7ff00000,%eax
 250         pushfl
 251         popl    %eax
 252         cmpl    $0,(%esp)               / is lo_32(x) = 0?
 253         pushfl
 254         popl    %ecx                    / bit 6 of ecx <-- lo_32(x) == 0
 255         andl    %ecx,%eax
 256         andl    $0x40,%eax
 257         shrl    $6,%eax
 258         .end
 259 
 260         .inline __isnormal,0
 261                                         / TRUE iff (x is _finite, but
 262                                         /           neither subnormal nor +/-0)
 263                                         /      iff (0 < bexp(x) < 0x7ff)
 264         movl    4(%esp),%eax            / eax <-- hi_32(x)
 265         andl    $0x7ff00000,%eax        / eax[20..30]  <-- bexp(x),
 266                                         / rest_of(eax) <-- 0
 267         pushfl
 268         popl    %ecx                    / bit 6 of ecx <-- not bexp(x)
 269         subl    $0x7ff00000,%eax
 270         pushfl
 271         popl    %eax                    / bit 6 of eax <-- not bexp(x)
 272         orl     %ecx,%eax
 273         andl    $0x40,%eax
 274         xorl    $0x40,%eax
 275         shrl    $6,%eax
 276         .end
 277 
 278         .inline __issubnormal,0




 200         subl    $8,%esp
 201         fstcw   (%esp)
 202         fldl    8(%esp)                 ///
 203         movw    (%esp),%cx
 204         orw     $0x0c00,%cx
 205         xorw    $0x0800,%cx
 206         movw    %cx,4(%esp)
 207         fldcw   4(%esp)                 / set RD = down
 208         frndint
 209         fstcw   4(%esp)                 / restore RD
 210         movw    4(%esp),%dx
 211         andw    $0xf3ff,%dx
 212         movw    (%esp),%cx
 213         andw    $0x0c00,%cx
 214         orw     %dx,%cx
 215         movw    %cx,(%esp)
 216         fldcw   (%esp)                  / restore RD
 217         addl    $8,%esp
 218         .end
 219 


















 220         .inline __isnanf,0
 221         movl    (%esp),%eax
 222         andl    $0x7fffffff,%eax
 223         negl    %eax
 224         addl    $0x7f800000,%eax
 225         shrl    $31,%eax
 226         .end
 227 













 228 
 229         .inline __isnormal,0
 230                                         / TRUE iff (x is _finite, but
 231                                         /           neither subnormal nor +/-0)
 232                                         /      iff (0 < bexp(x) < 0x7ff)
 233         movl    4(%esp),%eax            / eax <-- hi_32(x)
 234         andl    $0x7ff00000,%eax        / eax[20..30]  <-- bexp(x),
 235                                         / rest_of(eax) <-- 0
 236         pushfl
 237         popl    %ecx                    / bit 6 of ecx <-- not bexp(x)
 238         subl    $0x7ff00000,%eax
 239         pushfl
 240         popl    %eax                    / bit 6 of eax <-- not bexp(x)
 241         orl     %ecx,%eax
 242         andl    $0x40,%eax
 243         xorl    $0x40,%eax
 244         shrl    $6,%eax
 245         .end
 246 
 247         .inline __issubnormal,0