1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -o - %s | FileCheck %s
3 ; RUN: llc -O3 -o - %s | FileCheck %s --check-prefix=SUBOPTIMAL
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 declare float @llvm.experimental.constrained.sitofp.f32.i32(i32, metadata, metadata)
8 declare float @llvm.experimental.constrained.sitofp.f32.i16(i16, metadata, metadata)
9 declare i1 @llvm.experimental.constrained.fcmp.f32(float, float, metadata, metadata)
10 declare float @llvm.experimental.constrained.uitofp.f32.i16(i16, metadata, metadata)
12 define i32 @test() #0 {
14 ; CHECK: // %bb.0: // %entry
15 ; CHECK-NEXT: mov w8, #1
16 ; CHECK-NEXT: scvtf s0, w8
17 ; CHECK-NEXT: fcmp s0, s0
18 ; CHECK-NEXT: cset w0, eq
21 ; SUBOPTIMAL-LABEL: test:
22 ; SUBOPTIMAL: // %bb.0: // %entry
23 ; SUBOPTIMAL-NEXT: mov w8, #1
24 ; SUBOPTIMAL-NEXT: scvtf s0, w8
25 ; SUBOPTIMAL-NEXT: mov w8, #1
26 ; SUBOPTIMAL-NEXT: scvtf s1, w8
27 ; SUBOPTIMAL-NEXT: fcmp s0, s1
28 ; SUBOPTIMAL-NEXT: cset w8, eq
29 ; SUBOPTIMAL-NEXT: and w0, w8, #0x1
30 ; SUBOPTIMAL-NEXT: ret
32 %conv = call float @llvm.experimental.constrained.sitofp.f32.i32(i32 1, metadata !"round.tonearest", metadata !"fpexcept.strict") #1
33 %conv1 = call float @llvm.experimental.constrained.sitofp.f32.i16(i16 1, metadata !"round.tonearest", metadata !"fpexcept.strict") #1
34 %cmp = call i1 @llvm.experimental.constrained.fcmp.f32(float %conv, float %conv1, metadata !"oeq", metadata !"fpexcept.strict") #1
35 %conv2 = zext i1 %cmp to i32
39 define i32 @test2() #0 {
41 ; CHECK: // %bb.0: // %entry
42 ; CHECK-NEXT: mov w8, #1
43 ; CHECK-NEXT: scvtf s0, w8
44 ; CHECK-NEXT: ucvtf s1, w8
45 ; CHECK-NEXT: fcmp s0, s1
46 ; CHECK-NEXT: cset w0, eq
49 ; SUBOPTIMAL-LABEL: test2:
50 ; SUBOPTIMAL: // %bb.0: // %entry
51 ; SUBOPTIMAL-NEXT: mov w8, #1
52 ; SUBOPTIMAL-NEXT: scvtf s0, w8
53 ; SUBOPTIMAL-NEXT: mov w8, #1
54 ; SUBOPTIMAL-NEXT: ucvtf s1, w8
55 ; SUBOPTIMAL-NEXT: fcmp s0, s1
56 ; SUBOPTIMAL-NEXT: cset w8, eq
57 ; SUBOPTIMAL-NEXT: and w0, w8, #0x1
58 ; SUBOPTIMAL-NEXT: ret
60 %conv = call float @llvm.experimental.constrained.sitofp.f32.i32(i32 1, metadata !"round.tonearest", metadata !"fpexcept.strict") #1
61 %conv1 = call float @llvm.experimental.constrained.uitofp.f32.i16(i16 1, metadata !"round.tonearest", metadata !"fpexcept.strict") #1
62 %cmp = call i1 @llvm.experimental.constrained.fcmp.f32(float %conv, float %conv1, metadata !"oeq", metadata !"fpexcept.strict") #1
63 %conv2 = zext i1 %cmp to i32
67 attributes #0 = { strictfp noinline optnone }
68 attributes #1 = { strictfp }