This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Use sign extend for i32 arguments and returns in makeLibCall on RV64.
ClosedPublic

Authored by craig.topper on Jan 22 2021, 10:41 PM.

Details

Summary

As far as I know 32 bits arguments and returns on RV64 are always
sign extended to i64. So I think we should be taking this into
account around libcalls.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 22 2021, 10:41 PM
craig.topper requested review of this revision.Jan 22 2021, 10:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 10:41 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
luismarques accepted this revision.Jan 25 2021, 3:01 AM

Nice catch, LGTM.
I guess part of the reason why this wasn't noticed before is that many libcalls (e.g. __floatunsisf) produce the same value even if you zero-extend the argument.

This revision is now accepted and ready to land.Jan 25 2021, 3:01 AM
This revision was landed with ongoing or failed builds.Jan 25 2021, 9:34 AM
This revision was automatically updated to reflect the committed changes.