Skip to content

Commit 8f82eed

Browse files
committed
add intrinsic support for xvrlw
1 parent 7647fc8 commit 8f82eed

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

llvm/include/llvm/IR/IntrinsicsPowerPC.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@ class PowerPC_VSX_Sca_DDD_Intrinsic<string GCCIntSuffix>
387387
[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
388388
[IntrNoMem]>;
389389

390+
/// PowerPC_VSX_WWW_Intrinsic - A PowerPC intrinsic that takes two v4i32
391+
/// vectors and returns one. These intrinsics have no side effects.
392+
class PowerPC_VSX_WWW_Intrinsic<string GCCIntSuffix>
393+
: PowerPC_VSX_Intrinsic<GCCIntSuffix,
394+
[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
395+
[IntrNoMem]>;
390396
//===----------------------------------------------------------------------===//
391397
// PowerPC Altivec Intrinsic Definitions.
392398

@@ -1214,6 +1220,7 @@ def int_ppc_altivec_vsraw : PowerPC_Vec_WWW_Intrinsic<"vsraw">;
12141220
def int_ppc_altivec_vrlb : PowerPC_Vec_BBB_Intrinsic<"vrlb">;
12151221
def int_ppc_altivec_vrlh : PowerPC_Vec_HHH_Intrinsic<"vrlh">;
12161222
def int_ppc_altivec_vrlw : PowerPC_Vec_WWW_Intrinsic<"vrlw">;
1223+
def int_ppc_vsx_xvrlw : PowerPC_VSX_WWW_Intrinsic<"xvrlw">;
12171224
def int_ppc_altivec_vrld : PowerPC_Vec_DDD_Intrinsic<"vrld">;
12181225

12191226
let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.".
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2+
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3+
; RUN: -mcpu=future -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
4+
; RUN: FileCheck %s
5+
6+
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
7+
; RUN: -mcpu=future -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
8+
; RUN: FileCheck %s
9+
10+
; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-aix \
11+
; RUN: -mcpu=future -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
12+
; RUN: FileCheck %s
13+
14+
define <4 x i32> @testVRLWMI(<4 x i32> %a, <4 x i32> %b) {
15+
; CHECK-LABEL: testVRLWMI:
16+
; CHECK: # %bb.0: # %entry
17+
; CHECK-NEXT: xvrlw v2, v2, v3
18+
; CHECK-NEXT: blr
19+
entry:
20+
%0 = tail call <4 x i32> @llvm.ppc.vsx.xvrlw(<4 x i32> %a, <4 x i32> %b)
21+
ret <4 x i32> %0
22+
}

0 commit comments

Comments
 (0)