[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
[oota-llvm.git] / test / CodeGen / PowerPC / vsx-p8.ll
1 ; RUN: llc -mcpu=pwr8 -mattr=+power8-vector < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
4
5 ; Unaligned loads/stores on P8 and later should use VSX where possible.
6
7 define <2 x double> @test28u(<2 x double>* %a) {
8   %v = load <2 x double>* %a, align 8
9   ret <2 x double> %v
10
11 ; CHECK-LABEL: @test28u
12 ; CHECK: lxvd2x 34, 0, 3
13 ; CHECK: blr
14 }
15
16 define void @test29u(<2 x double>* %a, <2 x double> %b) {
17   store <2 x double> %b, <2 x double>* %a, align 8
18   ret void
19
20 ; CHECK-LABEL: @test29u
21 ; CHECK: stxvd2x 34, 0, 3
22 ; CHECK: blr
23 }
24
25 define <4 x float> @test32u(<4 x float>* %a) {
26   %v = load <4 x float>* %a, align 8
27   ret <4 x float> %v
28
29 ; CHECK-LABEL: @test32u
30 ; CHECK: lxvw4x 34, 0, 3
31 ; CHECK: blr
32 }
33
34 define void @test33u(<4 x float>* %a, <4 x float> %b) {
35   store <4 x float> %b, <4 x float>* %a, align 8
36   ret void
37
38 ; CHECK-LABEL: @test33u
39 ; CHECK: stxvw4x 34, 0, 3
40 ; CHECK: blr
41 }
42