diff --git a/llvm/lib/Target/PowerPC/PowerPCInstrFormats.td b/llvm/lib/Target/PowerPC/PowerPCInstrFormats.td index 52159dc040139a18a304570a48c523576d4d369f..426e9412ef7ffd01cd70192bf0723ec7d9848367 100644 --- a/llvm/lib/Target/PowerPC/PowerPCInstrFormats.td +++ b/llvm/lib/Target/PowerPC/PowerPCInstrFormats.td @@ -214,6 +214,23 @@ class XForm_base_r3xo opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, let Inst{31} = rc; } +// This is the same as XForm_base_r3xo, but the first two operands are swapped +// when code is emitted. +class XForm_base_r3xo_swapped + opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, + dag OL, string asmstr> + : I { + bits<5> A; + bits<5> RST; + bits<5> B; + + let Inst{6-10} = RST; + let Inst{11-15} = A; + let Inst{16-20} = B; + let Inst{21-30} = xo; + let Inst{31} = rc; +} + class XForm_1 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> @@ -228,17 +245,7 @@ class XForm_5 opcode, bits<10> xo, bit ppc64, bit vmx, class XForm_6 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> - : I { - bits<5> A; - bits<5> RST; - bits<5> B; - - let Inst{6-10} = RST; - let Inst{11-15} = A; - let Inst{16-20} = B; - let Inst{21-30} = xo; - let Inst{31} = rc; -} + : XForm_base_r3xo_swapped; class XForm_8 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> @@ -251,7 +258,7 @@ class XForm_10 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, class XForm_11 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> - : XForm_base_r3xo { + : XForm_base_r3xo_swapped { let B = 0; }