[llvm] [RISCV][P-ext][NFC] Add tests for packed reverse intrinsics (PR #208484)
Hongyu Chen via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 08:22:08 PDT 2026
https://github.com/XChy created https://github.com/llvm/llvm-project/pull/208484
None
>From ff89c980826491fd496b0bb5cc2bc16e5565d21c Mon Sep 17 00:00:00 2001
From: XChy <xxs_chy at outlook.com>
Date: Thu, 9 Jul 2026 23:19:02 +0800
Subject: [PATCH] [RISCV][P-ext][NFC] Add tests for pack reverse intrinsics
---
.../riscv_packed_simd.c | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c b/cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
index f23e43d4634d9..3e53c097888f0 100644
--- a/cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
+++ b/cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
@@ -2290,6 +2290,54 @@ int32x2_t test_pmerge_mvmn_i32x2(int32x2_t rs2, int32x2_t rs1, uint32x2_t rd) {
return __riscv_pmerge_i32x2(rs1, rs2, rd);
}
+// CHECK-LABEL: test_prev_i8x4:
+// CHECK: rev8
+int8x4_t test_prev_i8x4(int8x4_t a) { return __riscv_prev_i8x4(a); }
+
+// CHECK-LABEL: test_prev_u8x4:
+// CHECK: rev8
+uint8x4_t test_prev_u8x4(uint8x4_t a) { return __riscv_prev_u8x4(a); }
+
+// CHECK-LABEL: test_prev_i16x2:
+// RV32: ppairoe.h
+// RV64: rev16
+int16x2_t test_prev_i16x2(int16x2_t a) { return __riscv_prev_i16x2(a); }
+
+// CHECK-LABEL: test_prev_u16x2:
+// RV32: ppairoe.h
+// RV64: rev16
+uint16x2_t test_prev_u16x2(uint16x2_t a) { return __riscv_prev_u16x2(a); }
+
+// CHECK-LABEL: test_prev_i8x8:
+// RV32-COUNT-2: rev8
+// RV64: rev8
+int8x8_t test_prev_i8x8(int8x8_t a) { return __riscv_prev_i8x8(a); }
+
+// CHECK-LABEL: test_prev_u8x8:
+// RV32-COUNT-2: rev8
+// RV64: rev8
+uint8x8_t test_prev_u8x8(uint8x8_t a) { return __riscv_prev_u8x8(a); }
+
+// CHECK-LABEL: test_prev_i16x4:
+// RV32-COUNT-2: ppairoe.h
+// RV64: rev16
+int16x4_t test_prev_i16x4(int16x4_t a) { return __riscv_prev_i16x4(a); }
+
+// CHECK-LABEL: test_prev_u16x4:
+// RV32-COUNT-2: ppairoe.h
+// RV64: rev16
+uint16x4_t test_prev_u16x4(uint16x4_t a) { return __riscv_prev_u16x4(a); }
+
+// CHECK-LABEL: test_prev_i32x2:
+// RV32-COUNT-2: mv{{[[:space:]]}}
+// RV64: ppairoe.w
+int32x2_t test_prev_i32x2(int32x2_t a) { return __riscv_prev_i32x2(a); }
+
+// CHECK-LABEL: test_prev_u32x2:
+// RV32-COUNT-2: mv{{[[:space:]]}}
+// RV64: ppairoe.w
+uint32x2_t test_prev_u32x2(uint32x2_t a) { return __riscv_prev_u32x2(a); }
+
// CHECK-LABEL: test_pabdsumu_u8x4_u32:
// RV32: pabdsumu.b
// RV64: zext.w
More information about the llvm-commits
mailing list