2017-08-02 06:20:41 +08:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mattr=-power8-altivec | FileCheck %s
|
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mcpu=pwr7 | FileCheck %s
|
|
|
|
; 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
|
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=+vsx -mcpu=pwr7 | FileCheck %s -check-prefix=CHECK-VSX
|
|
|
|
; 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
|
2006-04-18 11:22:16 +08:00
|
|
|
|
2008-02-19 16:07:33 +08:00
|
|
|
define <4 x i32> @test_v4i32(<4 x i32>* %X, <4 x i32>* %Y) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load <4 x i32>, <4 x i32>* %X ; <<4 x i32>> [#uses=1]
|
|
|
|
%tmp2 = load <4 x i32>, <4 x i32>* %Y ; <<4 x i32>> [#uses=1]
|
2008-02-19 16:07:33 +08:00
|
|
|
%tmp3 = mul <4 x i32> %tmp, %tmp2 ; <<4 x i32>> [#uses=1]
|
|
|
|
ret <4 x i32> %tmp3
|
2006-04-18 11:22:16 +08:00
|
|
|
}
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_v4i32:
|
2012-11-30 21:05:44 +08:00
|
|
|
; CHECK: vmsumuhm
|
|
|
|
; CHECK-NOT: mullw
|
2014-06-10 00:06:29 +08:00
|
|
|
; CHECK-LE-LABEL: test_v4i32:
|
|
|
|
; CHECK-LE: vmsumuhm
|
|
|
|
; CHECK-LE-NOT: mullw
|
2014-10-17 09:41:22 +08:00
|
|
|
; CHECK-VSX-LABEL: test_v4i32:
|
|
|
|
; CHECK-VSX: vmsumuhm
|
|
|
|
; CHECK-VSX-NOT: mullw
|
|
|
|
; CHECK-LE-VSX-LABEL: test_v4i32:
|
|
|
|
; CHECK-LE-VSX: vmsumuhm
|
|
|
|
; CHECK-LE-VSX-NOT: mullw
|
2006-04-18 11:22:16 +08:00
|
|
|
|
2008-02-19 16:07:33 +08:00
|
|
|
define <8 x i16> @test_v8i16(<8 x i16>* %X, <8 x i16>* %Y) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load <8 x i16>, <8 x i16>* %X ; <<8 x i16>> [#uses=1]
|
|
|
|
%tmp2 = load <8 x i16>, <8 x i16>* %Y ; <<8 x i16>> [#uses=1]
|
2008-02-19 16:07:33 +08:00
|
|
|
%tmp3 = mul <8 x i16> %tmp, %tmp2 ; <<8 x i16>> [#uses=1]
|
|
|
|
ret <8 x i16> %tmp3
|
2006-04-18 11:54:50 +08:00
|
|
|
}
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_v8i16:
|
2012-11-30 21:05:44 +08:00
|
|
|
; CHECK: vmladduhm
|
|
|
|
; CHECK-NOT: mullw
|
2014-06-10 00:06:29 +08:00
|
|
|
; CHECK-LE-LABEL: test_v8i16:
|
|
|
|
; CHECK-LE: vmladduhm
|
|
|
|
; CHECK-LE-NOT: mullw
|
2014-10-17 09:41:22 +08:00
|
|
|
; CHECK-VSX-LABEL: test_v8i16:
|
|
|
|
; CHECK-VSX: vmladduhm
|
|
|
|
; CHECK-VSX-NOT: mullw
|
|
|
|
; CHECK-LE-VSX-LABEL: test_v8i16:
|
|
|
|
; CHECK-LE-VSX: vmladduhm
|
|
|
|
; CHECK-LE-VSX-NOT: mullw
|
2006-04-18 11:54:50 +08:00
|
|
|
|
2008-02-19 16:07:33 +08:00
|
|
|
define <16 x i8> @test_v16i8(<16 x i8>* %X, <16 x i8>* %Y) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load <16 x i8>, <16 x i8>* %X ; <<16 x i8>> [#uses=1]
|
|
|
|
%tmp2 = load <16 x i8>, <16 x i8>* %Y ; <<16 x i8>> [#uses=1]
|
2008-02-19 16:07:33 +08:00
|
|
|
%tmp3 = mul <16 x i8> %tmp, %tmp2 ; <<16 x i8>> [#uses=1]
|
|
|
|
ret <16 x i8> %tmp3
|
2006-04-18 11:54:50 +08:00
|
|
|
}
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_v16i8:
|
2012-11-30 21:05:44 +08:00
|
|
|
; CHECK: vmuloub
|
|
|
|
; CHECK: vmuleub
|
|
|
|
; CHECK-NOT: mullw
|
2014-06-10 00:06:29 +08:00
|
|
|
; CHECK-LE-LABEL: test_v16i8:
|
|
|
|
; CHECK-LE: vmuloub [[REG1:[0-9]+]]
|
|
|
|
; CHECK-LE: vmuleub [[REG2:[0-9]+]]
|
|
|
|
; CHECK-LE: vperm {{[0-9]+}}, [[REG2]], [[REG1]]
|
|
|
|
; CHECK-LE-NOT: mullw
|
2014-10-17 09:41:22 +08:00
|
|
|
; CHECK-VSX-LABEL: test_v16i8:
|
|
|
|
; CHECK-VSX: vmuloub
|
|
|
|
; CHECK-VSX: vmuleub
|
|
|
|
; CHECK-VSX-NOT: mullw
|
|
|
|
; CHECK-LE-VSX-LABEL: test_v16i8:
|
|
|
|
; CHECK-LE-VSX: vmuloub [[REG1:[0-9]+]]
|
|
|
|
; CHECK-LE-VSX: vmuleub [[REG2:[0-9]+]]
|
|
|
|
; CHECK-LE-VSX: vperm {{[0-9]+}}, [[REG2]], [[REG1]]
|
|
|
|
; CHECK-LE-VSX-NOT: mullw
|
2012-11-30 21:05:44 +08:00
|
|
|
|
|
|
|
define <4 x float> @test_float(<4 x float>* %X, <4 x float>* %Y) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load <4 x float>, <4 x float>* %X
|
|
|
|
%tmp2 = load <4 x float>, <4 x float>* %Y
|
2012-11-30 21:05:44 +08:00
|
|
|
%tmp3 = fmul <4 x float> %tmp, %tmp2
|
|
|
|
ret <4 x float> %tmp3
|
|
|
|
}
|
|
|
|
; Check the creation of a negative zero float vector by creating a vector of
|
|
|
|
; all bits set and shifting it 31 bits to left, resulting a an vector of
|
|
|
|
; 4 x 0x80000000 (-0.0 as float).
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_float:
|
2012-12-01 03:15:10 +08:00
|
|
|
; CHECK: vspltisw [[ZNEG:[0-9]+]], -1
|
|
|
|
; CHECK: vslw {{[0-9]+}}, [[ZNEG]], [[ZNEG]]
|
2012-11-30 21:05:44 +08:00
|
|
|
; CHECK: vmaddfp
|
2014-06-10 00:06:29 +08:00
|
|
|
; CHECK-LE-LABEL: test_float:
|
|
|
|
; CHECK-LE: vspltisw [[ZNEG:[0-9]+]], -1
|
|
|
|
; CHECK-LE: vslw {{[0-9]+}}, [[ZNEG]], [[ZNEG]]
|
|
|
|
; CHECK-LE: vmaddfp
|
2014-10-17 09:41:22 +08:00
|
|
|
; CHECK-VSX-LABEL: test_float:
|
|
|
|
; CHECK-VSX: xvmulsp
|
|
|
|
; CHECK-LE-VSX-LABEL: test_float:
|
|
|
|
; CHECK-LE-VSX: xvmulsp
|