[mips] Fix instruction selection pattern for sint_to_fp node to avoid emitting an
authorAkira Hatanaka <ahatanaka@mips.com>
Thu, 16 May 2013 19:48:37 +0000 (19:48 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Thu, 16 May 2013 19:48:37 +0000 (19:48 +0000)
commitec4db6ab5f64318b1aa2351f7e710569869193e9
treebe4c14d2e226a3fb22433a0b012f0f38d25f804b
parent50f02f9d21f3d3558249910b4e05abb49e8c6f50
[mips] Fix instruction selection pattern for sint_to_fp node to avoid emitting an
invalid instruction sequence.

Rather than emitting an int-to-FP move instruction and an int-to-FP conversion
instruction during instruction selection, we emit a pseudo instruction which gets
expanded post-RA. Without this change, register allocation can possibly insert a
floating point register move instruction between the two instructions, which is not
valid according to the ISA manual.

mtc1 $f4, $4         # int-to-fp move instruction.
mov.s $f2, $f4       # move contents of $f4 to $f2.
cvt.s.w $f0, $f2     # int-to-fp conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182042 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsInstrFPU.td
lib/Target/Mips/MipsSEInstrInfo.cpp
lib/Target/Mips/MipsSEInstrInfo.h