This is an archive of the discontinued LLVM Phabricator instance.

[mips] Promote all integral/enumeration types to the GPR width
ClosedPublic

Authored by dsanders on Oct 24 2014, 3:13 AM.

Details

Summary

Ensure all integral/enumeration types are appropriately annotated with
signext/zeroext. In particular, i32 now has these attributes when using the
N32/N64 ABI. This paves the way for accurately representing the way the
N32/N64 ABI's promotes integer arguments to i64.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 15389.Oct 24 2014, 3:13 AM
dsanders retitled this revision from to [mips] Promote all integral/enumeration types to the GPR width.
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: atanasyan.
dsanders added subscribers: theraven, Unknown Object (MLST).
atanasyan edited edge metadata.Oct 24 2014, 3:52 AM

Just curious, does it have a sense to zero- or sign- extend 32-bit types in case of O32 ABI? For example, PowerPC does the similar things in case of 64-bit ABI only PPC64_SVR4_ABIInfo::isPromotableTypeForABI.

In D5961#4, @atanasyan wrote:

Just curious, does it have a sense to zero- or sign- extend 32-bit types in case of O32 ABI? For example, PowerPC does the similar things in case of 64-bit ABI only PPC64_SVR4_ABIInfo::isPromotableTypeForABI.

I couldn't find a functional difference between 'i32' and 'i32 signext' on O32 (and similarly between 'i32' and 'i32 zeroext'). This makes sense because sign-extending i32 to i32 is a noop. I couldn't think of any benefits to using 'i32' for O32 and 'i32 signext' for N32/N64 so I decided to simplify the code.

atanasyan accepted this revision.Oct 24 2014, 5:34 AM
atanasyan edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 24 2014, 5:34 AM
dsanders closed this revision.Oct 24 2014, 7:53 AM