Craig Topper via llvm-dev
2021-Oct-19 17:21 UTC
[llvm-dev] [clang] sign extension of parameters
I believe it is done by calling ABIArgInfo::getExtend in the ABI handling in clang/lib/CodeGen/TargetInfo.cpp. This will add a signext or zeroext attribute to the argument in IR. The backend can use this to insert the appropriate extend. ~Craig On Tue, Oct 19, 2021 at 10:14 AM Bagel via llvm-dev <llvm-dev at lists.llvm.org> wrote:> My target is 64-bit only, it has no 32-bit operations other than LD/ST. > Parameters need to be sign or zero extended. Where in clang does one > indicate > that for a target? > > Thanks, > Brian > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211019/8b37a441/attachment.html>
Oh my! I had thought that all the target-dependent code was under lib/Basic/Targets/. Looks like I have more work to do. Is there other target-dependent code hiding elsewhere in the tree? Thanks for the prompt reply, Brian On 10/19/21 12:21 PM, Craig Topper wrote:> I believe it is done by calling ABIArgInfo::getExtend in the ABI handling in > clang/lib/CodeGen/TargetInfo.cpp. This will add a signext or zeroext attribute > to the argument in IR. The backend can use this to insert the appropriate extend. > > ~Craig > > On Tue, Oct 19, 2021 at 10:14 AM Bagel via llvm-dev <llvm-dev at lists.llvm.org > <mailto:llvm-dev at lists.llvm.org>> wrote: > > My target is 64-bit only, it has no 32-bit operations other than LD/ST. > Parameters need to be sign or zero extended. Where in clang does one indicate > that for a target? > > Thanks, > Brian > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> >