diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
| commit | 5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch) | |
| tree | f5944309621cee4fe0976be6f9ac619b7ebfc4c2 /test/CodeGen/ARM/bswap16.ll | |
| parent | 68bcb7db193e4bc81430063148253d30a791023e (diff) | |
Notes
Diffstat (limited to 'test/CodeGen/ARM/bswap16.ll')
| -rw-r--r-- | test/CodeGen/ARM/bswap16.ll | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/bswap16.ll b/test/CodeGen/ARM/bswap16.ll new file mode 100644 index 0000000000000..70c62d294eecf --- /dev/null +++ b/test/CodeGen/ARM/bswap16.ll @@ -0,0 +1,42 @@ +; RUN: llc -mtriple=arm-darwin -mattr=v6 < %s | FileCheck %s +; RUN: llc -mtriple=thumb-darwin -mattr=v6 < %s | FileCheck %s + + +define void @test1(i16* nocapture %data) { +entry: + %0 = load i16* %data, align 2 + %1 = tail call i16 @llvm.bswap.i16(i16 %0) + store i16 %1, i16* %data, align 2 + ret void + + ; CHECK-LABEL: test1: + ; CHECK: ldrh r[[R1:[0-9]+]], [r0] + ; CHECK: rev16 r[[R1]], r[[R1]] + ; CHECK: strh r[[R1]], [r0] +} + + +define void @test2(i16* nocapture %data, i16 zeroext %in) { +entry: + %0 = tail call i16 @llvm.bswap.i16(i16 %in) + store i16 %0, i16* %data, align 2 + ret void + + ; CHECK-LABEL: test2: + ; CHECK: rev16 r[[R1:[0-9]+]], r1 + ; CHECK: strh r[[R1]], [r0] +} + + +define i16 @test3(i16* nocapture %data) { +entry: + %0 = load i16* %data, align 2 + %1 = tail call i16 @llvm.bswap.i16(i16 %0) + ret i16 %1 + + ; CHECK-LABEL: test3: + ; CHECK: ldrh r[[R0:[0-9]+]], [r0] + ; CHECK: rev16 r[[R0]], r0 +} + +declare i16 @llvm.bswap.i16(i16) |
