[PATCH] D59884: [mips] Fix lowering a signed immediate for *.d MSA instructions
Simon Atanasyan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 27 09:03:28 PDT 2019
atanasyan created this revision.
atanasyan added a reviewer: Petar.Avramovic.
Herald added subscribers: jrtc27, hiraditya, arichardson, sdardis.
Herald added a project: LLVM.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D59884
Files:
llvm/lib/Target/Mips/MipsSEISelLowering.cpp
llvm/test/CodeGen/Mips/msa/i10.ll
llvm/test/CodeGen/Mips/msa/i5-c.ll
llvm/test/CodeGen/Mips/msa/i5-m.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59884.192452.patch
Type: text/x-patch
Size: 29565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190327/de574da6/attachment.bin>
More information about the llvm-commits
mailing list