summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-03 21:56:36 +0000
committerChris Lattner <sabre@nondot.org>2003-08-03 21:56:36 +0000
commit113455be9d69f881165abafb6b6b0dd5b4b54aa8 (patch)
tree8c8ae8d56757c37512c71efeffd35c7a12cc0706 /lib
parent4d18d5ce1e62779e7736ca0811e2e1cb06e4ea36 (diff)
downloadllvm-113455be9d69f881165abafb6b6b0dd5b4b54aa8.tar.gz
llvm-113455be9d69f881165abafb6b6b0dd5b4b54aa8.tar.bz2
llvm-113455be9d69f881165abafb6b6b0dd5b4b54aa8.tar.xz
Resort tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/FloatingPoint.cpp36
-rw-r--r--lib/Target/X86/X86FloatingPoint.cpp36
2 files changed, 40 insertions, 32 deletions
diff --git a/lib/Target/X86/FloatingPoint.cpp b/lib/Target/X86/FloatingPoint.cpp
index f37b65fe05..f451a23477 100644
--- a/lib/Target/X86/FloatingPoint.cpp
+++ b/lib/Target/X86/FloatingPoint.cpp
@@ -259,21 +259,25 @@ static int Lookup(const TableEntry *Table, unsigned N, unsigned Opcode) {
// element is an instruction, the second is the version which pops.
//
static const TableEntry PopTable[] = {
+ { X86::FADDrST0 , X86::FADDPrST0 },
+
+ { X86::FDIVRrST0, X86::FDIVRPrST0 },
+ { X86::FDIVrST0 , X86::FDIVPrST0 },
+
+ { X86::FISTr16 , X86::FISTPr16 },
+ { X86::FISTr32 , X86::FISTPr32 },
+
+ { X86::FMULrST0 , X86::FMULPrST0 },
+
{ X86::FSTr32 , X86::FSTPr32 },
{ X86::FSTr64 , X86::FSTPr64 },
{ X86::FSTrr , X86::FSTPrr },
- { X86::FISTr16 , X86::FISTPr16 },
- { X86::FISTr32 , X86::FISTPr32 },
- { X86::FADDrST0 , X86::FADDPrST0 },
- { X86::FSUBrST0 , X86::FSUBPrST0 },
{ X86::FSUBRrST0, X86::FSUBRPrST0 },
- { X86::FMULrST0 , X86::FMULPrST0 },
- { X86::FDIVrST0 , X86::FDIVPrST0 },
- { X86::FDIVRrST0, X86::FDIVRPrST0 },
+ { X86::FSUBrST0 , X86::FSUBPrST0 },
- { X86::FUCOMr , X86::FUCOMPr },
{ X86::FUCOMPr , X86::FUCOMPPr },
+ { X86::FUCOMr , X86::FUCOMPr },
};
/// popStackAfter - Pop the current value off of the top of the FP stack after
@@ -363,36 +367,36 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
// ForwardST0Table - Map: A = B op C into: ST(0) = ST(0) op ST(i)
static const TableEntry ForwardST0Table[] = {
{ X86::FpADD, X86::FADDST0r },
- { X86::FpSUB, X86::FSUBST0r },
- { X86::FpMUL, X86::FMULST0r },
{ X86::FpDIV, X86::FDIVST0r },
+ { X86::FpMUL, X86::FMULST0r },
+ { X86::FpSUB, X86::FSUBST0r },
{ X86::FpUCOM, X86::FUCOMr },
};
// ReverseST0Table - Map: A = B op C into: ST(0) = ST(i) op ST(0)
static const TableEntry ReverseST0Table[] = {
{ X86::FpADD, X86::FADDST0r }, // commutative
- { X86::FpSUB, X86::FSUBRST0r },
- { X86::FpMUL, X86::FMULST0r }, // commutative
{ X86::FpDIV, X86::FDIVRST0r },
+ { X86::FpMUL, X86::FMULST0r }, // commutative
+ { X86::FpSUB, X86::FSUBRST0r },
{ X86::FpUCOM, ~0 },
};
// ForwardSTiTable - Map: A = B op C into: ST(i) = ST(0) op ST(i)
static const TableEntry ForwardSTiTable[] = {
{ X86::FpADD, X86::FADDrST0 }, // commutative
- { X86::FpSUB, X86::FSUBRrST0 },
- { X86::FpMUL, X86::FMULrST0 }, // commutative
{ X86::FpDIV, X86::FDIVRrST0 },
+ { X86::FpMUL, X86::FMULrST0 }, // commutative
+ { X86::FpSUB, X86::FSUBRrST0 },
{ X86::FpUCOM, X86::FUCOMr },
};
// ReverseSTiTable - Map: A = B op C into: ST(i) = ST(i) op ST(0)
static const TableEntry ReverseSTiTable[] = {
{ X86::FpADD, X86::FADDrST0 },
- { X86::FpSUB, X86::FSUBrST0 },
- { X86::FpMUL, X86::FMULrST0 },
{ X86::FpDIV, X86::FDIVrST0 },
+ { X86::FpMUL, X86::FMULrST0 },
+ { X86::FpSUB, X86::FSUBrST0 },
{ X86::FpUCOM, ~0 },
};
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp
index f37b65fe05..f451a23477 100644
--- a/lib/Target/X86/X86FloatingPoint.cpp
+++ b/lib/Target/X86/X86FloatingPoint.cpp
@@ -259,21 +259,25 @@ static int Lookup(const TableEntry *Table, unsigned N, unsigned Opcode) {
// element is an instruction, the second is the version which pops.
//
static const TableEntry PopTable[] = {
+ { X86::FADDrST0 , X86::FADDPrST0 },
+
+ { X86::FDIVRrST0, X86::FDIVRPrST0 },
+ { X86::FDIVrST0 , X86::FDIVPrST0 },
+
+ { X86::FISTr16 , X86::FISTPr16 },
+ { X86::FISTr32 , X86::FISTPr32 },
+
+ { X86::FMULrST0 , X86::FMULPrST0 },
+
{ X86::FSTr32 , X86::FSTPr32 },
{ X86::FSTr64 , X86::FSTPr64 },
{ X86::FSTrr , X86::FSTPrr },
- { X86::FISTr16 , X86::FISTPr16 },
- { X86::FISTr32 , X86::FISTPr32 },
- { X86::FADDrST0 , X86::FADDPrST0 },
- { X86::FSUBrST0 , X86::FSUBPrST0 },
{ X86::FSUBRrST0, X86::FSUBRPrST0 },
- { X86::FMULrST0 , X86::FMULPrST0 },
- { X86::FDIVrST0 , X86::FDIVPrST0 },
- { X86::FDIVRrST0, X86::FDIVRPrST0 },
+ { X86::FSUBrST0 , X86::FSUBPrST0 },
- { X86::FUCOMr , X86::FUCOMPr },
{ X86::FUCOMPr , X86::FUCOMPPr },
+ { X86::FUCOMr , X86::FUCOMPr },
};
/// popStackAfter - Pop the current value off of the top of the FP stack after
@@ -363,36 +367,36 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
// ForwardST0Table - Map: A = B op C into: ST(0) = ST(0) op ST(i)
static const TableEntry ForwardST0Table[] = {
{ X86::FpADD, X86::FADDST0r },
- { X86::FpSUB, X86::FSUBST0r },
- { X86::FpMUL, X86::FMULST0r },
{ X86::FpDIV, X86::FDIVST0r },
+ { X86::FpMUL, X86::FMULST0r },
+ { X86::FpSUB, X86::FSUBST0r },
{ X86::FpUCOM, X86::FUCOMr },
};
// ReverseST0Table - Map: A = B op C into: ST(0) = ST(i) op ST(0)
static const TableEntry ReverseST0Table[] = {
{ X86::FpADD, X86::FADDST0r }, // commutative
- { X86::FpSUB, X86::FSUBRST0r },
- { X86::FpMUL, X86::FMULST0r }, // commutative
{ X86::FpDIV, X86::FDIVRST0r },
+ { X86::FpMUL, X86::FMULST0r }, // commutative
+ { X86::FpSUB, X86::FSUBRST0r },
{ X86::FpUCOM, ~0 },
};
// ForwardSTiTable - Map: A = B op C into: ST(i) = ST(0) op ST(i)
static const TableEntry ForwardSTiTable[] = {
{ X86::FpADD, X86::FADDrST0 }, // commutative
- { X86::FpSUB, X86::FSUBRrST0 },
- { X86::FpMUL, X86::FMULrST0 }, // commutative
{ X86::FpDIV, X86::FDIVRrST0 },
+ { X86::FpMUL, X86::FMULrST0 }, // commutative
+ { X86::FpSUB, X86::FSUBRrST0 },
{ X86::FpUCOM, X86::FUCOMr },
};
// ReverseSTiTable - Map: A = B op C into: ST(i) = ST(i) op ST(0)
static const TableEntry ReverseSTiTable[] = {
{ X86::FpADD, X86::FADDrST0 },
- { X86::FpSUB, X86::FSUBrST0 },
- { X86::FpMUL, X86::FMULrST0 },
{ X86::FpDIV, X86::FDIVrST0 },
+ { X86::FpMUL, X86::FMULrST0 },
+ { X86::FpSUB, X86::FSUBrST0 },
{ X86::FpUCOM, ~0 },
};