Skip to content

Commit d318f9a

Browse files
committed
resolve merge conflict
1 parent 16a027a commit d318f9a

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,7 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
23192319
// Determine the type of this overloaded NEON intrinsic.
23202320
NeonTypeFlags neonType(neonTypeConst->getZExtValue());
23212321
bool isUnsigned = neonType.isUnsigned();
2322+
bool isQuad = neonType.isQuad();
23222323
const bool hasLegalHalfType = getTarget().hasLegalHalfType();
23232324
// The value of allowBFloatArgsAndRet is true for AArch64, but it should
23242325
// come from ABI info.
@@ -2380,6 +2381,13 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
23802381
: "aarch64.neon.sqsub",
23812382
vTy, getLoc(e->getExprLoc()));
23822383
}
2384+
case NEON::BI__builtin_neon_vcvt_f32_v:
2385+
case NEON::BI__builtin_neon_vcvtq_f32_v: {
2386+
ops[0] = builder.createBitcast(ops[0], ty);
2387+
ty = GetNeonType(this, NeonTypeFlags(NeonTypeFlags::Float32, false, isQuad),
2388+
hasLegalHalfType);
2389+
return builder.createCast(cir::CastKind::int_to_float, ops[0], ty);
2390+
}
23832391
case NEON::BI__builtin_neon_vext_v:
23842392
case NEON::BI__builtin_neon_vextq_v: {
23852393
int cv = getIntValueFromConstOp(ops[2]);

clang/test/CIR/CodeGen/AArch64/neon-misc.c

+47
Original file line numberDiff line numberDiff line change
@@ -860,3 +860,50 @@ uint32x2_t test_vqmovn_u64(uint64x2_t a) {
860860
// LLVM: [[VQMOVN_V1_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.uqxtn.v2i32(<2 x i64> [[A]])
861861
// LLVM: ret <2 x i32> [[VQMOVN_V1_I]]
862862
}
863+
float32x2_t test_vcvt_f32_s32(int32x2_t a) {
864+
return vcvt_f32_s32(a);
865+
866+
// CIR-LABEL: vcvt_f32_s32
867+
// {{%.*}} = cir.cast(int_to_float, {{%.*}} : !cir.vector<!s32i x 2>), !cir.vector<!cir.float x 2>
868+
869+
// LLVM: {{.*}}test_vcvt_f32_s32(<2 x i32>{{.*}}[[a:%.*]])
870+
// LLVM: [[TMP0:%.*]] = bitcast <2 x i32> [[a]] to <8 x i8>
871+
// LLVM: [[VCVT_I:%.*]] = sitofp <2 x i32> [[a]] to <2 x float>
872+
// LLVM: ret <2 x float> [[VCVT_I]]
873+
}
874+
875+
float32x2_t test_vcvt_f32_u32(uint32x2_t a) {
876+
return vcvt_f32_u32(a);
877+
878+
// CIR-LABEL: vcvt_f32_u32
879+
// {{%.*}} = cir.cast(int_to_float, {{%.*}} : !cir.vector<!u32i x 2>), !cir.vector<!cir.float x 2>
880+
881+
// LLVM: {{.*}}test_vcvt_f32_u32(<2 x i32>{{.*}}[[a:%.*]])
882+
// LLVM: [[TMP0:%.*]] = bitcast <2 x i32> [[a]] to <8 x i8>
883+
// LLVM: [[VCVT_I:%.*]] = uitofp <2 x i32> [[a]] to <2 x float>
884+
// LLVM: ret <2 x float> [[VCVT_I]]
885+
}
886+
887+
float32x4_t test_vcvtq_f32_s32(int32x4_t a) {
888+
return vcvtq_f32_s32(a);
889+
890+
// CIR-LABEL: vcvtq_f32_s32
891+
// {{%.*}} = cir.cast(int_to_float, {{%.*}} : !cir.vector<!s32i x 4>), !cir.vector<!cir.float x 4>
892+
893+
// LLVM: {{.*}}test_vcvtq_f32_s32(<4 x i32>{{.*}}[[a:%.*]])
894+
// LLVM: [[TMP0:%.*]] = bitcast <4 x i32> [[a]] to <16 x i8>
895+
// LLVM: [[VCVT_I:%.*]] = sitofp <4 x i32> [[a]] to <4 x float>
896+
// LLVM: ret <4 x float> [[VCVT_I]]
897+
}
898+
899+
float32x4_t test_vcvtq_f32_u32(uint32x4_t a) {
900+
return vcvtq_f32_u32(a);
901+
902+
// CIR-LABEL: vcvtq_f32_u32
903+
// {{%.*}} = cir.cast(int_to_float, {{%.*}} : !cir.vector<!u32i x 4>), !cir.vector<!cir.float x 4>
904+
905+
// LLVM: {{.*}}test_vcvtq_f32_u32(<4 x i32>{{.*}}[[a:%.*]])
906+
// LLVM: [[TMP0:%.*]] = bitcast <4 x i32> [[a]] to <16 x i8>
907+
// LLVM: [[VCVT_I:%.*]] = uitofp <4 x i32> [[a]] to <4 x float>
908+
// LLVM: ret <4 x float> [[VCVT_I]]
909+
}

0 commit comments

Comments
 (0)