diff options
author | Simon Dardis <simon.dardis@imgtec.com> | 2017-10-16 14:20:22 +0000 |
---|---|---|
committer | Simon Dardis <simon.dardis@imgtec.com> | 2017-10-16 14:20:22 +0000 |
commit | 05cc2c7d76c3ffa504a6096aeedf0a1996d3d4f1 (patch) | |
tree | bd08f97a5490d1933d2d949eaef1709474bdbb2f /lib/Target/Mips | |
parent | b5d9fa1867a288fca27563c4a07c900e7db6fac6 (diff) | |
download | llvm-05cc2c7d76c3ffa504a6096aeedf0a1996d3d4f1.tar.gz |
[mips][micromips] Fix (dis)assembly of bc1(t|f)
Previously these instructions were marked codegen only and had
an under-specified instruction description that did not record the
fcc register.
Reviewers: atanasyan, abeserminji
Differential Revision: https://reviews.llvm.org/D38847
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r-- | lib/Target/Mips/MicroMipsInstrFPU.td | 14 | ||||
-rw-r--r-- | lib/Target/Mips/MicroMipsInstrFormats.td | 3 | ||||
-rw-r--r-- | lib/Target/Mips/MipsInstrFPU.td | 18 |
3 files changed, 21 insertions, 14 deletions
diff --git a/lib/Target/Mips/MicroMipsInstrFPU.td b/lib/Target/Mips/MicroMipsInstrFPU.td index 41280b3f7f80..ee40a79ccfdb 100644 --- a/lib/Target/Mips/MicroMipsInstrFPU.td +++ b/lib/Target/Mips/MicroMipsInstrFPU.td @@ -58,10 +58,16 @@ def FCMP_D32_MM : MMRel, CEQS_FT<"d", AFGR64, II_C_CC_D, MipsFPCmp>, bits<3> fcc = 0; } -def BC1F_MM : MMRel, BC1F_FT<"bc1f", brtarget_mm, II_BC1F, MIPS_BRANCH_F>, - BC1F_FM_MM<0x1c>, ISA_MICROMIPS32_NOT_MIPS32R6; -def BC1T_MM : MMRel, BC1F_FT<"bc1t", brtarget_mm, II_BC1T, MIPS_BRANCH_T>, - BC1F_FM_MM<0x1d>, ISA_MICROMIPS32_NOT_MIPS32R6; +} + +let DecoderNamespace = "MicroMips" in { + def BC1F_MM : MMRel, BC1F_FT<"bc1f", brtarget_mm, II_BC1F, MIPS_BRANCH_F>, + BC1F_FM_MM<0x1c>, ISA_MICROMIPS32_NOT_MIPS32R6; + def BC1T_MM : MMRel, BC1F_FT<"bc1t", brtarget_mm, II_BC1T, MIPS_BRANCH_T>, + BC1F_FM_MM<0x1d>, ISA_MICROMIPS32_NOT_MIPS32R6; +} + +let isCodeGenOnly = 1 in { def CVT_W_S_MM : MMRel, ABSS_FT<"cvt.w.s", FGR32Opnd, FGR32Opnd, II_CVT>, ROUND_W_FM_MM<0, 0x24>, ISA_MICROMIPS; def ROUND_W_S_MM : MMRel, StdMMR6Rel, ABSS_FT<"round.w.s", FGR32Opnd, FGR32Opnd, diff --git a/lib/Target/Mips/MicroMipsInstrFormats.td b/lib/Target/Mips/MicroMipsInstrFormats.td index 774976828a0c..bc0045dad21e 100644 --- a/lib/Target/Mips/MicroMipsInstrFormats.td +++ b/lib/Target/Mips/MicroMipsInstrFormats.td @@ -786,13 +786,14 @@ class C_COND_FM_MM<bits <2> fmt, bits<4> c> : CEQS_FM_MM<fmt> { } class BC1F_FM_MM<bits<5> tf> : MMArch { + bits<3> fcc; bits<16> offset; bits<32> Inst; let Inst{31-26} = 0x10; let Inst{25-21} = tf; - let Inst{20-18} = 0x0; // cc + let Inst{20-18} = fcc; // cc let Inst{17-16} = 0x0; let Inst{15-0} = offset; } diff --git a/lib/Target/Mips/MipsInstrFPU.td b/lib/Target/Mips/MipsInstrFPU.td index 75e1b2be2a43..89b9e5e7a81a 100644 --- a/lib/Target/Mips/MipsInstrFPU.td +++ b/lib/Target/Mips/MipsInstrFPU.td @@ -641,17 +641,17 @@ let AdditionalPredicates = [NoNaNsFPMath, HasMadd4], def MIPS_BRANCH_F : PatLeaf<(i32 0)>; def MIPS_BRANCH_T : PatLeaf<(i32 1)>; -def BC1F : MMRel, BC1F_FT<"bc1f", brtarget, II_BC1F, MIPS_BRANCH_F>, - BC1F_FM<0, 0>, ISA_MIPS1_NOT_32R6_64R6; -def BC1FL : MMRel, BC1XL_FT<"bc1fl", brtarget, II_BC1FL>, - BC1F_FM<1, 0>, ISA_MIPS2_NOT_32R6_64R6; -def BC1T : MMRel, BC1F_FT<"bc1t", brtarget, II_BC1T, MIPS_BRANCH_T>, - BC1F_FM<0, 1>, ISA_MIPS1_NOT_32R6_64R6; -def BC1TL : MMRel, BC1XL_FT<"bc1tl", brtarget, II_BC1TL>, - BC1F_FM<1, 1>, ISA_MIPS2_NOT_32R6_64R6; +let AdditionalPredicates = [NotInMicroMips] in { + def BC1F : MMRel, BC1F_FT<"bc1f", brtarget, II_BC1F, MIPS_BRANCH_F>, + BC1F_FM<0, 0>, ISA_MIPS1_NOT_32R6_64R6; + def BC1FL : MMRel, BC1XL_FT<"bc1fl", brtarget, II_BC1FL>, + BC1F_FM<1, 0>, ISA_MIPS2_NOT_32R6_64R6; + def BC1T : MMRel, BC1F_FT<"bc1t", brtarget, II_BC1T, MIPS_BRANCH_T>, + BC1F_FM<0, 1>, ISA_MIPS1_NOT_32R6_64R6; + def BC1TL : MMRel, BC1XL_FT<"bc1tl", brtarget, II_BC1TL>, + BC1F_FM<1, 1>, ISA_MIPS2_NOT_32R6_64R6; /// Floating Point Compare -let AdditionalPredicates = [NotInMicroMips] in { def FCMP_S32 : MMRel, CEQS_FT<"s", FGR32, II_C_CC_S, MipsFPCmp>, CEQS_FM<16>, ISA_MIPS1_NOT_32R6_64R6 { |