[clang] [aarch64] Add more MSVC intrinsics (PR #194632)
Adhemerval Zanella via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 29 05:05:04 PDT 2026
================
@@ -5244,6 +5293,26 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
return Builder.CreateCall(F, {Address, RW, Locality, Data});
}
+ if (BuiltinID == AArch64::BI__prefetch2) {
+ Value *Address = EmitScalarExpr(E->getArg(0));
+ llvm::APSInt PrfOp = E->getArg(1)->EvaluateKnownConstInt(CGM.getContext());
+ // Decode 5-bit PRFM encoding: bits[4:3]=type, bits[2:1]=target,
+ // bit[0]=policy
+ // type: PLD=0(load), PLI=1(instr), PST=2(store)
+ // target: L1=0, L2=1, L3=2
+ // policy: KEEP=0, STRM=1
+ uint64_t Op = PrfOp.getZExtValue();
+ uint64_t Type = (Op >> 3) & 0x3;
+ uint64_t Target = (Op >> 1) & 0x3;
+ uint64_t Policy = Op & 0x1;
+ Value *RW = ConstantInt::get(Int32Ty, Type == 2 ? 1 : 0);
----------------
zatrazz wrote:
Ack.
https://github.com/llvm/llvm-project/pull/194632
More information about the cfe-commits
mailing list