diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -20222,45 +20222,6 @@ // Zk builtins - // Zknd - case RISCV::BI__builtin_riscv_aes32dsi_32: - ID = Intrinsic::riscv_aes32dsi; - break; - case RISCV::BI__builtin_riscv_aes32dsmi_32: - ID = Intrinsic::riscv_aes32dsmi; - break; - case RISCV::BI__builtin_riscv_aes64ds_64: - ID = Intrinsic::riscv_aes64ds; - break; - case RISCV::BI__builtin_riscv_aes64dsm_64: - ID = Intrinsic::riscv_aes64dsm; - break; - case RISCV::BI__builtin_riscv_aes64im_64: - ID = Intrinsic::riscv_aes64im; - break; - - // Zkne - case RISCV::BI__builtin_riscv_aes32esi_32: - ID = Intrinsic::riscv_aes32esi; - break; - case RISCV::BI__builtin_riscv_aes32esmi_32: - ID = Intrinsic::riscv_aes32esmi; - break; - case RISCV::BI__builtin_riscv_aes64es_64: - ID = Intrinsic::riscv_aes64es; - break; - case RISCV::BI__builtin_riscv_aes64esm_64: - ID = Intrinsic::riscv_aes64esm; - break; - - // Zknd & Zkne - case RISCV::BI__builtin_riscv_aes64ks1i_64: - ID = Intrinsic::riscv_aes64ks1i; - break; - case RISCV::BI__builtin_riscv_aes64ks2_64: - ID = Intrinsic::riscv_aes64ks2; - break; - // Zknh case RISCV::BI__builtin_riscv_sha256sig0: ID = Intrinsic::riscv_sha256sig0; @@ -20278,36 +20239,6 @@ ID = Intrinsic::riscv_sha256sum1; IntrinsicTypes = {ResultType}; break; - case RISCV::BI__builtin_riscv_sha512sig0_64: - ID = Intrinsic::riscv_sha512sig0; - break; - case RISCV::BI__builtin_riscv_sha512sig0h_32: - ID = Intrinsic::riscv_sha512sig0h; - break; - case RISCV::BI__builtin_riscv_sha512sig0l_32: - ID = Intrinsic::riscv_sha512sig0l; - break; - case RISCV::BI__builtin_riscv_sha512sig1_64: - ID = Intrinsic::riscv_sha512sig1; - break; - case RISCV::BI__builtin_riscv_sha512sig1h_32: - ID = Intrinsic::riscv_sha512sig1h; - break; - case RISCV::BI__builtin_riscv_sha512sig1l_32: - ID = Intrinsic::riscv_sha512sig1l; - break; - case RISCV::BI__builtin_riscv_sha512sum0_64: - ID = Intrinsic::riscv_sha512sum0; - break; - case RISCV::BI__builtin_riscv_sha512sum0r_32: - ID = Intrinsic::riscv_sha512sum0r; - break; - case RISCV::BI__builtin_riscv_sha512sum1_64: - ID = Intrinsic::riscv_sha512sum1; - break; - case RISCV::BI__builtin_riscv_sha512sum1r_32: - ID = Intrinsic::riscv_sha512sum1r; - break; // Zksed case RISCV::BI__builtin_riscv_sm4ks: diff --git a/llvm/include/llvm/IR/IntrinsicsRISCV.td b/llvm/include/llvm/IR/IntrinsicsRISCV.td --- a/llvm/include/llvm/IR/IntrinsicsRISCV.td +++ b/llvm/include/llvm/IR/IntrinsicsRISCV.td @@ -1613,27 +1613,38 @@ [IntrNoMem, IntrSpeculatable, ImmArg>]>; // Zknd -def int_riscv_aes32dsi : ScalarCryptoByteSelect32; -def int_riscv_aes32dsmi : ScalarCryptoByteSelect32; +def int_riscv_aes32dsi : ScalarCryptoByteSelect32, + ClangBuiltin<"__builtin_riscv_aes32dsi_32">; +def int_riscv_aes32dsmi : ScalarCryptoByteSelect32, + ClangBuiltin<"__builtin_riscv_aes32dsmi_32">; -def int_riscv_aes64ds : ScalarCryptoGprGprIntrinsic64; -def int_riscv_aes64dsm : ScalarCryptoGprGprIntrinsic64; +def int_riscv_aes64ds : ScalarCryptoGprGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_aes64ds_64">; +def int_riscv_aes64dsm : ScalarCryptoGprGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_aes64dsm_64">; -def int_riscv_aes64im : ScalarCryptoGprIntrinsic64; +def int_riscv_aes64im : ScalarCryptoGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_aes64im_64">; // Zkne -def int_riscv_aes32esi : ScalarCryptoByteSelect32; -def int_riscv_aes32esmi : ScalarCryptoByteSelect32; +def int_riscv_aes32esi : ScalarCryptoByteSelect32, + ClangBuiltin<"__builtin_riscv_aes32esi_32">; +def int_riscv_aes32esmi : ScalarCryptoByteSelect32, + ClangBuiltin<"__builtin_riscv_aes32esmi_32">; -def int_riscv_aes64es : ScalarCryptoGprGprIntrinsic64; -def int_riscv_aes64esm : ScalarCryptoGprGprIntrinsic64; +def int_riscv_aes64es : ScalarCryptoGprGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_aes64es_64">; +def int_riscv_aes64esm : ScalarCryptoGprGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_aes64esm_64">; // Zknd & Zkne -def int_riscv_aes64ks2 : ScalarCryptoGprGprIntrinsic64; +def int_riscv_aes64ks2 : ScalarCryptoGprGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_aes64ks2_64">; def int_riscv_aes64ks1i : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty], [IntrNoMem, IntrSpeculatable, - ImmArg>]>; + ImmArg>]>, + ClangBuiltin<"__builtin_riscv_aes64ks1i_64">; // Zknh def int_riscv_sha256sig0 : ScalarCryptoGprIntrinsicAny; @@ -1641,17 +1652,27 @@ def int_riscv_sha256sum0 : ScalarCryptoGprIntrinsicAny; def int_riscv_sha256sum1 : ScalarCryptoGprIntrinsicAny; -def int_riscv_sha512sig0l : ScalarCryptoGprGprIntrinsic32; -def int_riscv_sha512sig0h : ScalarCryptoGprGprIntrinsic32; -def int_riscv_sha512sig1l : ScalarCryptoGprGprIntrinsic32; -def int_riscv_sha512sig1h : ScalarCryptoGprGprIntrinsic32; -def int_riscv_sha512sum0r : ScalarCryptoGprGprIntrinsic32; -def int_riscv_sha512sum1r : ScalarCryptoGprGprIntrinsic32; - -def int_riscv_sha512sig0 : ScalarCryptoGprIntrinsic64; -def int_riscv_sha512sig1 : ScalarCryptoGprIntrinsic64; -def int_riscv_sha512sum0 : ScalarCryptoGprIntrinsic64; -def int_riscv_sha512sum1 : ScalarCryptoGprIntrinsic64; +def int_riscv_sha512sig0l : ScalarCryptoGprGprIntrinsic32, + ClangBuiltin<"__builtin_riscv_sha512sig0l_32">; +def int_riscv_sha512sig0h : ScalarCryptoGprGprIntrinsic32, + ClangBuiltin<"__builtin_riscv_sha512sig0h_32">; +def int_riscv_sha512sig1l : ScalarCryptoGprGprIntrinsic32, + ClangBuiltin<"__builtin_riscv_sha512sig1l_32">; +def int_riscv_sha512sig1h : ScalarCryptoGprGprIntrinsic32, + ClangBuiltin<"__builtin_riscv_sha512sig1h_32">; +def int_riscv_sha512sum0r : ScalarCryptoGprGprIntrinsic32, + ClangBuiltin<"__builtin_riscv_sha512sum0r_32">; +def int_riscv_sha512sum1r : ScalarCryptoGprGprIntrinsic32, + ClangBuiltin<"__builtin_riscv_sha512sum1r_32">; + +def int_riscv_sha512sig0 : ScalarCryptoGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_sha512sig0_64">; +def int_riscv_sha512sig1 : ScalarCryptoGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_sha512sig1_64">; +def int_riscv_sha512sum0 : ScalarCryptoGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_sha512sum0_64">; +def int_riscv_sha512sum1 : ScalarCryptoGprIntrinsic64, + ClangBuiltin<"__builtin_riscv_sha512sum1_64">; // Zksed def int_riscv_sm4ks : ScalarCryptoByteSelectAny;