diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fcmp.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fcmp.ll --- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fcmp.ll +++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fcmp.ll @@ -1,5 +1,6 @@ -; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,SI %s -; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VI %s +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX %s +; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,VI %s declare i64 @llvm.amdgcn.fcmp.f32(float, float, i32) #0 declare i64 @llvm.amdgcn.fcmp.f64(double, double, i32) #0 @@ -8,18 +9,68 @@ declare i64 @llvm.amdgcn.fcmp.f16(half, half, i32) #0 declare half @llvm.fabs.f16(half) #0 -; GCN-LABEL: {{^}}v_fcmp_f32_oeq_with_fabs: -; GCN: v_cmp_eq_f32_e64 {{s\[[0-9]+:[0-9]+\]}}, {{s[0-9]+}}, |{{v[0-9]+}}| define amdgpu_kernel void @v_fcmp_f32_oeq_with_fabs(i64 addrspace(1)* %out, float %src, float %a) { +; GFX-LABEL: v_fcmp_f32_oeq_with_fabs: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_mov_b32_e32 v0, s3 +; GFX-NEXT: v_cmp_eq_f32_e64 s[2:3], s2, |v0| +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_oeq_with_fabs: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_mov_b32_e32 v0, s3 +; VI-NEXT: v_cmp_eq_f32_e64 s[2:3], s2, |v0| +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %temp = call float @llvm.fabs.f32(float %a) %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float %temp, i32 1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_oeq_both_operands_with_fabs: -; GCN: v_cmp_eq_f32_e64 {{s\[[0-9]+:[0-9]+\]}}, |{{s[0-9]+}}|, |{{v[0-9]+}}| define amdgpu_kernel void @v_fcmp_f32_oeq_both_operands_with_fabs(i64 addrspace(1)* %out, float %src, float %a) { +; GFX-LABEL: v_fcmp_f32_oeq_both_operands_with_fabs: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_mov_b32_e32 v0, s3 +; GFX-NEXT: v_cmp_eq_f32_e64 s[2:3], |s2|, |v0| +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_oeq_both_operands_with_fabs: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_mov_b32_e32 v0, s3 +; VI-NEXT: v_cmp_eq_f32_e64 s[2:3], |s2|, |v0| +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %temp = call float @llvm.fabs.f32(float %a) %src_input = call float @llvm.fabs.f32(float %src) %result = call i64 @llvm.amdgcn.fcmp.f32(float %src_input, float %temp, i32 1) @@ -27,227 +78,902 @@ ret void } -; GCN-LABEL: {{^}}v_fcmp_f32: -; GCN-NOT: v_cmp_eq_f32_e64 define amdgpu_kernel void @v_fcmp_f32(i64 addrspace(1)* %out, float %src) { +; GCN-LABEL: v_fcmp_f32: +; GCN: ; %bb.0: +; GCN-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 -1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_oeq: -; GCN: v_cmp_eq_f32_e64 define amdgpu_kernel void @v_fcmp_f32_oeq(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_oeq: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_eq_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_oeq: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_eq_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_one: -; GCN: v_cmp_neq_f32_e64 define amdgpu_kernel void @v_fcmp_f32_one(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_one: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_neq_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_one: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_neq_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 6) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_ogt: -; GCN: v_cmp_gt_f32_e64 define amdgpu_kernel void @v_fcmp_f32_ogt(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_ogt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_gt_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_ogt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_gt_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 2) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_oge: -; GCN: v_cmp_ge_f32_e64 define amdgpu_kernel void @v_fcmp_f32_oge(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_oge: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_ge_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_oge: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_ge_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 3) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_olt: -; GCN: v_cmp_lt_f32_e64 define amdgpu_kernel void @v_fcmp_f32_olt(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_olt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_lt_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_olt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_lt_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 4) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_ole: -; GCN: v_cmp_le_f32_e64 define amdgpu_kernel void @v_fcmp_f32_ole(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_ole: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_le_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_ole: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_le_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 5) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_ueq: -; GCN: v_cmp_nlg_f32_e64 define amdgpu_kernel void @v_fcmp_f32_ueq(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_ueq: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nlg_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_ueq: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nlg_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 9) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_une: -; GCN: v_cmp_neq_f32_e64 define amdgpu_kernel void @v_fcmp_f32_une(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_une: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_neq_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_une: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_neq_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 14) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_ugt: -; GCN: v_cmp_nle_f32_e64 define amdgpu_kernel void @v_fcmp_f32_ugt(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_ugt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nle_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_ugt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nle_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 10) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_uge: -; GCN: v_cmp_nlt_f32_e64 define amdgpu_kernel void @v_fcmp_f32_uge(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_uge: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nlt_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_uge: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nlt_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 11) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_ult: -; GCN: v_cmp_nge_f32_e64 define amdgpu_kernel void @v_fcmp_f32_ult(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_ult: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nge_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_ult: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nge_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 12) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f32_ule: -; GCN: v_cmp_ngt_f32_e64 define amdgpu_kernel void @v_fcmp_f32_ule(i64 addrspace(1)* %out, float %src) { +; GFX-LABEL: v_fcmp_f32_ule: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_ngt_f32_e64 s[4:5], s2, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f32_ule: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x42c80000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_ngt_f32_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f32(float %src, float 100.00, i32 13) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_oeq: -; GCN: v_cmp_eq_f64_e64 define amdgpu_kernel void @v_fcmp_f64_oeq(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_oeq: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_eq_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_oeq: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_eq_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_one: -; GCN: v_cmp_neq_f64_e64 define amdgpu_kernel void @v_fcmp_f64_one(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_one: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_neq_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_one: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_neq_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 6) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_ogt: -; GCN: v_cmp_gt_f64_e64 define amdgpu_kernel void @v_fcmp_f64_ogt(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_ogt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_gt_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_ogt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_gt_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 2) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_oge: -; GCN: v_cmp_ge_f64_e64 define amdgpu_kernel void @v_fcmp_f64_oge(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_oge: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_ge_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_oge: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_ge_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 3) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_olt: -; GCN: v_cmp_lt_f64_e64 define amdgpu_kernel void @v_fcmp_f64_olt(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_olt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_lt_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_olt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_lt_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 4) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_ole: -; GCN: v_cmp_le_f64_e64 define amdgpu_kernel void @v_fcmp_f64_ole(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_ole: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_le_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_ole: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_le_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 5) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_ueq: -; GCN: v_cmp_nlg_f64_e64 define amdgpu_kernel void @v_fcmp_f64_ueq(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_ueq: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nlg_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_ueq: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nlg_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 9) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_une: -; GCN: v_cmp_neq_f64_e64 define amdgpu_kernel void @v_fcmp_f64_une(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_une: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_neq_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_une: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_neq_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 14) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_ugt: -; GCN: v_cmp_nle_f64_e64 define amdgpu_kernel void @v_fcmp_f64_ugt(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_ugt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nle_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_ugt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nle_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 10) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_uge: -; GCN: v_cmp_nlt_f64_e64 define amdgpu_kernel void @v_fcmp_f64_uge(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_uge: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nlt_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_uge: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nlt_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 11) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_ult: -; GCN: v_cmp_nge_f64_e64 define amdgpu_kernel void @v_fcmp_f64_ult(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_ult: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_nge_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_ult: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nge_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 12) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f64_ule: -; GCN: v_cmp_ngt_f64_e64 define amdgpu_kernel void @v_fcmp_f64_ule(i64 addrspace(1)* %out, double %src) { +; GFX-LABEL: v_fcmp_f64_ule: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s7, 0xf000 +; GFX-NEXT: v_mov_b32_e32 v0, 0 +; GFX-NEXT: v_mov_b32_e32 v1, 0x40590000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cmp_ngt_f64_e64 s[2:3], s[2:3], v[0:1] +; GFX-NEXT: s_mov_b32 s6, -1 +; GFX-NEXT: s_mov_b32 s4, s0 +; GFX-NEXT: s_mov_b32 s5, s1 +; GFX-NEXT: v_mov_b32_e32 v0, s2 +; GFX-NEXT: v_mov_b32_e32 v1, s3 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f64_ule: +; VI: ; %bb.0: +; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0 +; VI-NEXT: v_mov_b32_e32 v1, 0x40590000 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_ngt_f64_e64 s[2:3], s[2:3], v[0:1] +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f64(double %src, double 100.00, i32 13) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_oeq_with_fabs: -; VI: v_cmp_eq_f16_e64 {{s\[[0-9]+:[0-9]+\]}}, {{s[0-9]+}}, |{{v[0-9]+}}| -; SI: v_cvt_f32_f16_e32 [[CVT0:v[0-9]+]], s{{[0-9]+}} -; SI: v_cvt_f32_f16_e64 [[CVT1:v[0-9]+]], |s{{[0-9]+}}| -; SI: v_cmp_eq_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[CVT0]], [[CVT1]] define amdgpu_kernel void @v_fcmp_f16_oeq_with_fabs(i64 addrspace(1)* %out, half %src, half %a) { +; GFX-LABEL: v_fcmp_f16_oeq_with_fabs: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: s_lshr_b32 s2, s2, 16 +; GFX-NEXT: v_cvt_f32_f16_e64 v1, |s2| +; GFX-NEXT: v_cmp_eq_f32_e64 s[4:5], v0, v1 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_oeq_with_fabs: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: s_lshr_b32 s3, s2, 16 +; VI-NEXT: v_mov_b32_e32 v0, s3 +; VI-NEXT: v_cmp_eq_f16_e64 s[2:3], s2, |v0| +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %temp = call half @llvm.fabs.f16(half %a) %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half %temp, i32 1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_oeq_both_operands_with_fabs: -; VI: v_cmp_eq_f16_e64 {{s\[[0-9]+:[0-9]+\]}}, |{{s[0-9]+}}|, |{{v[0-9]+}}| -; SI: v_cvt_f32_f16_e64 [[CVT0:v[0-9]+]], |s{{[0-9]+}}| -; SI: v_cvt_f32_f16_e64 [[CVT1:v[0-9]+]], |s{{[0-9]+}}| -; SI: v_cmp_eq_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[CVT0]], [[CVT1]] define amdgpu_kernel void @v_fcmp_f16_oeq_both_operands_with_fabs(i64 addrspace(1)* %out, half %src, half %a) { +; GFX-LABEL: v_fcmp_f16_oeq_both_operands_with_fabs: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e64 v0, |s2| +; GFX-NEXT: s_lshr_b32 s2, s2, 16 +; GFX-NEXT: v_cvt_f32_f16_e64 v1, |s2| +; GFX-NEXT: v_cmp_eq_f32_e64 s[4:5], v0, v1 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_oeq_both_operands_with_fabs: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: s_lshr_b32 s3, s2, 16 +; VI-NEXT: v_mov_b32_e32 v0, s3 +; VI-NEXT: v_cmp_eq_f16_e64 s[2:3], |s2|, |v0| +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %temp = call half @llvm.fabs.f16(half %a) %src_input = call half @llvm.fabs.f16(half %src) %result = call i64 @llvm.amdgcn.fcmp.f16(half %src_input, half %temp, i32 1) @@ -255,153 +981,430 @@ ret void } -; GCN-LABEL: {{^}}v_fcmp_f16: -; GCN-NOT: v_cmp_eq_ define amdgpu_kernel void @v_fcmp_f16(i64 addrspace(1)* %out, half %src) { +; GCN-LABEL: v_fcmp_f16: +; GCN: ; %bb.0: +; GCN-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 -1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_oeq: -; VI: v_cmp_eq_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_eq_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_oeq(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_oeq: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_eq_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_oeq: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_eq_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 1) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_one: -; VI: v_cmp_neq_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_neq_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_one(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_one: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_neq_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_one: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_neq_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 6) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_ogt: -; VI: v_cmp_gt_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_lt_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_ogt(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_ogt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_lt_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_ogt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_gt_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 2) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_oge: -; VI: v_cmp_ge_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_le_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_oge(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_oge: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_le_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_oge: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_ge_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 3) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_olt: -; VI: v_cmp_lt_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_gt_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_olt(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_olt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_gt_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_olt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_lt_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 4) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_ole: -; VI: v_cmp_le_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_ge_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_ole(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_ole: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_ge_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_ole: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_le_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 5) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_ueq: -; VI: v_cmp_nlg_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_nlg_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_ueq(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_ueq: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_nlg_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_ueq: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nlg_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 9) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_une: -; VI: v_cmp_neq_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_neq_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_une(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_une: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_neq_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_une: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_neq_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 14) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_ugt: -; VI: v_cmp_nle_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_nge_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_ugt(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_ugt: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_nge_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_ugt: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nle_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 10) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_uge: -; VI: v_cmp_nlt_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_ngt_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_uge(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_uge: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_ngt_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_uge: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nlt_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 11) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_ult: -; VI: v_cmp_nge_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_nle_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_ult(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_ult: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_nle_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_ult: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_nge_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 12) store i64 %result, i64 addrspace(1)* %out ret void } -; GCN-LABEL: {{^}}v_fcmp_f16_ule: -; VI: v_cmp_ngt_f16_e64 -; SI-DAG: s_mov_b32 [[K:s[0-9]+]], 0x42c80000 -; SI-DAG: v_cvt_f32_f16_e32 [[CVT:v[0-9]+]], s{{[0-9]+}} -; SI: v_cmp_nlt_f32_e64 s{{\[[0-9]+:[0-9]+\]}}, [[K]], [[CVT]] define amdgpu_kernel void @v_fcmp_f16_ule(i64 addrspace(1)* %out, half %src) { +; GFX-LABEL: v_fcmp_f16_ule: +; GFX: ; %bb.0: +; GFX-NEXT: s_load_dword s2, s[0:1], 0xb +; GFX-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9 +; GFX-NEXT: s_mov_b32 s3, 0xf000 +; GFX-NEXT: s_mov_b32 s4, 0x42c80000 +; GFX-NEXT: s_waitcnt lgkmcnt(0) +; GFX-NEXT: v_cvt_f32_f16_e32 v0, s2 +; GFX-NEXT: v_cmp_nlt_f32_e64 s[4:5], s4, v0 +; GFX-NEXT: s_mov_b32 s2, -1 +; GFX-NEXT: v_mov_b32_e32 v0, s4 +; GFX-NEXT: v_mov_b32_e32 v1, s5 +; GFX-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0 +; GFX-NEXT: s_endpgm +; +; VI-LABEL: v_fcmp_f16_ule: +; VI: ; %bb.0: +; VI-NEXT: s_load_dword s2, s[0:1], 0x2c +; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24 +; VI-NEXT: v_mov_b32_e32 v0, 0x5640 +; VI-NEXT: s_waitcnt lgkmcnt(0) +; VI-NEXT: v_cmp_ngt_f16_e64 s[2:3], s2, v0 +; VI-NEXT: v_mov_b32_e32 v0, s0 +; VI-NEXT: v_mov_b32_e32 v2, s2 +; VI-NEXT: v_mov_b32_e32 v1, s1 +; VI-NEXT: v_mov_b32_e32 v3, s3 +; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3] +; VI-NEXT: s_endpgm %result = call i64 @llvm.amdgcn.fcmp.f16(half %src, half 100.00, i32 13) store i64 %result, i64 addrspace(1)* %out ret void