• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=arm-darwin  -mattr=v6 < %s | FileCheck %s
2; RUN: llc -mtriple=thumb-darwin  -mattr=v6 < %s | FileCheck %s
3
4
5define void @test1(i16* nocapture %data) {
6entry:
7  %0 = load i16, i16* %data, align 2
8  %1 = tail call i16 @llvm.bswap.i16(i16 %0)
9  store i16 %1, i16* %data, align 2
10  ret void
11
12  ; CHECK-LABEL: test1:
13  ; CHECK: ldrh r[[R1:[0-9]+]], [r0]
14  ; CHECK: rev16 r[[R1]], r[[R1]]
15  ; CHECK: strh r[[R1]], [r0]
16}
17
18
19define void @test2(i16* nocapture %data, i16 zeroext %in) {
20entry:
21  %0 = tail call i16 @llvm.bswap.i16(i16 %in)
22  store i16 %0, i16* %data, align 2
23  ret void
24
25  ; CHECK-LABEL: test2:
26  ; CHECK: rev16 r[[R1:[0-9]+]], r1
27  ; CHECK: strh r[[R1]], [r0]
28}
29
30
31define i16 @test3(i16* nocapture %data) {
32entry:
33  %0 = load i16, i16* %data, align 2
34  %1 = tail call i16 @llvm.bswap.i16(i16 %0)
35  ret i16 %1
36
37  ; CHECK-LABEL: test3:
38  ; CHECK: ldrh r[[R0:[0-9]+]], [r0]
39  ; CHECK: rev16 r[[R0]], r0
40}
41
42declare i16 @llvm.bswap.i16(i16)
43