1 ; Test some floating point casting cases
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
5 %x = fptoui float 2.550000e+02 to i8 ; <i8> [#uses=1]
11 %x = fptosi float -1.000000e+00 to i8 ; <i8> [#uses=1]
17 define half @test3(float %a) {
19 ; CHECK: llvm.fabs.f16
20 %b = call float @llvm.fabs.f32(float %a)
21 %c = fptrunc float %b to half
26 define half @test4(float %a) {
29 %b = fsub float -0.0, %a
30 %c = fptrunc float %b to half
35 define half @test4-fast(float %a) {
38 %b = fsub fast float -0.0, %a
39 %c = fptrunc float %b to half
44 define half @test5(float %a, float %b, float %c) {
49 %d = fcmp ogt float %a, %b
50 %e = select i1 %d, float %c, float 1.0
51 %f = fptrunc float %e to half
55 declare float @llvm.fabs.f32(float) nounwind readonly