This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix __builtin_ppc_load2r to return short instead of int.
ClosedPublic

Authored by stefanp on Sep 29 2021, 1:20 PM.

Details

Summary

This patch fixes the return value of the builtin __builtin_ppc_load2r to
correctly return short instead of int.

Event Timeline

stefanp created this revision.Sep 29 2021, 1:20 PM
stefanp requested review of this revision.Sep 29 2021, 1:20 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 29 2021, 1:20 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
stefanp added a reviewer: Restricted Project.Sep 30 2021, 6:59 AM
nemanjai accepted this revision.Sep 30 2021, 6:23 PM

LGTM as long as the sign-extending test is added.

llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-load-store-reversed.ll
52

Please add an equivalent test with signext to ensure there is a extsh prior to the return.

This revision is now accepted and ready to land.Sep 30 2021, 6:23 PM
stefanp updated this revision to Diff 376857.Oct 4 2021, 4:14 AM

Rebased and added signext test case.