diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-04-21 21:02:25 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-04-21 21:02:25 +0000 |
| commit | 1725bde4cc55419ee8758b6f8fd42eec32fb0513 (patch) | |
| tree | 98394ba1cbfd9990c0414650bd2b8deb04b6b06c | |
| parent | 23341a84cacfa57722a6d0807846f164317f9d8d (diff) | |
| download | bcm5719-llvm-1725bde4cc55419ee8758b6f8fd42eec32fb0513.tar.gz bcm5719-llvm-1725bde4cc55419ee8758b6f8fd42eec32fb0513.zip | |
add tests for disguised fabs/fneg
llvm-svn: 267053
| -rw-r--r-- | llvm/test/CodeGen/AArch64/fcvt-int.ll | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/fcvt-int.ll b/llvm/test/CodeGen/AArch64/fcvt-int.ll index d549c7e7842..9092bea8c2a 100644 --- a/llvm/test/CodeGen/AArch64/fcvt-int.ll +++ b/llvm/test/CodeGen/AArch64/fcvt-int.ll @@ -149,3 +149,32 @@ define double @test_bitcasti64todouble(i64 %in) { ret double %res } + +define double @bitcast_fabs(double %x) { +; CHECK-LABEL: bitcast_fabs: +; CHECK: ; BB#0: +; CHECK-NEXT: fmov x8, d0 +; CHECK-NEXT: and x8, x8, #0x7fffffffffffffff +; CHECK-NEXT: fmov d0, x8 +; CHECK-NEXT: ret +; + %bc1 = bitcast double %x to i64 + %and = and i64 %bc1, 9223372036854775807 + %bc2 = bitcast i64 %and to double + ret double %bc2 +} + +define float @bitcast_fneg(float %x) { +; CHECK-LABEL: bitcast_fneg: +; CHECK: ; BB#0: +; CHECK-NEXT: fmov w8, s0 +; CHECK-NEXT: eor w8, w8, #0x80000000 +; CHECK-NEXT: fmov s0, w8 +; CHECK-NEXT: ret +; + %bc1 = bitcast float %x to i32 + %xor = xor i32 %bc1, 2147483648 + %bc2 = bitcast i32 %xor to float + ret float %bc2 +} + |

