1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mattr=-power8-altivec | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mcpu=pwr7 | FileCheck %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mcpu=pwr8 -mattr=-power8-altivec | FileCheck %s -check-prefix=CHECK-LE
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=+vsx -mcpu=pwr7 | FileCheck %s -check-prefix=CHECK-VSX
5 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mattr=+altivec -mattr=+vsx -mcpu=pwr8 -mattr=-power8-altivec | FileCheck %s -check-prefix=CHECK-LE-VSX
7 define <4 x i32> @test_v4i32(ptr %X, ptr %Y) {
8 %tmp = load <4 x i32>, ptr %X ; <<4 x i32>> [#uses=1]
9 %tmp2 = load <4 x i32>, ptr %Y ; <<4 x i32>> [#uses=1]
10 %tmp3 = mul <4 x i32> %tmp, %tmp2 ; <<4 x i32>> [#uses=1]
13 ; CHECK-LABEL: test_v4i32:
16 ; CHECK-LE-LABEL: test_v4i32:
19 ; CHECK-VSX-LABEL: test_v4i32:
21 ; CHECK-VSX-NOT: mullw
22 ; CHECK-LE-VSX-LABEL: test_v4i32:
23 ; CHECK-LE-VSX: vmsumuhm
24 ; CHECK-LE-VSX-NOT: mullw
26 define <8 x i16> @test_v8i16(ptr %X, ptr %Y) {
27 %tmp = load <8 x i16>, ptr %X ; <<8 x i16>> [#uses=1]
28 %tmp2 = load <8 x i16>, ptr %Y ; <<8 x i16>> [#uses=1]
29 %tmp3 = mul <8 x i16> %tmp, %tmp2 ; <<8 x i16>> [#uses=1]
32 ; CHECK-LABEL: test_v8i16:
35 ; CHECK-LE-LABEL: test_v8i16:
38 ; CHECK-VSX-LABEL: test_v8i16:
39 ; CHECK-VSX: vmladduhm
40 ; CHECK-VSX-NOT: mullw
41 ; CHECK-LE-VSX-LABEL: test_v8i16:
42 ; CHECK-LE-VSX: vmladduhm
43 ; CHECK-LE-VSX-NOT: mullw
45 define <16 x i8> @test_v16i8(ptr %X, ptr %Y) {
46 %tmp = load <16 x i8>, ptr %X ; <<16 x i8>> [#uses=1]
47 %tmp2 = load <16 x i8>, ptr %Y ; <<16 x i8>> [#uses=1]
48 %tmp3 = mul <16 x i8> %tmp, %tmp2 ; <<16 x i8>> [#uses=1]
51 ; CHECK-LABEL: test_v16i8:
55 ; CHECK-LE-LABEL: test_v16i8:
56 ; CHECK-LE: vmuloub [[REG1:[0-9]+]]
57 ; CHECK-LE: vmuleub [[REG2:[0-9]+]]
58 ; CHECK-LE: vperm {{[0-9]+}}, [[REG2]], [[REG1]]
60 ; CHECK-VSX-LABEL: test_v16i8:
63 ; CHECK-VSX-NOT: mullw
64 ; CHECK-LE-VSX-LABEL: test_v16i8:
65 ; CHECK-LE-VSX: vmuloub [[REG1:[0-9]+]]
66 ; CHECK-LE-VSX: vmuleub [[REG2:[0-9]+]]
67 ; CHECK-LE-VSX: vperm {{[0-9]+}}, [[REG2]], [[REG1]]
68 ; CHECK-LE-VSX-NOT: mullw
70 define <4 x float> @test_float(ptr %X, ptr %Y) {
71 %tmp = load <4 x float>, ptr %X
72 %tmp2 = load <4 x float>, ptr %Y
73 %tmp3 = fmul <4 x float> %tmp, %tmp2
76 ; Check the creation of a negative zero float vector by creating a vector of
77 ; all bits set and shifting it 31 bits to left, resulting a an vector of
78 ; 4 x 0x80000000 (-0.0 as float).
79 ; CHECK-LABEL: test_float:
80 ; CHECK: vspltisw [[ZNEG:[0-9]+]], -1
81 ; CHECK: vslw {{[0-9]+}}, [[ZNEG]], [[ZNEG]]
83 ; CHECK-LE-LABEL: test_float:
84 ; CHECK-LE: vspltisw [[ZNEG:[0-9]+]], -1
85 ; CHECK-LE: vslw {{[0-9]+}}, [[ZNEG]], [[ZNEG]]
87 ; CHECK-VSX-LABEL: test_float:
89 ; CHECK-LE-VSX-LABEL: test_float:
90 ; CHECK-LE-VSX: xvmulsp