Implement NEON domain switching for scalar <-> S-register vmovs on ARM
[oota-llvm.git] / test / CodeGen / ARM / unaligned_load_store.ll
1 ; RUN: llc < %s -march=arm -pre-RA-sched=source | FileCheck %s -check-prefix=EXPANDED
2 ; RUN: llc < %s -mtriple=armv6-apple-darwin -mcpu=cortex-a8 -arm-strict-align -pre-RA-sched=source | FileCheck %s -check-prefix=EXPANDED
3 ; RUN: llc < %s -mtriple=armv6-apple-darwin -mcpu=cortex-a8 | FileCheck %s -check-prefix=UNALIGNED
4
5 ; rdar://7113725
6 ; rdar://12091029
7
8 define void @t(i8* nocapture %a, i8* nocapture %b) nounwind {
9 entry:
10 ; EXPANDED: t:
11 ; EXPANDED: ldrb [[R2:r[0-9]+]]
12 ; EXPANDED: ldrb [[R3:r[0-9]+]]
13 ; EXPANDED: ldrb [[R12:r[0-9]+]]
14 ; EXPANDED: ldrb [[R1:r[0-9]+]]
15 ; EXPANDED: strb [[R1]]
16 ; EXPANDED: strb [[R12]]
17 ; EXPANDED: strb [[R3]]
18 ; EXPANDED: strb [[R2]]
19
20 ; UNALIGNED: t:
21 ; UNALIGNED: ldr r1
22 ; UNALIGNED: str r1
23
24   %__src1.i = bitcast i8* %b to i32*              ; <i32*> [#uses=1]
25   %__dest2.i = bitcast i8* %a to i32*             ; <i32*> [#uses=1]
26   %tmp.i = load i32* %__src1.i, align 1           ; <i32> [#uses=1]
27   store i32 %tmp.i, i32* %__dest2.i, align 1
28   ret void
29 }
30
31 define void @hword(double* %a, double* %b) nounwind {
32 entry:
33 ; EXPANDED: hword:
34 ; EXPANDED-NOT: vld1
35 ; EXPANDED: ldrh
36 ; EXPANDED-NOT: str1
37 ; EXPANDED: strh
38
39 ; UNALIGNED: hword:
40 ; UNALIGNED: vld1.16
41 ; UNALIGNED: vst1.16
42   %tmp = load double* %a, align 2
43   store double %tmp, double* %b, align 2
44   ret void
45 }
46
47 define void @byte(double* %a, double* %b) nounwind {
48 entry:
49 ; EXPANDED: byte:
50 ; EXPANDED-NOT: vld1
51 ; EXPANDED: ldrb
52 ; EXPANDED-NOT: str1
53 ; EXPANDED: strb
54
55 ; UNALIGNED: byte:
56 ; UNALIGNED: vld1.8
57 ; UNALIGNED: vst1.8
58   %tmp = load double* %a, align 1
59   store double %tmp, double* %b, align 1
60   ret void
61 }