1 ; RUN: opt -S -instcombine < %s | FileCheck %s
3 define i1 @test1(float %x, float %y) nounwind {
4 %ext1 = fpext float %x to double
5 %ext2 = fpext float %y to double
6 %cmp = fcmp ogt double %ext1, %ext2
9 ; CHECK-NEXT: fcmp ogt float %x, %y
12 define i1 @test2(float %a) nounwind {
13 %ext = fpext float %a to double
14 %cmp = fcmp ogt double %ext, 1.000000e+00
17 ; CHECK-NEXT: fcmp ogt float %a, 1.0
20 define i1 @test3(float %a) nounwind {
21 %ext = fpext float %a to double
22 %cmp = fcmp ogt double %ext, 0x3FF0000000000001 ; more precision than float.
25 ; CHECK-NEXT: fpext float %a to double
28 define i1 @test4(float %a) nounwind {
29 %ext = fpext float %a to double
30 %cmp = fcmp ogt double %ext, 0x36A0000000000000 ; denormal in float.
33 ; CHECK-NEXT: fpext float %a to double
36 define i1 @test5(float %a) nounwind {
37 %neg = fsub float -0.000000e+00, %a
38 %cmp = fcmp ogt float %neg, 1.000000e+00
41 ; CHECK-NEXT: fcmp olt float %a, -1.0
44 define i1 @test6(float %x, float %y) nounwind {
45 %neg1 = fsub float -0.000000e+00, %x
46 %neg2 = fsub float -0.000000e+00, %y
47 %cmp = fcmp olt float %neg1, %neg2
50 ; CHECK-NEXT: fcmp ogt float %x, %y
53 define i1 @test7(float %x) nounwind readnone ssp noredzone {
54 %ext = fpext float %x to ppc_fp128
55 %cmp = fcmp ogt ppc_fp128 %ext, 0xM00000000000000000000000000000000
57 ; Can't convert ppc_fp128
59 ; CHECK-NEXT: fpext float %x to ppc_fp128