1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
4 define amdgpu_kernel void @eq_t(float %x) {
7 ; GCN-NEXT: s_load_dword s0, s[2:3], 0x24
8 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
9 ; GCN-NEXT: v_cmp_lt_f32_e64 s[0:1], s0, 1.0
10 ; GCN-NEXT: v_cndmask_b32_e64 v0, 2.0, 4.0, s[0:1]
11 ; GCN-NEXT: flat_store_dword v[0:1], v0
13 %c1 = fcmp olt float %x, 1.0
14 %s1 = select i1 %c1, i32 56789, i32 1
15 %c2 = icmp eq i32 %s1, 56789
16 %s2 = select i1 %c2, float 4.0, float 2.0
17 store float %s2, ptr undef, align 4
21 define amdgpu_kernel void @ne_t(float %x) {
24 ; GCN-NEXT: s_load_dword s0, s[2:3], 0x24
25 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
26 ; GCN-NEXT: v_cmp_nlt_f32_e64 s[0:1], s0, 1.0
27 ; GCN-NEXT: v_cndmask_b32_e64 v0, 2.0, 4.0, s[0:1]
28 ; GCN-NEXT: flat_store_dword v[0:1], v0
30 %c1 = fcmp olt float %x, 1.0
31 %s1 = select i1 %c1, i32 56789, i32 1
32 %c2 = icmp ne i32 %s1, 56789
33 %s2 = select i1 %c2, float 4.0, float 2.0
34 store float %s2, ptr undef, align 4
38 define amdgpu_kernel void @eq_f(float %x) {
41 ; GCN-NEXT: s_load_dword s0, s[2:3], 0x24
42 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
43 ; GCN-NEXT: v_cmp_nlt_f32_e64 s[0:1], s0, 1.0
44 ; GCN-NEXT: v_cndmask_b32_e64 v0, 2.0, 4.0, s[0:1]
45 ; GCN-NEXT: flat_store_dword v[0:1], v0
47 %c1 = fcmp olt float %x, 1.0
48 %s1 = select i1 %c1, i32 1, i32 56789
49 %c2 = icmp eq i32 %s1, 56789
50 %s2 = select i1 %c2, float 4.0, float 2.0
51 store float %s2, ptr undef, align 4
55 define amdgpu_kernel void @ne_f(float %x) {
58 ; GCN-NEXT: s_load_dword s0, s[2:3], 0x24
59 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
60 ; GCN-NEXT: v_cmp_lt_f32_e64 s[0:1], s0, 1.0
61 ; GCN-NEXT: v_cndmask_b32_e64 v0, 2.0, 4.0, s[0:1]
62 ; GCN-NEXT: flat_store_dword v[0:1], v0
64 %c1 = fcmp olt float %x, 1.0
65 %s1 = select i1 %c1, i32 1, i32 56789
66 %c2 = icmp ne i32 %s1, 56789
67 %s2 = select i1 %c2, float 4.0, float 2.0
68 store float %s2, ptr undef, align 4
72 define amdgpu_kernel void @different_constants(float %x) {
73 ; GCN-LABEL: different_constants:
75 ; GCN-NEXT: v_mov_b32_e32 v0, 2.0
76 ; GCN-NEXT: flat_store_dword v[0:1], v0
78 %c1 = fcmp olt float %x, 1.0
79 %s1 = select i1 %c1, i32 56789, i32 1
80 %c2 = icmp eq i32 %s1, 5678
81 %s2 = select i1 %c2, float 4.0, float 2.0
82 store float %s2, ptr undef, align 4