================
@@ -34,3 +34,50 @@ bfloat16_t test_vduph_laneq_bf16(bfloat16x8_t v) {
// LLVM: ret bfloat [[VGETQ_LANE]]
return vduph_laneq_bf16(v, 7);
}
+
+// ALL-LABEL: @test_vdup_lane_bf16(
+bfloat16x4_t test_vdup_lane_bf16(bfloat16x4_t v) {
+ // CIR: cir.vec.shuffle({{%.*}}, {{%.*}} : !cir.vector<4 x !u16i>)
[#cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<1> :
!s32i] : !cir.vector<4 x !u16i>
+ // LLVM: shufflevector <4 x {{.*}}> {{.*}}, <4 x {{.*}}> {{.*}}, <4 x i32>
<i32 1, i32 1, i32 1, i32 1>
+ return vdup_lane_bf16(v, 1);
+}
+
+// ALL-LABEL: @test_vdupq_lane_bf16(
+bfloat16x8_t test_vdupq_lane_bf16(bfloat16x4_t v) {
+ // CIR: cir.vec.shuffle({{%.*}}, {{%.*}} : !cir.vector<4 x !u16i>)
[#cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<1> :
!s32i, #cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<1> : !s32i,
#cir.int<1> : !s32i] : !cir.vector<8 x !u16i>
+ // LLVM: shufflevector <4 x {{.*}}> {{.*}}, <4 x {{.*}}> {{.*}}, <8 x i32>
<i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
+ return vdupq_lane_bf16(v, 1);
+}
+
+// ALL-LABEL: @test_vdup_laneq_bf16(
+bfloat16x4_t test_vdup_laneq_bf16(bfloat16x8_t v) {
+ // CIR: cir.vec.shuffle({{%.*}}, {{%.*}} : !cir.vector<8 x !u16i>)
[#cir.int<7> : !s32i, #cir.int<7> : !s32i, #cir.int<7> : !s32i, #cir.int<7> :
!s32i] : !cir.vector<4 x !u16i>
+ // LLVM: shufflevector <8 x {{.*}}> {{.*}}, <8 x {{.*}}> {{.*}}, <4 x i32>
<i32 7, i32 7, i32 7, i32 7>
+ return vdup_laneq_bf16(v, 7);
+}
+
+// ALL-LABEL: @test_vdupq_laneq_bf16(
+bfloat16x8_t test_vdupq_laneq_bf16(bfloat16x8_t v) {
+ // CIR: cir.vec.shuffle({{%.*}}, {{%.*}} : !cir.vector<8 x !u16i>)
[#cir.int<7> : !s32i, #cir.int<7> : !s32i, #cir.int<7> : !s32i, #cir.int<7> :
!s32i, #cir.int<7> : !s32i, #cir.int<7> : !s32i, #cir.int<7> : !s32i,
#cir.int<7> : !s32i] : !cir.vector<8 x !u16i>
+ // LLVM: shufflevector <8 x {{.*}}> {{.*}}, <8 x {{.*}}> {{.*}}, <8 x i32>
<i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7>
+ return vdupq_laneq_bf16(v, 7);
+}
+
+// ALL-LABEL: @test_vdup_n_bf16(
+bfloat16x4_t test_vdup_n_bf16(bfloat16_t v) {
+ // CIR: cir.call @vdup_n_bf16
----------------
banach-space wrote:
I see that this is calling some other intrinsic. In such cases, we match the
label corresponding to `@vdup_n_bf16` and check what's inside that function
instead. Here's an example:
https://github.com/llvm/llvm-project/blob/ed76cbccbb40da23f443ee147d697917c5101e9a/clang/test/CodeGen/AArch64/neon/intrinsics.c?plain=1#L41-L45
Basically, we ignore the indirection and focus on the actual operation
performed. Hopefully this makes sense. If not, I am happy to explain more :)
https://github.com/llvm/llvm-project/pull/187460
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits