Add test cases for Mips mthc1/mfhc1 instructions. Add check for odd value of register...
authorVladimir Medic <Vladimir.Medic@imgtec.com>
Tue, 10 Sep 2013 09:50:01 +0000 (09:50 +0000)
committerVladimir Medic <Vladimir.Medic@imgtec.com>
Tue, 10 Sep 2013 09:50:01 +0000 (09:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190397 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
test/MC/Mips/mips-fpu-instructions.s

index 2aa90c7760121a77bc3d711d003bdf21c262c0e7..e547de5121a13c5694baab754eeb5b275359adc0 100644 (file)
@@ -1404,6 +1404,10 @@ MipsAsmParser::parseRegs(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
       RegNum = matchFPURegisterName(RegName);
       if (RegKind == MipsOperand::Kind_AFGR64Regs)
         RegNum /= 2;
+      else if (RegKind == MipsOperand::Kind_FGRH32Regs
+               && !isFP64())
+        if (RegNum != -1 && RegNum %2 != 0)
+          Warning(S, "Float register should be even.");
       break;
     case MipsOperand::Kind_FCCRegs:
       RegNum = matchFCCRegisterName(RegName);
index db3c5261a8e9929fe76b553d551fa55db9e4c076..eb1f6be88dd0bfb743ba77595bd6a1e18592c902 100644 (file)
 # CHECK:  suxc1   $f4, $24($5)            # encoding: [0x0d,0x20,0xb8,0x4c]
 # CHECK:  lwxc1   $f20, $12($14)          # encoding: [0x00,0x05,0xcc,0x4d]
 # CHECK:  swxc1   $f26, $18($22)          # encoding: [0x08,0xd0,0xd2,0x4e]
+# CHECK:  mfhc1   $17, $f4                # encoding: [0x00,0x20,0x71,0x44]
+# CHECK:  mthc1   $17, $f6                # encoding: [0x00,0x30,0xf1,0x44]
 
    cfc1    $a2,$0
    ctc1    $10,$31
    suxc1   $f4, $t8($a1)
    lwxc1   $f20, $12($14)
    swxc1   $f26, $s2($s6)
+   mfhc1   $17, $f4
+   mthc1   $17, $f6