diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /test/CodeGen/R600/fneg.ll | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'test/CodeGen/R600/fneg.ll')
-rw-r--r-- | test/CodeGen/R600/fneg.ll | 102 |
1 files changed, 49 insertions, 53 deletions
diff --git a/test/CodeGen/R600/fneg.ll b/test/CodeGen/R600/fneg.ll index 4cddc73..c20cf24 100644 --- a/test/CodeGen/R600/fneg.ll +++ b/test/CodeGen/R600/fneg.ll @@ -1,44 +1,41 @@ -; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600-CHECK -; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck %s --check-prefix=SI-CHECK +; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s +; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=FUNC %s -; R600-CHECK-LABEL: @fneg -; R600-CHECK: -PV -; SI-CHECK-LABEL: @fneg -; SI-CHECK: V_XOR_B32 -define void @fneg(float addrspace(1)* %out, float %in) { -entry: - %0 = fsub float -0.000000e+00, %in - store float %0, float addrspace(1)* %out +; FUNC-LABEL: {{^}}fneg_f32: +; R600: -PV + +; SI: v_xor_b32 +define void @fneg_f32(float addrspace(1)* %out, float %in) { + %fneg = fsub float -0.000000e+00, %in + store float %fneg, float addrspace(1)* %out ret void } -; R600-CHECK-LABEL: @fneg_v2 -; R600-CHECK: -PV -; R600-CHECK: -PV -; SI-CHECK-LABEL: @fneg_v2 -; SI-CHECK: V_XOR_B32 -; SI-CHECK: V_XOR_B32 -define void @fneg_v2(<2 x float> addrspace(1)* nocapture %out, <2 x float> %in) { -entry: - %0 = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %in - store <2 x float> %0, <2 x float> addrspace(1)* %out +; FUNC-LABEL: {{^}}fneg_v2f32: +; R600: -PV +; R600: -PV + +; SI: v_xor_b32 +; SI: v_xor_b32 +define void @fneg_v2f32(<2 x float> addrspace(1)* nocapture %out, <2 x float> %in) { + %fneg = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %in + store <2 x float> %fneg, <2 x float> addrspace(1)* %out ret void } -; R600-CHECK-LABEL: @fneg_v4 -; R600-CHECK: -PV -; R600-CHECK: -T -; R600-CHECK: -PV -; R600-CHECK: -PV -; SI-CHECK-LABEL: @fneg_v4 -; SI-CHECK: V_XOR_B32 -; SI-CHECK: V_XOR_B32 -; SI-CHECK: V_XOR_B32 -; SI-CHECK: V_XOR_B32 -define void @fneg_v4(<4 x float> addrspace(1)* nocapture %out, <4 x float> %in) { -entry: - %0 = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %in - store <4 x float> %0, <4 x float> addrspace(1)* %out +; FUNC-LABEL: {{^}}fneg_v4f32: +; R600: -PV +; R600: -T +; R600: -PV +; R600: -PV + +; SI: v_xor_b32 +; SI: v_xor_b32 +; SI: v_xor_b32 +; SI: v_xor_b32 +define void @fneg_v4f32(<4 x float> addrspace(1)* nocapture %out, <4 x float> %in) { + %fneg = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %in + store <4 x float> %fneg, <4 x float> addrspace(1)* %out ret void } @@ -46,27 +43,26 @@ entry: ; (fneg (f32 bitcast (i32 a))) => (f32 bitcast (xor (i32 a), 0x80000000)) ; unless the target returns true for isNegFree() -; R600-CHECK-LABEL: @fneg_free -; R600-CHECK-NOT: XOR -; R600-CHECK: -KC0[2].Z -; SI-CHECK-LABEL: @fneg_free -; XXX: We could use V_ADD_F32_e64 with the negate bit here instead. -; SI-CHECK: V_SUB_F32_e64 v{{[0-9]}}, 0.000000e+00, s{{[0-9]}}, 0, 0 -define void @fneg_free(float addrspace(1)* %out, i32 %in) { -entry: - %0 = bitcast i32 %in to float - %1 = fsub float 0.0, %0 - store float %1, float addrspace(1)* %out +; FUNC-LABEL: {{^}}fneg_free_f32: +; R600-NOT: XOR +; R600: -KC0[2].Z + +; XXX: We could use v_add_f32_e64 with the negate bit here instead. +; SI: v_sub_f32_e64 v{{[0-9]}}, 0.0, s{{[0-9]+$}} +define void @fneg_free_f32(float addrspace(1)* %out, i32 %in) { + %bc = bitcast i32 %in to float + %fsub = fsub float 0.0, %bc + store float %fsub, float addrspace(1)* %out ret void } -; SI-CHECK-LABEL: @fneg_fold -; SI-CHECK-NOT: V_XOR_B32 -; SI-CHECK: V_MUL_F32_e64 v{{[0-9]+}}, s{{[0-9]+}}, -v{{[0-9]+}} -define void @fneg_fold(float addrspace(1)* %out, float %in) { -entry: - %0 = fsub float -0.0, %in - %1 = fmul float %0, %in - store float %1, float addrspace(1)* %out +; FUNC-LABEL: {{^}}fneg_fold_f32: +; SI: s_load_dword [[NEG_VALUE:s[0-9]+]], s[{{[0-9]+:[0-9]+}}], 0xb +; SI-NOT: xor +; SI: v_mul_f32_e64 v{{[0-9]+}}, -[[NEG_VALUE]], [[NEG_VALUE]] +define void @fneg_fold_f32(float addrspace(1)* %out, float %in) { + %fsub = fsub float -0.0, %in + %fmul = fmul float %fsub, %in + store float %fmul, float addrspace(1)* %out ret void } |