1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/CodeGen/PowerPC/p10-vector-mask-ops.ll
Amy Kwan 2477050bd8 [PowerPC] Implement Vector Expand Mask builtins in LLVM/Clang
This patch implements the vec_expandm function prototypes in altivec.h in order
to utilize the vector expand with mask instructions introduced in Power10.

Differential Revision: https://reviews.llvm.org/D82727
2020-09-06 17:13:21 -05:00

123 lines
3.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN: FileCheck %s
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN: FileCheck %s
; This test case aims to test the vector mask manipulation operations
; on Power10.
declare i32 @llvm.ppc.altivec.vextractbm(<16 x i8>)
declare i32 @llvm.ppc.altivec.vextracthm(<8 x i16>)
declare i32 @llvm.ppc.altivec.vextractwm(<4 x i32>)
declare i32 @llvm.ppc.altivec.vextractdm(<2 x i64>)
declare i32 @llvm.ppc.altivec.vextractqm(<1 x i128>)
define i32 @test_vextractbm(<16 x i8> %a) {
; CHECK-LABEL: test_vextractbm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vextractbm r3, v2
; CHECK-NEXT: blr
entry:
%ext = tail call i32 @llvm.ppc.altivec.vextractbm(<16 x i8> %a)
ret i32 %ext
}
define i32 @test_vextracthm(<8 x i16> %a) {
; CHECK-LABEL: test_vextracthm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vextracthm r3, v2
; CHECK-NEXT: blr
entry:
%ext = tail call i32 @llvm.ppc.altivec.vextracthm(<8 x i16> %a)
ret i32 %ext
}
define i32 @test_vextractwm(<4 x i32> %a) {
; CHECK-LABEL: test_vextractwm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vextractwm r3, v2
; CHECK-NEXT: blr
entry:
%ext = tail call i32 @llvm.ppc.altivec.vextractwm(<4 x i32> %a)
ret i32 %ext
}
define i32 @test_vextractdm(<2 x i64> %a) {
; CHECK-LABEL: test_vextractdm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vextractdm r3, v2
; CHECK-NEXT: blr
entry:
%ext = tail call i32 @llvm.ppc.altivec.vextractdm(<2 x i64> %a)
ret i32 %ext
}
define i32 @test_vextractqm(<1 x i128> %a) {
; CHECK-LABEL: test_vextractqm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vextractqm r3, v2
; CHECK-NEXT: blr
entry:
%ext = tail call i32 @llvm.ppc.altivec.vextractqm(<1 x i128> %a)
ret i32 %ext
}
declare <16 x i8> @llvm.ppc.altivec.vexpandbm(<16 x i8>)
declare <8 x i16> @llvm.ppc.altivec.vexpandhm(<8 x i16>)
declare <4 x i32> @llvm.ppc.altivec.vexpandwm(<4 x i32>)
declare <2 x i64> @llvm.ppc.altivec.vexpanddm(<2 x i64>)
declare <1 x i128> @llvm.ppc.altivec.vexpandqm(<1 x i128>)
define <16 x i8> @test_vexpandbm(<16 x i8> %a) {
; CHECK-LABEL: test_vexpandbm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vexpandbm v2, v2
; CHECK-NEXT: blr
entry:
%exp = tail call <16 x i8> @llvm.ppc.altivec.vexpandbm(<16 x i8> %a)
ret <16 x i8> %exp
}
define <8 x i16> @test_vexpandhm(<8 x i16> %a) {
; CHECK-LABEL: test_vexpandhm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vexpandhm v2, v2
; CHECK-NEXT: blr
entry:
%exp = tail call <8 x i16> @llvm.ppc.altivec.vexpandhm(<8 x i16> %a)
ret <8 x i16> %exp
}
define <4 x i32> @test_vexpandwm(<4 x i32> %a) {
; CHECK-LABEL: test_vexpandwm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vexpandwm v2, v2
; CHECK-NEXT: blr
entry:
%exp = tail call <4 x i32> @llvm.ppc.altivec.vexpandwm(<4 x i32> %a)
ret <4 x i32> %exp
}
define <2 x i64> @test_vexpanddm(<2 x i64> %a) {
; CHECK-LABEL: test_vexpanddm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vexpanddm v2, v2
; CHECK-NEXT: blr
entry:
%exp = tail call <2 x i64> @llvm.ppc.altivec.vexpanddm(<2 x i64> %a)
ret <2 x i64> %exp
}
define <1 x i128> @test_vexpandqm(<1 x i128> %a) {
; CHECK-LABEL: test_vexpandqm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vexpandqm v2, v2
; CHECK-NEXT: blr
entry:
%exp = tail call <1 x i128> @llvm.ppc.altivec.vexpandqm(<1 x i128> %a)
ret <1 x i128> %exp
}