1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen/PowerPC/p10-vsx-pcv.ll
Amy Kwan 999d7986df [PowerPC][Power10] Implement VSX PCV Generate Operations in LLVM/Clang
This patch implements builtins for the following prototypes for the VSX Permute
Control Vector Generate with Mask Instructions:

vector unsigned char vec_genpcvm (vector unsigned char, const int);
vector unsigned short vec_genpcvm (vector unsigned short, const int);
vector unsigned int vec_genpcvm (vector unsigned int, const int);
vector unsigned long long vec_genpcvm (vector unsigned long long, const int);

Differential Revision: https://reviews.llvm.org/D81774
2020-06-22 21:09:34 -05:00

52 lines
1.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
; These test cases aim to test the VSX PCV Generate Operations on Power10.
declare <16 x i8> @llvm.ppc.vsx.xxgenpcvbm(<16 x i8>, i32)
declare <8 x i16> @llvm.ppc.vsx.xxgenpcvhm(<8 x i16>, i32)
declare <4 x i32> @llvm.ppc.vsx.xxgenpcvwm(<4 x i32>, i32)
declare <2 x i64> @llvm.ppc.vsx.xxgenpcvdm(<2 x i64>, i32)
define <16 x i8> @test_xxgenpcvbm(<16 x i8> %a) {
; CHECK-LABEL: test_xxgenpcvbm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xxgenpcvbm v2, v2, 1
; CHECK-NEXT: blr
entry:
%gen = tail call <16 x i8> @llvm.ppc.vsx.xxgenpcvbm(<16 x i8> %a, i32 1)
ret <16 x i8> %gen
}
define <8 x i16> @test_xxgenpcvhm(<8 x i16> %a) {
; CHECK-LABEL: test_xxgenpcvhm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xxgenpcvhm v2, v2, 1
; CHECK-NEXT: blr
entry:
%gen = tail call <8 x i16> @llvm.ppc.vsx.xxgenpcvhm(<8 x i16> %a, i32 1)
ret <8 x i16> %gen
}
define <4 x i32> @test_xxgenpcvwm(<4 x i32> %a) {
; CHECK-LABEL: test_xxgenpcvwm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xxgenpcvwm v2, v2, 1
; CHECK-NEXT: blr
entry:
%gen = tail call <4 x i32> @llvm.ppc.vsx.xxgenpcvwm(<4 x i32> %a, i32 1)
ret <4 x i32> %gen
}
define <2 x i64> @test_xxgenpcvdm(<2 x i64> %a) {
; CHECK-LABEL: test_xxgenpcvdm:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xxgenpcvdm v2, v2, 1
; CHECK-NEXT: blr
entry:
%gen = tail call <2 x i64> @llvm.ppc.vsx.xxgenpcvdm(<2 x i64> %a, i32 1)
ret <2 x i64> %gen
}