HomePhabricator

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

Description

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

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.

Differential Revision: http://reviews.llvm.org/D59884