2019-12-09 23:47:47 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-- | FileCheck %s
|
Fold comparisons against a constant nan, and optimize ORD/UNORD
comparisons with a constant. This allows us to compile isnan to:
_foo:
fcmpu cr7, f1, f1
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr
instead of:
LCPI1_0: ; float
.space 4
_foo:
lis r2, ha16(LCPI1_0)
lfs f0, lo16(LCPI1_0)(r2)
fcmpu cr7, f1, f0
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr
llvm-svn: 45405
2007-12-29 16:37:08 +08:00
|
|
|
|
2008-05-21 03:52:04 +08:00
|
|
|
declare i1 @llvm.isunordered.f64(double)
|
Fold comparisons against a constant nan, and optimize ORD/UNORD
comparisons with a constant. This allows us to compile isnan to:
_foo:
fcmpu cr7, f1, f1
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr
instead of:
LCPI1_0: ; float
.space 4
_foo:
lis r2, ha16(LCPI1_0)
lfs f0, lo16(LCPI1_0)(r2)
fcmpu cr7, f1, f0
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr
llvm-svn: 45405
2007-12-29 16:37:08 +08:00
|
|
|
|
2008-05-21 03:52:04 +08:00
|
|
|
define i1 @test_isnan(double %X) {
|
2019-12-09 23:47:47 +08:00
|
|
|
; CHECK-LABEL: test_isnan:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: fldl {{[0-9]+}}(%esp)
|
|
|
|
; CHECK-NEXT: fucomp %st(0)
|
|
|
|
; CHECK-NEXT: fnstsw %ax
|
|
|
|
; CHECK-NEXT: # kill: def $ah killed $ah killed $ax
|
|
|
|
; CHECK-NEXT: sahf
|
|
|
|
; CHECK-NEXT: setp %al
|
|
|
|
; CHECK-NEXT: retl
|
2008-05-21 03:52:04 +08:00
|
|
|
%R = fcmp uno double %X, %X ; <i1> [#uses=1]
|
|
|
|
ret i1 %R
|
Fold comparisons against a constant nan, and optimize ORD/UNORD
comparisons with a constant. This allows us to compile isnan to:
_foo:
fcmpu cr7, f1, f1
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr
instead of:
LCPI1_0: ; float
.space 4
_foo:
lis r2, ha16(LCPI1_0)
lfs f0, lo16(LCPI1_0)(r2)
fcmpu cr7, f1, f0
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr
llvm-svn: 45405
2007-12-29 16:37:08 +08:00
|
|
|
}
|
|
|
|
|