[clang] [llvm] [Clang][BPF] Allow sign extension for call parameters with int types (PR #84874)
Pu Lehui via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 14 18:46:32 PDT 2024
pulehui wrote:
> The `r1` would be zero extended, while to be ABI conformant it has to be sign extended, as for RV64 the 31-st bit should be the same as upper 32 bits. The fact that decision to zero or sign extend the argument depends on the architecture means that this extension has to be done at JIT time (meaning that BTF is mandatory) or be a part of kfunc.
Thanks for the clarification. riscv64 will do sign-extension both for int and uint. For uint, zero-extension is required, but after my investigation, it will be handled in the callee.
https://github.com/llvm/llvm-project/pull/84874
More information about the cfe-commits
mailing list