This is an archive of the discontinued LLVM Phabricator instance.

[MSP430] Declare comparison LibCalls as returning i16 instead of i32
ClosedPublic

Authored by atrosinenko on Jun 26 2020, 2:36 AM.

Details

Summary

For TI's distribution of msp430-gcc

msp430-elf-gcc -S -o- -Os -x c - <<< "int f(float a, float b) { return a != b; }"

does not mention R13 at all. __libgcc_cmp_return__ machine mode is 2 byte on MSP430, as well.

Diff Detail

Event Timeline

atrosinenko created this revision.Jun 26 2020, 2:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2020, 2:36 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
asl accepted this revision.Jun 26 2020, 5:35 AM
This revision is now accepted and ready to land.Jun 26 2020, 5:35 AM
atrosinenko edited the summary of this revision. (Show Details)Jun 29 2020, 11:47 PM

Just a note: using __mspabi_cmpf as a generic LibCall seems quite incorrect because __mspabi_cmpf does not accept NaNs according to MSP430 EABI. msp430-elf-gcc v9.2.0 just uses __nesf2 in the example above. I plan changing this later when doing more adjustments for libgcc/clang_rt.

This revision was automatically updated to reflect the committed changes.