From fb143ce459bafde02a7c6d625cc8974966fa5dff Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 27 Mar 2006 03:34:17 +0000 Subject: [PATCH] Fix the JIT encoding of VSEL git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27160 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCInstrAltivec.td | 8 ++++---- lib/Target/PowerPC/PPCInstrFormats.td | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/Target/PowerPC/PPCInstrAltivec.td b/lib/Target/PowerPC/PPCInstrAltivec.td index 360f7db3e56..f1b4ab7d45b 100644 --- a/lib/Target/PowerPC/PPCInstrAltivec.td +++ b/lib/Target/PowerPC/PPCInstrAltivec.td @@ -116,16 +116,16 @@ def VNMSUBFP: VAForm_1<47, (ops VRRC:$vD, VRRC:$vA, VRRC:$vC, VRRC:$vB), VRRC:$vB)))]>, Requires<[FPContractions]>; -def VPERM : VAForm_1<43, (ops VRRC:$vD, VRRC:$vA, VRRC:$vC, VRRC:$vB), - "vperm $vD, $vA, $vB, $vC", VecPerm, - [(set VRRC:$vD, +def VPERM : VAForm_1a<43, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, VRRC:$vC), + "vperm $vD, $vA, $vB, $vC", VecPerm, + [(set VRRC:$vD, (PPCvperm (v4f32 VRRC:$vA), VRRC:$vB, VRRC:$vC))]>; def VSLDOI : VAForm_2<44, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, u5imm:$SH), "vsldoi $vD, $vA, $vB, $SH", VecFP, [(set VRRC:$vD, (int_ppc_altivec_vsldoi VRRC:$vA, VRRC:$vB, imm:$SH))]>; -def VSEL : VAForm_1<42, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, VRRC:$vC), +def VSEL : VAForm_1a<42, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, VRRC:$vC), "vsel $vD, $vA, $vB, $vC", VecFP, [(set VRRC:$vD, (int_ppc_altivec_vsel VRRC:$vA, VRRC:$vB, VRRC:$vC))]>; diff --git a/lib/Target/PowerPC/PPCInstrFormats.td b/lib/Target/PowerPC/PPCInstrFormats.td index 9f87b278e67..805e1258c53 100644 --- a/lib/Target/PowerPC/PPCInstrFormats.td +++ b/lib/Target/PowerPC/PPCInstrFormats.td @@ -590,6 +590,8 @@ class MDForm_1 opcode, bits<3> xo, dag OL, string asmstr, } // E-1 VA-Form + +// VAForm_1 - DACB ordering. class VAForm_1 xo, dag OL, string asmstr, InstrItinClass itin, list pattern> : I<4, OL, asmstr, itin> { @@ -607,6 +609,24 @@ class VAForm_1 xo, dag OL, string asmstr, let Inst{26-31} = xo; } +// VAForm_1a - DABC ordering. +class VAForm_1a xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : I<4, OL, asmstr, itin> { + bits<5> VD; + bits<5> VA; + bits<5> VB; + bits<5> VC; + + let Pattern = pattern; + + let Inst{6-10} = VD; + let Inst{11-15} = VA; + let Inst{16-20} = VB; + let Inst{21-25} = VC; + let Inst{26-31} = xo; +} + class VAForm_2 xo, dag OL, string asmstr, InstrItinClass itin, list pattern> : I<4, OL, asmstr, itin> { -- 2.34.1