diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp index ba4c4a07943c..3f3c34f260c0 100644 --- a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp @@ -2594,6 +2594,489 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr( return emitCommonNeonCallPattern0(*this, intrincsName, argTypes, ops, vTy, e); } +static mlir::Value emitCommonNeonSISDBuiltinExpr( + CIRGenFunction &cgf, const ARMVectorIntrinsicInfo &info, + llvm::SmallVectorImpl &args, const CallExpr *expr) { + unsigned builtinID = info.BuiltinID; + switch (builtinID) { + default: + llvm::errs() << getAArch64SIMDIntrinsicString(builtinID) << " "; + llvm_unreachable("in emitCommonNeonSISDBuiltinExpr NYI"); + case NEON::BI__builtin_neon_vabdd_f64: + llvm_unreachable(" neon_vabdd_f64 NYI "); + case NEON::BI__builtin_neon_vabds_f32: + llvm_unreachable(" neon_vabds_f32 NYI "); + case NEON::BI__builtin_neon_vabsd_s64: + llvm_unreachable(" neon_vabsd_s64 NYI "); + case NEON::BI__builtin_neon_vaddlv_s32: + llvm_unreachable(" neon_vaddlv_s32 NYI "); + case NEON::BI__builtin_neon_vaddlv_u32: + llvm_unreachable(" neon_vaddlv_u32 NYI "); + case NEON::BI__builtin_neon_vaddlvq_s32: + llvm_unreachable(" neon_vaddlvq_s32 NYI "); + case NEON::BI__builtin_neon_vaddlvq_u32: + llvm_unreachable(" neon_vaddlvq_u32 NYI "); + case NEON::BI__builtin_neon_vaddv_f32: + llvm_unreachable(" neon_vaddv_f32 NYI "); + case NEON::BI__builtin_neon_vaddv_s32: + llvm_unreachable(" neon_vaddv_s32 NYI "); + case NEON::BI__builtin_neon_vaddv_u32: + llvm_unreachable(" neon_vaddv_u32 NYI "); + case NEON::BI__builtin_neon_vaddvq_f32: + llvm_unreachable(" neon_vaddvq_f32 NYI "); + case NEON::BI__builtin_neon_vaddvq_f64: + llvm_unreachable(" neon_vaddvq_f64 NYI "); + case NEON::BI__builtin_neon_vaddvq_s32: + llvm_unreachable(" neon_vaddvq_s32 NYI "); + case NEON::BI__builtin_neon_vaddvq_s64: + llvm_unreachable(" neon_vaddvq_s64 NYI "); + case NEON::BI__builtin_neon_vaddvq_u32: + llvm_unreachable(" neon_vaddvq_u32 NYI "); + case NEON::BI__builtin_neon_vaddvq_u64: + llvm_unreachable(" neon_vaddvq_u64 NYI "); + case NEON::BI__builtin_neon_vcaged_f64: + llvm_unreachable(" neon_vcaged_f64 NYI "); + case NEON::BI__builtin_neon_vcages_f32: + llvm_unreachable(" neon_vcages_f32 NYI "); + case NEON::BI__builtin_neon_vcagtd_f64: + llvm_unreachable(" neon_vcagtd_f64 NYI "); + case NEON::BI__builtin_neon_vcagts_f32: + llvm_unreachable(" neon_vcagts_f32 NYI "); + case NEON::BI__builtin_neon_vcaled_f64: + llvm_unreachable(" neon_vcaled_f64 NYI "); + case NEON::BI__builtin_neon_vcales_f32: + llvm_unreachable(" neon_vcales_f32 NYI "); + case NEON::BI__builtin_neon_vcaltd_f64: + llvm_unreachable(" neon_vcaltd_f64 NYI "); + case NEON::BI__builtin_neon_vcalts_f32: + llvm_unreachable(" neon_vcalts_f32 NYI "); + case NEON::BI__builtin_neon_vcvtad_s64_f64: + llvm_unreachable(" neon_vcvtad_s64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtad_u64_f64: + llvm_unreachable(" neon_vcvtad_u64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtas_s32_f32: + llvm_unreachable(" neon_vcvtas_s32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtas_u32_f32: + llvm_unreachable(" neon_vcvtas_u32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtd_n_f64_s64: + llvm_unreachable(" neon_vcvtd_n_f64_s64 NYI "); + case NEON::BI__builtin_neon_vcvtd_n_f64_u64: + llvm_unreachable(" neon_vcvtd_n_f64_u64 NYI "); + case NEON::BI__builtin_neon_vcvtd_n_s64_f64: + llvm_unreachable(" neon_vcvtd_n_s64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtd_n_u64_f64: + llvm_unreachable(" neon_vcvtd_n_u64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtd_s64_f64: + llvm_unreachable(" neon_vcvtd_s64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtd_u64_f64: + llvm_unreachable(" neon_vcvtd_u64_f64 NYI "); + case NEON::BI__builtin_neon_vcvth_bf16_f32: + llvm_unreachable(" neon_vcvth_bf16_f32 NYI "); + case NEON::BI__builtin_neon_vcvtmd_s64_f64: + llvm_unreachable(" neon_vcvtmd_s64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtmd_u64_f64: + llvm_unreachable(" neon_vcvtmd_u64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtms_s32_f32: + llvm_unreachable(" neon_vcvtms_s32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtms_u32_f32: + llvm_unreachable(" neon_vcvtms_u32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtnd_s64_f64: + llvm_unreachable(" neon_vcvtnd_s64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtnd_u64_f64: + llvm_unreachable(" neon_vcvtnd_u64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtns_s32_f32: + llvm_unreachable(" neon_vcvtns_s32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtns_u32_f32: + llvm_unreachable(" neon_vcvtns_u32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtpd_s64_f64: + llvm_unreachable(" neon_vcvtpd_s64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtpd_u64_f64: + llvm_unreachable(" neon_vcvtpd_u64_f64 NYI "); + case NEON::BI__builtin_neon_vcvtps_s32_f32: + llvm_unreachable(" neon_vcvtps_s32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtps_u32_f32: + llvm_unreachable(" neon_vcvtps_u32_f32 NYI "); + case NEON::BI__builtin_neon_vcvts_n_f32_s32: + llvm_unreachable(" neon_vcvts_n_f32_s32 NYI "); + case NEON::BI__builtin_neon_vcvts_n_f32_u32: + llvm_unreachable(" neon_vcvts_n_f32_u32 NYI "); + case NEON::BI__builtin_neon_vcvts_n_s32_f32: + llvm_unreachable(" neon_vcvts_n_s32_f32 NYI "); + case NEON::BI__builtin_neon_vcvts_n_u32_f32: + llvm_unreachable(" neon_vcvts_n_u32_f32 NYI "); + case NEON::BI__builtin_neon_vcvts_s32_f32: + llvm_unreachable(" neon_vcvts_s32_f32 NYI "); + case NEON::BI__builtin_neon_vcvts_u32_f32: + llvm_unreachable(" neon_vcvts_u32_f32 NYI "); + case NEON::BI__builtin_neon_vcvtxd_f32_f64: + llvm_unreachable(" neon_vcvtxd_f32_f64 NYI "); + case NEON::BI__builtin_neon_vmaxnmv_f32: + llvm_unreachable(" neon_vmaxnmv_f32 NYI "); + case NEON::BI__builtin_neon_vmaxnmvq_f32: + llvm_unreachable(" neon_vmaxnmvq_f32 NYI "); + case NEON::BI__builtin_neon_vmaxnmvq_f64: + llvm_unreachable(" neon_vmaxnmvq_f64 NYI "); + case NEON::BI__builtin_neon_vmaxv_f32: + llvm_unreachable(" neon_vmaxv_f32 NYI "); + case NEON::BI__builtin_neon_vmaxv_s32: + llvm_unreachable(" neon_vmaxv_s32 NYI "); + case NEON::BI__builtin_neon_vmaxv_u32: + llvm_unreachable(" neon_vmaxv_u32 NYI "); + case NEON::BI__builtin_neon_vmaxvq_f32: + llvm_unreachable(" neon_vmaxvq_f32 NYI "); + case NEON::BI__builtin_neon_vmaxvq_f64: + llvm_unreachable(" neon_vmaxvq_f64 NYI "); + case NEON::BI__builtin_neon_vmaxvq_s32: + llvm_unreachable(" neon_vmaxvq_s32 NYI "); + case NEON::BI__builtin_neon_vmaxvq_u32: + llvm_unreachable(" neon_vmaxvq_u32 NYI "); + case NEON::BI__builtin_neon_vminnmv_f32: + llvm_unreachable(" neon_vminnmv_f32 NYI "); + case NEON::BI__builtin_neon_vminnmvq_f32: + llvm_unreachable(" neon_vminnmvq_f32 NYI "); + case NEON::BI__builtin_neon_vminnmvq_f64: + llvm_unreachable(" neon_vminnmvq_f64 NYI "); + case NEON::BI__builtin_neon_vminv_f32: + llvm_unreachable(" neon_vminv_f32 NYI "); + case NEON::BI__builtin_neon_vminv_s32: + llvm_unreachable(" neon_vminv_s32 NYI "); + case NEON::BI__builtin_neon_vminv_u32: + llvm_unreachable(" neon_vminv_u32 NYI "); + case NEON::BI__builtin_neon_vminvq_f32: + llvm_unreachable(" neon_vminvq_f32 NYI "); + case NEON::BI__builtin_neon_vminvq_f64: + llvm_unreachable(" neon_vminvq_f64 NYI "); + case NEON::BI__builtin_neon_vminvq_s32: + llvm_unreachable(" neon_vminvq_s32 NYI "); + case NEON::BI__builtin_neon_vminvq_u32: + llvm_unreachable(" neon_vminvq_u32 NYI "); + case NEON::BI__builtin_neon_vmull_p64: + llvm_unreachable(" neon_vmull_p64 NYI "); + case NEON::BI__builtin_neon_vmulxd_f64: + llvm_unreachable(" neon_vmulxd_f64 NYI "); + case NEON::BI__builtin_neon_vmulxs_f32: + llvm_unreachable(" neon_vmulxs_f32 NYI "); + case NEON::BI__builtin_neon_vpaddd_s64: + llvm_unreachable(" neon_vpaddd_s64 NYI "); + case NEON::BI__builtin_neon_vpaddd_u64: + llvm_unreachable(" neon_vpaddd_u64 NYI "); + case NEON::BI__builtin_neon_vpmaxnmqd_f64: + llvm_unreachable(" neon_vpmaxnmqd_f64 NYI "); + case NEON::BI__builtin_neon_vpmaxnms_f32: + llvm_unreachable(" neon_vpmaxnms_f32 NYI "); + case NEON::BI__builtin_neon_vpmaxqd_f64: + llvm_unreachable(" neon_vpmaxqd_f64 NYI "); + case NEON::BI__builtin_neon_vpmaxs_f32: + llvm_unreachable(" neon_vpmaxs_f32 NYI "); + case NEON::BI__builtin_neon_vpminnmqd_f64: + llvm_unreachable(" neon_vpminnmqd_f64 NYI "); + case NEON::BI__builtin_neon_vpminnms_f32: + llvm_unreachable(" neon_vpminnms_f32 NYI "); + case NEON::BI__builtin_neon_vpminqd_f64: + llvm_unreachable(" neon_vpminqd_f64 NYI "); + case NEON::BI__builtin_neon_vpmins_f32: + llvm_unreachable(" neon_vpmins_f32 NYI "); + case NEON::BI__builtin_neon_vqabsb_s8: + llvm_unreachable(" neon_vqabsb_s8 NYI "); + case NEON::BI__builtin_neon_vqabsd_s64: + llvm_unreachable(" neon_vqabsd_s64 NYI "); + case NEON::BI__builtin_neon_vqabsh_s16: + llvm_unreachable(" neon_vqabsh_s16 NYI "); + case NEON::BI__builtin_neon_vqabss_s32: + llvm_unreachable(" neon_vqabss_s32 NYI "); + case NEON::BI__builtin_neon_vqaddb_s8: + llvm_unreachable(" neon_vqaddb_s8 NYI "); + case NEON::BI__builtin_neon_vqaddb_u8: + llvm_unreachable(" neon_vqaddb_u8 NYI "); + case NEON::BI__builtin_neon_vqaddd_s64: + llvm_unreachable(" neon_vqaddd_s64 NYI "); + case NEON::BI__builtin_neon_vqaddd_u64: + llvm_unreachable(" neon_vqaddd_u64 NYI "); + case NEON::BI__builtin_neon_vqaddh_s16: + llvm_unreachable(" neon_vqaddh_s16 NYI "); + case NEON::BI__builtin_neon_vqaddh_u16: + llvm_unreachable(" neon_vqaddh_u16 NYI "); + case NEON::BI__builtin_neon_vqadds_s32: + llvm_unreachable(" neon_vqadds_s32 NYI "); + case NEON::BI__builtin_neon_vqadds_u32: + llvm_unreachable(" neon_vqadds_u32 NYI "); + case NEON::BI__builtin_neon_vqdmulhh_s16: + llvm_unreachable(" neon_vqdmulhh_s16 NYI "); + case NEON::BI__builtin_neon_vqdmulhs_s32: + llvm_unreachable(" neon_vqdmulhs_s32 NYI "); + case NEON::BI__builtin_neon_vqdmullh_s16: + llvm_unreachable(" neon_vqdmullh_s16 NYI "); + case NEON::BI__builtin_neon_vqdmulls_s32: + llvm_unreachable(" neon_vqdmulls_s32 NYI "); + case NEON::BI__builtin_neon_vqmovnd_s64: + llvm_unreachable(" neon_vqmovnd_s64 NYI "); + case NEON::BI__builtin_neon_vqmovnd_u64: + llvm_unreachable(" neon_vqmovnd_u64 NYI "); + case NEON::BI__builtin_neon_vqmovnh_s16: + llvm_unreachable(" neon_vqmovnh_s16 NYI "); + case NEON::BI__builtin_neon_vqmovnh_u16: + llvm_unreachable(" neon_vqmovnh_u16 NYI "); + case NEON::BI__builtin_neon_vqmovns_s32: + llvm_unreachable(" neon_vqmovns_s32 NYI "); + case NEON::BI__builtin_neon_vqmovns_u32: + llvm_unreachable(" neon_vqmovns_u32 NYI "); + case NEON::BI__builtin_neon_vqmovund_s64: + llvm_unreachable(" neon_vqmovund_s64 NYI "); + case NEON::BI__builtin_neon_vqmovunh_s16: + llvm_unreachable(" neon_vqmovunh_s16 NYI "); + case NEON::BI__builtin_neon_vqmovuns_s32: + llvm_unreachable(" neon_vqmovuns_s32 NYI "); + case NEON::BI__builtin_neon_vqnegb_s8: + llvm_unreachable(" neon_vqnegb_s8 NYI "); + case NEON::BI__builtin_neon_vqnegd_s64: + llvm_unreachable(" neon_vqnegd_s64 NYI "); + case NEON::BI__builtin_neon_vqnegh_s16: + llvm_unreachable(" neon_vqnegh_s16 NYI "); + case NEON::BI__builtin_neon_vqnegs_s32: + llvm_unreachable(" neon_vqnegs_s32 NYI "); + case NEON::BI__builtin_neon_vqrdmlahh_s16: + llvm_unreachable(" neon_vqrdmlahh_s16 NYI "); + case NEON::BI__builtin_neon_vqrdmlahs_s32: + llvm_unreachable(" neon_vqrdmlahs_s32 NYI "); + case NEON::BI__builtin_neon_vqrdmlshh_s16: + llvm_unreachable(" neon_vqrdmlshh_s16 NYI "); + case NEON::BI__builtin_neon_vqrdmlshs_s32: + llvm_unreachable(" neon_vqrdmlshs_s32 NYI "); + case NEON::BI__builtin_neon_vqrdmulhh_s16: + llvm_unreachable(" neon_vqrdmulhh_s16 NYI "); + case NEON::BI__builtin_neon_vqrdmulhs_s32: + llvm_unreachable(" neon_vqrdmulhs_s32 NYI "); + case NEON::BI__builtin_neon_vqrshlb_s8: + llvm_unreachable(" neon_vqrshlb_s8 NYI "); + case NEON::BI__builtin_neon_vqrshlb_u8: + llvm_unreachable(" neon_vqrshlb_u8 NYI "); + case NEON::BI__builtin_neon_vqrshld_s64: + llvm_unreachable(" neon_vqrshld_s64 NYI "); + case NEON::BI__builtin_neon_vqrshld_u64: + llvm_unreachable(" neon_vqrshld_u64 NYI "); + case NEON::BI__builtin_neon_vqrshlh_s16: + llvm_unreachable(" neon_vqrshlh_s16 NYI "); + case NEON::BI__builtin_neon_vqrshlh_u16: + llvm_unreachable(" neon_vqrshlh_u16 NYI "); + case NEON::BI__builtin_neon_vqrshls_s32: + llvm_unreachable(" neon_vqrshls_s32 NYI "); + case NEON::BI__builtin_neon_vqrshls_u32: + llvm_unreachable(" neon_vqrshls_u32 NYI "); + case NEON::BI__builtin_neon_vqrshrnd_n_s64: + llvm_unreachable(" neon_vqrshrnd_n_s64 NYI "); + case NEON::BI__builtin_neon_vqrshrnd_n_u64: + llvm_unreachable(" neon_vqrshrnd_n_u64 NYI "); + case NEON::BI__builtin_neon_vqrshrnh_n_s16: + llvm_unreachable(" neon_vqrshrnh_n_s16 NYI "); + case NEON::BI__builtin_neon_vqrshrnh_n_u16: + llvm_unreachable(" neon_vqrshrnh_n_u16 NYI "); + case NEON::BI__builtin_neon_vqrshrns_n_s32: + llvm_unreachable(" neon_vqrshrns_n_s32 NYI "); + case NEON::BI__builtin_neon_vqrshrns_n_u32: + llvm_unreachable(" neon_vqrshrns_n_u32 NYI "); + case NEON::BI__builtin_neon_vqrshrund_n_s64: + llvm_unreachable(" neon_vqrshrund_n_s64 NYI "); + case NEON::BI__builtin_neon_vqrshrunh_n_s16: + llvm_unreachable(" neon_vqrshrunh_n_s16 NYI "); + case NEON::BI__builtin_neon_vqrshruns_n_s32: + llvm_unreachable(" neon_vqrshruns_n_s32 NYI "); + case NEON::BI__builtin_neon_vqshlb_n_s8: + llvm_unreachable(" neon_vqshlb_n_s8 NYI "); + case NEON::BI__builtin_neon_vqshlb_n_u8: + llvm_unreachable(" neon_vqshlb_n_u8 NYI "); + case NEON::BI__builtin_neon_vqshlb_s8: + llvm_unreachable(" neon_vqshlb_s8 NYI "); + case NEON::BI__builtin_neon_vqshlb_u8: + llvm_unreachable(" neon_vqshlb_u8 NYI "); + case NEON::BI__builtin_neon_vqshld_s64: + llvm_unreachable(" neon_vqshld_s64 NYI "); + case NEON::BI__builtin_neon_vqshld_u64: + llvm_unreachable(" neon_vqshld_u64 NYI "); + case NEON::BI__builtin_neon_vqshlh_n_s16: + llvm_unreachable(" neon_vqshlh_n_s16 NYI "); + case NEON::BI__builtin_neon_vqshlh_n_u16: + llvm_unreachable(" neon_vqshlh_n_u16 NYI "); + case NEON::BI__builtin_neon_vqshlh_s16: + llvm_unreachable(" neon_vqshlh_s16 NYI "); + case NEON::BI__builtin_neon_vqshlh_u16: + llvm_unreachable(" neon_vqshlh_u16 NYI "); + case NEON::BI__builtin_neon_vqshls_n_s32: + llvm_unreachable(" neon_vqshls_n_s32 NYI "); + case NEON::BI__builtin_neon_vqshls_n_u32: + llvm_unreachable(" neon_vqshls_n_u32 NYI "); + case NEON::BI__builtin_neon_vqshls_s32: + llvm_unreachable(" neon_vqshls_s32 NYI "); + case NEON::BI__builtin_neon_vqshls_u32: + llvm_unreachable(" neon_vqshls_u32 NYI "); + case NEON::BI__builtin_neon_vqshlub_n_s8: + llvm_unreachable(" neon_vqshlub_n_s8 NYI "); + case NEON::BI__builtin_neon_vqshluh_n_s16: + llvm_unreachable(" neon_vqshluh_n_s16 NYI "); + case NEON::BI__builtin_neon_vqshlus_n_s32: + llvm_unreachable(" neon_vqshlus_n_s32 NYI "); + case NEON::BI__builtin_neon_vqshrnd_n_s64: + llvm_unreachable(" neon_vqshrnd_n_s64 NYI "); + case NEON::BI__builtin_neon_vqshrnd_n_u64: + llvm_unreachable(" neon_vqshrnd_n_u64 NYI "); + case NEON::BI__builtin_neon_vqshrnh_n_s16: + llvm_unreachable(" neon_vqshrnh_n_s16 NYI "); + case NEON::BI__builtin_neon_vqshrnh_n_u16: + llvm_unreachable(" neon_vqshrnh_n_u16 NYI "); + case NEON::BI__builtin_neon_vqshrns_n_s32: + llvm_unreachable(" neon_vqshrns_n_s32 NYI "); + case NEON::BI__builtin_neon_vqshrns_n_u32: + llvm_unreachable(" neon_vqshrns_n_u32 NYI "); + case NEON::BI__builtin_neon_vqshrund_n_s64: + llvm_unreachable(" neon_vqshrund_n_s64 NYI "); + case NEON::BI__builtin_neon_vqshrunh_n_s16: + llvm_unreachable(" neon_vqshrunh_n_s16 NYI "); + case NEON::BI__builtin_neon_vqshruns_n_s32: + llvm_unreachable(" neon_vqshruns_n_s32 NYI "); + case NEON::BI__builtin_neon_vqsubb_s8: + llvm_unreachable(" neon_vqsubb_s8 NYI "); + case NEON::BI__builtin_neon_vqsubb_u8: + llvm_unreachable(" neon_vqsubb_u8 NYI "); + case NEON::BI__builtin_neon_vqsubd_s64: + llvm_unreachable(" neon_vqsubd_s64 NYI "); + case NEON::BI__builtin_neon_vqsubd_u64: + llvm_unreachable(" neon_vqsubd_u64 NYI "); + case NEON::BI__builtin_neon_vqsubh_s16: + llvm_unreachable(" neon_vqsubh_s16 NYI "); + case NEON::BI__builtin_neon_vqsubh_u16: + llvm_unreachable(" neon_vqsubh_u16 NYI "); + case NEON::BI__builtin_neon_vqsubs_s32: + llvm_unreachable(" neon_vqsubs_s32 NYI "); + case NEON::BI__builtin_neon_vqsubs_u32: + llvm_unreachable(" neon_vqsubs_u32 NYI "); + case NEON::BI__builtin_neon_vrecped_f64: + llvm_unreachable(" neon_vrecped_f64 NYI "); + case NEON::BI__builtin_neon_vrecpes_f32: + llvm_unreachable(" neon_vrecpes_f32 NYI "); + case NEON::BI__builtin_neon_vrecpxd_f64: + llvm_unreachable(" neon_vrecpxd_f64 NYI "); + case NEON::BI__builtin_neon_vrecpxs_f32: + llvm_unreachable(" neon_vrecpxs_f32 NYI "); + case NEON::BI__builtin_neon_vrshld_s64: + llvm_unreachable(" neon_vrshld_s64 NYI "); + case NEON::BI__builtin_neon_vrshld_u64: + llvm_unreachable(" neon_vrshld_u64 NYI "); + case NEON::BI__builtin_neon_vrsqrted_f64: + llvm_unreachable(" neon_vrsqrted_f64 NYI "); + case NEON::BI__builtin_neon_vrsqrtes_f32: + llvm_unreachable(" neon_vrsqrtes_f32 NYI "); + case NEON::BI__builtin_neon_vrsqrtsd_f64: + llvm_unreachable(" neon_vrsqrtsd_f64 NYI "); + case NEON::BI__builtin_neon_vrsqrtss_f32: + llvm_unreachable(" neon_vrsqrtss_f32 NYI "); + case NEON::BI__builtin_neon_vsha1cq_u32: + llvm_unreachable(" neon_vsha1cq_u32 NYI "); + case NEON::BI__builtin_neon_vsha1h_u32: + llvm_unreachable(" neon_vsha1h_u32 NYI "); + case NEON::BI__builtin_neon_vsha1mq_u32: + llvm_unreachable(" neon_vsha1mq_u32 NYI "); + case NEON::BI__builtin_neon_vsha1pq_u32: + llvm_unreachable(" neon_vsha1pq_u32 NYI "); + case NEON::BI__builtin_neon_vshld_s64: + llvm_unreachable(" neon_vshld_s64 NYI "); + case NEON::BI__builtin_neon_vshld_u64: + llvm_unreachable(" neon_vshld_u64 NYI "); + case NEON::BI__builtin_neon_vslid_n_s64: + llvm_unreachable(" neon_vslid_n_s64 NYI "); + case NEON::BI__builtin_neon_vslid_n_u64: + llvm_unreachable(" neon_vslid_n_u64 NYI "); + case NEON::BI__builtin_neon_vsqaddb_u8: + llvm_unreachable(" neon_vsqaddb_u8 NYI "); + case NEON::BI__builtin_neon_vsqaddd_u64: + llvm_unreachable(" neon_vsqaddd_u64 NYI "); + case NEON::BI__builtin_neon_vsqaddh_u16: + llvm_unreachable(" neon_vsqaddh_u16 NYI "); + case NEON::BI__builtin_neon_vsqadds_u32: + llvm_unreachable(" neon_vsqadds_u32 NYI "); + case NEON::BI__builtin_neon_vsrid_n_s64: + llvm_unreachable(" neon_vsrid_n_s64 NYI "); + case NEON::BI__builtin_neon_vsrid_n_u64: + llvm_unreachable(" neon_vsrid_n_u64 NYI "); + case NEON::BI__builtin_neon_vuqaddb_s8: + llvm_unreachable(" neon_vuqaddb_s8 NYI "); + case NEON::BI__builtin_neon_vuqaddd_s64: + llvm_unreachable(" neon_vuqaddd_s64 NYI "); + case NEON::BI__builtin_neon_vuqaddh_s16: + llvm_unreachable(" neon_vuqaddh_s16 NYI "); + case NEON::BI__builtin_neon_vuqadds_s32: + llvm_unreachable(" neon_vuqadds_s32 NYI "); + // FP16 scalar intrinisics go here. + case NEON::BI__builtin_neon_vabdh_f16: + llvm_unreachable(" neon_vabdh_f16 NYI "); + case NEON::BI__builtin_neon_vcvtah_s32_f16: + llvm_unreachable(" neon_vcvtah_s32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtah_s64_f16: + llvm_unreachable(" neon_vcvtah_s64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtah_u32_f16: + llvm_unreachable(" neon_vcvtah_u32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtah_u64_f16: + llvm_unreachable(" neon_vcvtah_u64_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_n_f16_s32: + llvm_unreachable(" neon_vcvth_n_f16_s32 NYI "); + case NEON::BI__builtin_neon_vcvth_n_f16_s64: + llvm_unreachable(" neon_vcvth_n_f16_s64 NYI "); + case NEON::BI__builtin_neon_vcvth_n_f16_u32: + llvm_unreachable(" neon_vcvth_n_f16_u32 NYI "); + case NEON::BI__builtin_neon_vcvth_n_f16_u64: + llvm_unreachable(" neon_vcvth_n_f16_u64 NYI "); + case NEON::BI__builtin_neon_vcvth_n_s32_f16: + llvm_unreachable(" neon_vcvth_n_s32_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_n_s64_f16: + llvm_unreachable(" neon_vcvth_n_s64_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_n_u32_f16: + llvm_unreachable(" neon_vcvth_n_u32_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_n_u64_f16: + llvm_unreachable(" neon_vcvth_n_u64_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_s32_f16: + llvm_unreachable(" neon_vcvth_s32_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_s64_f16: + llvm_unreachable(" neon_vcvth_s64_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_u32_f16: + llvm_unreachable(" neon_vcvth_u32_f16 NYI "); + case NEON::BI__builtin_neon_vcvth_u64_f16: + llvm_unreachable(" neon_vcvth_u64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtmh_s32_f16: + llvm_unreachable(" neon_vcvtmh_s32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtmh_s64_f16: + llvm_unreachable(" neon_vcvtmh_s64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtmh_u32_f16: + llvm_unreachable(" neon_vcvtmh_u32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtmh_u64_f16: + llvm_unreachable(" neon_vcvtmh_u64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtnh_s32_f16: + llvm_unreachable(" neon_vcvtnh_s32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtnh_s64_f16: + llvm_unreachable(" neon_vcvtnh_s64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtnh_u32_f16: + llvm_unreachable(" neon_vcvtnh_u32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtnh_u64_f16: + llvm_unreachable(" neon_vcvtnh_u64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtph_s32_f16: + llvm_unreachable(" neon_vcvtph_s32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtph_s64_f16: + llvm_unreachable(" neon_vcvtph_s64_f16 NYI "); + case NEON::BI__builtin_neon_vcvtph_u32_f16: + llvm_unreachable(" neon_vcvtph_u32_f16 NYI "); + case NEON::BI__builtin_neon_vcvtph_u64_f16: + llvm_unreachable(" neon_vcvtph_u64_f16 NYI "); + case NEON::BI__builtin_neon_vmulxh_f16: + llvm_unreachable(" neon_vmulxh_f16 NYI "); + case NEON::BI__builtin_neon_vrecpeh_f16: + llvm_unreachable(" neon_vrecpeh_f16 NYI "); + case NEON::BI__builtin_neon_vrecpxh_f16: + llvm_unreachable(" neon_vrecpxh_f16 NYI "); + case NEON::BI__builtin_neon_vrsqrteh_f16: + llvm_unreachable(" neon_vrsqrteh_f16 NYI "); + case NEON::BI__builtin_neon_vrsqrtsh_f16: + llvm_unreachable(" neon_vrsqrtsh_f16 NYI "); + } + return nullptr; +} + mlir::Value CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, @@ -2957,12 +3440,16 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E, Ops.push_back(emitScalarOrConstFoldImmArg(ICEArguments, i, E)); } - auto SISDMap = ArrayRef(AArch64SISDIntrinsicMap); - const ARMVectorIntrinsicInfo *Builtin = findARMVectorIntrinsicInMap( - SISDMap, BuiltinID, AArch64SISDIntrinsicsProvenSorted); + auto theSISDMap = ArrayRef(AArch64SISDIntrinsicMap); + const ARMVectorIntrinsicInfo *builtinInfo = findARMVectorIntrinsicInMap( + theSISDMap, BuiltinID, AArch64SISDIntrinsicsProvenSorted); - if (Builtin) { - llvm_unreachable("Builtin from findARMVectorIntrinsicInMap NYI"); + if (builtinInfo) { + Ops.push_back(emitScalarExpr(E->getArg(E->getNumArgs() - 1))); + mlir::Value result = + emitCommonNeonSISDBuiltinExpr(*this, *builtinInfo, Ops, E); + assert(result && "SISD intrinsic should have been handled"); + return result; } const Expr *Arg = E->getArg(E->getNumArgs() - 1); @@ -3304,12 +3791,13 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E, // Not all intrinsics handled by the common case work for AArch64 yet, so only // defer to common code if it's been added to our special map. - Builtin = findARMVectorIntrinsicInMap(AArch64SIMDIntrinsicMap, BuiltinID, - AArch64SIMDIntrinsicsProvenSorted); - if (Builtin) + builtinInfo = findARMVectorIntrinsicInMap(AArch64SIMDIntrinsicMap, BuiltinID, + AArch64SIMDIntrinsicsProvenSorted); + if (builtinInfo) return emitCommonNeonBuiltinExpr( - Builtin->BuiltinID, Builtin->LLVMIntrinsic, Builtin->AltLLVMIntrinsic, - Builtin->NameHint, Builtin->TypeModifier, E, Ops, + builtinInfo->BuiltinID, builtinInfo->LLVMIntrinsic, + builtinInfo->AltLLVMIntrinsic, builtinInfo->NameHint, + builtinInfo->TypeModifier, E, Ops, /*never use addresses*/ Address::invalid(), Address::invalid(), Arch); if (mlir::Value V = emitAArch64TblBuiltinExpr(*this, BuiltinID, E, Ops, Arch))