diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-08-20 21:08:22 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-08-20 21:08:22 +0000 |
commit | a98a486ad194c38293efcc5359d6ed2493f950dc (patch) | |
tree | 69d07a78f28f49d3e809589d088a240f0a923d12 /lib/Target/Mips/MipsInstrFPU.td | |
parent | 0323d4b169279414862174f38ae04add6b747a60 (diff) | |
download | llvm-a98a486ad194c38293efcc5359d6ed2493f950dc.tar.gz llvm-a98a486ad194c38293efcc5359d6ed2493f950dc.tar.bz2 llvm-a98a486ad194c38293efcc5359d6ed2493f950dc.tar.xz |
[mips] Resolve register classes dynamically using ptr_rc to reduce the number of
load/store instructions defined. Previously, we were defining load/store
instructions for each pointer size (32 and 64-bit), but now we need just one
definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsInstrFPU.td')
-rw-r--r-- | lib/Target/Mips/MipsInstrFPU.td | 59 |
1 files changed, 18 insertions, 41 deletions
diff --git a/lib/Target/Mips/MipsInstrFPU.td b/lib/Target/Mips/MipsInstrFPU.td index f64e6f7673..28fdbf5daa 100644 --- a/lib/Target/Mips/MipsInstrFPU.td +++ b/lib/Target/Mips/MipsInstrFPU.td @@ -143,16 +143,16 @@ class MTC1_FT<string opstr, RegisterOperand DstRC, RegisterOperand SrcRC, [(set DstRC:$fs, (OpNode SrcRC:$rt))], Itin, FrmFR>; class LW_FT<string opstr, RegisterOperand RC, InstrItinClass Itin, - Operand MemOpnd, SDPatternOperator OpNode= null_frag> : - InstSE<(outs RC:$rt), (ins MemOpnd:$addr), !strconcat(opstr, "\t$rt, $addr"), + SDPatternOperator OpNode= null_frag> : + InstSE<(outs RC:$rt), (ins mem:$addr), !strconcat(opstr, "\t$rt, $addr"), [(set RC:$rt, (OpNode addrDefault:$addr))], Itin, FrmFI> { let DecoderMethod = "DecodeFMem"; let mayLoad = 1; } class SW_FT<string opstr, RegisterOperand RC, InstrItinClass Itin, - Operand MemOpnd, SDPatternOperator OpNode= null_frag> : - InstSE<(outs), (ins RC:$rt, MemOpnd:$addr), !strconcat(opstr, "\t$rt, $addr"), + SDPatternOperator OpNode= null_frag> : + InstSE<(outs), (ins RC:$rt, mem:$addr), !strconcat(opstr, "\t$rt, $addr"), [(OpNode RC:$rt, addrDefault:$addr)], Itin, FrmFI> { let DecoderMethod = "DecodeFMem"; let mayStore = 1; @@ -353,39 +353,23 @@ def FMOV_D64 : ABSS_FT<"mov.d", FGR64Opnd, FGR64Opnd, IIFmove>, } /// Floating Point Memory Instructions -let Predicates = [IsN64, HasStdEnc], DecoderNamespace = "Mips64" in { - def LWC1_P8 : LW_FT<"lwc1", FGR32Opnd, IIFLoad, mem64, load>, - LW_FM<0x31>; - def SWC1_P8 : SW_FT<"swc1", FGR32Opnd, IIFStore, mem64, store>, - LW_FM<0x39>; - def LDC164_P8 : LW_FT<"ldc1", FGR64Opnd, IIFLoad, mem64, load>, - LW_FM<0x35> { - let isCodeGenOnly =1; - } - def SDC164_P8 : SW_FT<"sdc1", FGR64Opnd, IIFStore, mem64, store>, - LW_FM<0x3d> { - let isCodeGenOnly =1; - } -} - -let Predicates = [NotN64, HasStdEnc] in { - def LWC1 : LW_FT<"lwc1", FGR32Opnd, IIFLoad, mem, load>, LW_FM<0x31>; - def SWC1 : SW_FT<"swc1", FGR32Opnd, IIFStore, mem, store>, LW_FM<0x39>; +let Predicates = [HasStdEnc] in { + def LWC1 : LW_FT<"lwc1", FGR32Opnd, IIFLoad, load>, LW_FM<0x31>; + def SWC1 : SW_FT<"swc1", FGR32Opnd, IIFStore, store>, LW_FM<0x39>; } -let Predicates = [NotN64, HasMips64, HasStdEnc], - DecoderNamespace = "Mips64" in { - def LDC164 : LW_FT<"ldc1", FGR64Opnd, IIFLoad, mem, load>, LW_FM<0x35>; - def SDC164 : SW_FT<"sdc1", FGR64Opnd, IIFStore, mem, store>, LW_FM<0x3d>; +let Predicates = [HasMips64, HasStdEnc], DecoderNamespace = "Mips64" in { + def LDC164 : LW_FT<"ldc1", FGR64Opnd, IIFLoad, load>, LW_FM<0x35>; + def SDC164 : SW_FT<"sdc1", FGR64Opnd, IIFStore, store>, LW_FM<0x3d>; } -let Predicates = [NotN64, NotMips64, HasStdEnc] in { +let Predicates = [NotMips64, HasStdEnc] in { let isPseudo = 1, isCodeGenOnly = 1 in { - def PseudoLDC1 : LW_FT<"", AFGR64Opnd, IIFLoad, mem, load>; - def PseudoSDC1 : SW_FT<"", AFGR64Opnd, IIFStore, mem, store>; + def PseudoLDC1 : LW_FT<"", AFGR64Opnd, IIFLoad, load>; + def PseudoSDC1 : SW_FT<"", AFGR64Opnd, IIFStore, store>; } - def LDC1 : LW_FT<"ldc1", AFGR64Opnd, IIFLoad, mem>, LW_FM<0x35>; - def SDC1 : SW_FT<"sdc1", AFGR64Opnd, IIFStore, mem>, LW_FM<0x3d>; + def LDC1 : LW_FT<"ldc1", AFGR64Opnd, IIFLoad>, LW_FM<0x35>; + def SDC1 : SW_FT<"sdc1", AFGR64Opnd, IIFStore>, LW_FM<0x3d>; } // Indexed loads and stores. @@ -611,24 +595,17 @@ let Predicates = [IsFP64bit, HasStdEnc] in { // Patterns for loads/stores with a reg+imm operand. let AddedComplexity = 40 in { - let Predicates = [IsN64, HasStdEnc] in { - def : LoadRegImmPat<LWC1_P8, f32, load>; - def : StoreRegImmPat<SWC1_P8, f32>; - def : LoadRegImmPat<LDC164_P8, f64, load>; - def : StoreRegImmPat<SDC164_P8, f64>; - } - - let Predicates = [NotN64, HasStdEnc] in { + let Predicates = [HasStdEnc] in { def : LoadRegImmPat<LWC1, f32, load>; def : StoreRegImmPat<SWC1, f32>; } - let Predicates = [NotN64, HasMips64, HasStdEnc] in { + let Predicates = [HasMips64, HasStdEnc] in { def : LoadRegImmPat<LDC164, f64, load>; def : StoreRegImmPat<SDC164, f64>; } - let Predicates = [NotN64, NotMips64, HasStdEnc] in { + let Predicates = [NotMips64, HasStdEnc] in { def : LoadRegImmPat<PseudoLDC1, f64, load>; def : StoreRegImmPat<PseudoSDC1, f64>; } |