This is an archive of the discontinued LLVM Phabricator instance.

[Analysis][LoongArch] Add sign extension for i32 parameters and returns
ClosedPublic

Authored by Ami-zhang on May 31 2023, 3:05 AM.

Details

Summary

In LoongArch ABI spec, we can see that in the LP64D ABI, unsigned 32-bit
types, such as unsigned int, are stored in general-purpose registers as
proper sign extensions of their 32-bit values.

Reference:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_abi_lp64d

Diff Detail

Event Timeline

Ami-zhang created this revision.May 31 2023, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 3:05 AM
Ami-zhang requested review of this revision.May 31 2023, 3:05 AM
xen0n added inline comments.May 31 2023, 3:28 AM
llvm/include/llvm/Analysis/TargetLibraryInfo.h
414–415

The comment should be tweaked accordingly too.

Ami-zhang added inline comments.May 31 2023, 3:41 AM
llvm/include/llvm/Analysis/TargetLibraryInfo.h
414–415

Done.
Thanks for your reminder.

Ami-zhang updated this revision to Diff 526987.May 31 2023, 3:42 AM

Modify comments

SixWeining added inline comments.May 31 2023, 5:03 PM
llvm/test/Instrumentation/AddressSanitizer/experiment.ll
123

Better to sort alphabetically.

SixWeining added inline comments.May 31 2023, 5:06 PM
llvm/include/llvm/Analysis/TargetLibraryInfo.h
415–417

Better to sort alphabetically.

Ami-zhang added inline comments.May 31 2023, 6:41 PM
llvm/include/llvm/Analysis/TargetLibraryInfo.h
415–417

Ok.

Ami-zhang updated this revision to Diff 527258.May 31 2023, 6:45 PM

slightly adjusted the order

SixWeining accepted this revision.May 31 2023, 6:48 PM
SixWeining retitled this revision from [LoongArch] Add sign extension for i32 parameters and returns. to [Analysis][LoongArch] Add sign extension for i32 parameters and returns..
SixWeining retitled this revision from [Analysis][LoongArch] Add sign extension for i32 parameters and returns. to [Analysis][LoongArch] Add sign extension for i32 parameters and returns.
This revision is now accepted and ready to land.May 31 2023, 6:49 PM
xen0n accepted this revision.May 31 2023, 7:55 PM

Thanks!