diff --git a/clang/include/clang/Basic/BuiltinsAssigner.def b/clang/include/clang/Basic/BuiltinsAssigner.def index 480f937a751b..88be6d1b988d 100644 --- a/clang/include/clang/Basic/BuiltinsAssigner.def +++ b/clang/include/clang/Basic/BuiltinsAssigner.def @@ -50,5 +50,8 @@ BUILTIN(__builtin_assigner_vesta_curve_init, "e2g7g7", "n") BUILTIN(__builtin_assigner_bls12381_curve_init, "e3g3g3", "n") BUILTIN(__builtin_assigner_curve25519_curve_init, "e4g5g5", "n") +BUILTIN(__builtin_assigner_bit_decomposition64, "E64g1g1", "n") +BUILTIN(__builtin_assigner_bit_composition128, "g1E64g1E64g1", "n") + #undef BUILTIN #undef TARGET_BUILTIN diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 1c3b3fe3a782..5de8c3ddb042 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -19908,6 +19908,21 @@ Value *CodeGenFunction::EmitAssignerBuiltinExpr(unsigned int BuiltinID, OverloadTypes = {Curve, BaseField}; break; } + case assigner::BI__builtin_assigner_bit_composition128: { + ID = Intrinsic::assigner_bit_composition128; + auto ElemTy = llvm::GaloisFieldType::get(context, + llvm::GALOIS_FIELD_PALLAS_BASE); + + OverloadTypes = {ElemTy, llvm::FixedVectorType::get(ElemTy, 64)}; + break; + } + case assigner::BI__builtin_assigner_bit_decomposition64: { + ID = Intrinsic::assigner_bit_decomposition64; + auto ElemTy = llvm::GaloisFieldType::get(context, + llvm::GALOIS_FIELD_PALLAS_BASE); + OverloadTypes = {llvm::FixedVectorType::get(ElemTy, 64), ElemTy}; + break; + } } assert(ID != Intrinsic::not_intrinsic); diff --git a/llvm/include/llvm/IR/IntrinsicsAssigner.td b/llvm/include/llvm/IR/IntrinsicsAssigner.td index cc6a7943b5fd..cbaf40f4ff88 100644 --- a/llvm/include/llvm/IR/IntrinsicsAssigner.td +++ b/llvm/include/llvm/IR/IntrinsicsAssigner.td @@ -21,3 +21,6 @@ def int_assigner_zkml_pooling: Intrinsic<[llvm_ptrptr_ty], [llvm_ptrptr_t def int_assigner_zkml_ReLU: Intrinsic<[llvm_float_ty], [llvm_float_ty]>; def int_assigner_zkml_batch_norm: Intrinsic<[llvm_ptrptr_ty], [llvm_ptrptr_ty]>; def int_assigner_curve_init: Intrinsic<[llvm_any_ty], [llvm_any_ty, LLVMMatchType<1>]>; + +def int_assigner_bit_decomposition64: Intrinsic<[llvm_anyvector_ty], [llvm_any_ty]>; +def int_assigner_bit_composition128: Intrinsic<[llvm_any_ty], [llvm_anyvector_ty, LLVMMatchType<1>]>;