This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fix lowering a signed immediate for *.d MSA instructions
ClosedPublic

Authored by atanasyan on Mar 27 2019, 9:02 AM.

Details

Summary

The lowerMSASplatImm function zero-extends i32 immediates while building constant. If target type is i64, negative immediate loses the sign. As a result, for example __builtin_msa_ldi_d(-1) lowered to series of instruction loads incorrect value 0xffffffff to the $w0 register instead of single ldi.d $w0, -1 instruction.

The fix zero-extends unsigned immediates and signed-extend signed immediates.

Diff Detail

Event Timeline

atanasyan created this revision.Mar 27 2019, 9:02 AM
This revision is now accepted and ready to land.Mar 27 2019, 10:05 AM
This revision was automatically updated to reflect the committed changes.