From reid at x10sys.com Mon Jul 2 01:16:33 2007
From: reid at x10sys.com (Reid Spencer)
Date: Mon, 02 Jul 2007 06:16:33 -0000
Subject: [llvm-commits] [llvm] r37836 - /llvm/trunk/utils/NewNightlyTest.pl
Message-ID: <200707020616.l626GXOS000374@zion.cs.uiuc.edu>
Author: reid
Date: Mon Jul 2 01:16:32 2007
New Revision: 37836
URL: http://llvm.org/viewvc/llvm-project?rev=37836&view=rev
Log:
We want the Subversion checkout to succeed even if we don't specify
the -verbose option! Doh!
Modified:
llvm/trunk/utils/NewNightlyTest.pl
Modified: llvm/trunk/utils/NewNightlyTest.pl
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/NewNightlyTest.pl?rev=37836&r1=37835&r2=37836&view=diff
==============================================================================
--- llvm/trunk/utils/NewNightlyTest.pl (original)
+++ llvm/trunk/utils/NewNightlyTest.pl Mon Jul 2 01:16:32 2007
@@ -513,24 +513,24 @@
#
##############################################################
if (!$NOCHECKOUT) {
- if ( $VERBOSE ) {
- print "CHECKOUT STAGE:\n";
- }
+ if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; }
if ($USESVN) {
my $SVNCMD = "$NICE svn co $SVNURL";
if ($VERBOSE) {
print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
"$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
- system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
}
+ system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
+ "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
} else {
my $CVSOPT = "";
$CVSOPT = "-z3" # Use compression if going over ssh.
if $CVSRootDir =~ /^:ext:/;
my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
- print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
- "$CVSCMD llvm-test ) > $COLog 2>&1\n";
+ if ($VERBOSE) {
+ print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
+ "$CVSCMD llvm-test ) > $COLog 2>&1\n";
+ }
system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
"$CVSCMD llvm-test ) > $COLog 2>&1\n";
}
From reid at x10sys.com Mon Jul 2 01:19:57 2007
From: reid at x10sys.com (Reid Spencer)
Date: Mon, 02 Jul 2007 06:19:57 -0000
Subject: [llvm-commits] [llvm] r37837 - /llvm/trunk/utils/NewNightlyTest.pl
Message-ID: <200707020619.l626JvUv000490@zion.cs.uiuc.edu>
Author: reid
Date: Mon Jul 2 01:19:57 2007
New Revision: 37837
URL: http://llvm.org/viewvc/llvm-project?rev=37837&view=rev
Log:
Remove the last vestiges of -usesvn.
Implement -usecvs just in case we need to go back to cvs for some reason.
Modified:
llvm/trunk/utils/NewNightlyTest.pl
Modified: llvm/trunk/utils/NewNightlyTest.pl
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/NewNightlyTest.pl?rev=37837&r1=37836&r2=37837&view=diff
==============================================================================
--- llvm/trunk/utils/NewNightlyTest.pl (original)
+++ llvm/trunk/utils/NewNightlyTest.pl Mon Jul 2 01:19:57 2007
@@ -45,10 +45,8 @@
# -gccpath Path to gcc/g++ used to build LLVM
# -cvstag Check out a specific CVS tag to build LLVM (useful for
# testing release branches)
-# -usesvn Check code out from a subversion repository.
-# -svnurl Specify the SVN URL where LLVM can be found. Needs -usesvn
-# to be useful. If -svnurl is not used but -usesvn is then
-# the standard (UIUC) repository will be used.
+# -usecvs Check code out from the (old) CVS Repository instead of from
+# the standard Subversion repository.
# -target Specify the target triplet
# -cflags Next argument specifies that C compilation options that
# override the default.
@@ -170,7 +168,7 @@
else { $GCCPATH=""; }
if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; }
else { $CVSCOOPT="";}
- if (/^-svnurl/) { $SVNURL = $ARGV[0]; shift; next; }
+ if (/^-usecvs/) { $USESVN = 0; }
if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
shift; next; }
if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
From zhousheng00 at gmail.com Mon Jul 2 03:02:15 2007
From: zhousheng00 at gmail.com (Zhou Sheng)
Date: Mon, 02 Jul 2007 08:02:15 -0000
Subject: [llvm-commits] [llvm] r37838 -
/llvm/trunk/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll
Message-ID: <200707020802.l6282F5Y012575@zion.cs.uiuc.edu>
Author: sheng
Date: Mon Jul 2 03:02:14 2007
New Revision: 37838
URL: http://llvm.org/viewvc/llvm-project?rev=37838&view=rev
Log:
Test case for recent patch for IndVarSimplify.cpp
Added:
llvm/trunk/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll
Added: llvm/trunk/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll?rev=37838&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll (added)
+++ llvm/trunk/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll Mon Jul 2 03:02:14 2007
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | opt -indvars -disable-output
+
+; ModuleID = 'testcase.bc'
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "i686-pc-linux-gnu"
+
+define i32 @testcase(i5 zext %k) {
+entry:
+ br label %bb2
+
+bb: ; preds = %bb2
+ %tmp1 = add i32 %tmp2, %result ; [#uses=1]
+ %indvar_next1 = add i5 %k_0, 1 ; [#uses=1]
+ br label %bb2
+
+bb2: ; preds = %bb, %entry
+ %k_0 = phi i5 [ 0, %entry ], [ %indvar_next1, %bb ] ; [#uses=2]
+ %result = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ; [#uses=2]
+ %tmp2 = zext i5 %k_0 to i32 ; [#uses=1]
+ %exitcond = icmp eq i32 %tmp2, 16 ; [#uses=1]
+ br i1 %exitcond, label %bb3, label %bb
+
+bb3: ; preds = %bb2
+ ret i32 %result
+}
From djg at cray.com Mon Jul 2 09:53:38 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 14:53:38 -0000
Subject: [llvm-commits] [llvm] r37839 - in /llvm/trunk:
include/llvm/Analysis/LoopPass.h include/llvm/CallGraphSCCPass.h
include/llvm/CodeGen/MachineFunctionPass.h
lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/CFGPrinter.cpp
Message-ID: <200707021453.l62ErcOj026620@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 09:53:37 2007
New Revision: 37839
URL: http://llvm.org/viewvc/llvm-project?rev=37839&view=rev
Log:
Add explicit keywords.
Modified:
llvm/trunk/include/llvm/Analysis/LoopPass.h
llvm/trunk/include/llvm/CallGraphSCCPass.h
llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
llvm/trunk/lib/Analysis/CFGPrinter.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=37839&r1=37838&r2=37839&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopPass.h Mon Jul 2 09:53:37 2007
@@ -29,9 +29,9 @@
class LoopPass : public Pass {
public:
- LoopPass(intptr_t pid) : Pass(pid) {}
+ explicit LoopPass(intptr_t pid) : Pass(pid) {}
- // runOnLoop - THis method should be implemented by the subclass to perform
+ // runOnLoop - This method should be implemented by the subclass to perform
// whatever action is necessary for the specfied Loop.
virtual bool runOnLoop (Loop *L, LPPassManager &LPM) = 0;
virtual bool runOnFunctionBody (Function &F, LPPassManager &LPM) {
Modified: llvm/trunk/include/llvm/CallGraphSCCPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallGraphSCCPass.h?rev=37839&r1=37838&r2=37839&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CallGraphSCCPass.h (original)
+++ llvm/trunk/include/llvm/CallGraphSCCPass.h Mon Jul 2 09:53:37 2007
@@ -31,7 +31,7 @@
struct CallGraphSCCPass : public Pass {
- CallGraphSCCPass(intptr_t pid) : Pass(pid) {}
+ explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {}
/// doInitialization - This method is called before the SCC's of the program
/// has been processed, allowing the pass to do initialization as necessary.
Modified: llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h?rev=37839&r1=37838&r2=37839&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h Mon Jul 2 09:53:37 2007
@@ -26,7 +26,7 @@
struct MachineFunctionPass : public FunctionPass {
- MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
+ explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
/// runOnMachineFunction - This method must be overloaded to perform the
/// desired machine code transformation or analysis.
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=37839&r1=37838&r2=37839&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon Jul 2 09:53:37 2007
@@ -38,7 +38,7 @@
struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
static char ID; // Class identification, replacement for typeinfo
NoAA() : ImmutablePass((intptr_t)&ID) {}
- NoAA(intptr_t PID) : ImmutablePass(PID) { }
+ explicit NoAA(intptr_t PID) : ImmutablePass(PID) { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired();
Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=37839&r1=37838&r2=37839&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original)
+++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Mon Jul 2 09:53:37 2007
@@ -135,7 +135,7 @@
struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
CFGPrinter() : FunctionPass((intptr_t)&ID) {}
- CFGPrinter(intptr_t pid) : FunctionPass(pid) {}
+ explicit CFGPrinter(intptr_t pid) : FunctionPass(pid) {}
virtual bool runOnFunction(Function &F) {
std::string Filename = "cfg." + F.getName() + ".dot";
From djg at cray.com Mon Jul 2 10:06:26 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 15:06:26 -0000
Subject: [llvm-commits] [llvm] r37840 - in /llvm/trunk/include/llvm/CodeGen:
InstrScheduling.h Passes.h
Message-ID: <200707021506.l62F6Q3T026983@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 10:06:26 2007
New Revision: 37840
URL: http://llvm.org/viewvc/llvm-project?rev=37840&view=rev
Log:
Remove declarations for code no longer in the tree, to avoid confusion.
Removed:
llvm/trunk/include/llvm/CodeGen/InstrScheduling.h
Modified:
llvm/trunk/include/llvm/CodeGen/Passes.h
Removed: llvm/trunk/include/llvm/CodeGen/InstrScheduling.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/InstrScheduling.h?rev=37839&view=auto
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/InstrScheduling.h (original)
+++ llvm/trunk/include/llvm/CodeGen/InstrScheduling.h (removed)
@@ -1,37 +0,0 @@
-//===-- InstrScheduling.h - Interface To Instruction Scheduling -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a minimal, but complete, interface to instruction
-// scheduling.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_INSTR_SCHEDULING_H
-#define LLVM_CODEGEN_INSTR_SCHEDULING_H
-
-namespace llvm {
-
-class FunctionPass;
-class TargetMachine;
-
-//---------------------------------------------------------------------------
-// Function: createScheduleInstructionsWithSSAPass(..)
-//
-// Purpose:
-// Entry point for instruction scheduling on SSA form.
-// Schedules the machine instructions generated by instruction selection.
-// Assumes that register allocation has not been done, i.e., operands
-// are still in SSA form.
-//---------------------------------------------------------------------------
-
-FunctionPass *createInstructionSchedulingWithSSAPass(const TargetMachine &TM);
-
-} // End llvm namespace
-
-#endif
Modified: llvm/trunk/include/llvm/CodeGen/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=37840&r1=37839&r2=37840&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/Passes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/Passes.h Mon Jul 2 10:06:26 2007
@@ -112,12 +112,6 @@
/// for the Sparc.
FunctionPass *getRegisterAllocator(TargetMachine &T);
- //createModuloSchedulingPass - Creates the Swing Modulo Scheduling Pass
- FunctionPass *createModuloSchedulingPass(TargetMachine & targ);
-
- //createModuloSchedulingPass - Creates the Swing Modulo Scheduling Pass
- FunctionPass *createModuloSchedulingSBPass(TargetMachine & targ);
-
} // End llvm namespace
#endif
From djg at cray.com Mon Jul 2 10:43:21 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 15:43:21 -0000
Subject: [llvm-commits] [llvm] r37841 -
/llvm/trunk/test/CodeGen/X86/negative-sin.ll
Message-ID: <200707021543.l62FhLZG028059@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 10:43:20 2007
New Revision: 37841
URL: http://llvm.org/viewvc/llvm-project?rev=37841&view=rev
Log:
New test case. DAGCombiner should be able to fold -sin(-x)
in -enable-unsafe-fp-math mode.
Added:
llvm/trunk/test/CodeGen/X86/negative-sin.ll
Added: llvm/trunk/test/CodeGen/X86/negative-sin.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/negative-sin.ll?rev=37841&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/negative-sin.ll (added)
+++ llvm/trunk/test/CodeGen/X86/negative-sin.ll Mon Jul 2 10:43:20 2007
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -enable-unsafe-fp-math -march=x86-64 | \
+; RUN: not egrep {addsd|subsd|xor}
+
+declare double @sin(double %f)
+
+define double @foo(double %e)
+{
+ %f = sub double 0.0, %e
+ %g = call double @sin(double %f)
+ %h = sub double 0.0, %g
+ ret double %h
+}
From djg at cray.com Mon Jul 2 10:48:56 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 15:48:56 -0000
Subject: [llvm-commits] [llvm] r37842 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Message-ID: <200707021548.l62Fmvlw028181@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 10:48:56 2007
New Revision: 37842
URL: http://llvm.org/viewvc/llvm-project?rev=37842&view=rev
Log:
Teach GetNegatedExpression to negate 0-B to B in UnsafeFPMath mode, and
visitFSUB to fold 0-B to -B in UnsafeFPMath mode. Also change visitFNEG
to use isNegatibleForFree/GetNegatedExpression instead of doing a subset
of the same thing manually.
This fixes test/CodeGen/X86/negative-sin.ll.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=37842&r1=37841&r2=37842&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Jul 2 10:48:56 2007
@@ -429,6 +429,11 @@
case ISD::FSUB:
// We can't turn -(A-B) into B-A when we honor signed zeros.
assert(UnsafeFPMath);
+
+ // -(0-B) -> B
+ if (ConstantFPSDNode *N0CFP = dyn_cast(Op.getOperand(0)))
+ if (N0CFP->getValue() == 0.0)
+ return Op.getOperand(1);
// -(A-B) -> B-A
return DAG.getNode(ISD::FSUB, Op.getValueType(), Op.getOperand(1),
@@ -3025,6 +3030,12 @@
// fold (fsub c1, c2) -> c1-c2
if (N0CFP && N1CFP)
return DAG.getNode(ISD::FSUB, VT, N0, N1);
+ // fold (0-B) -> -B
+ if (UnsafeFPMath && N0CFP && N0CFP->getValue() == 0.0) {
+ if (isNegatibleForFree(N1))
+ return GetNegatedExpression(N1, DAG);
+ return DAG.getNode(ISD::FNEG, VT, N1);
+ }
// fold (A-(-B)) -> A+B
if (isNegatibleForFree(N1))
return DAG.getNode(ISD::FADD, VT, N0, GetNegatedExpression(N1, DAG));
@@ -3297,18 +3308,10 @@
SDOperand DAGCombiner::visitFNEG(SDNode *N) {
SDOperand N0 = N->getOperand(0);
- ConstantFPSDNode *N0CFP = dyn_cast(N0);
- MVT::ValueType VT = N->getValueType(0);
- // fold (fneg c1) -> -c1
- if (N0CFP)
- return DAG.getNode(ISD::FNEG, VT, N0);
- // fold (fneg (sub x, y)) -> (sub y, x)
- if (N0.getOpcode() == ISD::SUB)
- return DAG.getNode(ISD::SUB, VT, N0.getOperand(1), N0.getOperand(0));
- // fold (fneg (fneg x)) -> x
- if (N0.getOpcode() == ISD::FNEG)
- return N0.getOperand(0);
+ if (isNegatibleForFree(N0))
+ return GetNegatedExpression(N0, DAG);
+
return SDOperand();
}
From djg at cray.com Mon Jul 2 11:18:06 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 16:18:06 -0000
Subject: [llvm-commits] [llvm] r37843 -
/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <200707021618.l62GI6GA029325@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 11:18:06 2007
New Revision: 37843
URL: http://llvm.org/viewvc/llvm-project?rev=37843&view=rev
Log:
Replace ExpandScalarFormalArgs and ExpandScalarCallArgs with the newly
refactored getCopyFromParts and getCopyToParts, which are more general.
This effectively adds support for lowering illegal by-val vector call
arguments.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=37843&r1=37842&r2=37843&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jul 2 11:18:06 2007
@@ -2861,7 +2861,7 @@
if (!MVT::isVector(ValueVT) || NumParts == 1) {
// If the value was expanded, copy from the parts.
if (NumParts > 1) {
- for (unsigned i = 0; i < NumParts; ++i)
+ for (unsigned i = 0; i != NumParts; ++i)
Parts[i] = DAG.getNode(ISD::EXTRACT_ELEMENT, PartVT, Val,
DAG.getConstant(i, MVT::i32));
return;
@@ -2950,7 +2950,7 @@
// Copy the legal parts from the registers.
unsigned NumParts = Regs.size();
SmallVector Parts(NumParts);
- for (unsigned i = 0; i < NumParts; ++i) {
+ for (unsigned i = 0; i != NumParts; ++i) {
SDOperand Part = Flag ?
DAG.getCopyFromReg(Chain, Regs[i], RegVT, *Flag) :
DAG.getCopyFromReg(Chain, Regs[i], RegVT);
@@ -2981,7 +2981,7 @@
getCopyToParts(DAG, Val, &Parts[0], NumParts, RegVT);
// Copy the parts into the registers.
- for (unsigned i = 0; i < NumParts; ++i) {
+ for (unsigned i = 0; i != NumParts; ++i) {
SDOperand Part = Flag ?
DAG.getCopyToReg(Chain, R[i], Parts[i], *Flag) :
DAG.getCopyToReg(Chain, R[i], Parts[i]);
@@ -3746,32 +3746,6 @@
DAG.getSrcValue(I.getOperand(2))));
}
-/// ExpandScalarFormalArgs - Recursively expand the formal_argument node, either
-/// bit_convert it or join a pair of them with a BUILD_PAIR when appropriate.
-static SDOperand ExpandScalarFormalArgs(MVT::ValueType VT, SDNode *Arg,
- unsigned &i, SelectionDAG &DAG,
- TargetLowering &TLI) {
- if (TLI.getTypeAction(VT) != TargetLowering::Expand)
- return SDOperand(Arg, i++);
-
- MVT::ValueType EVT = TLI.getTypeToTransformTo(VT);
- unsigned NumVals = MVT::getSizeInBits(VT) / MVT::getSizeInBits(EVT);
- if (NumVals == 1) {
- return DAG.getNode(ISD::BIT_CONVERT, VT,
- ExpandScalarFormalArgs(EVT, Arg, i, DAG, TLI));
- } else if (NumVals == 2) {
- SDOperand Lo = ExpandScalarFormalArgs(EVT, Arg, i, DAG, TLI);
- SDOperand Hi = ExpandScalarFormalArgs(EVT, Arg, i, DAG, TLI);
- if (!TLI.isLittleEndian())
- std::swap(Lo, Hi);
- return DAG.getNode(ISD::BUILD_PAIR, VT, Lo, Hi);
- } else {
- // Value scalarized into many values. Unimp for now.
- assert(0 && "Cannot expand i64 -> i16 yet!");
- }
- return SDOperand();
-}
-
/// TargetLowering::LowerArguments - This is the default LowerArguments
/// implementation, which just inserts a FORMAL_ARGUMENTS node. FIXME: When all
/// targets are migrated to using FORMAL_ARGUMENTS, this hook should be
@@ -3842,8 +3816,8 @@
SDNode *Result = DAG.getNode(ISD::FORMAL_ARGUMENTS,
DAG.getNodeValueTypes(RetVals), RetVals.size(),
&Ops[0], Ops.size()).Val;
-
- DAG.setRoot(SDOperand(Result, Result->getNumValues()-1));
+ unsigned NumArgRegs = Result->getNumValues() - 1;
+ DAG.setRoot(SDOperand(Result, NumArgRegs));
// Set up the return result vector.
Ops.clear();
@@ -3875,79 +3849,22 @@
Ops.push_back(Op);
break;
}
- case Expand:
- if (!MVT::isVector(VT)) {
- // If this is a large integer or a floating point node that needs to be
- // expanded, it needs to be reassembled from small integers. Figure out
- // what the source elt type is and how many small integers it is.
- Ops.push_back(ExpandScalarFormalArgs(VT, Result, i, DAG, *this));
- } else {
- // Otherwise, this is a vector type. We only support legal vectors
- // right now.
- const VectorType *PTy = cast(I->getType());
- unsigned NumElems = PTy->getNumElements();
- const Type *EltTy = PTy->getElementType();
-
- // Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the vector type.
- MVT::ValueType TVT =
- MVT::getVectorType(getValueType(EltTy), NumElems);
- if (TVT != MVT::Other && isTypeLegal(TVT)) {
- SDOperand N = SDOperand(Result, i++);
- // Handle copies from vectors to registers.
- N = DAG.getNode(ISD::BIT_CONVERT, TVT, N);
- Ops.push_back(N);
- } else {
- assert(0 && "Don't support illegal by-val vector arguments yet!");
- abort();
- }
- }
+ case Expand: {
+ MVT::ValueType PartVT = getRegisterType(VT);
+ unsigned NumParts = getNumRegisters(VT);
+ SmallVector Parts(NumParts);
+ for (unsigned j = 0; j != NumParts; ++j)
+ Parts[j] = SDOperand(Result, i++);
+ Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts, PartVT, VT));
break;
}
+ }
}
+ assert(i == NumArgRegs && "Argument register count mismatch!");
return Ops;
}
-/// ExpandScalarCallArgs - Recursively expand call argument node by
-/// bit_converting it or extract a pair of elements from the larger node.
-static void ExpandScalarCallArgs(MVT::ValueType VT, SDOperand Arg,
- unsigned Flags,
- SmallVector &Ops,
- SelectionDAG &DAG,
- TargetLowering &TLI,
- bool isFirst = true) {
-
- if (TLI.getTypeAction(VT) != TargetLowering::Expand) {
- // if it isn't first piece, alignment must be 1
- if (!isFirst)
- Flags = (Flags & (~ISD::ParamFlags::OrigAlignment)) |
- (1 << ISD::ParamFlags::OrigAlignmentOffs);
- Ops.push_back(Arg);
- Ops.push_back(DAG.getConstant(Flags, MVT::i32));
- return;
- }
-
- MVT::ValueType EVT = TLI.getTypeToTransformTo(VT);
- unsigned NumVals = MVT::getSizeInBits(VT) / MVT::getSizeInBits(EVT);
- if (NumVals == 1) {
- Arg = DAG.getNode(ISD::BIT_CONVERT, EVT, Arg);
- ExpandScalarCallArgs(EVT, Arg, Flags, Ops, DAG, TLI, isFirst);
- } else if (NumVals == 2) {
- SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, EVT, Arg,
- DAG.getConstant(0, TLI.getPointerTy()));
- SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, EVT, Arg,
- DAG.getConstant(1, TLI.getPointerTy()));
- if (!TLI.isLittleEndian())
- std::swap(Lo, Hi);
- ExpandScalarCallArgs(EVT, Lo, Flags, Ops, DAG, TLI, isFirst);
- ExpandScalarCallArgs(EVT, Hi, Flags, Ops, DAG, TLI, false);
- } else {
- // Value scalarized into many values. Unimp for now.
- assert(0 && "Cannot expand i64 -> i16 yet!");
- }
-}
-
/// TargetLowering::LowerCallTo - This is the default LowerCallTo
/// implementation, which just inserts an ISD::CALL node, which is later custom
/// lowered by the target to something concrete. FIXME: When all targets are
@@ -4014,35 +3931,24 @@
Ops.push_back(Op);
Ops.push_back(DAG.getConstant(Flags, MVT::i32));
break;
- case Expand:
- if (!MVT::isVector(VT)) {
- // If this is a large integer, it needs to be broken down into small
- // integers. Figure out what the source elt type is and how many small
- // integers it is.
- ExpandScalarCallArgs(VT, Op, Flags, Ops, DAG, *this);
- } else {
- // Otherwise, this is a vector type. We only support legal vectors
- // right now.
- const VectorType *PTy = cast(Args[i].Ty);
- unsigned NumElems = PTy->getNumElements();
- const Type *EltTy = PTy->getElementType();
-
- // Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the vector type.
- MVT::ValueType TVT =
- MVT::getVectorType(getValueType(EltTy), NumElems);
- if (TVT != MVT::Other && isTypeLegal(TVT)) {
- // Insert a BIT_CONVERT of the original type to the vector type.
- Op = DAG.getNode(ISD::BIT_CONVERT, TVT, Op);
- Ops.push_back(Op);
- Ops.push_back(DAG.getConstant(Flags, MVT::i32));
- } else {
- assert(0 && "Don't support illegal by-val vector call args yet!");
- abort();
- }
+ case Expand: {
+ MVT::ValueType PartVT = getRegisterType(VT);
+ unsigned NumParts = getNumRegisters(VT);
+ SmallVector Parts(NumParts);
+ getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT);
+ for (unsigned i = 0; i != NumParts; ++i) {
+ // if it isn't first piece, alignment must be 1
+ unsigned MyFlags = Flags;
+ if (i != 0)
+ MyFlags = (MyFlags & (~ISD::ParamFlags::OrigAlignment)) |
+ (1 << ISD::ParamFlags::OrigAlignmentOffs);
+
+ Ops.push_back(Parts[i]);
+ Ops.push_back(DAG.getConstant(MyFlags, MVT::i32));
}
break;
}
+ }
}
// Figure out the result value types.
@@ -4360,7 +4266,7 @@
// Copy the value by legal parts into sequential virtual registers.
getCopyToParts(DAG, Op, &Regs[0], NumRegs, RegisterVT);
- for (unsigned i = 0; i < NumRegs; ++i)
+ for (unsigned i = 0; i != NumRegs; ++i)
Chains[i] = DAG.getCopyToReg(getRoot(), Reg + i, Regs[i]);
return DAG.getNode(ISD::TokenFactor, MVT::Other, &Chains[0], NumRegs);
}
From djg at cray.com Mon Jul 2 11:21:53 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 16:21:53 -0000
Subject: [llvm-commits] [llvm] r37844 -
/llvm/trunk/lib/Target/X86/X86CallingConv.td
Message-ID: <200707021621.l62GLsPM029629@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 11:21:53 2007
New Revision: 37844
URL: http://llvm.org/viewvc/llvm-project?rev=37844&view=rev
Log:
Vector results may be returned in XMM0 and XMM1, not just XMM0. With
the recent lowering changes, this allows types like <4 x double> to
be returned, using two vector registers.
Modified:
llvm/trunk/lib/Target/X86/X86CallingConv.td
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=37844&r1=37843&r2=37844&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Mon Jul 2 11:21:53 2007
@@ -28,9 +28,10 @@
CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>,
CCIfType<[i64], CCAssignToReg<[RAX, RDX]>>,
- // Vector types are always returned in XMM0. If the target doesn't have XMM0,
- // it won't have vector types.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToReg<[XMM0]>>,
+ // Vector types are returned in XMM0 and XMM1, when they fit. If the target
+ // doesn't have XMM registers, it won't have vector types.
+ CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
+ CCAssignToReg<[XMM0,XMM1]>>,
// MMX vector types are always returned in MM0. If the target doesn't have
// MM0, it doesn't support these vector types.
From djg at cray.com Mon Jul 2 11:23:47 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 02 Jul 2007 16:23:47 -0000
Subject: [llvm-commits] [llvm] r37845 -
/llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll
Message-ID: <200707021623.l62GNlaG029742@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 2 11:23:47 2007
New Revision: 37845
URL: http://llvm.org/viewvc/llvm-project?rev=37845&view=rev
Log:
Add a basic test-case for passing and returning <4 x double> and
<8 x float> values on X86.
Added:
llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll
Added: llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll?rev=37845&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll (added)
+++ llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll Mon Jul 2 11:23:47 2007
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {mulpd %xmm3, %xmm1}
+; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {mulpd %xmm2, %xmm0}
+; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {addps %xmm3, %xmm1}
+; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {addps %xmm2, %xmm0}
+
+define <4 x double> @foo(<4 x double> %x, <4 x double> %z) {
+ %y = mul <4 x double> %x, %z
+ ret <4 x double> %y
+}
+
+define <8 x float> @bar(<8 x float> %x, <8 x float> %z) {
+ %y = add <8 x float> %x, %z
+ ret <8 x float> %y
+}
From tonic at nondot.org Mon Jul 2 13:10:53 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 02 Jul 2007 18:10:53 -0000
Subject: [llvm-commits] [llvm] r37846 - /llvm/trunk/CREDITS.TXT
Message-ID: <200707021810.l62IArba001515@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Jul 2 13:10:52 2007
New Revision: 37846
URL: http://llvm.org/viewvc/llvm-project?rev=37846&view=rev
Log:
Testing commit.
Modified:
llvm/trunk/CREDITS.TXT
Modified: llvm/trunk/CREDITS.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CREDITS.TXT?rev=37846&r1=37845&r2=37846&view=diff
==============================================================================
--- llvm/trunk/CREDITS.TXT (original)
+++ llvm/trunk/CREDITS.TXT Mon Jul 2 13:10:52 2007
@@ -146,7 +146,7 @@
W: http://nondot.org/~sabre/
D: Primary architect of LLVM
-N: Tanya Lattner (formerly Tanya Brethour)
+N: Tanya Lattner (Tanya Brethour)
E: tonic at nondot.org
W: http://nondot.org/~tonic/
D: The initial llvm-ar tool, converted regression testsuite to dejagnu
From clattner at apple.com Mon Jul 2 13:50:22 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 2 Jul 2007 11:50:22 -0700
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/CallingConvLower.h
SelectionDAG.h SelectionDAGNodes.h ValueTypes.h
In-Reply-To: <20070629194748.GS5693@village.us.cray.com>
References: <20070629194748.GS5693@village.us.cray.com>
Message-ID: <98A64F8D-BF44-4A48-A173-CB52BCFF7538@apple.com>
On Jun 29, 2007, at 12:47 PM, Dan Gohman wrote:
>>>
>>> I notice that several places use !MVT::isExtendedValueType(VT).
>>> Please add MVT::isSimpleValueType()
>
> After making a different change to TargetLowering.h following the
> review feedback,
> there are fewer of these. Fewer uses of isExtendedVT are negated
> than not now.
> I'd prefer to avoid having two different names to do essentially
> the same thing.
Ok, nice work on 8 x float btw!
-Chris
From clattner at apple.com Mon Jul 2 13:53:51 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 2 Jul 2007 11:53:51 -0700
Subject: [llvm-commits]
CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
LegalizeDAG.cpp SelectionDAG.cpp SelectionDAGISel.cpp
TargetLowering.cpp
In-Reply-To: <20070629193833.GR5693@village.us.cray.com>
References: <20070629193833.GR5693@village.us.cray.com>
Message-ID: <0C341E52-0053-4CA9-9175-221B86599970@apple.com>
On Jun 29, 2007, at 12:38 PM, Dan Gohman wrote:
>>> Just as there isn't a special ADD node kind for vectors -- just
>>> an ADD
>>> kind with nodes that can have a vector ValueType, ConstantFP can
>>> also
>>> be "vectorized". A ConstantFP with a vector ValueType is a vector
>>> constant,
>>> equivalent to what is currently represented as a splat BUILD_VECTOR,
>>> except that it's easier to work with :).
>>
>> I'm not opposed to doing this, but I don't think we should overload
>> ConstantFP() and getConstantFP() for this. Could you make a new
>> VectorConstantFP or something?
>
> We overload ISD::FADD and quite a lot of others. Why not
> ISD::ConstantFP too?
Fair enough, after pondering on it, I agree with you. The proposed
semantics are that a ConstantFP (and also a normal Constant?) produce
the splatted immediate value?
If so, this sounds fine. This should also reduce codegen memory
usage for many common cases, a very nice bonus :)
Please add a dag combine xform from build_vector [c,c,c,c] ->
constantfp and friends.
Thanks Dan,
-Chris
From dalej at apple.com Mon Jul 2 19:53:03 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 03 Jul 2007 00:53:03 -0000
Subject: [llvm-commits] [llvm] r37847 - in /llvm/trunk/lib:
CodeGen/SelectionDAG/ Target/X86/
Message-ID: <200707030053.l630r4O3013545@zion.cs.uiuc.edu>
Author: johannes
Date: Mon Jul 2 19:53:03 2007
New Revision: 37847
URL: http://llvm.org/viewvc/llvm-project?rev=37847&view=rev
Log:
Fix for PR 1505 (and 1489). Rewrite X87 register
model to include f32 variants. Some factoring
improvments forthcoming.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86InstrFPStack.td
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
llvm/trunk/lib/Target/X86/X86InstrSSE.td
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.td
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jul 2 19:53:03 2007
@@ -3016,11 +3016,33 @@
}
break;
+ case ISD::FP_ROUND:
+ if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) ==
+ TargetLowering::Expand) {
+ // The only way we can lower this is to turn it into a TRUNCSTORE,
+ // EXTLOAD pair, targetting a temporary location (a stack slot).
+
+ // NOTE: there is a choice here between constantly creating new stack
+ // slots and always reusing the same one. We currently always create
+ // new ones, as reuse may inhibit scheduling.
+ MVT::ValueType VT = Op.getValueType(); // 32
+ const Type *Ty = MVT::getTypeForValueType(VT);
+ uint64_t TySize = TLI.getTargetData()->getTypeSize(Ty);
+ unsigned Align = TLI.getTargetData()->getPrefTypeAlignment(Ty);
+ MachineFunction &MF = DAG.getMachineFunction();
+ int SSFI =
+ MF.getFrameInfo()->CreateStackObject(TySize, Align);
+ SDOperand StackSlot = DAG.getFrameIndex(SSFI, TLI.getPointerTy());
+ Result = DAG.getTruncStore(DAG.getEntryNode(), Node->getOperand(0),
+ StackSlot, NULL, 0, VT);
+ Result = DAG.getLoad(VT, Result, StackSlot, NULL, 0, VT);
+ break;
+ }
+ // FALL THROUGH
case ISD::ANY_EXTEND:
case ISD::ZERO_EXTEND:
case ISD::SIGN_EXTEND:
case ISD::FP_EXTEND:
- case ISD::FP_ROUND:
switch (getTypeAction(Node->getOperand(0).getValueType())) {
case Expand: assert(0 && "Shouldn't need to expand other operators here!");
case Legal:
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jul 2 19:53:03 2007
@@ -3918,15 +3918,7 @@
Op = DAG.getNode(ExtOp, getTypeToTransformTo(VT), Op);
} else {
assert(MVT::isFloatingPoint(VT) && "Not int or FP?");
- // A true promotion would change the size of the argument.
- // Instead, pretend this is an int. If FP objects are not
- // passed the same as ints, the original type should be Legal
- // and we should not get here.
- Op = DAG.getNode(ISD::BIT_CONVERT,
- VT==MVT::f32 ? MVT::i32 :
- (VT==MVT::f64 ? MVT::i64 :
- MVT::Other),
- Op);
+ Op = DAG.getNode(ISD::FP_EXTEND, getTypeToTransformTo(VT), Op);
}
Ops.push_back(Op);
Ops.push_back(DAG.getConstant(Flags, MVT::i32));
Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Mon Jul 2 19:53:03 2007
@@ -324,61 +324,101 @@
// concrete X86 instruction which uses the register stack.
//
static const TableEntry OpcodeTable[] = {
- { X86::FpABS , X86::FABS },
+ { X86::FpABS32 , X86::FABS },
+ { X86::FpABS64 , X86::FABS },
{ X86::FpADD32m , X86::FADD32m },
{ X86::FpADD64m , X86::FADD64m },
- { X86::FpCHS , X86::FCHS },
- { X86::FpCMOVB , X86::FCMOVB },
- { X86::FpCMOVBE , X86::FCMOVBE },
- { X86::FpCMOVE , X86::FCMOVE },
- { X86::FpCMOVNB , X86::FCMOVNB },
- { X86::FpCMOVNBE , X86::FCMOVNBE },
- { X86::FpCMOVNE , X86::FCMOVNE },
- { X86::FpCMOVNP , X86::FCMOVNP },
- { X86::FpCMOVP , X86::FCMOVP },
- { X86::FpCOS , X86::FCOS },
+ { X86::FpCHS32 , X86::FCHS },
+ { X86::FpCHS64 , X86::FCHS },
+ { X86::FpCMOVB32 , X86::FCMOVB },
+ { X86::FpCMOVB64 , X86::FCMOVB },
+ { X86::FpCMOVBE32 , X86::FCMOVBE },
+ { X86::FpCMOVBE64 , X86::FCMOVBE },
+ { X86::FpCMOVE32 , X86::FCMOVE },
+ { X86::FpCMOVE64 , X86::FCMOVE },
+ { X86::FpCMOVNB32 , X86::FCMOVNB },
+ { X86::FpCMOVNB64 , X86::FCMOVNB },
+ { X86::FpCMOVNBE32 , X86::FCMOVNBE },
+ { X86::FpCMOVNBE64 , X86::FCMOVNBE },
+ { X86::FpCMOVNE32 , X86::FCMOVNE },
+ { X86::FpCMOVNE64 , X86::FCMOVNE },
+ { X86::FpCMOVNP32 , X86::FCMOVNP },
+ { X86::FpCMOVNP64 , X86::FCMOVNP },
+ { X86::FpCMOVP32 , X86::FCMOVP },
+ { X86::FpCMOVP64 , X86::FCMOVP },
+ { X86::FpCOS32 , X86::FCOS },
+ { X86::FpCOS64 , X86::FCOS },
{ X86::FpDIV32m , X86::FDIV32m },
{ X86::FpDIV64m , X86::FDIV64m },
{ X86::FpDIVR32m , X86::FDIVR32m },
{ X86::FpDIVR64m , X86::FDIVR64m },
- { X86::FpIADD16m , X86::FIADD16m },
- { X86::FpIADD32m , X86::FIADD32m },
- { X86::FpIDIV16m , X86::FIDIV16m },
- { X86::FpIDIV32m , X86::FIDIV32m },
- { X86::FpIDIVR16m, X86::FIDIVR16m},
- { X86::FpIDIVR32m, X86::FIDIVR32m},
- { X86::FpILD16m , X86::FILD16m },
- { X86::FpILD32m , X86::FILD32m },
- { X86::FpILD64m , X86::FILD64m },
- { X86::FpIMUL16m , X86::FIMUL16m },
- { X86::FpIMUL32m , X86::FIMUL32m },
- { X86::FpIST16m , X86::FIST16m },
- { X86::FpIST32m , X86::FIST32m },
- { X86::FpIST64m , X86::FISTP64m },
- { X86::FpISTT16m , X86::FISTTP16m},
- { X86::FpISTT32m , X86::FISTTP32m},
- { X86::FpISTT64m , X86::FISTTP64m},
- { X86::FpISUB16m , X86::FISUB16m },
- { X86::FpISUB32m , X86::FISUB32m },
- { X86::FpISUBR16m, X86::FISUBR16m},
- { X86::FpISUBR32m, X86::FISUBR32m},
- { X86::FpLD0 , X86::FLD0 },
- { X86::FpLD1 , X86::FLD1 },
+ { X86::FpIADD16m32 , X86::FIADD16m },
+ { X86::FpIADD16m64 , X86::FIADD16m },
+ { X86::FpIADD32m32 , X86::FIADD32m },
+ { X86::FpIADD32m64 , X86::FIADD32m },
+ { X86::FpIDIV16m32 , X86::FIDIV16m },
+ { X86::FpIDIV16m64 , X86::FIDIV16m },
+ { X86::FpIDIV32m32 , X86::FIDIV32m },
+ { X86::FpIDIV32m64 , X86::FIDIV32m },
+ { X86::FpIDIVR16m32, X86::FIDIVR16m},
+ { X86::FpIDIVR16m64, X86::FIDIVR16m},
+ { X86::FpIDIVR32m32, X86::FIDIVR32m},
+ { X86::FpIDIVR32m64, X86::FIDIVR32m},
+ { X86::FpILD16m32 , X86::FILD16m },
+ { X86::FpILD16m64 , X86::FILD16m },
+ { X86::FpILD32m32 , X86::FILD32m },
+ { X86::FpILD32m64 , X86::FILD32m },
+ { X86::FpILD64m32 , X86::FILD64m },
+ { X86::FpILD64m64 , X86::FILD64m },
+ { X86::FpIMUL16m32 , X86::FIMUL16m },
+ { X86::FpIMUL16m64 , X86::FIMUL16m },
+ { X86::FpIMUL32m32 , X86::FIMUL32m },
+ { X86::FpIMUL32m64 , X86::FIMUL32m },
+ { X86::FpIST16m32 , X86::FIST16m },
+ { X86::FpIST16m64 , X86::FIST16m },
+ { X86::FpIST32m32 , X86::FIST32m },
+ { X86::FpIST32m64 , X86::FIST32m },
+ { X86::FpIST64m32 , X86::FISTP64m },
+ { X86::FpIST64m64 , X86::FISTP64m },
+ { X86::FpISTT16m32 , X86::FISTTP16m},
+ { X86::FpISTT16m64 , X86::FISTTP16m},
+ { X86::FpISTT32m32 , X86::FISTTP32m},
+ { X86::FpISTT32m64 , X86::FISTTP32m},
+ { X86::FpISTT64m32 , X86::FISTTP64m},
+ { X86::FpISTT64m64 , X86::FISTTP64m},
+ { X86::FpISUB16m32 , X86::FISUB16m },
+ { X86::FpISUB16m64 , X86::FISUB16m },
+ { X86::FpISUB32m32 , X86::FISUB32m },
+ { X86::FpISUB32m64 , X86::FISUB32m },
+ { X86::FpISUBR16m32, X86::FISUBR16m},
+ { X86::FpISUBR16m64, X86::FISUBR16m},
+ { X86::FpISUBR32m32, X86::FISUBR32m},
+ { X86::FpISUBR32m64, X86::FISUBR32m},
+ { X86::FpLD032 , X86::FLD0 },
+ { X86::FpLD064 , X86::FLD0 },
+ { X86::FpLD132 , X86::FLD1 },
+ { X86::FpLD164 , X86::FLD1 },
{ X86::FpLD32m , X86::FLD32m },
{ X86::FpLD64m , X86::FLD64m },
{ X86::FpMUL32m , X86::FMUL32m },
{ X86::FpMUL64m , X86::FMUL64m },
- { X86::FpSIN , X86::FSIN },
- { X86::FpSQRT , X86::FSQRT },
+ { X86::FpSIN32 , X86::FSIN },
+ { X86::FpSIN64 , X86::FSIN },
+ { X86::FpSQRT32 , X86::FSQRT },
+ { X86::FpSQRT64 , X86::FSQRT },
{ X86::FpST32m , X86::FST32m },
{ X86::FpST64m , X86::FST64m },
+ { X86::FpST64m32 , X86::FST32m },
{ X86::FpSUB32m , X86::FSUB32m },
{ X86::FpSUB64m , X86::FSUB64m },
{ X86::FpSUBR32m , X86::FSUBR32m },
{ X86::FpSUBR64m , X86::FSUBR64m },
- { X86::FpTST , X86::FTST },
- { X86::FpUCOMIr , X86::FUCOMIr },
- { X86::FpUCOMr , X86::FUCOMr },
+ { X86::FpTST32 , X86::FTST },
+ { X86::FpTST64 , X86::FTST },
+ { X86::FpUCOMIr32 , X86::FUCOMIr },
+ { X86::FpUCOMIr64 , X86::FUCOMIr },
+ { X86::FpUCOMr32 , X86::FUCOMr },
+ { X86::FpUCOMr64 , X86::FUCOMr },
};
static unsigned getConcreteOpcode(unsigned Opcode) {
@@ -510,10 +550,14 @@
// Ditto FISTTP16m, FISTTP32m, FISTTP64m.
//
if (!KillsSrc &&
- (MI->getOpcode() == X86::FpIST64m ||
- MI->getOpcode() == X86::FpISTT16m ||
- MI->getOpcode() == X86::FpISTT32m ||
- MI->getOpcode() == X86::FpISTT64m)) {
+ (MI->getOpcode() == X86::FpIST64m32 ||
+ MI->getOpcode() == X86::FpISTT16m32 ||
+ MI->getOpcode() == X86::FpISTT32m32 ||
+ MI->getOpcode() == X86::FpISTT64m32 ||
+ MI->getOpcode() == X86::FpIST64m64 ||
+ MI->getOpcode() == X86::FpISTT16m64 ||
+ MI->getOpcode() == X86::FpISTT32m64 ||
+ MI->getOpcode() == X86::FpISTT64m64)) {
duplicateToTop(Reg, 7 /*temp register*/, I);
} else {
moveToTop(Reg, I); // Move to the top of the stack...
@@ -578,34 +622,50 @@
// ForwardST0Table - Map: A = B op C into: ST(0) = ST(0) op ST(i)
static const TableEntry ForwardST0Table[] = {
- { X86::FpADD , X86::FADDST0r },
- { X86::FpDIV , X86::FDIVST0r },
- { X86::FpMUL , X86::FMULST0r },
- { X86::FpSUB , X86::FSUBST0r },
+ { X86::FpADD32 , X86::FADDST0r },
+ { X86::FpADD64 , X86::FADDST0r },
+ { X86::FpDIV32 , X86::FDIVST0r },
+ { X86::FpDIV64 , X86::FDIVST0r },
+ { X86::FpMUL32 , X86::FMULST0r },
+ { X86::FpMUL64 , X86::FMULST0r },
+ { X86::FpSUB32 , X86::FSUBST0r },
+ { X86::FpSUB64 , X86::FSUBST0r },
};
// ReverseST0Table - Map: A = B op C into: ST(0) = ST(i) op ST(0)
static const TableEntry ReverseST0Table[] = {
- { X86::FpADD , X86::FADDST0r }, // commutative
- { X86::FpDIV , X86::FDIVRST0r },
- { X86::FpMUL , X86::FMULST0r }, // commutative
- { X86::FpSUB , X86::FSUBRST0r },
+ { X86::FpADD32 , X86::FADDST0r }, // commutative
+ { X86::FpADD64 , X86::FADDST0r }, // commutative
+ { X86::FpDIV32 , X86::FDIVRST0r },
+ { X86::FpDIV64 , X86::FDIVRST0r },
+ { X86::FpMUL32 , X86::FMULST0r }, // commutative
+ { X86::FpMUL64 , X86::FMULST0r }, // commutative
+ { X86::FpSUB32 , X86::FSUBRST0r },
+ { X86::FpSUB64 , X86::FSUBRST0r },
};
// ForwardSTiTable - Map: A = B op C into: ST(i) = ST(0) op ST(i)
static const TableEntry ForwardSTiTable[] = {
- { X86::FpADD , X86::FADDrST0 }, // commutative
- { X86::FpDIV , X86::FDIVRrST0 },
- { X86::FpMUL , X86::FMULrST0 }, // commutative
- { X86::FpSUB , X86::FSUBRrST0 },
+ { X86::FpADD32 , X86::FADDrST0 }, // commutative
+ { X86::FpADD64 , X86::FADDrST0 }, // commutative
+ { X86::FpDIV32 , X86::FDIVRrST0 },
+ { X86::FpDIV64 , X86::FDIVRrST0 },
+ { X86::FpMUL32 , X86::FMULrST0 }, // commutative
+ { X86::FpMUL64 , X86::FMULrST0 }, // commutative
+ { X86::FpSUB32 , X86::FSUBRrST0 },
+ { X86::FpSUB64 , X86::FSUBRrST0 },
};
// ReverseSTiTable - Map: A = B op C into: ST(i) = ST(i) op ST(0)
static const TableEntry ReverseSTiTable[] = {
- { X86::FpADD , X86::FADDrST0 },
- { X86::FpDIV , X86::FDIVrST0 },
- { X86::FpMUL , X86::FMULrST0 },
- { X86::FpSUB , X86::FSUBrST0 },
+ { X86::FpADD32 , X86::FADDrST0 },
+ { X86::FpADD64 , X86::FADDrST0 },
+ { X86::FpDIV32 , X86::FDIVrST0 },
+ { X86::FpDIV64 , X86::FDIVrST0 },
+ { X86::FpMUL32 , X86::FMULrST0 },
+ { X86::FpMUL64 , X86::FMULrST0 },
+ { X86::FpSUB32 , X86::FSUBrST0 },
+ { X86::FpSUB64 , X86::FSUBrST0 },
};
@@ -777,15 +837,20 @@
MachineInstr *MI = I;
switch (MI->getOpcode()) {
default: assert(0 && "Unknown SpecialFP instruction!");
- case X86::FpGETRESULT: // Appears immediately after a call returning FP type!
+ case X86::FpGETRESULT32: // Appears immediately after a call returning FP type!
+ case X86::FpGETRESULT64: // Appears immediately after a call returning FP type!
assert(StackTop == 0 && "Stack should be empty after a call!");
pushReg(getFPReg(MI->getOperand(0)));
break;
- case X86::FpSETRESULT:
+ case X86::FpSETRESULT32:
+ case X86::FpSETRESULT64:
assert(StackTop == 1 && "Stack should have one element on it to return!");
--StackTop; // "Forget" we have something on the top of stack!
break;
- case X86::FpMOV: {
+ case X86::FpMOV3232:
+ case X86::FpMOV3264:
+ case X86::FpMOV6432:
+ case X86::FpMOV6464: {
unsigned SrcReg = getFPReg(MI->getOperand(1));
unsigned DestReg = getFPReg(MI->getOperand(0));
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Jul 2 19:53:03 2007
@@ -492,11 +492,13 @@
for (MachineBasicBlock::iterator I = MBBI->begin(), E = MBBI->end();
!ContainsFPCode && I != E; ++I) {
if (I->getNumOperands() != 0 && I->getOperand(0).isRegister()) {
+ const TargetRegisterClass *clas;
for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) {
if (I->getOperand(op).isRegister() && I->getOperand(op).isDef() &&
MRegisterInfo::isVirtualRegister(I->getOperand(op).getReg()) &&
- RegMap->getRegClass(I->getOperand(0).getReg()) ==
- X86::RFPRegisterClass) {
+ ((clas = RegMap->getRegClass(I->getOperand(0).getReg())) ==
+ X86::RFP32RegisterClass ||
+ clas == X86::RFP64RegisterClass)) {
ContainsFPCode = true;
break;
}
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jul 2 19:53:03 2007
@@ -289,11 +289,14 @@
addLegalFPImmediate(+0.0); // xorps / xorpd
} else {
// Set up the FP register classes.
- addRegisterClass(MVT::f64, X86::RFPRegisterClass);
+ addRegisterClass(MVT::f64, X86::RFP64RegisterClass);
+ addRegisterClass(MVT::f32, X86::RFP32RegisterClass);
setOperationAction(ISD::UNDEF, MVT::f64, Expand);
+ setOperationAction(ISD::UNDEF, MVT::f32, Expand);
setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
+ setOperationAction(ISD::FP_ROUND, MVT::f32, Expand);
if (!UnsafeFPMath) {
setOperationAction(ISD::FSIN , MVT::f64 , Expand);
@@ -301,6 +304,7 @@
}
setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
+ setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
addLegalFPImmediate(+0.0); // FLD0
addLegalFPImmediate(+1.0); // FLD1
addLegalFPImmediate(-0.0); // FLD0/FCHS
@@ -553,7 +557,7 @@
MemLoc = DAG.getFrameIndex(SSFI, getPointerTy());
Chain = DAG.getStore(Op.getOperand(0), Value, MemLoc, NULL, 0);
}
- SDVTList Tys = DAG.getVTList(MVT::f64, MVT::Other);
+ SDVTList Tys = DAG.getVTList(RVLocs[0].getValVT(), MVT::Other);
SDOperand Ops[] = {Chain, MemLoc, DAG.getValueType(RVLocs[0].getValVT())};
Value = DAG.getNode(X86ISD::FLD, Tys, Ops, 3);
Chain = Value.getValue(1);
@@ -604,7 +608,7 @@
// before the fp stackifier runs.
// Copy ST0 into an RFP register with FP_GET_RESULT.
- SDVTList Tys = DAG.getVTList(MVT::f64, MVT::Other, MVT::Flag);
+ SDVTList Tys = DAG.getVTList(RVLocs[0].getValVT(), MVT::Other, MVT::Flag);
SDOperand GROps[] = { Chain, InFlag };
SDOperand RetVal = DAG.getNode(X86ISD::FP_GET_RESULT, Tys, GROps, 2);
Chain = RetVal.getValue(1);
@@ -626,11 +630,6 @@
RetVal = DAG.getLoad(RVLocs[0].getValVT(), Chain, StackSlot, NULL, 0);
Chain = RetVal.getValue(1);
}
-
- if (RVLocs[0].getValVT() == MVT::f32 && !X86ScalarSSE)
- // FIXME: we would really like to remember that this FP_ROUND
- // operation is okay to eliminate if we allow excess FP precision.
- RetVal = DAG.getNode(ISD::FP_ROUND, MVT::f32, RetVal);
ResultVals.push_back(RetVal);
}
@@ -3252,7 +3251,7 @@
if (X86ScalarSSE)
Tys = DAG.getVTList(MVT::f64, MVT::Other, MVT::Flag);
else
- Tys = DAG.getVTList(MVT::f64, MVT::Other);
+ Tys = DAG.getVTList(Op.getValueType(), MVT::Other);
SmallVector Ops;
Ops.push_back(Chain);
Ops.push_back(StackSlot);
@@ -3307,7 +3306,7 @@
if (X86ScalarSSE) {
assert(Op.getValueType() == MVT::i64 && "Invalid FP_TO_SINT to lower!");
Chain = DAG.getStore(Chain, Value, StackSlot, NULL, 0);
- SDVTList Tys = DAG.getVTList(MVT::f64, MVT::Other);
+ SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(), MVT::Other);
SDOperand Ops[] = {
Chain, StackSlot, DAG.getValueType(Op.getOperand(0).getValueType())
};
@@ -4437,9 +4436,12 @@
return BB;
}
- case X86::FP_TO_INT16_IN_MEM:
- case X86::FP_TO_INT32_IN_MEM:
- case X86::FP_TO_INT64_IN_MEM: {
+ case X86::FP32_TO_INT16_IN_MEM:
+ case X86::FP32_TO_INT32_IN_MEM:
+ case X86::FP32_TO_INT64_IN_MEM:
+ case X86::FP64_TO_INT16_IN_MEM:
+ case X86::FP64_TO_INT32_IN_MEM:
+ case X86::FP64_TO_INT64_IN_MEM: {
// Change the floating point control register to use "round towards zero"
// mode when truncating to an integer value.
MachineFunction *F = BB->getParent();
@@ -4466,9 +4468,12 @@
unsigned Opc;
switch (MI->getOpcode()) {
default: assert(0 && "illegal opcode!");
- case X86::FP_TO_INT16_IN_MEM: Opc = X86::FpIST16m; break;
- case X86::FP_TO_INT32_IN_MEM: Opc = X86::FpIST32m; break;
- case X86::FP_TO_INT64_IN_MEM: Opc = X86::FpIST64m; break;
+ case X86::FP32_TO_INT16_IN_MEM: Opc = X86::FpIST16m32; break;
+ case X86::FP32_TO_INT32_IN_MEM: Opc = X86::FpIST32m32; break;
+ case X86::FP32_TO_INT64_IN_MEM: Opc = X86::FpIST64m32; break;
+ case X86::FP64_TO_INT16_IN_MEM: Opc = X86::FpIST16m64; break;
+ case X86::FP64_TO_INT32_IN_MEM: Opc = X86::FpIST32m64; break;
+ case X86::FP64_TO_INT64_IN_MEM: Opc = X86::FpIST64m64; break;
}
X86AddressMode AM;
Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Mon Jul 2 19:53:03 2007
@@ -17,13 +17,13 @@
// FPStack specific DAG Nodes.
//===----------------------------------------------------------------------===//
-def SDTX86FpGet : SDTypeProfile<1, 0, [SDTCisVT<0, f64>]>;
+def SDTX86FpGet : SDTypeProfile<1, 0, [SDTCisFP<0>]>;
def SDTX86FpSet : SDTypeProfile<0, 1, [SDTCisFP<0>]>;
-def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisVT<0, f64>,
+def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>,
SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>;
def SDTX86Fst : SDTypeProfile<0, 3, [SDTCisFP<0>,
SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>;
-def SDTX86Fild : SDTypeProfile<1, 2, [SDTCisVT<0, f64>, SDTCisPtrTy<1>,
+def SDTX86Fild : SDTypeProfile<1, 2, [SDTCisFP<0>, SDTCisPtrTy<1>,
SDTCisVT<2, OtherVT>]>;
def SDTX86FpToIMem: SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>;
@@ -50,19 +50,19 @@
// FPStack pattern fragments
//===----------------------------------------------------------------------===//
-def fp64imm0 : PatLeaf<(f64 fpimm), [{
+def fpimm0 : PatLeaf<(fpimm), [{
return N->isExactlyValue(+0.0);
}]>;
-def fp64immneg0 : PatLeaf<(f64 fpimm), [{
+def fpimmneg0 : PatLeaf<(fpimm), [{
return N->isExactlyValue(-0.0);
}]>;
-def fp64imm1 : PatLeaf<(f64 fpimm), [{
+def fpimm1 : PatLeaf<(fpimm), [{
return N->isExactlyValue(+1.0);
}]>;
-def fp64immneg1 : PatLeaf<(f64 fpimm), [{
+def fpimmneg1 : PatLeaf<(fpimm), [{
return N->isExactlyValue(-1.0);
}]>;
@@ -70,18 +70,30 @@
// Some 'special' instructions
let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
- def FP_TO_INT16_IN_MEM : I<0, Pseudo,
- (ops i16mem:$dst, RFP:$src),
- "#FP_TO_INT16_IN_MEM PSEUDO!",
- [(X86fp_to_i16mem RFP:$src, addr:$dst)]>;
- def FP_TO_INT32_IN_MEM : I<0, Pseudo,
- (ops i32mem:$dst, RFP:$src),
- "#FP_TO_INT32_IN_MEM PSEUDO!",
- [(X86fp_to_i32mem RFP:$src, addr:$dst)]>;
- def FP_TO_INT64_IN_MEM : I<0, Pseudo,
- (ops i64mem:$dst, RFP:$src),
- "#FP_TO_INT64_IN_MEM PSEUDO!",
- [(X86fp_to_i64mem RFP:$src, addr:$dst)]>;
+ def FP32_TO_INT16_IN_MEM : I<0, Pseudo,
+ (ops i16mem:$dst, RFP32:$src),
+ "#FP32_TO_INT16_IN_MEM PSEUDO!",
+ [(X86fp_to_i16mem RFP32:$src, addr:$dst)]>;
+ def FP32_TO_INT32_IN_MEM : I<0, Pseudo,
+ (ops i32mem:$dst, RFP32:$src),
+ "#FP32_TO_INT32_IN_MEM PSEUDO!",
+ [(X86fp_to_i32mem RFP32:$src, addr:$dst)]>;
+ def FP32_TO_INT64_IN_MEM : I<0, Pseudo,
+ (ops i64mem:$dst, RFP32:$src),
+ "#FP32_TO_INT64_IN_MEM PSEUDO!",
+ [(X86fp_to_i64mem RFP32:$src, addr:$dst)]>;
+ def FP64_TO_INT16_IN_MEM : I<0, Pseudo,
+ (ops i16mem:$dst, RFP64:$src),
+ "#FP64_TO_INT16_IN_MEM PSEUDO!",
+ [(X86fp_to_i16mem RFP64:$src, addr:$dst)]>;
+ def FP64_TO_INT32_IN_MEM : I<0, Pseudo,
+ (ops i32mem:$dst, RFP64:$src),
+ "#FP64_TO_INT32_IN_MEM PSEUDO!",
+ [(X86fp_to_i32mem RFP64:$src, addr:$dst)]>;
+ def FP64_TO_INT64_IN_MEM : I<0, Pseudo,
+ (ops i64mem:$dst, RFP64:$src),
+ "#FP64_TO_INT64_IN_MEM PSEUDO!",
+ [(X86fp_to_i64mem RFP64:$src, addr:$dst)]>;
}
let isTerminator = 1 in
@@ -111,30 +123,47 @@
}
// Random Pseudo Instructions.
-def FpGETRESULT : FpI_<(ops RFP:$dst), SpecialFP,
- [(set RFP:$dst, X86fpget)]>; // FPR = ST(0)
+def FpGETRESULT32 : FpI_<(ops RFP32:$dst), SpecialFP,
+ [(set RFP32:$dst, X86fpget)]>; // FPR = ST(0)
-let noResults = 1 in
- def FpSETRESULT : FpI_<(ops RFP:$src), SpecialFP,
- [(X86fpset RFP:$src)]>, Imp<[], [ST0]>; // ST(0) = FPR
+def FpGETRESULT64 : FpI_<(ops RFP64:$dst), SpecialFP,
+ [(set RFP64:$dst, X86fpget)]>; // FPR = ST(0)
+let noResults = 1 in {
+ def FpSETRESULT32 : FpI_<(ops RFP32:$src), SpecialFP,
+ [(X86fpset RFP32:$src)]>, Imp<[], [ST0]>; // ST(0) = FPR
+
+ def FpSETRESULT64 : FpI_<(ops RFP64:$src), SpecialFP,
+ [(X86fpset RFP64:$src)]>, Imp<[], [ST0]>; // ST(0) = FPR
+}
// FpI - Floating Point Psuedo Instruction template. Predicated on FPStack.
class FpI pattern> :
FpI_, Requires<[FPStack]>;
-
-def FpMOV : FpI<(ops RFP:$dst, RFP:$src), SpecialFP, []>; // f1 = fmov f2
+// Register copies. Just copies, the 64->32 version does not truncate.
+def FpMOV3232 : FpI<(ops RFP32:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2
+def FpMOV3264 : FpI<(ops RFP64:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2
+def FpMOV6432 : FpI<(ops RFP32:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2
+def FpMOV6464 : FpI<(ops RFP64:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2
// Arithmetic
// Add, Sub, Mul, Div.
-def FpADD : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), TwoArgFP,
- [(set RFP:$dst, (fadd RFP:$src1, RFP:$src2))]>;
-def FpSUB : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), TwoArgFP,
- [(set RFP:$dst, (fsub RFP:$src1, RFP:$src2))]>;
-def FpMUL : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), TwoArgFP,
- [(set RFP:$dst, (fmul RFP:$src1, RFP:$src2))]>;
-def FpDIV : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), TwoArgFP,
- [(set RFP:$dst, (fdiv RFP:$src1, RFP:$src2))]>;
+def FpADD32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
+ [(set RFP32:$dst, (fadd RFP32:$src1, RFP32:$src2))]>;
+def FpSUB32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
+ [(set RFP32:$dst, (fsub RFP32:$src1, RFP32:$src2))]>;
+def FpMUL32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
+ [(set RFP32:$dst, (fmul RFP32:$src1, RFP32:$src2))]>;
+def FpDIV32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
+ [(set RFP32:$dst, (fdiv RFP32:$src1, RFP32:$src2))]>;
+def FpADD64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
+ [(set RFP64:$dst, (fadd RFP64:$src1, RFP64:$src2))]>;
+def FpSUB64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
+ [(set RFP64:$dst, (fsub RFP64:$src1, RFP64:$src2))]>;
+def FpMUL64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
+ [(set RFP64:$dst, (fmul RFP64:$src1, RFP64:$src2))]>;
+def FpDIV64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
+ [(set RFP64:$dst, (fdiv RFP64:$src1, RFP64:$src2))]>;
class FPST0rInst o, string asm>
: FPI, D8;
@@ -144,47 +173,41 @@
: FPI, DE;
// Binary Ops with a memory source.
-def FpADD32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fadd RFP:$src1,
- (extloadf64f32 addr:$src2)))]>;
+def FpADD32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fadd RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) + [mem32]
-def FpADD64m : FpI<(ops RFP:$dst, RFP:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fadd RFP:$src1, (loadf64 addr:$src2)))]>;
+def FpADD64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fadd RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) + [mem64]
-def FpMUL32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fmul RFP:$src1,
- (extloadf64f32 addr:$src2)))]>;
+def FpMUL32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fmul RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) * [mem32]
-def FpMUL64m : FpI<(ops RFP:$dst, RFP:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fmul RFP:$src1, (loadf64 addr:$src2)))]>;
+def FpMUL64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fmul RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) * [mem64]
-def FpSUB32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub RFP:$src1,
- (extloadf64f32 addr:$src2)))]>;
+def FpSUB32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) - [mem32]
-def FpSUB64m : FpI<(ops RFP:$dst, RFP:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub RFP:$src1, (loadf64 addr:$src2)))]>;
+def FpSUB64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) - [mem64]
-def FpSUBR32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub (extloadf64f32 addr:$src2),
- RFP:$src1))]>;
+def FpSUBR32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub (loadf32 addr:$src2), RFP32:$src1))]>;
// ST(0) = [mem32] - ST(0)
-def FpSUBR64m : FpI<(ops RFP:$dst, RFP:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub (loadf64 addr:$src2), RFP:$src1))]>;
+def FpSUBR64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub (loadf64 addr:$src2), RFP64:$src1))]>;
// ST(0) = [mem64] - ST(0)
-def FpDIV32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv RFP:$src1,
- (extloadf64f32 addr:$src2)))]>;
+def FpDIV32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) / [mem32]
-def FpDIV64m : FpI<(ops RFP:$dst, RFP:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv RFP:$src1, (loadf64 addr:$src2)))]>;
+def FpDIV64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) / [mem64]
-def FpDIVR32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv (extloadf64f32 addr:$src2),
- RFP:$src1))]>;
+def FpDIVR32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv (loadf32 addr:$src2), RFP32:$src1))]>;
// ST(0) = [mem32] / ST(0)
-def FpDIVR64m : FpI<(ops RFP:$dst, RFP:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv (loadf64 addr:$src2), RFP:$src1))]>;
+def FpDIVR64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv (loadf64 addr:$src2), RFP64:$src1))]>;
// ST(0) = [mem64] / ST(0)
@@ -201,53 +224,102 @@
def FDIVR32m : FPI<0xD8, MRM7m, (ops f32mem:$src), "fdivr{s} $src">;
def FDIVR64m : FPI<0xDC, MRM7m, (ops f64mem:$src), "fdivr{l} $src">;
-def FpIADD16m : FpI<(ops RFP:$dst, RFP:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fadd RFP:$src1,
+def FpIADD16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fadd RFP32:$src1,
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) + [mem16int]
+def FpIADD32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fadd RFP32:$src1,
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) + [mem32int]
+def FpIMUL16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fmul RFP32:$src1,
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) * [mem16int]
+def FpIMUL32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fmul RFP32:$src1,
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) * [mem32int]
+def FpISUB16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub RFP32:$src1,
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) - [mem16int]
+def FpISUB32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub RFP32:$src1,
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) - [mem32int]
+def FpISUBR16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub (X86fild addr:$src2, i16),
+ RFP32:$src1))]>;
+ // ST(0) = [mem16int] - ST(0)
+def FpISUBR32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub (X86fild addr:$src2, i32),
+ RFP32:$src1))]>;
+ // ST(0) = [mem32int] - ST(0)
+def FpIDIV16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv RFP32:$src1,
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) / [mem16int]
+def FpIDIV32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv RFP32:$src1,
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) / [mem32int]
+def FpIDIVR16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i16),
+ RFP32:$src1))]>;
+ // ST(0) = [mem16int] / ST(0)
+def FpIDIVR32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i32),
+ RFP32:$src1))]>;
+ // ST(0) = [mem32int] / ST(0)
+
+def FpIADD16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fadd RFP64:$src1,
(X86fild addr:$src2, i16)))]>;
// ST(0) = ST(0) + [mem16int]
-def FpIADD32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fadd RFP:$src1,
+def FpIADD32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fadd RFP64:$src1,
(X86fild addr:$src2, i32)))]>;
// ST(0) = ST(0) + [mem32int]
-def FpIMUL16m : FpI<(ops RFP:$dst, RFP:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fmul RFP:$src1,
+def FpIMUL16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fmul RFP64:$src1,
(X86fild addr:$src2, i16)))]>;
// ST(0) = ST(0) * [mem16int]
-def FpIMUL32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fmul RFP:$src1,
+def FpIMUL32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fmul RFP64:$src1,
(X86fild addr:$src2, i32)))]>;
// ST(0) = ST(0) * [mem32int]
-def FpISUB16m : FpI<(ops RFP:$dst, RFP:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub RFP:$src1,
+def FpISUB16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub RFP64:$src1,
(X86fild addr:$src2, i16)))]>;
// ST(0) = ST(0) - [mem16int]
-def FpISUB32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub RFP:$src1,
+def FpISUB32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub RFP64:$src1,
(X86fild addr:$src2, i32)))]>;
// ST(0) = ST(0) - [mem32int]
-def FpISUBR16m : FpI<(ops RFP:$dst, RFP:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub (X86fild addr:$src2, i16),
- RFP:$src1))]>;
+def FpISUBR16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub (X86fild addr:$src2, i16),
+ RFP64:$src1))]>;
// ST(0) = [mem16int] - ST(0)
-def FpISUBR32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fsub (X86fild addr:$src2, i32),
- RFP:$src1))]>;
+def FpISUBR32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub (X86fild addr:$src2, i32),
+ RFP64:$src1))]>;
// ST(0) = [mem32int] - ST(0)
-def FpIDIV16m : FpI<(ops RFP:$dst, RFP:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv RFP:$src1,
+def FpIDIV16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv RFP64:$src1,
(X86fild addr:$src2, i16)))]>;
// ST(0) = ST(0) / [mem16int]
-def FpIDIV32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv RFP:$src1,
+def FpIDIV32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv RFP64:$src1,
(X86fild addr:$src2, i32)))]>;
// ST(0) = ST(0) / [mem32int]
-def FpIDIVR16m : FpI<(ops RFP:$dst, RFP:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv (X86fild addr:$src2, i16),
- RFP:$src1))]>;
+def FpIDIVR16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i16),
+ RFP64:$src1))]>;
// ST(0) = [mem16int] / ST(0)
-def FpIDIVR32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fdiv (X86fild addr:$src2, i32),
- RFP:$src1))]>;
+def FpIDIVR32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i32),
+ RFP64:$src1))]>;
// ST(0) = [mem32int] / ST(0)
def FIADD16m : FPI<0xDE, MRM0m, (ops i16mem:$src), "fiadd{s} $src">;
@@ -285,19 +357,31 @@
def FDIVRrST0 : FPrST0Inst <0xF0, "fdiv{|r} {%st(0), $op|$op, %ST(0)}">;
def FDIVRPrST0 : FPrST0PInst<0xF0, "fdiv{|r}p $op">;
-
// Unary operations.
-def FpCHS : FpI<(ops RFP:$dst, RFP:$src), OneArgFPRW,
- [(set RFP:$dst, (fneg RFP:$src))]>;
-def FpABS : FpI<(ops RFP:$dst, RFP:$src), OneArgFPRW,
- [(set RFP:$dst, (fabs RFP:$src))]>;
-def FpSQRT : FpI<(ops RFP:$dst, RFP:$src), OneArgFPRW,
- [(set RFP:$dst, (fsqrt RFP:$src))]>;
-def FpSIN : FpI<(ops RFP:$dst, RFP:$src), OneArgFPRW,
- [(set RFP:$dst, (fsin RFP:$src))]>;
-def FpCOS : FpI<(ops RFP:$dst, RFP:$src), OneArgFPRW,
- [(set RFP:$dst, (fcos RFP:$src))]>;
-def FpTST : FpI<(ops RFP:$src), OneArgFP,
+def FpCHS32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
+ [(set RFP32:$dst, (fneg RFP32:$src))]>;
+def FpABS32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
+ [(set RFP32:$dst, (fabs RFP32:$src))]>;
+def FpSQRT32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
+ [(set RFP32:$dst, (fsqrt RFP32:$src))]>;
+def FpSIN32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
+ [(set RFP32:$dst, (fsin RFP32:$src))]>;
+def FpCOS32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
+ [(set RFP32:$dst, (fcos RFP32:$src))]>;
+def FpTST32 : FpI<(ops RFP32:$src), OneArgFP,
+ []>;
+
+def FpCHS64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
+ [(set RFP64:$dst, (fneg RFP64:$src))]>;
+def FpABS64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
+ [(set RFP64:$dst, (fabs RFP64:$src))]>;
+def FpSQRT64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
+ [(set RFP64:$dst, (fsqrt RFP64:$src))]>;
+def FpSIN64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
+ [(set RFP64:$dst, (fsin RFP64:$src))]>;
+def FpCOS64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
+ [(set RFP64:$dst, (fcos RFP64:$src))]>;
+def FpTST64 : FpI<(ops RFP64:$src), OneArgFP,
[]>;
def FCHS : FPI<0xE0, RawFrm, (ops), "fchs">, D9;
@@ -310,29 +394,54 @@
// Floating point cmovs.
let isTwoAddress = 1 in {
- def FpCMOVB : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVB32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_B))]>;
- def FpCMOVBE : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVBE32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_BE))]>;
- def FpCMOVE : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVE32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_E))]>;
- def FpCMOVP : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVP32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_P))]>;
- def FpCMOVNB : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVNB32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_AE))]>;
- def FpCMOVNBE: FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVNBE32: FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_A))]>;
- def FpCMOVNE : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVNE32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
X86_COND_NE))]>;
- def FpCMOVNP : FpI<(ops RFP:$dst, RFP:$src1, RFP:$src2), CondMovFP,
- [(set RFP:$dst, (X86cmov RFP:$src1, RFP:$src2,
+ def FpCMOVNP32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
+ [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
+ X86_COND_NP))]>;
+
+ def FpCMOVB64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_B))]>;
+ def FpCMOVBE64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_BE))]>;
+ def FpCMOVE64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_E))]>;
+ def FpCMOVP64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_P))]>;
+ def FpCMOVNB64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_AE))]>;
+ def FpCMOVNBE64: FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_A))]>;
+ def FpCMOVNE64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
+ X86_COND_NE))]>;
+ def FpCMOVNP64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
+ [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
X86_COND_NP))]>;
}
@@ -354,27 +463,39 @@
"fcmovnu {$op, %st(0)|%ST(0), $op}">, DB;
// Floating point loads & stores.
-def FpLD32m : FpI<(ops RFP:$dst, f32mem:$src), ZeroArgFP,
- [(set RFP:$dst, (extloadf64f32 addr:$src))]>;
-def FpLD64m : FpI<(ops RFP:$dst, f64mem:$src), ZeroArgFP,
- [(set RFP:$dst, (loadf64 addr:$src))]>;
-def FpILD16m : FpI<(ops RFP:$dst, i16mem:$src), ZeroArgFP,
- [(set RFP:$dst, (X86fild addr:$src, i16))]>;
-def FpILD32m : FpI<(ops RFP:$dst, i32mem:$src), ZeroArgFP,
- [(set RFP:$dst, (X86fild addr:$src, i32))]>;
-def FpILD64m : FpI<(ops RFP:$dst, i64mem:$src), ZeroArgFP,
- [(set RFP:$dst, (X86fild addr:$src, i64))]>;
-
-def FpST32m : FpI<(ops f32mem:$op, RFP:$src), OneArgFP,
- [(truncstoref32 RFP:$src, addr:$op)]>;
-def FpST64m : FpI<(ops f64mem:$op, RFP:$src), OneArgFP,
- [(store RFP:$src, addr:$op)]>;
-
-def FpSTP32m : FpI<(ops f32mem:$op, RFP:$src), OneArgFP, []>;
-def FpSTP64m : FpI<(ops f64mem:$op, RFP:$src), OneArgFP, []>;
-def FpIST16m : FpI<(ops i16mem:$op, RFP:$src), OneArgFP, []>;
-def FpIST32m : FpI<(ops i32mem:$op, RFP:$src), OneArgFP, []>;
-def FpIST64m : FpI<(ops i64mem:$op, RFP:$src), OneArgFP, []>;
+def FpLD32m : FpI<(ops RFP32:$dst, f32mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (loadf32 addr:$src))]>;
+def FpLD64m : FpI<(ops RFP64:$dst, f64mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (loadf64 addr:$src))]>;
+def FpILD16m32 : FpI<(ops RFP32:$dst, i16mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (X86fild addr:$src, i16))]>;
+def FpILD32m32 : FpI<(ops RFP32:$dst, i32mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (X86fild addr:$src, i32))]>;
+def FpILD64m32 : FpI<(ops RFP32:$dst, i64mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (X86fild addr:$src, i64))]>;
+def FpILD16m64 : FpI<(ops RFP64:$dst, i16mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (X86fild addr:$src, i16))]>;
+def FpILD32m64 : FpI<(ops RFP64:$dst, i32mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (X86fild addr:$src, i32))]>;
+def FpILD64m64 : FpI<(ops RFP64:$dst, i64mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (X86fild addr:$src, i64))]>;
+
+def FpST32m : FpI<(ops f32mem:$op, RFP32:$src), OneArgFP,
+ [(store RFP32:$src, addr:$op)]>;
+def FpST64m32 : FpI<(ops f32mem:$op, RFP64:$src), OneArgFP,
+ [(truncstoref32 RFP64:$src, addr:$op)]>;
+def FpST64m : FpI<(ops f64mem:$op, RFP64:$src), OneArgFP,
+ [(store RFP64:$src, addr:$op)]>;
+
+def FpSTP32m : FpI<(ops f32mem:$op, RFP32:$src), OneArgFP, []>;
+def FpSTP64m32 : FpI<(ops f32mem:$op, RFP64:$src), OneArgFP, []>;
+def FpSTP64m : FpI<(ops f64mem:$op, RFP64:$src), OneArgFP, []>;
+def FpIST16m32 : FpI<(ops i16mem:$op, RFP32:$src), OneArgFP, []>;
+def FpIST32m32 : FpI<(ops i32mem:$op, RFP32:$src), OneArgFP, []>;
+def FpIST64m32 : FpI<(ops i64mem:$op, RFP32:$src), OneArgFP, []>;
+def FpIST16m64 : FpI<(ops i16mem:$op, RFP64:$src), OneArgFP, []>;
+def FpIST32m64 : FpI<(ops i32mem:$op, RFP64:$src), OneArgFP, []>;
+def FpIST64m64 : FpI<(ops i64mem:$op, RFP64:$src), OneArgFP, []>;
def FLD32m : FPI<0xD9, MRM0m, (ops f32mem:$src), "fld{s} $src">;
def FLD64m : FPI<0xDD, MRM0m, (ops f64mem:$src), "fld{l} $src">;
@@ -392,14 +513,23 @@
def FISTP64m : FPI<0xDF, MRM7m, (ops i64mem:$dst), "fistp{ll} $dst">;
// FISTTP requires SSE3 even though it's a FPStack op.
-def FpISTT16m : FpI_<(ops i16mem:$op, RFP:$src), OneArgFP,
- [(X86fp_to_i16mem RFP:$src, addr:$op)]>,
+def FpISTT16m32 : FpI_<(ops i16mem:$op, RFP32:$src), OneArgFP,
+ [(X86fp_to_i16mem RFP32:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT32m32 : FpI_<(ops i32mem:$op, RFP32:$src), OneArgFP,
+ [(X86fp_to_i32mem RFP32:$src, addr:$op)]>,
Requires<[HasSSE3]>;
-def FpISTT32m : FpI_<(ops i32mem:$op, RFP:$src), OneArgFP,
- [(X86fp_to_i32mem RFP:$src, addr:$op)]>,
+def FpISTT64m32 : FpI_<(ops i64mem:$op, RFP32:$src), OneArgFP,
+ [(X86fp_to_i64mem RFP32:$src, addr:$op)]>,
Requires<[HasSSE3]>;
-def FpISTT64m : FpI_<(ops i64mem:$op, RFP:$src), OneArgFP,
- [(X86fp_to_i64mem RFP:$src, addr:$op)]>,
+def FpISTT16m64 : FpI_<(ops i16mem:$op, RFP64:$src), OneArgFP,
+ [(X86fp_to_i16mem RFP64:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT32m64 : FpI_<(ops i32mem:$op, RFP64:$src), OneArgFP,
+ [(X86fp_to_i32mem RFP64:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT64m64 : FpI_<(ops i64mem:$op, RFP64:$src), OneArgFP,
+ [(X86fp_to_i64mem RFP64:$src, addr:$op)]>,
Requires<[HasSSE3]>;
def FISTTP16m : FPI<0xDF, MRM1m, (ops i16mem:$dst), "fisttp{s} $dst">;
@@ -414,10 +544,14 @@
// Floating point constant loads.
let isReMaterializable = 1 in {
-def FpLD0 : FpI<(ops RFP:$dst), ZeroArgFP,
- [(set RFP:$dst, fp64imm0)]>;
-def FpLD1 : FpI<(ops RFP:$dst), ZeroArgFP,
- [(set RFP:$dst, fp64imm1)]>;
+def FpLD032 : FpI<(ops RFP32:$dst), ZeroArgFP,
+ [(set RFP32:$dst, fpimm0)]>;
+def FpLD132 : FpI<(ops RFP32:$dst), ZeroArgFP,
+ [(set RFP32:$dst, fpimm1)]>;
+def FpLD064 : FpI<(ops RFP64:$dst), ZeroArgFP,
+ [(set RFP64:$dst, fpimm0)]>;
+def FpLD164 : FpI<(ops RFP64:$dst), ZeroArgFP,
+ [(set RFP64:$dst, fpimm1)]>;
}
def FLD0 : FPI<0xEE, RawFrm, (ops), "fldz">, D9;
@@ -425,10 +559,14 @@
// Floating point compares.
-def FpUCOMr : FpI<(ops RFP:$lhs, RFP:$rhs), CompareFP,
+def FpUCOMr32 : FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP,
+ []>; // FPSW = cmp ST(0) with ST(i)
+def FpUCOMIr32 : FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP,
+ [(X86cmp RFP32:$lhs, RFP32:$rhs)]>; // CC = cmp ST(0) with ST(i)
+def FpUCOMr64 : FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP,
[]>; // FPSW = cmp ST(0) with ST(i)
-def FpUCOMIr : FpI<(ops RFP:$lhs, RFP:$rhs), CompareFP,
- [(X86cmp RFP:$lhs, RFP:$rhs)]>; // CC = cmp ST(0) with ST(i)
+def FpUCOMIr64 : FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP,
+ [(X86cmp RFP64:$lhs, RFP64:$rhs)]>; // CC = cmp ST(0) with ST(i)
def FUCOMr : FPI<0xE0, AddRegFrm, // FPSW = cmp ST(0) with ST(i)
(ops RST:$reg),
@@ -447,7 +585,6 @@
(ops RST:$reg),
"fucomip {$reg, %st(0)|%ST(0), $reg}">, DF, Imp<[ST0],[]>;
-
// Floating point flag ops.
def FNSTSW8r : I<0xE0, RawFrm, // AX = fp flags
(ops), "fnstsw", []>, DF, Imp<[],[AX]>;
@@ -466,12 +603,18 @@
def : Pat<(X86fld addr:$src, f64), (FpLD64m addr:$src)>;
// Required for CALL which return f32 / f64 values.
-def : Pat<(X86fst RFP:$src, addr:$op, f32), (FpST32m addr:$op, RFP:$src)>;
-def : Pat<(X86fst RFP:$src, addr:$op, f64), (FpST64m addr:$op, RFP:$src)>;
+def : Pat<(X86fst RFP32:$src, addr:$op, f32), (FpST32m addr:$op, RFP32:$src)>;
+def : Pat<(X86fst RFP64:$src, addr:$op, f32), (FpST64m32 addr:$op, RFP64:$src)>;
+def : Pat<(X86fst RFP64:$src, addr:$op, f64), (FpST64m addr:$op, RFP64:$src)>;
// Floating point constant -0.0 and -1.0
-def : Pat<(f64 fp64immneg0), (FpCHS (FpLD0))>, Requires<[FPStack]>;
-def : Pat<(f64 fp64immneg1), (FpCHS (FpLD1))>, Requires<[FPStack]>;
+def : Pat<(f32 fpimmneg0), (FpCHS32 (FpLD032))>, Requires<[FPStack]>;
+def : Pat<(f32 fpimmneg1), (FpCHS32 (FpLD132))>, Requires<[FPStack]>;
+def : Pat<(f64 fpimmneg0), (FpCHS64 (FpLD064))>, Requires<[FPStack]>;
+def : Pat<(f64 fpimmneg1), (FpCHS64 (FpLD164))>, Requires<[FPStack]>;
// Used to conv. i64 to f64 since there isn't a SSE version.
-def : Pat<(X86fildflag addr:$src, i64), (FpILD64m addr:$src)>;
+def : Pat<(X86fildflag addr:$src, i64), (FpILD64m64 addr:$src)>;
+
+def : Pat<(extloadf32 addr:$src), (FpMOV3264 (FpLD32m addr:$src))>, Requires<[FPStack]>;
+def : Pat<(fextend RFP32:$src), (FpMOV3264 RFP32:$src)>, Requires<[FPStack]>;
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Jul 2 19:53:03 2007
@@ -33,7 +33,8 @@
if (oc == X86::MOV8rr || oc == X86::MOV16rr ||
oc == X86::MOV32rr || oc == X86::MOV64rr ||
oc == X86::MOV16to16_ || oc == X86::MOV32to32_ ||
- oc == X86::FpMOV || oc == X86::MOVSSrr || oc == X86::MOVSDrr ||
+ oc == X86::FpMOV3232 || oc == X86::MOVSSrr || oc == X86::MOVSDrr ||
+ oc == X86::FpMOV3264 || oc == X86::FpMOV6432 || oc == X86::FpMOV6464 ||
oc == X86::FsMOVAPSrr || oc == X86::FsMOVAPDrr ||
oc == X86::MOVAPSrr || oc == X86::MOVAPDrr ||
oc == X86::MOVSS2PSrr || oc == X86::MOVSD2PDrr ||
Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jul 2 19:53:03 2007
@@ -964,7 +964,7 @@
// Alias instructions that map fld0 to pxor for sse.
def FsFLD0SD : I<0xEF, MRMInitReg, (ops FR64:$dst),
- "pxor $dst, $dst", [(set FR64:$dst, fp64imm0)]>,
+ "pxor $dst, $dst", [(set FR64:$dst, fpimm0)]>,
Requires<[HasSSE2]>, TB, OpSize;
// Alias instruction to do FR64 reg-to-reg copy using movapd. Upper bits are
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Jul 2 19:53:03 2007
@@ -82,8 +82,10 @@
Opc = X86::MOV32_mr;
} else if (RC == &X86::GR16_RegClass) {
Opc = X86::MOV16_mr;
- } else if (RC == &X86::RFPRegClass || RC == &X86::RSTRegClass) {
+ } else if (RC == &X86::RFP64RegClass || RC == &X86::RSTRegClass) {
Opc = X86::FpST64m;
+ } else if (RC == &X86::RFP32RegClass) {
+ Opc = X86::FpST32m;
} else if (RC == &X86::FR32RegClass) {
Opc = X86::MOVSSmr;
} else if (RC == &X86::FR64RegClass) {
@@ -117,8 +119,10 @@
Opc = X86::MOV32_rm;
} else if (RC == &X86::GR16_RegClass) {
Opc = X86::MOV16_rm;
- } else if (RC == &X86::RFPRegClass || RC == &X86::RSTRegClass) {
+ } else if (RC == &X86::RFP64RegClass || RC == &X86::RSTRegClass) {
Opc = X86::FpLD64m;
+ } else if (RC == &X86::RFP32RegClass) {
+ Opc = X86::FpLD32m;
} else if (RC == &X86::FR32RegClass) {
Opc = X86::MOVSSrm;
} else if (RC == &X86::FR64RegClass) {
@@ -151,8 +155,10 @@
Opc = X86::MOV32_rr;
} else if (RC == &X86::GR16_RegClass) {
Opc = X86::MOV16_rr;
- } else if (RC == &X86::RFPRegClass || RC == &X86::RSTRegClass) {
- Opc = X86::FpMOV;
+ } else if (RC == &X86::RFP32RegClass) {
+ Opc = X86::FpMOV3232;
+ } else if (RC == &X86::RFP64RegClass || RC == &X86::RSTRegClass) {
+ Opc = X86::FpMOV6464;
} else if (RC == &X86::FR32RegClass) {
Opc = X86::FsMOVAPSrr;
} else if (RC == &X86::FR64RegClass) {
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.td?rev=37847&r1=37846&r2=37847&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.td Mon Jul 2 19:53:03 2007
@@ -425,7 +425,8 @@
// faster on common hardware. In reality, this should be controlled by a
// command line option or something.
-def RFP : RegisterClass<"X86", [f64], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
+def RFP32 : RegisterClass<"X86", [f32], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
+def RFP64 : RegisterClass<"X86", [f64], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
// Floating point stack registers (these are not allocatable by the
// register allocator - the floating point stackifier is responsible
From dalej at apple.com Mon Jul 2 19:58:37 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 03 Jul 2007 00:58:37 -0000
Subject: [llvm-commits] [llvm] r37848 - in /llvm/trunk/test/CodeGen/X86:
pr1489.ll pr1505.ll pr1505b.ll
Message-ID: <200707030058.l630wbpe013743@zion.cs.uiuc.edu>
Author: johannes
Date: Mon Jul 2 19:58:37 2007
New Revision: 37848
URL: http://llvm.org/viewvc/llvm-project?rev=37848&view=rev
Log:
New testcases for rev 37847 (PR's 1489 and 1505).
Added:
llvm/trunk/test/CodeGen/X86/pr1489.ll
llvm/trunk/test/CodeGen/X86/pr1505.ll
llvm/trunk/test/CodeGen/X86/pr1505b.ll
Added: llvm/trunk/test/CodeGen/X86/pr1489.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr1489.ll?rev=37848&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr1489.ll (added)
+++ llvm/trunk/test/CodeGen/X86/pr1489.ll Mon Jul 2 19:58:37 2007
@@ -0,0 +1,55 @@
+; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 1082126238 | wc -l | grep 3
+; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 3058016715 | wc -l | grep 1
+;; magic constants are 3.999f and half of 3.999
+; ModuleID = '1489.c'
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "i686-apple-darwin8"
+ at .str = internal constant [13 x i8] c"%d %d %d %d\0A\00" ; <[13 x i8]*> [#uses=1]
+
+define i32 @quux() {
+entry:
+ %tmp1 = tail call i32 @lrintf( float 0x400FFDF3C0000000 ) ; [#uses=1]
+ %tmp2 = icmp slt i32 %tmp1, 1 ; [#uses=1]
+ %tmp23 = zext i1 %tmp2 to i32 ; [#uses=1]
+ ret i32 %tmp23
+}
+
+declare i32 @lrintf(float)
+
+define i32 @foo() {
+entry:
+ %tmp1 = tail call i32 @lrint( double 3.999000e+00 ) ; [#uses=1]
+ %tmp2 = icmp slt i32 %tmp1, 1 ; [#uses=1]
+ %tmp23 = zext i1 %tmp2 to i32 ; [#uses=1]
+ ret i32 %tmp23
+}
+
+declare i32 @lrint(double)
+
+define i32 @bar() {
+entry:
+ %tmp1 = tail call i32 @lrintf( float 0x400FFDF3C0000000 ) ; [#uses=1]
+ %tmp2 = icmp slt i32 %tmp1, 1 ; [#uses=1]
+ %tmp23 = zext i1 %tmp2 to i32 ; [#uses=1]
+ ret i32 %tmp23
+}
+
+define i32 @baz() {
+entry:
+ %tmp1 = tail call i32 @lrintf( float 0x400FFDF3C0000000 ) ; [#uses=1]
+ %tmp2 = icmp slt i32 %tmp1, 1 ; [#uses=1]
+ %tmp23 = zext i1 %tmp2 to i32 ; [#uses=1]
+ ret i32 %tmp23
+}
+
+define i32 @main() {
+entry:
+ %tmp = tail call i32 @baz( ) ; [#uses=1]
+ %tmp1 = tail call i32 @bar( ) ; [#uses=1]
+ %tmp2 = tail call i32 @foo( ) ; [#uses=1]
+ %tmp3 = tail call i32 @quux( ) ; [#uses=1]
+ %tmp5 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 %tmp3, i32 %tmp2, i32 %tmp1, i32 %tmp ) ; [#uses=0]
+ ret i32 undef
+}
+
+declare i32 @printf(i8*, ...)
Added: llvm/trunk/test/CodeGen/X86/pr1505.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr1505.ll?rev=37848&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr1505.ll (added)
+++ llvm/trunk/test/CodeGen/X86/pr1505.ll Mon Jul 2 19:58:37 2007
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -mcpu=i486 | not grep fldl
+
+; ModuleID = ''
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "i686-apple-darwin8"
+ at G = weak global float 0.000000e+00 ; [#uses=1]
+
+define void @t1(float %F) {
+entry:
+ store float %F, float* @G
+ ret void
+}
Added: llvm/trunk/test/CodeGen/X86/pr1505b.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr1505b.ll?rev=37848&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr1505b.ll (added)
+++ llvm/trunk/test/CodeGen/X86/pr1505b.ll Mon Jul 2 19:58:37 2007
@@ -0,0 +1,73 @@
+; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | wc -l | grep 4
+; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | wc -l | grep 3
+
+; ModuleID = ''
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "i686-apple-darwin8"
+ %"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::num_get > >"*, %"struct.std::num_get > >"* }
+ %"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" }
+ %"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
+ %"struct.std::ctype" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i32*, i8, [256 x i8], [256 x i8], i8 }
+ %"struct.std::ctype_base" = type <{ i8 }>
+ %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
+ %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
+ %"struct.std::ios_base::_Words" = type { i8*, i32 }
+ %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
+ %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
+ %"struct.std::locale::facet" = type { i32 (...)**, i32 }
+ %"struct.std::num_get > >" = type { %"struct.std::locale::facet" }
+ at a = global float 0x3FD3333340000000 ; [#uses=1]
+ at b = global double 6.000000e-01, align 8 ; [#uses=1]
+ at _ZSt8__ioinit = internal global %"struct.std::ctype_base" zeroinitializer ; <%"struct.std::ctype_base"*> [#uses=2]
+ at __dso_handle = external global i8* ; [#uses=1]
+ at _ZSt4cout = external global %"struct.std::basic_ostream >" ; <%"struct.std::basic_ostream >"*> [#uses=2]
+ at .str = internal constant [12 x i8] c"tan float: \00" ; <[12 x i8]*> [#uses=1]
+ at .str1 = internal constant [13 x i8] c"tan double: \00" ; <[13 x i8]*> [#uses=1]
+ at llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
+
+define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_instructions" {
+entry:
+ tail call void @_ZNSt8ios_base4InitC1Ev( %"struct.std::ctype_base"* @_ZSt8__ioinit )
+ %tmp10.i = tail call i32 @__cxa_atexit( void (i8*)* @__tcf_0, i8* null, i8* bitcast (i8** @__dso_handle to i8*) ) ; [#uses=0]
+ ret void
+}
+
+define internal void @__tcf_0(i8* %unnamed_arg) {
+entry:
+ tail call void @_ZNSt8ios_base4InitD1Ev( %"struct.std::ctype_base"* @_ZSt8__ioinit )
+ ret void
+}
+
+declare void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ctype_base"*)
+
+declare void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ctype_base"*)
+
+declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
+
+define i32 @main() {
+entry:
+ %tmp6 = volatile load float* @a ; [#uses=1]
+ %tmp9 = tail call float @tanf( float %tmp6 ) ; [#uses=1]
+ %tmp12 = volatile load double* @b ; [#uses=1]
+ %tmp13 = tail call double @tan( double %tmp12 ) ; [#uses=1]
+ %tmp1314 = fptrunc double %tmp13 to float ; [#uses=1]
+ %tmp16 = tail call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0) ) ; <%"struct.std::basic_ostream >"*> [#uses=1]
+ %tmp1920 = fpext float %tmp9 to double ; [#uses=1]
+ %tmp22 = tail call %"struct.std::basic_ostream >"* @_ZNSolsEd( %"struct.std::basic_ostream >"* %tmp16, double %tmp1920 ) ; <%"struct.std::basic_ostream >"*> [#uses=1]
+ %tmp30 = tail call %"struct.std::basic_ostream >"* @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_( %"struct.std::basic_ostream >"* %tmp22 ) ; <%"struct.std::basic_ostream >"*> [#uses=0]
+ %tmp34 = tail call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr ([13 x i8]* @.str1, i32 0, i32 0) ) ; <%"struct.std::basic_ostream >"*> [#uses=1]
+ %tmp3940 = fpext float %tmp1314 to double ; [#uses=1]
+ %tmp42 = tail call %"struct.std::basic_ostream >"* @_ZNSolsEd( %"struct.std::basic_ostream >"* %tmp34, double %tmp3940 ) ; <%"struct.std::basic_ostream >"*> [#uses=1]
+ %tmp51 = tail call %"struct.std::basic_ostream >"* @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_( %"struct.std::basic_ostream >"* %tmp42 ) ; <%"struct.std::basic_ostream >"*> [#uses=0]
+ ret i32 0
+}
+
+declare float @tanf(float)
+
+declare double @tan(double)
+
+declare %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"*, i8*)
+
+declare %"struct.std::basic_ostream >"* @_ZNSolsEd(%"struct.std::basic_ostream >"*, double)
+
+declare %"struct.std::basic_ostream >"* @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%"struct.std::basic_ostream >"*)
From resistor at mac.com Mon Jul 2 21:28:17 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 03 Jul 2007 02:28:17 -0000
Subject: [llvm-commits] [llvm] r37849 - /llvm/trunk/CREDITS.TXT
Message-ID: <200707030228.l632SH1d016019@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Jul 2 21:28:17 2007
New Revision: 37849
URL: http://llvm.org/viewvc/llvm-project?rev=37849&view=rev
Log:
Test commit.
Modified:
llvm/trunk/CREDITS.TXT
Modified: llvm/trunk/CREDITS.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CREDITS.TXT?rev=37849&r1=37848&r2=37849&view=diff
==============================================================================
--- llvm/trunk/CREDITS.TXT (original)
+++ llvm/trunk/CREDITS.TXT Mon Jul 2 21:28:17 2007
@@ -15,7 +15,8 @@
N: Owen Anderson
E: resistor at mac.com
-D: LCSSA pass and related LoopUnswitch work, TargetData refactoring, random improvements
+D: LCSSA pass and related LoopUnswitch work
+D: GVNPRE pass, TargetData refactoring, random improvements
N: Henrik Bach
D: MingW Win32 API portability layer
From greened at obbligato.org Mon Jul 2 22:04:37 2007
From: greened at obbligato.org (David A. Greene)
Date: Mon, 2 Jul 2007 22:04:37 -0500
Subject: [llvm-commits] [llvm] r37845 -
/llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll
In-Reply-To: <200707021623.l62GNlaG029742@zion.cs.uiuc.edu>
References: <200707021623.l62GNlaG029742@zion.cs.uiuc.edu>
Message-ID: <200707022204.38345.greened@obbligato.org>
On Monday 02 July 2007 11:23, Dan Gohman wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=37845&view=rev
> Log:
> Add a basic test-case for passing and returning <4 x double> and
> <8 x float> values on X86.
Hey Dan, what's the goal of all of this?
-Dave
From greened at obbligato.org Mon Jul 2 23:28:16 2007
From: greened at obbligato.org (David A. Greene)
Date: Mon, 2 Jul 2007 23:28:16 -0500
Subject: [llvm-commits] [llvm] r37845 -
/llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll
In-Reply-To: <200707022204.38345.greened@obbligato.org>
References: <200707021623.l62GNlaG029742@zion.cs.uiuc.edu>
<200707022204.38345.greened@obbligato.org>
Message-ID: <200707022328.16395.greened@obbligato.org>
On Monday 02 July 2007 22:04, David A. Greene wrote:
> On Monday 02 July 2007 11:23, Dan Gohman wrote:
> > URL: http://llvm.org/viewvc/llvm-project?rev=37845&view=rev
> > Log:
> > Add a basic test-case for passing and returning <4 x double> and
> > <8 x float> values on X86.
>
> Hey Dan, what's the goal of all of this?
Sorry folks. Apparently I don't know how to use an e-mail client. That
was just supposed to go to Dan.
-Dave
From clattner at apple.com Mon Jul 2 23:33:17 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 2 Jul 2007 21:33:17 -0700
Subject: [llvm-commits] [llvm] r37845 -
/llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll
In-Reply-To: <200707022328.16395.greened@obbligato.org>
References: <200707021623.l62GNlaG029742@zion.cs.uiuc.edu>
<200707022204.38345.greened@obbligato.org>
<200707022328.16395.greened@obbligato.org>
Message-ID:
On Jul 2, 2007, at 9:28 PM, David A. Greene wrote:
> On Monday 02 July 2007 22:04, David A. Greene wrote:
>> On Monday 02 July 2007 11:23, Dan Gohman wrote:
>>> URL: http://llvm.org/viewvc/llvm-project?rev=37845&view=rev
>>> Log:
>>> Add a basic test-case for passing and returning <4 x double> and
>>> <8 x float> values on X86.
>>
>> Hey Dan, what's the goal of all of this?
>
> Sorry folks. Apparently I don't know how to use an e-mail client.
> That
> was just supposed to go to Dan.
No worries, the list is configured to reply to the list. This is to
prevent people on email discussions from getting many copies IIRC.
-Chris
From sabre at nondot.org Mon Jul 2 23:41:50 2007
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 03 Jul 2007 04:41:50 -0000
Subject: [llvm-commits] [llvm] r37850 - /llvm/trunk/docs/AliasAnalysis.html
Message-ID: <200707030441.l634foUc019355@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 2 23:41:50 2007
New Revision: 37850
URL: http://llvm.org/viewvc/llvm-project?rev=37850&view=rev
Log:
note where to get steens-aa and ds-aa
Modified:
llvm/trunk/docs/AliasAnalysis.html
Modified: llvm/trunk/docs/AliasAnalysis.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AliasAnalysis.html?rev=37850&r1=37849&r2=37850&view=diff
==============================================================================
--- llvm/trunk/docs/AliasAnalysis.html (original)
+++ llvm/trunk/docs/AliasAnalysis.html Mon Jul 2 23:41:50 2007
@@ -755,6 +755,9 @@
Structure Analysis framework. This gives it substantially more precision than
the standard algorithm while maintaining excellent analysis scalability.
+Note that -steens-aa is available in the optional "poolalloc"
+module, it is not part of the LLVM core.
+
@@ -775,6 +778,9 @@
only major facility not implemented so far is support for must-alias
information.
+Note that -ds-aa is available in the optional "poolalloc"
+module, it is not part of the LLVM core.
+
From djg at cray.com Tue Jul 3 09:03:58 2007
From: djg at cray.com (Dan Gohman)
Date: Tue, 03 Jul 2007 14:03:58 -0000
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Message-ID: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
Author: djg
Date: Tue Jul 3 09:03:57 2007
New Revision: 37851
URL: http://llvm.org/viewvc/llvm-project?rev=37851&view=rev
Log:
Fix several over-aggressive folds for undef nodes in dagcombine, to
follow the rules for undef used in instcombine.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=37851&r1=37850&r2=37851&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jul 3 09:03:57 2007
@@ -854,6 +854,9 @@
SDOperand FoldedVOp = SimplifyVBinOp(N);
if (FoldedVOp.Val) return FoldedVOp;
+ // fold (add x, undef) -> undef
+ if (N1.getOpcode() == ISD::UNDEF)
+ return N1;
// fold (add c1, c2) -> c1+c2
if (N0C && N1C)
return DAG.getNode(ISD::ADD, VT, N0, N1);
@@ -925,10 +928,6 @@
if (Result.Val) return Result;
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -1029,7 +1028,7 @@
SDOperand Result = combineSelectAndUse(N, N1, N0, DAG);
if (Result.Val) return Result;
}
- // If either operand is undef, the result is undef
+ // If either operand of a sub is undef, the result is undef
if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
return DAG.getNode(ISD::UNDEF, VT);
@@ -1047,6 +1046,9 @@
SDOperand FoldedVOp = SimplifyVBinOp(N);
if (FoldedVOp.Val) return FoldedVOp;
+ // fold (mul x, undef) -> 0
+ if (N1.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
// fold (mul c1, c2) -> c1*c2
if (N0C && N1C)
return DAG.getNode(ISD::MUL, VT, N0, N1);
@@ -1112,10 +1114,6 @@
if (RMUL.Val != 0)
return RMUL;
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -1185,9 +1183,12 @@
if (Op.Val) return Op;
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
+ // undef / X -> 0
+ if (N0.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
+ // X / undef -> undef
+ if (N1.getOpcode() == ISD::UNDEF)
+ return N1;
return SDOperand();
}
@@ -1230,9 +1231,12 @@
if (Op.Val) return Op;
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
+ // undef / X -> 0
+ if (N0.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
+ // X / undef -> undef
+ if (N1.getOpcode() == ISD::UNDEF)
+ return N1;
return SDOperand();
}
@@ -1265,9 +1269,12 @@
return Sub;
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
+ // undef % X -> 0
+ if (N0.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
+ // X % undef -> undef
+ if (N1.getOpcode() == ISD::UNDEF)
+ return N1;
return SDOperand();
}
@@ -1307,9 +1314,12 @@
return Sub;
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
+ // undef % X -> 0
+ if (N0.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
+ // X % undef -> undef
+ if (N1.getOpcode() == ISD::UNDEF)
+ return N1;
return SDOperand();
}
@@ -1328,9 +1338,9 @@
return DAG.getNode(ISD::SRA, N0.getValueType(), N0,
DAG.getConstant(MVT::getSizeInBits(N0.getValueType())-1,
TLI.getShiftAmountTy()));
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
+ // fold (mulhs x, undef) -> 0
+ if (N1.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
return SDOperand();
}
@@ -1347,9 +1357,9 @@
// fold (mulhu x, 1) -> 0
if (N1C && N1C->getValue() == 1)
return DAG.getConstant(0, N0.getValueType());
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
+ // fold (mulhu x, undef) -> 0
+ if (N1.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
return SDOperand();
}
@@ -1390,10 +1400,6 @@
return DAG.getNode(N0.getOpcode(), VT, ORNode, N0.getOperand(1));
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -1409,6 +1415,9 @@
SDOperand FoldedVOp = SimplifyVBinOp(N);
if (FoldedVOp.Val) return FoldedVOp;
+ // fold (and x, undef) -> 0
+ if (N1.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(0, VT);
// fold (and c1, c2) -> c1&c2
if (N0C && N1C)
return DAG.getNode(ISD::AND, VT, N0, N1);
@@ -1594,6 +1603,9 @@
SDOperand FoldedVOp = SimplifyVBinOp(N);
if (FoldedVOp.Val) return FoldedVOp;
+ // fold (or x, undef) -> -1
+ if (N1.getOpcode() == ISD::UNDEF)
+ return DAG.getConstant(-1, VT);
// fold (or c1, c2) -> c1|c2
if (N0C && N1C)
return DAG.getNode(ISD::OR, VT, N0, N1);
@@ -1877,6 +1889,9 @@
SDOperand FoldedVOp = SimplifyVBinOp(N);
if (FoldedVOp.Val) return FoldedVOp;
+ // fold (xor x, undef) -> undef
+ if (N1.getOpcode() == ISD::UNDEF)
+ return N1;
// fold (xor c1, c2) -> c1^c2
if (N0C && N1C)
return DAG.getNode(ISD::XOR, VT, N0, N1);
@@ -3009,10 +3024,6 @@
return DAG.getNode(ISD::FADD, VT, N0.getOperand(0),
DAG.getNode(ISD::FADD, VT, N0.getOperand(1), N1));
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -3040,10 +3051,6 @@
if (isNegatibleForFree(N1))
return DAG.getNode(ISD::FADD, VT, N0, GetNegatedExpression(N1, DAG));
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -3088,10 +3095,6 @@
return DAG.getNode(ISD::FMUL, VT, N0.getOperand(0),
DAG.getNode(ISD::FMUL, VT, N0.getOperand(1), N1));
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -3122,10 +3125,6 @@
}
}
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
@@ -3140,10 +3139,6 @@
if (N0CFP && N1CFP)
return DAG.getNode(ISD::FREM, VT, N0, N1);
- // If either operand is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, VT);
-
return SDOperand();
}
From baldrick at free.fr Tue Jul 3 09:43:14 2007
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 3 Jul 2007 16:43:14 +0200
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
Message-ID: <200707031643.14426.baldrick@free.fr>
Hi Dan,
> + // fold (add x, undef) -> undef
> + if (N1.getOpcode() == ISD::UNDEF)
> + return N1;
what if N0 is undef and not N1?
> - // If either operand is undef, the result is undef
> - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> - return DAG.getNode(ISD::UNDEF, VT);
> -
Did you move this earlier to make it more efficient, or for another
reason?
> - // If either operand is undef, the result is undef
> + // If either operand of a sub is undef, the result is undef
> if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> return DAG.getNode(ISD::UNDEF, VT);
If it was more efficient doing this earlier for add, presumably the
same is true for subtraction.
> + // fold (mul x, undef) -> 0
> + if (N1.getOpcode() == ISD::UNDEF)
> + return DAG.getConstant(0, VT);
Yes, this seems better :) Again, is the undef guaranteed to be
in N1 and not N0?
> + // undef / X -> 0
> + if (N0.getOpcode() == ISD::UNDEF)
> + return DAG.getConstant(0, VT);
Indeed.
> + // X / undef -> undef
> + if (N1.getOpcode() == ISD::UNDEF)
> + return N1;
Here you use that X / 0 is undefined in the usual sense,
and can take on any value. Is it undefined? Also, wouldn't
it be better to do this before the N0 one, in case you have
undef/undef ?
Same comments for udiv, srem and urem.
> @@ -1390,10 +1400,6 @@
> return DAG.getNode(N0.getOpcode(), VT, ORNode, N0.getOperand(1));
> }
>
> - // If either operand is undef, the result is undef
> - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> - return DAG.getNode(ISD::UNDEF, VT);
> -
> return SDOperand();
> }
(SimplifyBinOpWithSameOpcodeHands)
In this case both N0 and N1 must be undef (since by definition they
have the same opcode here), so returning undef seems ok here. That
said, the original "if" was kind of silly since if one opcode is undef
then so is the other.
> + // fold (or x, undef) -> -1
> + if (N1.getOpcode() == ISD::UNDEF)
> + return DAG.getConstant(-1, VT);
Is this the right way to get an all-bits-one value?
> @@ -3040,10 +3051,6 @@
> if (isNegatibleForFree(N1))
> return DAG.getNode(ISD::FADD, VT, N0, GetNegatedExpression(N1, DAG));
>
> - // If either operand is undef, the result is undef
> - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> - return DAG.getNode(ISD::UNDEF, VT);
> -
> return SDOperand();
> }
Why the difference between fadd and fsub? If you are worried about NaNs
etc, at worst you can always, I suppose, turn x fsub undef into x.
Likewise for the other floating point ops.
Ciao,
Duncan.
From clattner at apple.com Tue Jul 3 11:23:19 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 09:23:19 -0700
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <200707031643.14426.baldrick@free.fr>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
<200707031643.14426.baldrick@free.fr>
Message-ID: <27DA872F-8A61-4916-9C7D-B151D16440A3@apple.com>
On Jul 3, 2007, at 7:43 AM, Duncan Sands wrote:
> Hi Dan,
>> + // fold (add x, undef) -> undef
>> + if (N1.getOpcode() == ISD::UNDEF)
>> + return N1;
>
> what if N0 is undef and not N1?
Presumably, undef is being canonicalized to the RHS somewhere. I
don't know if this is actually true in the dag combiner though, it
should be checked.
>> + // fold (mul x, undef) -> 0
>> + if (N1.getOpcode() == ISD::UNDEF)
>> + return DAG.getConstant(0, VT);
>
> Yes, this seems better :) Again, is the undef guaranteed to be
> in N1 and not N0?
Does this work for vectors? Does DAG.getConstant(0, MVT::v4i32)
work? This xform should probably be disabled after legalize for
vectors.
>> + // fold (or x, undef) -> -1
>> + if (N1.getOpcode() == ISD::UNDEF)
>> + return DAG.getConstant(-1, VT);
>
> Is this the right way to get an all-bits-one value?
Yes, but this has the same problem with vectors. :)
-Chris
From greened at obbligato.org Tue Jul 3 11:43:08 2007
From: greened at obbligato.org (David A. Greene)
Date: Tue, 3 Jul 2007 11:43:08 -0500
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <27DA872F-8A61-4916-9C7D-B151D16440A3@apple.com>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
<200707031643.14426.baldrick@free.fr>
<27DA872F-8A61-4916-9C7D-B151D16440A3@apple.com>
Message-ID: <200707031143.08661.greened@obbligato.org>
On Tuesday 03 July 2007 11:23, Chris Lattner wrote:
> >> + // fold (or x, undef) -> -1
> >> + if (N1.getOpcode() == ISD::UNDEF)
> >> + return DAG.getConstant(-1, VT);
> >
> > Is this the right way to get an all-bits-one value?
>
> Yes, but this has the same problem with vectors. :)
I don't understand the comment about vectors, but I would have expected
"all ones" to be spelled "~0ull." Of course, the suffix used might depend on
the host architecture, which makes things tricky. But not every host may be
two's-complement, either. :)
-Dave
From asl at math.spbu.ru Tue Jul 3 12:01:59 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 03 Jul 2007 17:01:59 -0000
Subject: [llvm-commits] [llvm] r37852 - in /llvm/trunk:
autoconf/configure.ac configure
Message-ID: <200707031701.l63H1xKa016388@zion.cs.uiuc.edu>
Author: asl
Date: Tue Jul 3 12:01:58 2007
New Revision: 37852
URL: http://llvm.org/viewvc/llvm-project?rev=37852&view=rev
Log:
Rename llvm-test => test-suite. By Dave Greene.
Modified:
llvm/trunk/autoconf/configure.ac
llvm/trunk/configure
Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=37852&r1=37851&r2=37852&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Tue Jul 3 12:01:58 2007
@@ -70,7 +70,7 @@
sample) AC_CONFIG_SUBDIRS([projects/sample]) ;;
privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;;
- llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
+ test-suite) AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
llvm-reopt) AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
llvm-gcc) AC_CONFIG_SUBDIRS([projects/llvm-gcc]) ;;
llvm-java) AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=37852&r1=37851&r2=37852&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Tue Jul 3 12:01:58 2007
@@ -944,7 +944,7 @@
ac_subdirs_all='projects/sample
projects/privbracket
projects/llvm-stacker
-projects/llvm-test
+projects/test-suite
projects/llvm-reopt
projects/llvm-gcc
projects/llvm-java
@@ -2074,7 +2074,7 @@
;;
llvm-stacker) subdirs="$subdirs projects/llvm-stacker"
;;
- llvm-test) subdirs="$subdirs projects/llvm-test"
+ test-suite) subdirs="$subdirs projects/test-suite"
;;
llvm-reopt) subdirs="$subdirs projects/llvm-reopt"
;;
From dalej at apple.com Tue Jul 3 12:07:33 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 03 Jul 2007 17:07:33 -0000
Subject: [llvm-commits] [llvm] r37853 - in /llvm/trunk/lib/Target/X86:
X86FloatingPoint.cpp X86InstrFPStack.td
Message-ID: <200707031707.l63H7XRT016593@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Jul 3 12:07:33 2007
New Revision: 37853
URL: http://llvm.org/viewvc/llvm-project?rev=37853&view=rev
Log:
Some spacing fixes. Cosmetic.
Modified:
llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
llvm/trunk/lib/Target/X86/X86InstrFPStack.td
Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=37853&r1=37852&r2=37853&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Tue Jul 3 12:07:33 2007
@@ -326,8 +326,8 @@
static const TableEntry OpcodeTable[] = {
{ X86::FpABS32 , X86::FABS },
{ X86::FpABS64 , X86::FABS },
- { X86::FpADD32m , X86::FADD32m },
- { X86::FpADD64m , X86::FADD64m },
+ { X86::FpADD32m , X86::FADD32m },
+ { X86::FpADD64m , X86::FADD64m },
{ X86::FpCHS32 , X86::FCHS },
{ X86::FpCHS64 , X86::FCHS },
{ X86::FpCMOVB32 , X86::FCMOVB },
@@ -348,10 +348,10 @@
{ X86::FpCMOVP64 , X86::FCMOVP },
{ X86::FpCOS32 , X86::FCOS },
{ X86::FpCOS64 , X86::FCOS },
- { X86::FpDIV32m , X86::FDIV32m },
- { X86::FpDIV64m , X86::FDIV64m },
- { X86::FpDIVR32m , X86::FDIVR32m },
- { X86::FpDIVR64m , X86::FDIVR64m },
+ { X86::FpDIV32m , X86::FDIV32m },
+ { X86::FpDIV64m , X86::FDIV64m },
+ { X86::FpDIVR32m , X86::FDIVR32m },
+ { X86::FpDIVR64m , X86::FDIVR64m },
{ X86::FpIADD16m32 , X86::FIADD16m },
{ X86::FpIADD16m64 , X86::FIADD16m },
{ X86::FpIADD32m32 , X86::FIADD32m },
@@ -398,21 +398,21 @@
{ X86::FpLD064 , X86::FLD0 },
{ X86::FpLD132 , X86::FLD1 },
{ X86::FpLD164 , X86::FLD1 },
- { X86::FpLD32m , X86::FLD32m },
- { X86::FpLD64m , X86::FLD64m },
- { X86::FpMUL32m , X86::FMUL32m },
- { X86::FpMUL64m , X86::FMUL64m },
+ { X86::FpLD32m , X86::FLD32m },
+ { X86::FpLD64m , X86::FLD64m },
+ { X86::FpMUL32m , X86::FMUL32m },
+ { X86::FpMUL64m , X86::FMUL64m },
{ X86::FpSIN32 , X86::FSIN },
{ X86::FpSIN64 , X86::FSIN },
{ X86::FpSQRT32 , X86::FSQRT },
{ X86::FpSQRT64 , X86::FSQRT },
- { X86::FpST32m , X86::FST32m },
- { X86::FpST64m , X86::FST64m },
+ { X86::FpST32m , X86::FST32m },
+ { X86::FpST64m , X86::FST64m },
{ X86::FpST64m32 , X86::FST32m },
- { X86::FpSUB32m , X86::FSUB32m },
- { X86::FpSUB64m , X86::FSUB64m },
- { X86::FpSUBR32m , X86::FSUBR32m },
- { X86::FpSUBR64m , X86::FSUBR64m },
+ { X86::FpSUB32m , X86::FSUB32m },
+ { X86::FpSUB64m , X86::FSUB64m },
+ { X86::FpSUBR32m , X86::FSUBR32m },
+ { X86::FpSUBR64m , X86::FSUBR64m },
{ X86::FpTST32 , X86::FTST },
{ X86::FpTST64 , X86::FTST },
{ X86::FpUCOMIr32 , X86::FUCOMIr },
Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=37853&r1=37852&r2=37853&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Jul 3 12:07:33 2007
@@ -17,27 +17,27 @@
// FPStack specific DAG Nodes.
//===----------------------------------------------------------------------===//
-def SDTX86FpGet : SDTypeProfile<1, 0, [SDTCisFP<0>]>;
-def SDTX86FpSet : SDTypeProfile<0, 1, [SDTCisFP<0>]>;
-def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>,
- SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>;
-def SDTX86Fst : SDTypeProfile<0, 3, [SDTCisFP<0>,
- SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>;
-def SDTX86Fild : SDTypeProfile<1, 2, [SDTCisFP<0>, SDTCisPtrTy<1>,
- SDTCisVT<2, OtherVT>]>;
-def SDTX86FpToIMem: SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>;
+def SDTX86FpGet : SDTypeProfile<1, 0, [SDTCisFP<0>]>;
+def SDTX86FpSet : SDTypeProfile<0, 1, [SDTCisFP<0>]>;
+def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>,
+ SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>;
+def SDTX86Fst : SDTypeProfile<0, 3, [SDTCisFP<0>,
+ SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>;
+def SDTX86Fild : SDTypeProfile<1, 2, [SDTCisFP<0>, SDTCisPtrTy<1>,
+ SDTCisVT<2, OtherVT>]>;
+def SDTX86FpToIMem : SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>;
-def X86fpget : SDNode<"X86ISD::FP_GET_RESULT", SDTX86FpGet,
+def X86fpget : SDNode<"X86ISD::FP_GET_RESULT", SDTX86FpGet,
[SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
-def X86fpset : SDNode<"X86ISD::FP_SET_RESULT", SDTX86FpSet,
+def X86fpset : SDNode<"X86ISD::FP_SET_RESULT", SDTX86FpSet,
[SDNPHasChain, SDNPOutFlag]>;
-def X86fld : SDNode<"X86ISD::FLD", SDTX86Fld,
+def X86fld : SDNode<"X86ISD::FLD", SDTX86Fld,
[SDNPHasChain]>;
-def X86fst : SDNode<"X86ISD::FST", SDTX86Fst,
+def X86fst : SDNode<"X86ISD::FST", SDTX86Fst,
[SDNPHasChain, SDNPInFlag]>;
-def X86fild : SDNode<"X86ISD::FILD", SDTX86Fild,
+def X86fild : SDNode<"X86ISD::FILD", SDTX86Fild,
[SDNPHasChain]>;
-def X86fildflag: SDNode<"X86ISD::FILD_FLAG",SDTX86Fild,
+def X86fildflag : SDNode<"X86ISD::FILD_FLAG",SDTX86Fild,
[SDNPHasChain, SDNPOutFlag]>;
def X86fp_to_i16mem : SDNode<"X86ISD::FP_TO_INT16_IN_MEM", SDTX86FpToIMem,
[SDNPHasChain]>;
@@ -71,29 +71,29 @@
// Some 'special' instructions
let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
def FP32_TO_INT16_IN_MEM : I<0, Pseudo,
- (ops i16mem:$dst, RFP32:$src),
- "#FP32_TO_INT16_IN_MEM PSEUDO!",
- [(X86fp_to_i16mem RFP32:$src, addr:$dst)]>;
+ (ops i16mem:$dst, RFP32:$src),
+ "#FP32_TO_INT16_IN_MEM PSEUDO!",
+ [(X86fp_to_i16mem RFP32:$src, addr:$dst)]>;
def FP32_TO_INT32_IN_MEM : I<0, Pseudo,
- (ops i32mem:$dst, RFP32:$src),
- "#FP32_TO_INT32_IN_MEM PSEUDO!",
- [(X86fp_to_i32mem RFP32:$src, addr:$dst)]>;
+ (ops i32mem:$dst, RFP32:$src),
+ "#FP32_TO_INT32_IN_MEM PSEUDO!",
+ [(X86fp_to_i32mem RFP32:$src, addr:$dst)]>;
def FP32_TO_INT64_IN_MEM : I<0, Pseudo,
- (ops i64mem:$dst, RFP32:$src),
- "#FP32_TO_INT64_IN_MEM PSEUDO!",
- [(X86fp_to_i64mem RFP32:$src, addr:$dst)]>;
+ (ops i64mem:$dst, RFP32:$src),
+ "#FP32_TO_INT64_IN_MEM PSEUDO!",
+ [(X86fp_to_i64mem RFP32:$src, addr:$dst)]>;
def FP64_TO_INT16_IN_MEM : I<0, Pseudo,
- (ops i16mem:$dst, RFP64:$src),
- "#FP64_TO_INT16_IN_MEM PSEUDO!",
- [(X86fp_to_i16mem RFP64:$src, addr:$dst)]>;
+ (ops i16mem:$dst, RFP64:$src),
+ "#FP64_TO_INT16_IN_MEM PSEUDO!",
+ [(X86fp_to_i16mem RFP64:$src, addr:$dst)]>;
def FP64_TO_INT32_IN_MEM : I<0, Pseudo,
- (ops i32mem:$dst, RFP64:$src),
- "#FP64_TO_INT32_IN_MEM PSEUDO!",
- [(X86fp_to_i32mem RFP64:$src, addr:$dst)]>;
+ (ops i32mem:$dst, RFP64:$src),
+ "#FP64_TO_INT32_IN_MEM PSEUDO!",
+ [(X86fp_to_i32mem RFP64:$src, addr:$dst)]>;
def FP64_TO_INT64_IN_MEM : I<0, Pseudo,
- (ops i64mem:$dst, RFP64:$src),
- "#FP64_TO_INT64_IN_MEM PSEUDO!",
- [(X86fp_to_i64mem RFP64:$src, addr:$dst)]>;
+ (ops i64mem:$dst, RFP64:$src),
+ "#FP64_TO_INT64_IN_MEM PSEUDO!",
+ [(X86fp_to_i64mem RFP64:$src, addr:$dst)]>;
}
let isTerminator = 1 in
@@ -124,10 +124,10 @@
// Random Pseudo Instructions.
def FpGETRESULT32 : FpI_<(ops RFP32:$dst), SpecialFP,
- [(set RFP32:$dst, X86fpget)]>; // FPR = ST(0)
+ [(set RFP32:$dst, X86fpget)]>; // FPR = ST(0)
def FpGETRESULT64 : FpI_<(ops RFP64:$dst), SpecialFP,
- [(set RFP64:$dst, X86fpget)]>; // FPR = ST(0)
+ [(set RFP64:$dst, X86fpget)]>; // FPR = ST(0)
let noResults = 1 in {
def FpSETRESULT32 : FpI_<(ops RFP32:$src), SpecialFP,
@@ -174,40 +174,40 @@
// Binary Ops with a memory source.
def FpADD32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fadd RFP32:$src1, (loadf32 addr:$src2)))]>;
+ [(set RFP32:$dst, (fadd RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) + [mem32]
def FpADD64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fadd RFP64:$src1, (loadf64 addr:$src2)))]>;
+ [(set RFP64:$dst, (fadd RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) + [mem64]
def FpMUL32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fmul RFP32:$src1, (loadf32 addr:$src2)))]>;
+ [(set RFP32:$dst, (fmul RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) * [mem32]
def FpMUL64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fmul RFP64:$src1, (loadf64 addr:$src2)))]>;
+ [(set RFP64:$dst, (fmul RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) * [mem64]
def FpSUB32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub RFP32:$src1, (loadf32 addr:$src2)))]>;
+ [(set RFP32:$dst, (fsub RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) - [mem32]
def FpSUB64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub RFP64:$src1, (loadf64 addr:$src2)))]>;
+ [(set RFP64:$dst, (fsub RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) - [mem64]
def FpSUBR32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub (loadf32 addr:$src2), RFP32:$src1))]>;
+ [(set RFP32:$dst, (fsub (loadf32 addr:$src2), RFP32:$src1))]>;
// ST(0) = [mem32] - ST(0)
def FpSUBR64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub (loadf64 addr:$src2), RFP64:$src1))]>;
+ [(set RFP64:$dst, (fsub (loadf64 addr:$src2), RFP64:$src1))]>;
// ST(0) = [mem64] - ST(0)
def FpDIV32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv RFP32:$src1, (loadf32 addr:$src2)))]>;
+ [(set RFP32:$dst, (fdiv RFP32:$src1, (loadf32 addr:$src2)))]>;
// ST(0) = ST(0) / [mem32]
def FpDIV64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv RFP64:$src1, (loadf64 addr:$src2)))]>;
+ [(set RFP64:$dst, (fdiv RFP64:$src1, (loadf64 addr:$src2)))]>;
// ST(0) = ST(0) / [mem64]
def FpDIVR32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv (loadf32 addr:$src2), RFP32:$src1))]>;
+ [(set RFP32:$dst, (fdiv (loadf32 addr:$src2), RFP32:$src1))]>;
// ST(0) = [mem32] / ST(0)
def FpDIVR64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv (loadf64 addr:$src2), RFP64:$src1))]>;
+ [(set RFP64:$dst, (fdiv (loadf64 addr:$src2), RFP64:$src1))]>;
// ST(0) = [mem64] / ST(0)
@@ -226,101 +226,101 @@
def FpIADD16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fadd RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) + [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) + [mem16int]
def FpIADD32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fadd RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) + [mem32int]
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) + [mem32int]
def FpIMUL16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fmul RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) * [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) * [mem16int]
def FpIMUL32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fmul RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) * [mem32int]
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) * [mem32int]
def FpISUB16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fsub RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) - [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) - [mem16int]
def FpISUB32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fsub RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) - [mem32int]
-def FpISUBR16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub (X86fild addr:$src2, i16),
- RFP32:$src1))]>;
- // ST(0) = [mem16int] - ST(0)
-def FpISUBR32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub (X86fild addr:$src2, i32),
- RFP32:$src1))]>;
- // ST(0) = [mem32int] - ST(0)
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) - [mem32int]
+def FpISUBR16m32: FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub (X86fild addr:$src2, i16),
+ RFP32:$src1))]>;
+ // ST(0) = [mem16int] - ST(0)
+def FpISUBR32m32: FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fsub (X86fild addr:$src2, i32),
+ RFP32:$src1))]>;
+ // ST(0) = [mem32int] - ST(0)
def FpIDIV16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fdiv RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) / [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) / [mem16int]
def FpIDIV32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP32:$dst, (fdiv RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) / [mem32int]
-def FpIDIVR16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i16),
- RFP32:$src1))]>;
- // ST(0) = [mem16int] / ST(0)
-def FpIDIVR32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i32),
- RFP32:$src1))]>;
- // ST(0) = [mem32int] / ST(0)
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) / [mem32int]
+def FpIDIVR16m32: FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i16),
+ RFP32:$src1))]>;
+ // ST(0) = [mem16int] / ST(0)
+def FpIDIVR32m32: FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i32),
+ RFP32:$src1))]>;
+ // ST(0) = [mem32int] / ST(0)
def FpIADD16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fadd RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) + [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) + [mem16int]
def FpIADD32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fadd RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) + [mem32int]
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) + [mem32int]
def FpIMUL16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fmul RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) * [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) * [mem16int]
def FpIMUL32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fmul RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) * [mem32int]
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) * [mem32int]
def FpISUB16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fsub RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) - [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) - [mem16int]
def FpISUB32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fsub RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) - [mem32int]
-def FpISUBR16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) - [mem32int]
+def FpISUBR16m64: FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fsub (X86fild addr:$src2, i16),
- RFP64:$src1))]>;
- // ST(0) = [mem16int] - ST(0)
-def FpISUBR32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub (X86fild addr:$src2, i32),
- RFP64:$src1))]>;
- // ST(0) = [mem32int] - ST(0)
+ RFP64:$src1))]>;
+ // ST(0) = [mem16int] - ST(0)
+def FpISUBR32m64: FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fsub (X86fild addr:$src2, i32),
+ RFP64:$src1))]>;
+ // ST(0) = [mem32int] - ST(0)
def FpIDIV16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fdiv RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) / [mem16int]
+ (X86fild addr:$src2, i16)))]>;
+ // ST(0) = ST(0) / [mem16int]
def FpIDIV32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
[(set RFP64:$dst, (fdiv RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) / [mem32int]
-def FpIDIVR16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i16),
- RFP64:$src1))]>;
- // ST(0) = [mem16int] / ST(0)
-def FpIDIVR32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i32),
- RFP64:$src1))]>;
- // ST(0) = [mem32int] / ST(0)
+ (X86fild addr:$src2, i32)))]>;
+ // ST(0) = ST(0) / [mem32int]
+def FpIDIVR16m64: FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i16),
+ RFP64:$src1))]>;
+ // ST(0) = [mem16int] / ST(0)
+def FpIDIVR32m64: FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i32),
+ RFP64:$src1))]>;
+ // ST(0) = [mem32int] / ST(0)
def FIADD16m : FPI<0xDE, MRM0m, (ops i16mem:$src), "fiadd{s} $src">;
def FIADD32m : FPI<0xDA, MRM0m, (ops i32mem:$src), "fiadd{l} $src">;
@@ -396,53 +396,53 @@
let isTwoAddress = 1 in {
def FpCMOVB32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_B))]>;
+ X86_COND_B))]>;
def FpCMOVBE32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_BE))]>;
+ X86_COND_BE))]>;
def FpCMOVE32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_E))]>;
+ X86_COND_E))]>;
def FpCMOVP32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_P))]>;
+ X86_COND_P))]>;
def FpCMOVNB32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_AE))]>;
+ X86_COND_AE))]>;
def FpCMOVNBE32: FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_A))]>;
+ X86_COND_A))]>;
def FpCMOVNE32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_NE))]>;
+ X86_COND_NE))]>;
def FpCMOVNP32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), CondMovFP,
[(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- X86_COND_NP))]>;
+ X86_COND_NP))]>;
def FpCMOVB64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_B))]>;
+ X86_COND_B))]>;
def FpCMOVBE64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_BE))]>;
+ X86_COND_BE))]>;
def FpCMOVE64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_E))]>;
+ X86_COND_E))]>;
def FpCMOVP64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_P))]>;
+ X86_COND_P))]>;
def FpCMOVNB64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_AE))]>;
+ X86_COND_AE))]>;
def FpCMOVNBE64: FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_A))]>;
+ X86_COND_A))]>;
def FpCMOVNE64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_NE))]>;
+ X86_COND_NE))]>;
def FpCMOVNP64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), CondMovFP,
[(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- X86_COND_NP))]>;
+ X86_COND_NP))]>;
}
def FCMOVB : FPI<0xC0, AddRegFrm, (ops RST:$op),
@@ -455,7 +455,7 @@
"fcmovu {$op, %st(0)|%ST(0), $op}">, DA;
def FCMOVNB : FPI<0xC0, AddRegFrm, (ops RST:$op),
"fcmovnb {$op, %st(0)|%ST(0), $op}">, DB;
-def FCMOVNBE : FPI<0xD0, AddRegFrm, (ops RST:$op),
+def FCMOVNBE: FPI<0xD0, AddRegFrm, (ops RST:$op),
"fcmovnbe {$op, %st(0)|%ST(0), $op}">, DB;
def FCMOVNE : FPI<0xC8, AddRegFrm, (ops RST:$op),
"fcmovne {$op, %st(0)|%ST(0), $op}">, DB;
@@ -463,29 +463,29 @@
"fcmovnu {$op, %st(0)|%ST(0), $op}">, DB;
// Floating point loads & stores.
-def FpLD32m : FpI<(ops RFP32:$dst, f32mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (loadf32 addr:$src))]>;
-def FpLD64m : FpI<(ops RFP64:$dst, f64mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (loadf64 addr:$src))]>;
-def FpILD16m32 : FpI<(ops RFP32:$dst, i16mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (X86fild addr:$src, i16))]>;
-def FpILD32m32 : FpI<(ops RFP32:$dst, i32mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (X86fild addr:$src, i32))]>;
-def FpILD64m32 : FpI<(ops RFP32:$dst, i64mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (X86fild addr:$src, i64))]>;
-def FpILD16m64 : FpI<(ops RFP64:$dst, i16mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (X86fild addr:$src, i16))]>;
-def FpILD32m64 : FpI<(ops RFP64:$dst, i32mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (X86fild addr:$src, i32))]>;
-def FpILD64m64 : FpI<(ops RFP64:$dst, i64mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (X86fild addr:$src, i64))]>;
+def FpLD32m : FpI<(ops RFP32:$dst, f32mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (loadf32 addr:$src))]>;
+def FpLD64m : FpI<(ops RFP64:$dst, f64mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (loadf64 addr:$src))]>;
+def FpILD16m32: FpI<(ops RFP32:$dst, i16mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (X86fild addr:$src, i16))]>;
+def FpILD32m32: FpI<(ops RFP32:$dst, i32mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (X86fild addr:$src, i32))]>;
+def FpILD64m32: FpI<(ops RFP32:$dst, i64mem:$src), ZeroArgFP,
+ [(set RFP32:$dst, (X86fild addr:$src, i64))]>;
+def FpILD16m64: FpI<(ops RFP64:$dst, i16mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (X86fild addr:$src, i16))]>;
+def FpILD32m64: FpI<(ops RFP64:$dst, i32mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (X86fild addr:$src, i32))]>;
+def FpILD64m64: FpI<(ops RFP64:$dst, i64mem:$src), ZeroArgFP,
+ [(set RFP64:$dst, (X86fild addr:$src, i64))]>;
def FpST32m : FpI<(ops f32mem:$op, RFP32:$src), OneArgFP,
- [(store RFP32:$src, addr:$op)]>;
+ [(store RFP32:$src, addr:$op)]>;
def FpST64m32 : FpI<(ops f32mem:$op, RFP64:$src), OneArgFP,
- [(truncstoref32 RFP64:$src, addr:$op)]>;
+ [(truncstoref32 RFP64:$src, addr:$op)]>;
def FpST64m : FpI<(ops f64mem:$op, RFP64:$src), OneArgFP,
- [(store RFP64:$src, addr:$op)]>;
+ [(store RFP64:$src, addr:$op)]>;
def FpSTP32m : FpI<(ops f32mem:$op, RFP32:$src), OneArgFP, []>;
def FpSTP64m32 : FpI<(ops f32mem:$op, RFP64:$src), OneArgFP, []>;
@@ -513,24 +513,24 @@
def FISTP64m : FPI<0xDF, MRM7m, (ops i64mem:$dst), "fistp{ll} $dst">;
// FISTTP requires SSE3 even though it's a FPStack op.
-def FpISTT16m32 : FpI_<(ops i16mem:$op, RFP32:$src), OneArgFP,
- [(X86fp_to_i16mem RFP32:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
+def FpISTT16m32 : FpI_<(ops i16mem:$op, RFP32:$src), OneArgFP,
+ [(X86fp_to_i16mem RFP32:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
def FpISTT32m32 : FpI_<(ops i32mem:$op, RFP32:$src), OneArgFP,
- [(X86fp_to_i32mem RFP32:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def FpISTT64m32 : FpI_<(ops i64mem:$op, RFP32:$src), OneArgFP,
- [(X86fp_to_i64mem RFP32:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def FpISTT16m64 : FpI_<(ops i16mem:$op, RFP64:$src), OneArgFP,
- [(X86fp_to_i16mem RFP64:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def FpISTT32m64 : FpI_<(ops i32mem:$op, RFP64:$src), OneArgFP,
- [(X86fp_to_i32mem RFP64:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def FpISTT64m64 : FpI_<(ops i64mem:$op, RFP64:$src), OneArgFP,
- [(X86fp_to_i64mem RFP64:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
+ [(X86fp_to_i32mem RFP32:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT64m32 : FpI_<(ops i64mem:$op, RFP32:$src), OneArgFP,
+ [(X86fp_to_i64mem RFP32:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT16m64 : FpI_<(ops i16mem:$op, RFP64:$src), OneArgFP,
+ [(X86fp_to_i16mem RFP64:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT32m64 : FpI_<(ops i32mem:$op, RFP64:$src), OneArgFP,
+ [(X86fp_to_i32mem RFP64:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
+def FpISTT64m64 : FpI_<(ops i64mem:$op, RFP64:$src), OneArgFP,
+ [(X86fp_to_i64mem RFP64:$src, addr:$op)]>,
+ Requires<[HasSSE3]>;
def FISTTP16m : FPI<0xDF, MRM1m, (ops i16mem:$dst), "fisttp{s} $dst">;
def FISTTP32m : FPI<0xDB, MRM1m, (ops i32mem:$dst), "fisttp{l} $dst">;
@@ -559,31 +559,31 @@
// Floating point compares.
-def FpUCOMr32 : FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP,
- []>; // FPSW = cmp ST(0) with ST(i)
-def FpUCOMIr32 : FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP,
- [(X86cmp RFP32:$lhs, RFP32:$rhs)]>; // CC = cmp ST(0) with ST(i)
-def FpUCOMr64 : FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP,
- []>; // FPSW = cmp ST(0) with ST(i)
-def FpUCOMIr64 : FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP,
- [(X86cmp RFP64:$lhs, RFP64:$rhs)]>; // CC = cmp ST(0) with ST(i)
+def FpUCOMr32 : FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP,
+ []>; // FPSW = cmp ST(0) with ST(i)
+def FpUCOMIr32: FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP,
+ [(X86cmp RFP32:$lhs, RFP32:$rhs)]>; // CC = cmp ST(0) with ST(i)
+def FpUCOMr64 : FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP,
+ []>; // FPSW = cmp ST(0) with ST(i)
+def FpUCOMIr64: FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP,
+ [(X86cmp RFP64:$lhs, RFP64:$rhs)]>; // CC = cmp ST(0) with ST(i)
def FUCOMr : FPI<0xE0, AddRegFrm, // FPSW = cmp ST(0) with ST(i)
(ops RST:$reg),
"fucom $reg">, DD, Imp<[ST0],[]>;
def FUCOMPr : FPI<0xE8, AddRegFrm, // FPSW = cmp ST(0) with ST(i), pop
- (ops RST:$reg),
- "fucomp $reg">, DD, Imp<[ST0],[]>;
+ (ops RST:$reg),
+ "fucomp $reg">, DD, Imp<[ST0],[]>;
def FUCOMPPr : FPI<0xE9, RawFrm, // cmp ST(0) with ST(1), pop, pop
- (ops),
- "fucompp">, DA, Imp<[ST0],[]>;
+ (ops),
+ "fucompp">, DA, Imp<[ST0],[]>;
-def FUCOMIr : FPI<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i)
- (ops RST:$reg),
- "fucomi {$reg, %st(0)|%ST(0), $reg}">, DB, Imp<[ST0],[]>;
-def FUCOMIPr : FPI<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i), pop
- (ops RST:$reg),
- "fucomip {$reg, %st(0)|%ST(0), $reg}">, DF, Imp<[ST0],[]>;
+def FUCOMIr : FPI<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i)
+ (ops RST:$reg),
+ "fucomi {$reg, %st(0)|%ST(0), $reg}">, DB, Imp<[ST0],[]>;
+def FUCOMIPr : FPI<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i), pop
+ (ops RST:$reg),
+ "fucomip {$reg, %st(0)|%ST(0), $reg}">, DF, Imp<[ST0],[]>;
// Floating point flag ops.
def FNSTSW8r : I<0xE0, RawFrm, // AX = fp flags
From asl at math.spbu.ru Tue Jul 3 12:16:46 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 03 Jul 2007 17:16:46 -0000
Subject: [llvm-commits] [llvm] r37854 - in /llvm/trunk:
autoconf/configure.ac configure
Message-ID: <200707031716.l63HGlAf016819@zion.cs.uiuc.edu>
Author: asl
Date: Tue Jul 3 12:16:46 2007
New Revision: 37854
URL: http://llvm.org/viewvc/llvm-project?rev=37854&view=rev
Log:
Revert last change until issue reported by Owen, won't be fixed.
Modified:
llvm/trunk/autoconf/configure.ac
llvm/trunk/configure
Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=37854&r1=37853&r2=37854&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Tue Jul 3 12:16:46 2007
@@ -70,7 +70,7 @@
sample) AC_CONFIG_SUBDIRS([projects/sample]) ;;
privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;;
- test-suite) AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
+ llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
llvm-reopt) AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
llvm-gcc) AC_CONFIG_SUBDIRS([projects/llvm-gcc]) ;;
llvm-java) AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=37854&r1=37853&r2=37854&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Tue Jul 3 12:16:46 2007
@@ -944,7 +944,7 @@
ac_subdirs_all='projects/sample
projects/privbracket
projects/llvm-stacker
-projects/test-suite
+projects/llvm-test
projects/llvm-reopt
projects/llvm-gcc
projects/llvm-java
@@ -2074,7 +2074,7 @@
;;
llvm-stacker) subdirs="$subdirs projects/llvm-stacker"
;;
- test-suite) subdirs="$subdirs projects/test-suite"
+ llvm-test) subdirs="$subdirs projects/llvm-test"
;;
llvm-reopt) subdirs="$subdirs projects/llvm-reopt"
;;
From lattner at apple.com Tue Jul 3 12:27:30 2007
From: lattner at apple.com (Tanya Lattner)
Date: Tue, 3 Jul 2007 10:27:30 -0700
Subject: [llvm-commits] [llvm] r37852 - in
/llvm/trunk: autoconf/configure.ac configure
In-Reply-To: <200707031701.l63H1xKa016388@zion.cs.uiuc.edu>
References: <200707031701.l63H1xKa016388@zion.cs.uiuc.edu>
Message-ID: <681F705E-1249-4935-8587-B77393837D92@apple.com>
This will most likely break the nightly tester.
-Tanya
On Jul 3, 2007, at 10:01 AM, Anton Korobeynikov wrote:
> Author: asl
> Date: Tue Jul 3 12:01:58 2007
> New Revision: 37852
>
> URL: http://llvm.org/viewvc/llvm-project?rev=37852&view=rev
> Log:
> Rename llvm-test => test-suite. By Dave Greene.
>
> Modified:
> llvm/trunk/autoconf/configure.ac
> llvm/trunk/configure
>
> Modified: llvm/trunk/autoconf/configure.ac
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/
> configure.ac?rev=37852&r1=37851&r2=37852&view=diff
> ======================================================================
> ========
>
> --- llvm/trunk/autoconf/configure.ac (original)
> +++ llvm/trunk/autoconf/configure.ac Tue Jul 3 12:01:58 2007
> @@ -70,7 +70,7 @@
> sample) AC_CONFIG_SUBDIRS([projects/sample]) ;;
> privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
> llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;;
> - llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
> + test-suite) AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
> llvm-reopt) AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
> llvm-gcc) AC_CONFIG_SUBDIRS([projects/llvm-gcc]) ;;
> llvm-java) AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
>
> Modified: llvm/trunk/configure
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?
> rev=37852&r1=37851&r2=37852&view=diff
> ======================================================================
> ========
>
> --- llvm/trunk/configure (original)
> +++ llvm/trunk/configure Tue Jul 3 12:01:58 2007
> @@ -944,7 +944,7 @@
> ac_subdirs_all='projects/sample
> projects/privbracket
> projects/llvm-stacker
> -projects/llvm-test
> +projects/test-suite
> projects/llvm-reopt
> projects/llvm-gcc
> projects/llvm-java
> @@ -2074,7 +2074,7 @@
> ;;
> llvm-stacker) subdirs="$subdirs projects/llvm-stacker"
> ;;
> - llvm-test) subdirs="$subdirs projects/llvm-test"
> + test-suite) subdirs="$subdirs projects/test-suite"
> ;;
> llvm-reopt) subdirs="$subdirs projects/llvm-reopt"
> ;;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From raulherbster at gmail.com Tue Jul 3 12:35:54 2007
From: raulherbster at gmail.com (Raul Fernandes Herbster)
Date: Tue, 3 Jul 2007 14:35:54 -0300
Subject: [llvm-commits] Patch: ARM JIT support
Message-ID: <6fbb4ff20707031035v79af3e4bh3900dfa39e972ba0@mail.gmail.com>
I received very important comments from Evan and fixed some problems. Thanks
for any suggestion.
[]'s
--
Raul Fernandes Herbster
Embedded and Pervasive Computing Laboratory - embedded.dee.ufcg.edu.br
Electrical Engineering Department - DEE - www.ee.ufcg.edu.br
Electrical Engineering and Informatics Center - CEEI
Federal University of Campina Grande - UFCG - www.ufcg.edu.br
Caixa Postal 10105
58109-970 Campina Grande - PB - Brasil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070703/878d42ea/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 5519 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070703/878d42ea/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm_jit.tar.gz
Type: application/x-gzip
Size: 3490 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070703/878d42ea/attachment.gz
From tonic at nondot.org Tue Jul 3 13:11:20 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 03 Jul 2007 18:11:20 -0000
Subject: [llvm-commits] [llvm] r37855 - /llvm/trunk/docs/Makefile
Message-ID: <200707031811.l63IBKcp018386@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Jul 3 13:11:20 2007
New Revision: 37855
URL: http://llvm.org/viewvc/llvm-project?rev=37855&view=rev
Log:
We really should not have this version number in SO many makefiles. This should also probably change to svn instead of cvs, but leaving it for now.
Modified:
llvm/trunk/docs/Makefile
Modified: llvm/trunk/docs/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Makefile?rev=37855&r1=37854&r2=37855&view=diff
==============================================================================
--- llvm/trunk/docs/Makefile (original)
+++ llvm/trunk/docs/Makefile Tue Jul 3 13:11:20 2007
@@ -14,7 +14,7 @@
PROJ_OBJ_DIR = .
DOXYGEN = doxygen
# Extract version number from the AC_INT line in configure.ac
-# AC_INIT([[llvm]],[[2.0cvs]],[llvmbugs at cs.uiuc.edu])
+# AC_INIT([[llvm]],[[2.1cvs]],[llvmbugs at cs.uiuc.edu])
PACKAGE_VERSION = $(shell grep AC_INIT ../autoconf/configure.ac | sed -e 's/[^,]*,[[][[]//' -e 's/]],.*//')
$(warning VERSION=$(VERSION))
From isanbard at gmail.com Tue Jul 3 13:12:19 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 3 Jul 2007 11:12:19 -0700
Subject: [llvm-commits] Commit Message Problems
Message-ID: <16e5fdf90707031112t4edaefd7t12186ed12c4bb600@mail.gmail.com>
On 7/3/07, Dan Gohman wrote:
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=37851&r1=37850&r2=37851&view=diff
> ==============================================================================
>
Could there be an extra newline between the URL and the ==== border?
My mail client makes it part of the URL. (Yes, I know it shouldn't do
that, but still...)
Thanks!
-bw
From asl at math.spbu.ru Tue Jul 3 13:20:40 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 03 Jul 2007 22:20:40 +0400
Subject: [llvm-commits] Commit Message Problems
In-Reply-To: <16e5fdf90707031112t4edaefd7t12186ed12c4bb600.SS587SS@mail.gmail.com>
References: <16e5fdf90707031112t4edaefd7t12186ed12c4bb600.SS587SS@mail.gmail.com>
Message-ID: <1183486840.6891.93.camel@asl.dorms.spbu.ru>
Hello, Bill
> On 7/3/07, Dan Gohman wrote:
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=37851&r1=37850&r2=37851&view=diff
> > ==============================================================================
> >
> Could there be an extra newline between the URL and the ==== border?
> My mail client makes it part of the URL. (Yes, I know it shouldn't do
> that, but still...)
We know about this issue. Even more, I've prepared patch for it. It
should be just installed on Zion.
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From isanbard at gmail.com Tue Jul 3 13:24:28 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 3 Jul 2007 11:24:28 -0700
Subject: [llvm-commits] Commit Message Problems
In-Reply-To: <1183486840.6891.93.camel@asl.dorms.spbu.ru>
References: <16e5fdf90707031112t4edaefd7t12186ed12c4bb600.SS587SS@mail.gmail.com>
<1183486840.6891.93.camel@asl.dorms.spbu.ru>
Message-ID: <16e5fdf90707031124p39ff036bj6baef9dbcd13ee26@mail.gmail.com>
On 7/3/07, Anton Korobeynikov wrote:
> Hello, Bill
>
> > On 7/3/07, Dan Gohman wrote:
> > > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=37851&r1=37850&r2=37851&view=diff
> > > ==============================================================================
> > >
> > Could there be an extra newline between the URL and the ==== border?
> > My mail client makes it part of the URL. (Yes, I know it shouldn't do
> > that, but still...)
> We know about this issue. Even more, I've prepared patch for it. It
> should be just installed on Zion.
>
Coolness! Thanks :-)
-bw
From clattner at apple.com Tue Jul 3 13:32:37 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 11:32:37 -0700
Subject: [llvm-commits] Commit Message Problems
In-Reply-To: <1183486840.6891.93.camel@asl.dorms.spbu.ru>
References: <16e5fdf90707031112t4edaefd7t12186ed12c4bb600.SS587SS@mail.gmail.com>
<1183486840.6891.93.camel@asl.dorms.spbu.ru>
Message-ID:
On Jul 3, 2007, at 11:20 AM, Anton Korobeynikov wrote:
> Hello, Bill
>
>> On 7/3/07, Dan Gohman wrote:
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/
>>> SelectionDAG/DAGCombiner.cpp?rev=37851&r1=37850&r2=37851&view=diff
>>> ====================================================================
>>> ==========
>>>
>> Could there be an extra newline between the URL and the ==== border?
>> My mail client makes it part of the URL. (Yes, I know it shouldn't do
>> that, but still...)
> We know about this issue. Even more, I've prepared patch for it. It
> should be just installed on Zion.
I installed it on zion, it still doesn't work. Perhaps I did it wrong?
-Chris
From resistor at mac.com Tue Jul 3 13:37:09 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 03 Jul 2007 18:37:09 -0000
Subject: [llvm-commits] [llvm] r37856 - in /llvm/trunk:
lib/Transforms/Scalar/GVNPRE.cpp test/Transforms/GVNPRE/cast.ll
Message-ID: <200707031837.l63Ib9A3019244@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Jul 3 13:37:08 2007
New Revision: 37856
URL: http://llvm.org/viewvc/llvm-project?rev=37856&view=rev
Log:
Add support for performing GVNPRE on cast instructions, and add a testcase for this.
Added:
llvm/trunk/test/Transforms/GVNPRE/cast.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=37856&r1=37855&r2=37856&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Jul 3 13:37:08 2007
@@ -629,8 +629,41 @@
if (V == 0)
return 0;
+ // Unary Operations
+ if (isa(V)) {
+ User* U = cast(V);
+
+ Value* newOp1 = 0;
+ if (isa(U->getOperand(0)))
+ newOp1 = phi_translate(U->getOperand(0), pred, succ);
+ else
+ newOp1 = U->getOperand(0);
+
+ if (newOp1 == 0)
+ return 0;
+
+ if (newOp1 != U->getOperand(0)) {
+ Instruction* newVal = 0;
+ if (CastInst* C = dyn_cast(U))
+ newVal = CastInst::create(C->getOpcode(),
+ newOp1, C->getType(),
+ C->getName()+".expr");
+
+ uint32_t v = VN.lookup_or_add(newVal);
+
+ Value* leader = find_leader(availableOut[pred], v);
+ if (leader == 0) {
+ createdExpressions.push_back(newVal);
+ return newVal;
+ } else {
+ VN.erase(newVal);
+ delete newVal;
+ return leader;
+ }
+ }
+
// Binary Operations
- if (isa(V) || isa(V) ||
+ } if (isa(V) || isa(V) ||
isa(V)) {
User* U = cast(V);
@@ -783,8 +816,22 @@
for (unsigned i = 0; i < worklist.size(); ++i) {
Value* v = worklist[i];
+ // Handle unary ops
+ if (isa(v)) {
+ User* U = cast(v);
+
+ bool lhsValid = !isa(U->getOperand(0));
+ lhsValid |= presentInSet.test(VN.lookup(U->getOperand(0)));
+ if (lhsValid)
+ lhsValid = !dependsOnInvoke(U->getOperand(0));
+
+ if (!lhsValid) {
+ set.erase(U);
+ presentInSet.flip(VN.lookup(U));
+ }
+
// Handle binary ops
- if (isa(v) || isa(v) ||
+ } else if (isa(v) || isa(v) ||
isa(v)) {
User* U = cast(v);
@@ -843,9 +890,23 @@
while (!stack.empty()) {
Value* e = stack.back();
-
+
+ // Handle unary ops
+ if (isa(e)) {
+ User* U = cast(e);
+ Value* l = find_leader(set, VN.lookup(U->getOperand(0)));
+
+ if (l != 0 && isa(l) &&
+ visited.count(l) == 0)
+ stack.push_back(l);
+ else {
+ vec.push_back(e);
+ visited.insert(e);
+ stack.pop_back();
+ }
+
// Handle binary ops
- if (isa(e) || isa(e) ||
+ } else if (isa(e) || isa(e) ||
isa(e)) {
User* U = cast(e);
Value* l = find_leader(set, VN.lookup(U->getOperand(0)));
@@ -935,7 +996,8 @@
if (isa(BI) || isa(BI) ||
isa(BI) || isa(BI) ||
- isa(BI) || isa(BI)) {
+ isa(BI) || isa(BI) ||
+ isa(BI)) {
Value *leader = find_leader(availableOut[BB], VN.lookup(BI));
if (leader != 0)
@@ -990,7 +1052,27 @@
availNumbers.resize(VN.size());
currPhis.insert(p);
+
+ // Handle unary ops
+ } else if (isa(I)) {
+ User* U = cast(I);
+ Value* leftValue = U->getOperand(0);
+
+ unsigned num = VN.lookup_or_add(U);
+ expNumbers.resize(VN.size());
+ availNumbers.resize(VN.size());
+
+ if (isa(leftValue))
+ if (!expNumbers.test(VN.lookup(leftValue))) {
+ currExps.insert(leftValue);
+ expNumbers.set(VN.lookup(leftValue));
+ }
+ if (!expNumbers.test(VN.lookup(U))) {
+ currExps.insert(U);
+ expNumbers.set(num);
+ }
+
// Handle binary ops
} else if (isa(I) || isa(I) ||
isa(I)) {
@@ -1266,21 +1348,31 @@
isa(U->getOperand(0)) ||
isa(U->getOperand(0)) ||
isa(U->getOperand(0)) ||
- isa(U->getOperand(0)))
+ isa(U->getOperand(0)) ||
+ isa(U->getOperand(0)))
s1 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(0)));
else
s1 = U->getOperand(0);
Value* s2 = 0;
- if (isa(U->getOperand(1)) ||
- isa(U->getOperand(1)) ||
- isa(U->getOperand(1)) ||
- isa(U->getOperand(1)) ||
- isa(U->getOperand(1)) ||
- isa(U->getOperand(1)))
- s2 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(1)));
- else
- s2 = U->getOperand(1);
+
+ if (isa(U) ||
+ isa(U) ||
+ isa(U) ||
+ isa(U) ||
+ isa(U) ||
+ isa(U))
+ if (isa(U->getOperand(1)) ||
+ isa(U->getOperand(1)) ||
+ isa(U->getOperand(1)) ||
+ isa(U->getOperand(1)) ||
+ isa(U->getOperand(1)) ||
+ isa(U->getOperand(1)) ||
+ isa(U->getOperand(1))) {
+ s2 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(1)));
+ } else {
+ s2 = U->getOperand(1);
+ }
// Ternary Operators
Value* s3 = 0;
@@ -1292,10 +1384,12 @@
isa(U->getOperand(2)) ||
isa(U->getOperand(2)) ||
isa(U->getOperand(2)) ||
- isa(U->getOperand(2)))
+ isa(U->getOperand(2)) ||
+ isa(U->getOperand(2))) {
s3 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(2)));
- else
+ } else {
s3 = U->getOperand(2);
+ }
Value* newVal = 0;
if (BinaryOperator* BO = dyn_cast(U))
@@ -1319,6 +1413,10 @@
newVal = new SelectInst(S->getCondition(), S->getTrueValue(),
S->getFalseValue(), S->getName()+".gvnpre",
(*PI)->getTerminator());
+ else if (CastInst* C = dyn_cast(U))
+ newVal = CastInst::create(C->getOpcode(), s1, C->getType(),
+ C->getName()+".gvnpre",
+ (*PI)->getTerminator());
VN.add(newVal, VN.lookup(U));
@@ -1365,7 +1463,7 @@
if (isa(e) || isa(e) ||
isa(e) || isa(e) ||
- isa(e) || isa(e)) {
+ isa(e) || isa(e) || isa(e)) {
if (find_leader(availableOut[D->getIDom()->getBlock()],
VN.lookup(e)) != 0)
continue;
Added: llvm/trunk/test/Transforms/GVNPRE/cast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVNPRE/cast.ll?rev=37856&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVNPRE/cast.ll (added)
+++ llvm/trunk/test/Transforms/GVNPRE/cast.ll Tue Jul 3 13:37:08 2007
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
+
+define i32 @extract() {
+entry: ; preds = %cond_false, %entry
+ br i1 true, label %cond_true, label %cond_false
+
+cond_true:
+ br label %end
+
+cond_false:
+ %a = sext i16 0 to i32
+ br label %end
+
+end:
+ %b = sext i16 0 to i32
+ ret i32 %b
+}
From resistor at mac.com Tue Jul 3 14:01:42 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 03 Jul 2007 19:01:42 -0000
Subject: [llvm-commits] [llvm] r37857 -
/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Message-ID: <200707031901.l63J1gTf019961@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Jul 3 14:01:42 2007
New Revision: 37857
URL: http://llvm.org/viewvc/llvm-project?rev=37857&view=rev
Log:
Make the unary operator case a bit faster, since casts are the only kind of unary operation.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=37857&r1=37856&r2=37857&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Jul 3 14:01:42 2007
@@ -630,9 +630,7 @@
return 0;
// Unary Operations
- if (isa(V)) {
- User* U = cast(V);
-
+ if (CastInst* U = dyn_cast(V)) {
Value* newOp1 = 0;
if (isa(U->getOperand(0)))
newOp1 = phi_translate(U->getOperand(0), pred, succ);
@@ -817,9 +815,7 @@
Value* v = worklist[i];
// Handle unary ops
- if (isa(v)) {
- User* U = cast(v);
-
+ if (CastInst* U = dyn_cast(v)) {
bool lhsValid = !isa(U->getOperand(0));
lhsValid |= presentInSet.test(VN.lookup(U->getOperand(0)));
if (lhsValid)
@@ -892,8 +888,7 @@
Value* e = stack.back();
// Handle unary ops
- if (isa(e)) {
- User* U = cast(e);
+ if (CastInst* U = dyn_cast(e)) {
Value* l = find_leader(set, VN.lookup(U->getOperand(0)));
if (l != 0 && isa(l) &&
@@ -1054,8 +1049,7 @@
currPhis.insert(p);
// Handle unary ops
- } else if (isa(I)) {
- User* U = cast(I);
+ } else if (CastInst* U = dyn_cast(I)) {
Value* leftValue = U->getOperand(0);
unsigned num = VN.lookup_or_add(U);
From greened at obbligato.org Tue Jul 3 15:11:10 2007
From: greened at obbligato.org (David A. Greene)
Date: Tue, 3 Jul 2007 15:11:10 -0500
Subject: [llvm-commits] [llvm] r37854 - in /llvm/trunk:
autoconf/configure.ac configure
In-Reply-To: <200707031716.l63HGlAf016819@zion.cs.uiuc.edu>
References: <200707031716.l63HGlAf016819@zion.cs.uiuc.edu>
Message-ID: <200707031511.10946.greened@obbligato.org>
On Tuesday 03 July 2007 12:16, Anton Korobeynikov wrote:
> Author: asl
> Date: Tue Jul 3 12:16:46 2007
> New Revision: 37854
>
> URL: http://llvm.org/viewvc/llvm-project?rev=37854&view=rev
> Log:
> Revert last change until issue reported by Owen, won't be fixed.
> - test-suite) AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
> + llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
I believe the right thing to do here is fix the web page.
-Dave
From clattner at apple.com Tue Jul 3 15:31:24 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 13:31:24 -0700
Subject: [llvm-commits] [llvm] r37854 - in /llvm/trunk:
autoconf/configure.ac configure
In-Reply-To: <200707031511.10946.greened@obbligato.org>
References: <200707031716.l63HGlAf016819@zion.cs.uiuc.edu>
<200707031511.10946.greened@obbligato.org>
Message-ID:
On Jul 3, 2007, at 1:11 PM, David A. Greene wrote:
> On Tuesday 03 July 2007 12:16, Anton Korobeynikov wrote:
>> Author: asl
>> Date: Tue Jul 3 12:16:46 2007
>> New Revision: 37854
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=37854&view=rev
>> Log:
>> Revert last change until issue reported by Owen, won't be fixed.
>
>> - test-suite) AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
>> + llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
>
> I believe the right thing to do here is fix the web page.
alternatively, just add both to the configure script.
-Chris
From djg at cray.com Tue Jul 3 16:13:20 2007
From: djg at cray.com (Dan Gohman)
Date: Tue, 3 Jul 2007 16:13:20 -0500
Subject: [llvm-commits] CVS:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp LegalizeDAG.cpp
SelectionDAG.cpp SelectionDAGISel.cpp TargetLowering.cpp
Message-ID: <20070703211320.GF5693@village.us.cray.com>
>> We overload ISD::FADD and quite a lot of others. Why not
>> ISD::ConstantFP too?
>
> Fair enough, after pondering on it, I agree with you. The proposed
> semantics are that a ConstantFP (and also a normal Constant?) produce
> the splatted immediate value?
Constant sounds good too. And UNDEF, for that matter. And yes, that's the
semantics I mean.
> If so, this sounds fine. This should also reduce codegen memory
> usage for many common cases, a very nice bonus :)
:)
> Please add a dag combine xform from build_vector [c,c,c,c] ->
> constantfp and friends.
I sketched out some of the code for this. One question that's come up so far is
whether if the vector has some undef elements but all the non-undef elements
are equal it should still be folded. My initial preference is to still fold it,
since that lets things like isBuildVectorAllZeros become trivial to unnecessary,
but it is a pessimization in some obscure cases.
Dan
--
Dan Gohman, Cray Inc.
From djg at cray.com Tue Jul 3 16:29:50 2007
From: djg at cray.com (Dan Gohman)
Date: Tue, 3 Jul 2007 16:29:50 -0500
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <200707031643.14426.baldrick@free.fr>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
<200707031643.14426.baldrick@free.fr>
Message-ID: <20070703212950.GG5693@village.us.cray.com>
On Tue, Jul 03, 2007 at 04:43:14PM +0200, Duncan Sands wrote:
> Hi Dan,
>
> > + // fold (add x, undef) -> undef
> > + if (N1.getOpcode() == ISD::UNDEF)
> > + return N1;
>
> what if N0 is undef and not N1?
I had thought they'd be canonicalized, but I missed that the dagcombiner
sometimes has non-canonicalized nodes. I'll fix these.
> > - // If either operand is undef, the result is undef
> > - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> > - return DAG.getNode(ISD::UNDEF, VT);
> > -
>
> Did you move this earlier to make it more efficient, or for another
> reason?
I was looking at the instcombine code, where undefs tend to be handled
toward the beginning. I wasn't trying to micro-optimize dagcombine :).
> > - // If either operand is undef, the result is undef
> > + // If either operand of a sub is undef, the result is undef
> > if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> > return DAG.getNode(ISD::UNDEF, VT);
>
> If it was more efficient doing this earlier for add, presumably the
> same is true for subtraction.
I guess I can make this more consistent with instcombine too.
> > + // fold (mul x, undef) -> 0
> > + if (N1.getOpcode() == ISD::UNDEF)
> > + return DAG.getConstant(0, VT);
>
> Yes, this seems better :) Again, is the undef guaranteed to be
> in N1 and not N0?
Same as add, above.
> > + // X / undef -> undef
> > + if (N1.getOpcode() == ISD::UNDEF)
> > + return N1;
>
> Here you use that X / 0 is undefined in the usual sense,
> and can take on any value. Is it undefined? Also, wouldn't
> it be better to do this before the N0 one, in case you have
> undef/undef ?
>
> Same comments for udiv, srem and urem.
The primary aim of this mod was to get dagcombine to stop being
over-aggressive. I agree that there does seem to be more room for
optimization, in both instcombine and dagcombine.
> > @@ -1390,10 +1400,6 @@
> > return DAG.getNode(N0.getOpcode(), VT, ORNode, N0.getOperand(1));
> > }
> >
> > - // If either operand is undef, the result is undef
> > - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> > - return DAG.getNode(ISD::UNDEF, VT);
> > -
> > return SDOperand();
> > }
>
> (SimplifyBinOpWithSameOpcodeHands)
>
> In this case both N0 and N1 must be undef (since by definition they
> have the same opcode here), so returning undef seems ok here. That
> said, the original "if" was kind of silly since if one opcode is undef
> then so is the other.
This logic was removed in favor of having specific logic in visitAND,
visitOR, and visitXOR. The new code has the same problem as visitADD,
discussed above, so I'll fix that, but then it'll cover the UNDEF op UNDEF
cases as well.
> > + // fold (or x, undef) -> -1
> > + if (N1.getOpcode() == ISD::UNDEF)
> > + return DAG.getConstant(-1, VT);
>
> Is this the right way to get an all-bits-one value?
I guess DAG.getConstant(~0ULL, VT) is the way its written elsewhere. And I
have to fix it for vectors. I'll work on it.
> > @@ -3040,10 +3051,6 @@
> > if (isNegatibleForFree(N1))
> > return DAG.getNode(ISD::FADD, VT, N0, GetNegatedExpression(N1, DAG));
> >
> > - // If either operand is undef, the result is undef
> > - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
> > - return DAG.getNode(ISD::UNDEF, VT);
> > -
> > return SDOperand();
> > }
>
> Why the difference between fadd and fsub? If you are worried about NaNs
> etc, at worst you can always, I suppose, turn x fsub undef into x.
> Likewise for the other floating point ops.
Did you mean the difference between integer add and fadd? I just decided
that folding floating-point undef isn't very valuable to me, and the easiest
way to fix the code was to revert the change.
Looking at it a little more, I think the instcombine folds are actually
wrong here. For example, it does X + undef -> undef, but that's wrong if
X is a NaN.
Dan
--
Dan Gohman, Cray Inc.
From resistor at mac.com Tue Jul 3 16:36:47 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 03 Jul 2007 21:36:47 -0000
Subject: [llvm-commits] [llvm] r37858 - in /llvm/trunk/examples: BFtoLLVM/
Makefile
Message-ID: <200707032136.l63LalTV024067@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Jul 3 16:36:47 2007
New Revision: 37858
URL: http://llvm.org/viewvc/llvm-project?rev=37858&view=rev
Log:
Remove BFtoLLVM. It was old, and a poor example because it didn't use best practices for making
a LLVM frontend in C++. Maybe someday it will be rewritten..
Removed:
llvm/trunk/examples/BFtoLLVM/
Modified:
llvm/trunk/examples/Makefile
Modified: llvm/trunk/examples/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Makefile?rev=37858&r1=37857&r2=37858&view=diff
==============================================================================
--- llvm/trunk/examples/Makefile (original)
+++ llvm/trunk/examples/Makefile Tue Jul 3 16:36:47 2007
@@ -10,7 +10,7 @@
include $(LEVEL)/Makefile.config
-PARALLEL_DIRS:= Fibonacci HowToUseJIT ModuleMaker BFtoLLVM
+PARALLEL_DIRS:= Fibonacci HowToUseJIT ModuleMaker
ifeq ($(HAVE_PTHREAD),1)
PARALLEL_DIRS += ParallelJIT
From clattner at apple.com Tue Jul 3 16:42:01 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 14:42:01 -0700
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <20070703212950.GG5693@village.us.cray.com>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
<200707031643.14426.baldrick@free.fr>
<20070703212950.GG5693@village.us.cray.com>
Message-ID: <13196C7C-515E-4B33-BF85-68D843EBD0BA@apple.com>
>>> + // fold (or x, undef) -> -1
>>> + if (N1.getOpcode() == ISD::UNDEF)
>>> + return DAG.getConstant(-1, VT);
>>
>> Is this the right way to get an all-bits-one value?
>
> I guess DAG.getConstant(~0ULL, VT) is the way its written
> elsewhere. And I
> have to fix it for vectors. I'll work on it.
Either way works. "-1" is a signed integer that sign extends to
uint64_t. ~0ULL is more explicit though.
> Looking at it a little more, I think the instcombine folds are
> actually
> wrong here. For example, it does X + undef -> undef, but that's
> wrong if
> X is a NaN.
Ah, good point.
-Chris
From asl at math.spbu.ru Tue Jul 3 16:57:50 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 03 Jul 2007 21:57:50 -0000
Subject: [llvm-commits] [llvm] r37859 - /llvm/trunk/utils/NLT.schema
Message-ID: <200707032157.l63Lvo9m024974@zion.cs.uiuc.edu>
Author: asl
Date: Tue Jul 3 16:57:50 2007
New Revision: 37859
URL: http://llvm.org/viewvc/llvm-project?rev=37859&view=rev
Log:
Test modified svn mailer
Modified:
llvm/trunk/utils/NLT.schema
Modified: llvm/trunk/utils/NLT.schema
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/NLT.schema?rev=37859&r1=37858&r2=37859&view=diff
==============================================================================
--- llvm/trunk/utils/NLT.schema (original)
+++ llvm/trunk/utils/NLT.schema Tue Jul 3 16:57:50 2007
@@ -5,3 +5,4 @@
`VALUE` double NOT NULL default '0',
KEY `name_index` (`NAME`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
From clattner at apple.com Tue Jul 3 17:07:26 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 15:07:26 -0700
Subject: [llvm-commits]
CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
LegalizeDAG.cpp SelectionDAG.cpp SelectionDAGISel.cpp
TargetLowering.cpp
In-Reply-To: <20070703211320.GF5693@village.us.cray.com>
References: <20070703211320.GF5693@village.us.cray.com>
Message-ID: <6E7636D5-88D1-45E1-9017-86553FBF974B@apple.com>
On Jul 3, 2007, at 2:13 PM, Dan Gohman wrote:
>>> We overload ISD::FADD and quite a lot of others. Why not
>>> ISD::ConstantFP too?
>>
>> Fair enough, after pondering on it, I agree with you. The proposed
>> semantics are that a ConstantFP (and also a normal Constant?) produce
>> the splatted immediate value?
>
> Constant sounds good too. And UNDEF, for that matter. And yes,
> that's the
> semantics I mean.
Ok, makes sense. I think we already use UNDEF for vectors.
>> Please add a dag combine xform from build_vector [c,c,c,c] ->
>> constantfp and friends.
>
> I sketched out some of the code for this. One question that's come
> up so far is
> whether if the vector has some undef elements but all the non-undef
> elements
> are equal it should still be folded. My initial preference is to
> still fold it,
> since that lets things like isBuildVectorAllZeros become trivial to
> unnecessary,
> but it is a pessimization in some obscure cases.
I'm not sure about it. One specific issue is with shuffle masks,
which we want to retain the undef element values for. I don't think
there is a good way to retain shuffle masks but not other build
vectors, so we probably need to keep the individual undef elements in
it.
isBuildVectorAllZeros and friends are another issue. To me there are
actually two issues that should be resolved at some point:
1. vector constant and shuffle mask matching code is crazily complex,
particularly in the x86 backend. For vector constants, this is only
slightly annoying. For vector shuffle masks, the selected shuffles
are currently whatever is best for yonah, and it's not really
possible to prefer different shuffles on different subtargets. We
really want to add a layer of abstraction in the shuffle/constant
matching code, which would make the undef handling stuff happen
implicitly. Making a more declarative description of the various
masks would make it much easier to maintain, understand, and debug.
2. the x86 backend specifically has a problem with the way it selects
vector constants (I think this is in the readme). In particular, if
you have a 4 x f32 and a 4 x i32 zero vector, you'll get two
different pxor instructions, because they are of different type.
There are two different ways to solve this problem:
The easy answer is to do what the ppc backend does. It always
selects zero (and -1) vectors to 4 x i32 IIRC, and then does a
bitcast to the desired type if needed. This ensures that the
constant vectors always get CSEd. The tricky part of this is to
ensure that the 0/-1 vectors still get folded if you have operations
(like ~) that require one of these as an operand. This ugliness is
why we have "vnot" and "vnot_conv" and have to duplicate patterns.
The better fix is to change the way the select phase produces code.
In particular, the reason these two zero vectors don't get CSE'd
after selection is because they have two different value types, and
the autocse stuff doesn't "know" that the two VTs end up in the same
register class.
To solve this, it seems like we can add a new MVT type, where a
certain range of MVTs (128-255?) correspond to register class ID's.
At selection time, instead of giving the new nodes their old MVT's,
they would get new MVT's that correspond to the regclass of the
result (ok, we'd keep MVT::Other, MVT::Flag and maybe some others).
This makes the scheduler slightly simpler (because it doesn't need to
map MVT -> regclass) anymore, and opens up future possibilities.
In particular, it lets us fix a long-standing class of issues where
we can't have fp stack and SSE registers around at the same time,
both with MVT::f32 or f64 type. The current scheduler can only map
f32 to one register class (thus, it can't keep the distinction) but
with this change the select pass can pick any regclass it wants.
Anyway, this is a bit of a crazy tangent, but I think undef's in
buildvector should probably stay :)
-Chris
From resistor at mac.com Tue Jul 3 17:50:57 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 03 Jul 2007 22:50:57 -0000
Subject: [llvm-commits] [llvm] r37860 -
/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Message-ID: <200707032250.l63MovSU026731@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Jul 3 17:50:56 2007
New Revision: 37860
URL: http://llvm.org/viewvc/llvm-project?rev=37860&view=rev
Log:
Add functionality to value number GEP instructions. This also provides the infrastructure that will
be used for function calls. NOTE: This does not yet do any transformation of GEPs or function calls.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=37860&r1=37859&r2=37860&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Jul 3 17:50:56 2007
@@ -62,13 +62,14 @@
FCMPULT, FCMPULE, FCMPUNE, EXTRACT, INSERT,
SHUFFLE, SELECT, TRUNC, ZEXT, SEXT, FPTOUI,
FPTOSI, UITOFP, SITOFP, FPTRUNC, FPEXT,
- PTRTOINT, INTTOPTR, BITCAST};
+ PTRTOINT, INTTOPTR, BITCAST, GEP};
ExpressionOpcode opcode;
const Type* type;
uint32_t firstVN;
uint32_t secondVN;
uint32_t thirdVN;
+ std::vector varargs;
bool operator< (const Expression& other) const {
if (opcode < other.opcode)
@@ -91,8 +92,20 @@
return true;
else if (thirdVN > other.thirdVN)
return false;
- else
+ else {
+ if (varargs.size() < other.varargs.size())
+ return true;
+ else if (varargs.size() > other.varargs.size())
+ return false;
+
+ for (size_t i = 0; i < varargs.size(); ++i)
+ if (varargs[i] < other.varargs[i])
+ return true;
+ else if (varargs[i] > other.varargs[i])
+ return false;
+
return false;
+ }
}
};
@@ -112,6 +125,7 @@
Expression create_expression(InsertElementInst* V);
Expression create_expression(SelectInst* V);
Expression create_expression(CastInst* C);
+ Expression create_expression(GetElementPtrInst* G);
public:
ValueTable() { nextValueNumber = 1; }
uint32_t lookup_or_add(Value* V);
@@ -354,6 +368,22 @@
return e;
}
+ValueTable::Expression ValueTable::create_expression(GetElementPtrInst* G) {
+ Expression e;
+
+ e.firstVN = lookup_or_add(G->getPointerOperand());
+ e.secondVN = 0;
+ e.thirdVN = 0;
+ e.type = G->getType();
+ e.opcode = Expression::SELECT;
+
+ for (GetElementPtrInst::op_iterator I = G->idx_begin(), E = G->idx_end();
+ I != E; ++I)
+ e.varargs.push_back(lookup_or_add(*I));
+
+ return e;
+}
+
//===----------------------------------------------------------------------===//
// ValueTable External Functions
//===----------------------------------------------------------------------===//
From isanbard at gmail.com Tue Jul 3 18:04:11 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 03 Jul 2007 23:04:11 -0000
Subject: [llvm-commits] [llvm] r37861 - /llvm/trunk/Makefile.config.in
Message-ID: <200707032304.l63N4BWo027173@zion.cs.uiuc.edu>
Author: void
Date: Tue Jul 3 18:04:11 2007
New Revision: 37861
URL: http://llvm.org/viewvc/llvm-project?rev=37861&view=rev
Log:
Change the place where man pages are installed to ${prefix}/share/man1. This
puts them in a more standardized place.
Modified:
llvm/trunk/Makefile.config.in
Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=37861&r1=37860&r2=37861&view=diff
==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Tue Jul 3 18:04:11 2007
@@ -83,7 +83,7 @@
PROJ_etcdir := $(DESTDIR)$(PROJ_prefix)/etc/llvm
PROJ_includedir := $(DESTDIR)$(PROJ_prefix)/include
PROJ_infodir := $(DESTDIR)$(PROJ_prefix)/info
-PROJ_mandir := $(DESTDIR)$(PROJ_prefix)/man
+PROJ_mandir := $(DESTDIR)$(PROJ_prefix)/share/man
# Determine if we're on a unix type operating system
LLVM_ON_UNIX:=@LLVM_ON_UNIX@
From bwendlin at apple.com Tue Jul 3 18:06:28 2007
From: bwendlin at apple.com (bwendlin at apple.com)
Date: Tue, 3 Jul 2007 16:06:28 -0700 (PDT)
Subject: [llvm-commits] [129120] Change the place the man pages are
installed to be /usr/local/ share/man instead
Message-ID: <20070703230628.23A84C3CC9B9@src>
Revision: 129120
Author: bwendlin
Date: 2007-07-03 16:06:28 -0700 (Tue, 03 Jul 2007)
Log Message:
-----------
Change the place the man pages are installed to be /usr/local/share/man instead
of /usr/local/llvm-gcc-install/share/man.
Modified Paths:
--------------
apple-local/branches/llvm/build_gcc
Modified: apple-local/branches/llvm/build_gcc
===================================================================
--- apple-local/branches/llvm/build_gcc 2007-07-03 22:52:55 UTC (rev 129119)
+++ apple-local/branches/llvm/build_gcc 2007-07-03 23:06:28 UTC (rev 129120)
@@ -162,7 +162,7 @@
CONFIGFLAGS="--disable-checking --enable-werror \
--prefix=$DEST_ROOT \
- --mandir=$DEST_ROOT/share/man \
+ --mandir=$DEST_DIR$LLVM_INSTALL_PREFIX/share/man \
--enable-languages=c,objc,c++,obj-c++ \
--program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
$LIBSTDCXX_CONFIG_OPTION \
From clattner at apple.com Tue Jul 3 18:41:50 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 16:41:50 -0700
Subject: [llvm-commits]
CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
In-Reply-To: <46831649.6010708@gmail.com>
References: <46831649.6010708@gmail.com>
Message-ID: <6526931C-F1A8-4E8C-8B70-221D47F82C00@apple.com>
On Jun 27, 2007, at 7:00 PM, Sheng Zhou wrote:
> Chris,
>
> Attached is the testcase, which will get:
>
> opt: /developer/home2/zsth/llvm-gcc-dev/HEAD/llvm/llvm/lib/VMCore/
> Constants.cpp:1559: static llvm::Constant*
> llvm::ConstantExpr::getZExt(llvm::Constant*, const llvm::Type*):
> Assertion `C->getType()->getPrimitiveSizeInBits() < Ty-
> >getPrimitiveSizeInBits()&& "SrcTy must be smaller than DestTy for
> ZExt!"' failed.
>
> The condition "IterationCount->getType() != LargestType" doesn't
> mean the IterationCount->getType's bitwidth < LargestType's
> so, sometimes, (like in this testcase), it need a trunc not ext.
> This patch is to fix it.
Ah, I see. Thank you for checking in the testcase. The reason this
looked fishy to me is that the code attempts to insert the IV as the
largest type, but that it could then need a zero extend. Doesn't
this mean the zero extend case (which I know you didn't put in
there :) is really dead? If so, please remove it and switch back to
a simple:
if (IterationCount->getType() != LargestType)
IterationCount = SCEVTruncateExpr::get(IterationCount,
LargestType);
Thanks! If this doesn't make any sense, please feel free to ask for
clarification :)
-Chris
> Sheng
>
>
>
> DOUT << "INDVARS: New CanIV: " << *IndVar;
>>
>> if (!isa(IterationCount)) {
>> - if (IterationCount->getType() != LargestType)
>> + if (IterationCount->getType()->getPrimitiveSizeInBits() <
>> + LargestType->getPrimitiveSizeInBits())
>> IterationCount = SCEVZeroExtendExpr::get(IterationCount,
>> LargestType);
>> + else if (IterationCount->getType() != LargestType)
>> + IterationCount = SCEVTruncateExpr::get(IterationCount,
>> LargestType);
>> if (Instruction *DI = LinearFunctionTestReplace(L,
>> IterationCount,Rewriter))
>> DeadInsts.insert(DI);
>> }
>
>
>
> ; ModuleID = 'testcase.bc'
> target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
> target triple = "i686-pc-linux-gnu"
>
> define i32 @testcase(i5 zext %k) {
> entry:
> br label %bb2
>
> bb: ; preds = %bb2
> %tmp1 = add i32 %tmp2, %result ; [#uses=1]
> %indvar_next1 = add i5 %k_0, 1 ; [#uses=1]
> br label %bb2
>
> bb2: ; preds = %bb, %entry
> %k_0 = phi i5 [ 0, %entry ], [ %indvar_next1, %bb ] ; [#uses=2]
> %result = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ; [#uses=2]
> %tmp2 = zext i5 %k_0 to i32 ; [#uses=1]
> %exitcond = icmp eq i32 %tmp2, 16 ; [#uses=1]
> br i1 %exitcond, label %bb3, label %bb
>
> bb3: ; preds = %bb2
> ret i32 %result
> }
From clattner at apple.com Tue Jul 3 18:47:12 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 16:47:12 -0700
Subject: [llvm-commits]
CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <200706291010.23781.baldrick@free.fr>
References: <20070627205029.GW5693@village.us.cray.com>
<200706291010.23781.baldrick@free.fr>
Message-ID: <646AEB4C-8291-4450-9CE3-CAF5D82CCFB0@apple.com>
On Jun 29, 2007, at 1:10 AM, Duncan Sands wrote:
> Hi,
>
>>>>> It seems like folding undef/X to undef isn't safe either though,
>
> here is my understanding of how to fold undef. I hope it clarifies
> this confusing area. Of course, I could be confused myself but I
> hope not :)
>
> (1) When is it OK to fold "y=foo(undef)" to "y=undef"? I claim that
> it is OK if and only if foo is surjective, i.e. if for each possible
> value for y there exists a value for x such that y=foo(x).
> "Surjective"
> is sometimes called "onto".
>
> Before I explain why I think this, an example:
> y=(undef == z)
> The possible values of y are 0 and 1 because the result of == is
> an i1. Surjectivity means: can I get (undef==z) to produce each of
> 0 and 1 by plugging in different values for undef? Obviously I can,
> so in this case I can fold to "y=undef".
Yep, I agree.
> (2) What to do when foo is not surjective? Choose some value for
> undef
> and fold to "y=foo(value_chosen)". In general foo will involve some
> other variables, so the trick is to find a constant value for y
> that is
> always obtainable no matter what those other variables are (while
> it is
> logically correct to replace y with a function of those other
> variables,
> which is what foo(0) will give in general for example, it is more
> efficient
> to use a constant value if possible).
>
> Example: folding "y=undef udiv x". This could be folded to 0 or to 1,
> since 0 is what you get by substituting undef=0, and 1 is what you get
> by substituting undef=x. (If x=0 then in both cases you get 0/0 which
> is, I hear, undefined so you can choose it to be 0 or 1 as you like).
> Of course you could also fold it to "1 div x" or "intmax div x" or
> "(x*x) div x" if you really felt like it, but 0 and 1 are the only
> constants that can always be obtained regardless of the value of x,
> so they are the most efficient choices.
Yes.
Duncan, this whole write-up is very helpful. Can you find some place
to put this so that we can find it again in the future? How about
the programmer's manual?
-Chris
From resistor at mac.com Tue Jul 3 18:51:19 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 03 Jul 2007 23:51:19 -0000
Subject: [llvm-commits] [llvm] r37862 - in /llvm/trunk:
lib/Transforms/Scalar/GVNPRE.cpp test/Transforms/GVNPRE/gep.ll
Message-ID: <200707032351.l63NpJ9X028156@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Jul 3 18:51:19 2007
New Revision: 37862
URL: http://llvm.org/viewvc/llvm-project?rev=37862&view=rev
Log:
Add support for performing GVNPRE on GEP instructions.
Added:
llvm/trunk/test/Transforms/GVNPRE/gep.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=37862&r1=37861&r2=37862&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Jul 3 18:51:19 2007
@@ -487,6 +487,19 @@
return nextValueNumber++;
}
+ } else if (GetElementPtrInst* U = dyn_cast(V)) {
+ Expression e = create_expression(U);
+
+ std::map::iterator EI = expressionNumbering.find(e);
+ if (EI != expressionNumbering.end()) {
+ valueNumbering.insert(std::make_pair(V, EI->second));
+ return EI->second;
+ } else {
+ expressionNumbering.insert(std::make_pair(e, nextValueNumber));
+ valueNumbering.insert(std::make_pair(V, nextValueNumber));
+
+ return nextValueNumber++;
+ }
} else {
valueNumbering.insert(std::make_pair(V, nextValueNumber));
return nextValueNumber++;
@@ -798,6 +811,48 @@
}
}
+ // Varargs operators
+ } else if (GetElementPtrInst* U = dyn_cast(V)) {
+ Value* newOp1 = 0;
+ if (isa(U->getPointerOperand()))
+ newOp1 = phi_translate(U->getPointerOperand(), pred, succ);
+ else
+ newOp1 = U->getPointerOperand();
+
+ if (newOp1 == 0)
+ return 0;
+
+ bool changed_idx = false;
+ std::vector newIdx;
+ for (GetElementPtrInst::op_iterator I = U->idx_begin(), E = U->idx_end();
+ I != E; ++I)
+ if (isa(*I)) {
+ Value* newVal = phi_translate(*I, pred, succ);
+ newIdx.push_back(newVal);
+ if (newVal != *I)
+ changed_idx = true;
+ } else {
+ newIdx.push_back(*I);
+ }
+
+ if (newOp1 != U->getPointerOperand() || changed_idx) {
+ Instruction* newVal = new GetElementPtrInst(U->getPointerOperand(),
+ &newIdx[0], newIdx.size(),
+ U->getName()+".expr");
+
+ uint32_t v = VN.lookup_or_add(newVal);
+
+ Value* leader = find_leader(availableOut[pred], v);
+ if (leader == 0) {
+ createdExpressions.push_back(newVal);
+ return newVal;
+ } else {
+ VN.erase(newVal);
+ delete newVal;
+ return leader;
+ }
+ }
+
// PHI Nodes
} else if (PHINode* P = dyn_cast(V)) {
if (P->getParent() == succ)
@@ -900,6 +955,26 @@
set.erase(U);
presentInSet.flip(VN.lookup(U));
}
+
+ // Handle varargs ops
+ } else if (GetElementPtrInst* U = dyn_cast(v)) {
+ bool ptrValid = !isa(U->getPointerOperand());
+ ptrValid |= presentInSet.test(VN.lookup(U->getPointerOperand()));
+ if (ptrValid)
+ ptrValid = !dependsOnInvoke(U->getPointerOperand());
+
+ bool varValid = true;
+ for (GetElementPtrInst::op_iterator I = U->idx_begin(), E = U->idx_end();
+ I != E; ++I)
+ if (varValid) {
+ varValid &= !isa(*I) || presentInSet.test(VN.lookup(*I));
+ varValid &= !dependsOnInvoke(*I);
+ }
+
+ if (!ptrValid || !varValid) {
+ set.erase(U);
+ presentInSet.flip(VN.lookup(U));
+ }
}
}
}
@@ -972,6 +1047,31 @@
stack.pop_back();
}
+ // Handle vararg ops
+ } else if (GetElementPtrInst* U = dyn_cast(e)) {
+ Value* p = find_leader(set, VN.lookup(U->getPointerOperand()));
+
+ if (p != 0 && isa(p) &&
+ visited.count(p) == 0)
+ stack.push_back(p);
+ else {
+ bool push_va = false;
+ for (GetElementPtrInst::op_iterator I = U->idx_begin(),
+ E = U->idx_end(); I != E; ++I) {
+ Value * v = find_leader(set, VN.lookup(*I));
+ if (v != 0 && isa(v) && visited.count(v) == 0) {
+ stack.push_back(v);
+ push_va = true;
+ }
+ }
+
+ if (!push_va) {
+ vec.push_back(e);
+ visited.insert(e);
+ stack.pop_back();
+ }
+ }
+
// Handle opaque ops
} else {
visited.insert(e);
@@ -1022,7 +1122,7 @@
if (isa(BI) || isa(BI) ||
isa(BI) || isa(BI) ||
isa(BI) || isa(BI) ||
- isa(BI)) {
+ isa(BI) || isa(BI)) {
Value *leader = find_leader(availableOut[BB], VN.lookup(BI));
if (leader != 0)
@@ -1160,6 +1260,34 @@
expNumbers.set(num);
}
+ // Handle vararg ops
+ } else if (GetElementPtrInst* U = dyn_cast(I)) {
+ Value* ptrValue = U->getPointerOperand();
+
+ VN.lookup_or_add(U);
+
+ unsigned num = VN.lookup_or_add(U);
+ expNumbers.resize(VN.size());
+ availNumbers.resize(VN.size());
+
+ if (isa(ptrValue))
+ if (!expNumbers.test(VN.lookup(ptrValue))) {
+ currExps.insert(ptrValue);
+ expNumbers.set(VN.lookup(ptrValue));
+ }
+
+ for (GetElementPtrInst::op_iterator OI = U->idx_begin(), OE = U->idx_end();
+ OI != OE; ++OI)
+ if (isa(*OI) && !expNumbers.test(VN.lookup(*OI))) {
+ currExps.insert(*OI);
+ expNumbers.set(VN.lookup(*OI));
+ }
+
+ if (!expNumbers.test(VN.lookup(U))) {
+ currExps.insert(U);
+ expNumbers.set(num);
+ }
+
// Handle opaque ops
} else if (!I->isTerminator()){
VN.lookup_or_add(I);
@@ -1373,7 +1501,8 @@
isa(U->getOperand(0)) ||
isa(U->getOperand(0)) ||
isa(U->getOperand(0)) ||
- isa(U->getOperand(0)))
+ isa(U->getOperand(0)) ||
+ isa(U->getOperand(0)))
s1 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(0)));
else
s1 = U->getOperand(0);
@@ -1392,7 +1521,8 @@
isa(U->getOperand(1)) ||
isa(U->getOperand(1)) ||
isa(U->getOperand(1)) ||
- isa(U->getOperand(1))) {
+ isa(U->getOperand(1)) ||
+ isa(U->getOperand(1))) {
s2 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(1)));
} else {
s2 = U->getOperand(1);
@@ -1409,12 +1539,34 @@
isa(U->getOperand(2)) ||
isa(U->getOperand(2)) ||
isa(U->getOperand(2)) ||
- isa(U->getOperand(2))) {
+ isa(U->getOperand(2)) ||
+ isa(U->getOperand(2))) {
s3 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(2)));
} else {
s3 = U->getOperand(2);
}
+ // Vararg operators
+ std::vector sVarargs;
+ if (GetElementPtrInst* G = dyn_cast(U)) {
+ for (GetElementPtrInst::op_iterator OI = G->idx_begin(),
+ OE = G->idx_end(); OI != OE; ++OI) {
+ if (isa(*OI) ||
+ isa(*OI) ||
+ isa(*OI) ||
+ isa(*OI) ||
+ isa(*OI) ||
+ isa(*OI) ||
+ isa(*OI) ||
+ isa(*OI)) {
+ sVarargs.push_back(find_leader(availableOut[*PI],
+ VN.lookup(*OI)));
+ } else {
+ sVarargs.push_back(*OI);
+ }
+ }
+ }
+
Value* newVal = 0;
if (BinaryOperator* BO = dyn_cast(U))
newVal = BinaryOperator::create(BO->getOpcode(), s1, s2,
@@ -1441,6 +1593,10 @@
newVal = CastInst::create(C->getOpcode(), s1, C->getType(),
C->getName()+".gvnpre",
(*PI)->getTerminator());
+ else if (GetElementPtrInst* G = dyn_cast(U))
+ newVal = new GetElementPtrInst(s1, &sVarargs[0], sVarargs.size(),
+ G->getName()+".gvnpre",
+ (*PI)->getTerminator());
VN.add(newVal, VN.lookup(U));
@@ -1487,7 +1643,8 @@
if (isa(e) || isa(e) ||
isa(e) || isa(e) ||
- isa(e) || isa(e) || isa(e)) {
+ isa(e) || isa(e) || isa(e) ||
+ isa(e)) {
if (find_leader(availableOut[D->getIDom()->getBlock()],
VN.lookup(e)) != 0)
continue;
Added: llvm/trunk/test/Transforms/GVNPRE/gep.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVNPRE/gep.ll?rev=37862&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVNPRE/gep.ll (added)
+++ llvm/trunk/test/Transforms/GVNPRE/gep.ll Tue Jul 3 18:51:19 2007
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
+
+define i32 @extract({ i32 }* %P) {
+entry: ; preds = %cond_false, %entry
+ br i1 true, label %cond_true, label %cond_false
+
+cond_true:
+ br label %end
+
+cond_false:
+ %a = getelementptr { i32 }* %P, i32 0, i32 0
+ br label %end
+
+end:
+ %b = getelementptr { i32 }* %P, i32 0, i32 0
+ ret i32 0
+}
From isanbard at gmail.com Tue Jul 3 19:19:54 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 04 Jul 2007 00:19:54 -0000
Subject: [llvm-commits] [llvm] r37863 - in /llvm/trunk:
lib/Target/X86/X86InstrMMX.td test/CodeGen/X86/2007-06-15-IntToMMX.ll
test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
Message-ID: <200707040019.l640Jsuc028788@zion.cs.uiuc.edu>
Author: void
Date: Tue Jul 3 19:19:54 2007
New Revision: 37863
URL: http://llvm.org/viewvc/llvm-project?rev=37863&view=rev
Log:
Allow a GR64 to be moved into an MMX register via the "movd" instruction.
Still need to have JIT generate this code.
Added:
llvm/trunk/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
Modified:
llvm/trunk/lib/Target/X86/X86InstrMMX.td
llvm/trunk/test/CodeGen/X86/2007-06-15-IntToMMX.ll
Modified: llvm/trunk/lib/Target/X86/X86InstrMMX.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrMMX.td?rev=37863&r1=37862&r2=37863&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrMMX.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrMMX.td Tue Jul 3 19:19:54 2007
@@ -183,6 +183,9 @@
def MMX_MOVD64mr : MMXI<0x7E, MRMDestMem, (ops i32mem:$dst, VR64:$src),
"movd {$src, $dst|$dst, $src}", []>;
+def MMX_MOVD64to64rr : MMXI<0x6E, MRMSrcReg, (ops VR64:$dst, GR64:$src),
+ "movd {$src, $dst|$dst, $src}", []>;
+
def MMX_MOVQ64rr : MMXI<0x6F, MRMSrcReg, (ops VR64:$dst, VR64:$src),
"movq {$src, $dst|$dst, $src}", []>;
def MMX_MOVQ64rm : MMXI<0x6F, MRMSrcMem, (ops VR64:$dst, i64mem:$src),
@@ -552,6 +555,16 @@
def : Pat<(v1i64 (bitconvert (v4i16 VR64:$src))), (v1i64 VR64:$src)>;
def : Pat<(v1i64 (bitconvert (v8i8 VR64:$src))), (v1i64 VR64:$src)>;
+// 64-bit bit convert.
+def : Pat<(v1i64 (bitconvert (i64 GR64:$src))),
+ (MMX_MOVD64to64rr GR64:$src)>;
+def : Pat<(v2i32 (bitconvert (i64 GR64:$src))),
+ (MMX_MOVD64to64rr GR64:$src)>;
+def : Pat<(v4i16 (bitconvert (i64 GR64:$src))),
+ (MMX_MOVD64to64rr GR64:$src)>;
+def : Pat<(v8i8 (bitconvert (i64 GR64:$src))),
+ (MMX_MOVD64to64rr GR64:$src)>;
+
def MMX_X86s2vec : SDNode<"X86ISD::S2VEC", SDTypeProfile<1, 1, []>, []>;
// Move scalar to XMM zero-extended
Modified: llvm/trunk/test/CodeGen/X86/2007-06-15-IntToMMX.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-06-15-IntToMMX.ll?rev=37863&r1=37862&r2=37863&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-06-15-IntToMMX.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2007-06-15-IntToMMX.ll Tue Jul 3 19:19:54 2007
@@ -1,5 +1,4 @@
; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep paddusw
-; XFAIL: *
@R = external global <1 x i64> ; <<1 x i64>*> [#uses=1]
define void @foo(<1 x i64> %A, <1 x i64> %B) {
Added: llvm/trunk/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll?rev=37863&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll Tue Jul 3 19:19:54 2007
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep {movd %rsi, %mm0} &&
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep {movd %rdi, %mm1} &&
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep {paddusw %mm0, %mm1}
+
+ at R = external global <1 x i64> ; <<1 x i64>*> [#uses=1]
+
+define void @foo(<1 x i64> %A, <1 x i64> %B) {
+entry:
+ %tmp4 = bitcast <1 x i64> %B to <4 x i16> ; <<4 x i16>> [#uses=1]
+ %tmp6 = bitcast <1 x i64> %A to <4 x i16> ; <<4 x i16>> [#uses=1]
+ %tmp7 = tail call <4 x i16> @llvm.x86.mmx.paddus.w( <4 x i16> %tmp6, <4 x i16> %tmp4 ) ; <<4 x i16>> [#uses=1]
+ %tmp8 = bitcast <4 x i16> %tmp7 to <1 x i64> ; <<1 x i64>> [#uses=1]
+ store <1 x i64> %tmp8, <1 x i64>* @R
+ tail call void @llvm.x86.mmx.emms( )
+ ret void
+}
+
+declare <4 x i16> @llvm.x86.mmx.paddus.w(<4 x i16>, <4 x i16>)
+
+declare void @llvm.x86.mmx.emms()
From dpatel at apple.com Tue Jul 3 20:05:22 2007
From: dpatel at apple.com (Devang Patel)
Date: Wed, 04 Jul 2007 01:05:22 -0000
Subject: [llvm-commits] [llvm] r37864 -
/llvm/trunk/include/llvm/Analysis/Dominators.h
Message-ID: <200707040105.l6415NgY029998@zion.cs.uiuc.edu>
Author: dpatel
Date: Tue Jul 3 20:05:22 2007
New Revision: 37864
URL: http://llvm.org/viewvc/llvm-project?rev=37864&view=rev
Log:
Fix typo in assertion check.
Modified:
llvm/trunk/include/llvm/Analysis/Dominators.h
Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=37864&r1=37863&r2=37864&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Tue Jul 3 20:05:22 2007
@@ -155,7 +155,7 @@
DomTreeNode *N = getNode(BB);
assert (N && "Missing dominator tree node");
DomTreeNode *I = N->getIDom();
- assert (N && "Missing immediate dominator");
+ assert (I && "Missing immediate dominator");
return I->getBlock();
}
From dpatel at apple.com Tue Jul 3 20:11:19 2007
From: dpatel at apple.com (Devang Patel)
Date: Wed, 04 Jul 2007 01:11:19 -0000
Subject: [llvm-commits] [llvm] r37865 -
/llvm/trunk/include/llvm/Analysis/Dominators.h
Message-ID: <200707040111.l641BJcc030189@zion.cs.uiuc.edu>
Author: dpatel
Date: Tue Jul 3 20:11:19 2007
New Revision: 37865
URL: http://llvm.org/viewvc/llvm-project?rev=37865&view=rev
Log:
Remove unused method - getIDomBlock().
Modified:
llvm/trunk/include/llvm/Analysis/Dominators.h
Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=37865&r1=37864&r2=37865&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Tue Jul 3 20:11:19 2007
@@ -149,16 +149,6 @@
return getNode(BB);
}
- /// getIDomBlock - return basic block BB's immediate dominator basic block.
- ///
- BasicBlock *getIDomBlock(BasicBlock *BB) {
- DomTreeNode *N = getNode(BB);
- assert (N && "Missing dominator tree node");
- DomTreeNode *I = N->getIDom();
- assert (I && "Missing immediate dominator");
- return I->getBlock();
- }
-
/// getRootNode - This returns the entry node for the CFG of the function. If
/// this tree represents the post-dominance relations for a function, however,
/// this root may be a node with the block == NULL. This is the case when
From isanbard at gmail.com Tue Jul 3 20:29:22 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 04 Jul 2007 01:29:22 -0000
Subject: [llvm-commits] [llvm] r37866 -
/llvm/trunk/lib/Target/X86/X86InstrMMX.td
Message-ID: <200707040129.l641TMwl030772@zion.cs.uiuc.edu>
Author: void
Date: Tue Jul 3 20:29:22 2007
New Revision: 37866
URL: http://llvm.org/viewvc/llvm-project?rev=37866&view=rev
Log:
Support generation of GR64 to MMX code in the JIT.
Modified:
llvm/trunk/lib/Target/X86/X86InstrMMX.td
Modified: llvm/trunk/lib/Target/X86/X86InstrMMX.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrMMX.td?rev=37866&r1=37865&r2=37866&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrMMX.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrMMX.td Tue Jul 3 20:29:22 2007
@@ -25,6 +25,8 @@
// MMXIS - MMX instructions with XS prefix.
class MMXI o, Format F, dag ops, string asm, list pattern>
: I, TB, Requires<[HasMMX]>;
+class MMXRI o, Format F, dag ops, string asm, list pattern>
+ : I, TB, REX_W, Requires<[HasMMX]>;
class MMX2I o, Format F, dag ops, string asm, list pattern>
: I, TB, OpSize, Requires<[HasMMX]>;
class MMXIi8 o, Format F, dag ops, string asm, list pattern>
@@ -183,8 +185,8 @@
def MMX_MOVD64mr : MMXI<0x7E, MRMDestMem, (ops i32mem:$dst, VR64:$src),
"movd {$src, $dst|$dst, $src}", []>;
-def MMX_MOVD64to64rr : MMXI<0x6E, MRMSrcReg, (ops VR64:$dst, GR64:$src),
- "movd {$src, $dst|$dst, $src}", []>;
+def MMX_MOVD64to64rr : MMXRI<0x6E, MRMSrcReg, (ops VR64:$dst, GR64:$src),
+ "movd {$src, $dst|$dst, $src}", []>;
def MMX_MOVQ64rr : MMXI<0x6F, MRMSrcReg, (ops VR64:$dst, VR64:$src),
"movq {$src, $dst|$dst, $src}", []>;
From reid at x10sys.com Tue Jul 3 20:35:32 2007
From: reid at x10sys.com (Reid Spencer)
Date: Wed, 04 Jul 2007 01:35:32 -0000
Subject: [llvm-commits] [llvm] r37867 - /llvm/trunk/utils/llvmdo
Message-ID: <200707040135.l641ZWJt030928@zion.cs.uiuc.edu>
Author: reid
Date: Tue Jul 3 20:35:32 2007
New Revision: 37867
URL: http://llvm.org/viewvc/llvm-project?rev=37867&view=rev
Log:
Ignore the .svn directories so countloc.sh and llvmgrep won't traverse them.
Modified:
llvm/trunk/utils/llvmdo
Modified: llvm/trunk/utils/llvmdo
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvmdo?rev=37867&r1=37866&r2=37867&view=diff
==============================================================================
--- llvm/trunk/utils/llvmdo (original)
+++ llvm/trunk/utils/llvmdo Tue Jul 3 20:35:32 2007
@@ -78,6 +78,8 @@
paths_to_ignore="\
-path */CVS -o \
-path */CVS/* -o \
+ -path */.svn/ -o \
+ -path */.svn/* -o \
-path docs/doxygen/* -o \
-path docs/CommandGuide/html/* -o \
-path docs/CommandGuide/man/* -o \
From evan.cheng at apple.com Tue Jul 3 20:35:58 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 3 Jul 2007 18:35:58 -0700
Subject: [llvm-commits] [llvm] r37843 -
/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
In-Reply-To: <200707021618.l62GI6GA029325@zion.cs.uiuc.edu>
References: <200707021618.l62GI6GA029325@zion.cs.uiuc.edu>
Message-ID:
Hi Dan,
This patch is breaking llvm-gcc bootstrapping on PPC.
I am not sure what exactly wrong is it. But the old code has a check
for endianness while your new code doesn't. Can you check again if
you are taking endianness into consideration?
Thanks,
Evan
On Jul 2, 2007, at 9:18 AM, Dan Gohman wrote:
> Author: djg
> Date: Mon Jul 2 11:18:06 2007
> New Revision: 37843
>
> URL: http://llvm.org/viewvc/llvm-project?rev=37843&view=rev
> Log:
> Replace ExpandScalarFormalArgs and ExpandScalarCallArgs with the newly
> refactored getCopyFromParts and getCopyToParts, which are more
> general.
> This effectively adds support for lowering illegal by-val vector call
> arguments.
>
> Modified:
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/
> SelectionDAG/SelectionDAGISel.cpp?
> rev=37843&r1=37842&r2=37843&view=diff
> ======================================================================
> ========
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon
> Jul 2 11:18:06 2007
> @@ -2861,7 +2861,7 @@
> if (!MVT::isVector(ValueVT) || NumParts == 1) {
> // If the value was expanded, copy from the parts.
> if (NumParts > 1) {
> - for (unsigned i = 0; i < NumParts; ++i)
> + for (unsigned i = 0; i != NumParts; ++i)
> Parts[i] = DAG.getNode(ISD::EXTRACT_ELEMENT, PartVT, Val,
> DAG.getConstant(i, MVT::i32));
> return;
> @@ -2950,7 +2950,7 @@
> // Copy the legal parts from the registers.
> unsigned NumParts = Regs.size();
> SmallVector Parts(NumParts);
> - for (unsigned i = 0; i < NumParts; ++i) {
> + for (unsigned i = 0; i != NumParts; ++i) {
> SDOperand Part = Flag ?
> DAG.getCopyFromReg(Chain, Regs[i], RegVT,
> *Flag) :
> DAG.getCopyFromReg(Chain, Regs[i], RegVT);
> @@ -2981,7 +2981,7 @@
> getCopyToParts(DAG, Val, &Parts[0], NumParts, RegVT);
>
> // Copy the parts into the registers.
> - for (unsigned i = 0; i < NumParts; ++i) {
> + for (unsigned i = 0; i != NumParts; ++i) {
> SDOperand Part = Flag ?
> DAG.getCopyToReg(Chain, R[i], Parts[i], *Flag) :
> DAG.getCopyToReg(Chain, R[i], Parts[i]);
> @@ -3746,32 +3746,6 @@
> DAG.getSrcValue(I.getOperand(2))));
> }
>
> -/// ExpandScalarFormalArgs - Recursively expand the
> formal_argument node, either
> -/// bit_convert it or join a pair of them with a BUILD_PAIR when
> appropriate.
> -static SDOperand ExpandScalarFormalArgs(MVT::ValueType VT, SDNode
> *Arg,
> - unsigned &i, SelectionDAG
> &DAG,
> - TargetLowering &TLI) {
> - if (TLI.getTypeAction(VT) != TargetLowering::Expand)
> - return SDOperand(Arg, i++);
> -
> - MVT::ValueType EVT = TLI.getTypeToTransformTo(VT);
> - unsigned NumVals = MVT::getSizeInBits(VT) / MVT::getSizeInBits
> (EVT);
> - if (NumVals == 1) {
> - return DAG.getNode(ISD::BIT_CONVERT, VT,
> - ExpandScalarFormalArgs(EVT, Arg, i, DAG,
> TLI));
> - } else if (NumVals == 2) {
> - SDOperand Lo = ExpandScalarFormalArgs(EVT, Arg, i, DAG, TLI);
> - SDOperand Hi = ExpandScalarFormalArgs(EVT, Arg, i, DAG, TLI);
> - if (!TLI.isLittleEndian())
> - std::swap(Lo, Hi);
> - return DAG.getNode(ISD::BUILD_PAIR, VT, Lo, Hi);
> - } else {
> - // Value scalarized into many values. Unimp for now.
> - assert(0 && "Cannot expand i64 -> i16 yet!");
> - }
> - return SDOperand();
> -}
> -
> /// TargetLowering::LowerArguments - This is the default
> LowerArguments
> /// implementation, which just inserts a FORMAL_ARGUMENTS node.
> FIXME: When all
> /// targets are migrated to using FORMAL_ARGUMENTS, this hook
> should be
> @@ -3842,8 +3816,8 @@
> SDNode *Result = DAG.getNode(ISD::FORMAL_ARGUMENTS,
> DAG.getNodeValueTypes(RetVals),
> RetVals.size(),
> &Ops[0], Ops.size()).Val;
> -
> - DAG.setRoot(SDOperand(Result, Result->getNumValues()-1));
> + unsigned NumArgRegs = Result->getNumValues() - 1;
> + DAG.setRoot(SDOperand(Result, NumArgRegs));
>
> // Set up the return result vector.
> Ops.clear();
> @@ -3875,79 +3849,22 @@
> Ops.push_back(Op);
> break;
> }
> - case Expand:
> - if (!MVT::isVector(VT)) {
> - // If this is a large integer or a floating point node
> that needs to be
> - // expanded, it needs to be reassembled from small
> integers. Figure out
> - // what the source elt type is and how many small integers
> it is.
> - Ops.push_back(ExpandScalarFormalArgs(VT, Result, i, DAG,
> *this));
> - } else {
> - // Otherwise, this is a vector type. We only support
> legal vectors
> - // right now.
> - const VectorType *PTy = cast(I->getType());
> - unsigned NumElems = PTy->getNumElements();
> - const Type *EltTy = PTy->getElementType();
> -
> - // Figure out if there is a Packed type corresponding to
> this Vector
> - // type. If so, convert to the vector type.
> - MVT::ValueType TVT =
> - MVT::getVectorType(getValueType(EltTy), NumElems);
> - if (TVT != MVT::Other && isTypeLegal(TVT)) {
> - SDOperand N = SDOperand(Result, i++);
> - // Handle copies from vectors to registers.
> - N = DAG.getNode(ISD::BIT_CONVERT, TVT, N);
> - Ops.push_back(N);
> - } else {
> - assert(0 && "Don't support illegal by-val vector
> arguments yet!");
> - abort();
> - }
> - }
> + case Expand: {
> + MVT::ValueType PartVT = getRegisterType(VT);
> + unsigned NumParts = getNumRegisters(VT);
> + SmallVector Parts(NumParts);
> + for (unsigned j = 0; j != NumParts; ++j)
> + Parts[j] = SDOperand(Result, i++);
> + Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts,
> PartVT, VT));
> break;
> }
> + }
> }
> + assert(i == NumArgRegs && "Argument register count mismatch!");
> return Ops;
> }
>
>
> -/// ExpandScalarCallArgs - Recursively expand call argument node by
> -/// bit_converting it or extract a pair of elements from the
> larger node.
> -static void ExpandScalarCallArgs(MVT::ValueType VT, SDOperand Arg,
> - unsigned Flags,
> - SmallVector &Ops,
> - SelectionDAG &DAG,
> - TargetLowering &TLI,
> - bool isFirst = true) {
> -
> - if (TLI.getTypeAction(VT) != TargetLowering::Expand) {
> - // if it isn't first piece, alignment must be 1
> - if (!isFirst)
> - Flags = (Flags & (~ISD::ParamFlags::OrigAlignment)) |
> - (1 << ISD::ParamFlags::OrigAlignmentOffs);
> - Ops.push_back(Arg);
> - Ops.push_back(DAG.getConstant(Flags, MVT::i32));
> - return;
> - }
> -
> - MVT::ValueType EVT = TLI.getTypeToTransformTo(VT);
> - unsigned NumVals = MVT::getSizeInBits(VT) / MVT::getSizeInBits
> (EVT);
> - if (NumVals == 1) {
> - Arg = DAG.getNode(ISD::BIT_CONVERT, EVT, Arg);
> - ExpandScalarCallArgs(EVT, Arg, Flags, Ops, DAG, TLI, isFirst);
> - } else if (NumVals == 2) {
> - SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, EVT, Arg,
> - DAG.getConstant(0, TLI.getPointerTy
> ()));
> - SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, EVT, Arg,
> - DAG.getConstant(1, TLI.getPointerTy
> ()));
> - if (!TLI.isLittleEndian())
> - std::swap(Lo, Hi);
> - ExpandScalarCallArgs(EVT, Lo, Flags, Ops, DAG, TLI, isFirst);
> - ExpandScalarCallArgs(EVT, Hi, Flags, Ops, DAG, TLI, false);
> - } else {
> - // Value scalarized into many values. Unimp for now.
> - assert(0 && "Cannot expand i64 -> i16 yet!");
> - }
> -}
> -
> /// TargetLowering::LowerCallTo - This is the default LowerCallTo
> /// implementation, which just inserts an ISD::CALL node, which is
> later custom
> /// lowered by the target to something concrete. FIXME: When all
> targets are
> @@ -4014,35 +3931,24 @@
> Ops.push_back(Op);
> Ops.push_back(DAG.getConstant(Flags, MVT::i32));
> break;
> - case Expand:
> - if (!MVT::isVector(VT)) {
> - // If this is a large integer, it needs to be broken down
> into small
> - // integers. Figure out what the source elt type is and
> how many small
> - // integers it is.
> - ExpandScalarCallArgs(VT, Op, Flags, Ops, DAG, *this);
> - } else {
> - // Otherwise, this is a vector type. We only support
> legal vectors
> - // right now.
> - const VectorType *PTy = cast(Args[i].Ty);
> - unsigned NumElems = PTy->getNumElements();
> - const Type *EltTy = PTy->getElementType();
> -
> - // Figure out if there is a Packed type corresponding to
> this Vector
> - // type. If so, convert to the vector type.
> - MVT::ValueType TVT =
> - MVT::getVectorType(getValueType(EltTy), NumElems);
> - if (TVT != MVT::Other && isTypeLegal(TVT)) {
> - // Insert a BIT_CONVERT of the original type to the
> vector type.
> - Op = DAG.getNode(ISD::BIT_CONVERT, TVT, Op);
> - Ops.push_back(Op);
> - Ops.push_back(DAG.getConstant(Flags, MVT::i32));
> - } else {
> - assert(0 && "Don't support illegal by-val vector call
> args yet!");
> - abort();
> - }
> + case Expand: {
> + MVT::ValueType PartVT = getRegisterType(VT);
> + unsigned NumParts = getNumRegisters(VT);
> + SmallVector Parts(NumParts);
> + getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT);
> + for (unsigned i = 0; i != NumParts; ++i) {
> + // if it isn't first piece, alignment must be 1
> + unsigned MyFlags = Flags;
> + if (i != 0)
> + MyFlags = (MyFlags & (~ISD::ParamFlags::OrigAlignment)) |
> + (1 << ISD::ParamFlags::OrigAlignmentOffs);
> +
> + Ops.push_back(Parts[i]);
> + Ops.push_back(DAG.getConstant(MyFlags, MVT::i32));
> }
> break;
> }
> + }
> }
>
> // Figure out the result value types.
> @@ -4360,7 +4266,7 @@
>
> // Copy the value by legal parts into sequential virtual registers.
> getCopyToParts(DAG, Op, &Regs[0], NumRegs, RegisterVT);
> - for (unsigned i = 0; i < NumRegs; ++i)
> + for (unsigned i = 0; i != NumRegs; ++i)
> Chains[i] = DAG.getCopyToReg(getRoot(), Reg + i, Regs[i]);
> return DAG.getNode(ISD::TokenFactor, MVT::Other, &Chains[0],
> NumRegs);
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From resistor at mac.com Tue Jul 3 23:51:16 2007
From: resistor at mac.com (Owen Anderson)
Date: Wed, 04 Jul 2007 04:51:16 -0000
Subject: [llvm-commits] [llvm] r37868 - in /llvm/trunk:
lib/Transforms/Scalar/GVNPRE.cpp
test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
Message-ID: <200707040451.l644pGat003148@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Jul 3 23:51:16 2007
New Revision: 37868
URL: http://llvm.org/viewvc/llvm-project?rev=37868&view=rev
Log:
Fix an error in phi translation of GEPs that was causing failures.
Added:
llvm/trunk/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=37868&r1=37867&r2=37868&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Jul 3 23:51:16 2007
@@ -836,7 +836,7 @@
}
if (newOp1 != U->getPointerOperand() || changed_idx) {
- Instruction* newVal = new GetElementPtrInst(U->getPointerOperand(),
+ Instruction* newVal = new GetElementPtrInst(newOp1,
&newIdx[0], newIdx.size(),
U->getName()+".expr");
Added: llvm/trunk/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll?rev=37868&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll (added)
+++ llvm/trunk/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll Tue Jul 3 23:51:16 2007
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
+
+define i64 @foo({ i32, i32 }** %__v) {
+entry:
+ br label %bb
+
+bb: ; preds = %bb, %entry
+ %__x.066.0 = phi { i32, i32 }* [ null, %entry ], [ null, %bb ]
+ %tmp2.i.i63 = getelementptr { i32, i32 }* %__x.066.0, i32 0, i32 1
+ br i1 false, label %bb, label %cond_true
+
+cond_true: ; preds = %bb
+ ret i64 0
+}
From zhousheng00 at gmail.com Wed Jul 4 00:34:06 2007
From: zhousheng00 at gmail.com (Zhou Sheng)
Date: Wed, 4 Jul 2007 13:34:06 +0800
Subject: [llvm-commits] CVS:
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
In-Reply-To: <6526931C-F1A8-4E8C-8B70-221D47F82C00@apple.com>
References: <46831649.6010708@gmail.com>
<6526931C-F1A8-4E8C-8B70-221D47F82C00@apple.com>
Message-ID: <8abe0dc60707032234i2cd26765o6f8fea29020f1970@mail.gmail.com>
Hi Chris,
> > The condition "IterationCount->getType() != LargestType" doesn't
> > mean the IterationCount->getType's bitwidth < LargestType's
> > so, sometimes, (like in this testcase), it need a trunc not ext.
> > This patch is to fix it.
>
> Ah, I see. Thank you for checking in the testcase. The reason this
> looked fishy to me is that the code attempts to insert the IV as the
> largest type, but that it could then need a zero extend. Doesn't
> this mean the zero extend case (which I know you didn't put in
> there :) is really dead? If so, please remove it and switch back to
> a simple:
>
> if (IterationCount->getType() != LargestType)
> IterationCount = SCEVTruncateExpr::get(IterationCount,
> LargestType);
No, it's incorrect. That will fail
llvm/test/Transforms/IndVarSimplify/exit_value_tests.llx ( which got an
assertion)
i think we should keep the extend code.
Sheng.
Thanks! If this doesn't make any sense, please feel free to ask for
> clarification :)
>
> -Chris
>
> > Sheng
> >
> >
> >
> > DOUT << "INDVARS: New CanIV: " << *IndVar;
> >>
> >> if (!isa(IterationCount)) {
> >> - if (IterationCount->getType() != LargestType)
> >> + if (IterationCount->getType()->getPrimitiveSizeInBits() <
> >> + LargestType->getPrimitiveSizeInBits())
> >> IterationCount = SCEVZeroExtendExpr::get(IterationCount,
> >> LargestType);
> >> + else if (IterationCount->getType() != LargestType)
> >> + IterationCount = SCEVTruncateExpr::get(IterationCount,
> >> LargestType);
> >> if (Instruction *DI = LinearFunctionTestReplace(L,
> >> IterationCount,Rewriter))
> >> DeadInsts.insert(DI);
> >> }
> >
> >
> >
> > ; ModuleID = 'testcase.bc'
> > target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> > i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
> > target triple = "i686-pc-linux-gnu"
> >
> > define i32 @testcase(i5 zext %k) {
> > entry:
> > br label %bb2
> >
> > bb: ; preds = %bb2
> > %tmp1 = add i32 %tmp2, %result ; [#uses=1]
> > %indvar_next1 = add i5 %k_0, 1 ; [#uses=1]
> > br label %bb2
> >
> > bb2: ; preds = %bb, %entry
> > %k_0 = phi i5 [ 0, %entry ], [ %indvar_next1, %bb ] ;
> [#uses=2]
> > %result = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ;
> [#uses=2]
> > %tmp2 = zext i5 %k_0 to i32 ; [#uses=1]
> > %exitcond = icmp eq i32 %tmp2, 16 ; [#uses=1]
> > br i1 %exitcond, label %bb3, label %bb
> >
> > bb3: ; preds = %bb2
> > ret i32 %result
> > }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070704/9ca48814/attachment.html
From clattner at apple.com Wed Jul 4 00:54:25 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 3 Jul 2007 22:54:25 -0700
Subject: [llvm-commits] [llvm] r37843 -
/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
In-Reply-To:
References: <200707021618.l62GI6GA029325@zion.cs.uiuc.edu>
Message-ID: <3FD23FCD-D28C-41DB-BB50-258013EDC6E0@apple.com>
On Jul 3, 2007, at 6:35 PM, Evan Cheng wrote:
> Hi Dan,
>
> This patch is breaking llvm-gcc bootstrapping on PPC.
>
> I am not sure what exactly wrong is it. But the old code has a check
> for endianness while your new code doesn't. Can you check again if
> you are taking endianness into consideration?
One thing to check: if returning (or passing) an i64 value, make sure
the right halves are returned in r3 vs r4. Thanks!
-Chris
From rspencer at reidspencer.com Wed Jul 4 01:38:45 2007
From: rspencer at reidspencer.com (Reid Spencer)
Date: Tue, 03 Jul 2007 23:38:45 -0700
Subject: [llvm-commits] [llvm] r37855 - /llvm/trunk/docs/Makefile
In-Reply-To: <200707031811.l63IBKcp018386@zion.cs.uiuc.edu>
References: <200707031811.l63IBKcp018386@zion.cs.uiuc.edu>
Message-ID: <1183531125.3143.276.camel@bashful.x10sys.com>
On Tue, 2007-07-03 at 18:11 +0000, Tanya Lattner wrote:
> Author: tbrethou
> Date: Tue Jul 3 13:11:20 2007
> New Revision: 37855
>
> URL: http://llvm.org/viewvc/llvm-project?rev=37855&view=rev
> Log:
> We really should not have this version number in SO many makefiles. This should also probably change to svn instead of cvs, but leaving it for now.
Its not in "SO" many makefiles. The line you changed is a comment (to
remind us of the syntax of the line being grepped). The next line
(PACKAGE_VERSION) is extracting the version number from the AC_INIT line
in the configure.ac file, specifically so the version number can be in
just one place.
Do you know of other places where the version number is located?
Reid.
>
> Modified:
> llvm/trunk/docs/Makefile
>
> Modified: llvm/trunk/docs/Makefile
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Makefile?rev=37855&r1=37854&r2=37855&view=diff
> ==============================================================================
>
> --- llvm/trunk/docs/Makefile (original)
> +++ llvm/trunk/docs/Makefile Tue Jul 3 13:11:20 2007
> @@ -14,7 +14,7 @@
> PROJ_OBJ_DIR = .
> DOXYGEN = doxygen
> # Extract version number from the AC_INT line in configure.ac
> -# AC_INIT([[llvm]],[[2.0cvs]],[llvmbugs at cs.uiuc.edu])
> +# AC_INIT([[llvm]],[[2.1cvs]],[llvmbugs at cs.uiuc.edu])
> PACKAGE_VERSION = $(shell grep AC_INIT ../autoconf/configure.ac | sed -e 's/[^,]*,[[][[]//' -e 's/]],.*//')
> $(warning VERSION=$(VERSION))
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From rspencer at reidspencer.com Wed Jul 4 01:47:56 2007
From: rspencer at reidspencer.com (Reid Spencer)
Date: Tue, 03 Jul 2007 23:47:56 -0700
Subject: [llvm-commits] [llvm] r37852 -
in /llvm/trunk: autoconf/configure.ac configure
In-Reply-To: <681F705E-1249-4935-8587-B77393837D92@apple.com>
References: <200707031701.l63H1xKa016388@zion.cs.uiuc.edu>
<681F705E-1249-4935-8587-B77393837D92@apple.com>
Message-ID: <1183531676.3143.278.camel@bashful.x10sys.com>
On Tue, 2007-07-03 at 10:27 -0700, Tanya Lattner wrote:
> This will most likely break the nightly tester.
Yeah, it will. The nightly tester checks out "test-suite" *as* llvm-test
specifically so this configure stuff wouldn't break .. a temporary
measure till we get llvm-top all figured out.
Reid.
>
> -Tanya
>
> On Jul 3, 2007, at 10:01 AM, Anton Korobeynikov wrote:
>
> > Author: asl
> > Date: Tue Jul 3 12:01:58 2007
> > New Revision: 37852
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=37852&view=rev
> > Log:
> > Rename llvm-test => test-suite. By Dave Greene.
> >
> > Modified:
> > llvm/trunk/autoconf/configure.ac
> > llvm/trunk/configure
> >
> > Modified: llvm/trunk/autoconf/configure.ac
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/
> > configure.ac?rev=37852&r1=37851&r2=37852&view=diff
> > ======================================================================
> > ========
> >
> > --- llvm/trunk/autoconf/configure.ac (original)
> > +++ llvm/trunk/autoconf/configure.ac Tue Jul 3 12:01:58 2007
> > @@ -70,7 +70,7 @@
> > sample) AC_CONFIG_SUBDIRS([projects/sample]) ;;
> > privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
> > llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;;
> > - llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
> > + test-suite) AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
> > llvm-reopt) AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
> > llvm-gcc) AC_CONFIG_SUBDIRS([projects/llvm-gcc]) ;;
> > llvm-java) AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
> >
> > Modified: llvm/trunk/configure
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?
> > rev=37852&r1=37851&r2=37852&view=diff
> > ======================================================================
> > ========
> >
> > --- llvm/trunk/configure (original)
> > +++ llvm/trunk/configure Tue Jul 3 12:01:58 2007
> > @@ -944,7 +944,7 @@
> > ac_subdirs_all='projects/sample
> > projects/privbracket
> > projects/llvm-stacker
> > -projects/llvm-test
> > +projects/test-suite
> > projects/llvm-reopt
> > projects/llvm-gcc
> > projects/llvm-java
> > @@ -2074,7 +2074,7 @@
> > ;;
> > llvm-stacker) subdirs="$subdirs projects/llvm-stacker"
> > ;;
> > - llvm-test) subdirs="$subdirs projects/llvm-test"
> > + test-suite) subdirs="$subdirs projects/test-suite"
> > ;;
> > llvm-reopt) subdirs="$subdirs projects/llvm-reopt"
> > ;;
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From baldrick at free.fr Wed Jul 4 03:13:02 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 4 Jul 2007 10:13:02 +0200
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <20070703212950.GG5693@village.us.cray.com>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
<200707031643.14426.baldrick@free.fr>
<20070703212950.GG5693@village.us.cray.com>
Message-ID: <200707041013.02760.baldrick@free.fr>
> Looking at it a little more, I think the instcombine folds are actually
> wrong here. For example, it does X + undef -> undef, but that's wrong if
> X is a NaN.
Right, that's why I suggested X + undef -> X.
Ciao,
Duncan.
From reid at x10sys.com Wed Jul 4 06:17:02 2007
From: reid at x10sys.com (Reid Spencer)
Date: Wed, 4 Jul 2007 06:17:02 -0500
Subject: [llvm-commits] CVS: llvm-www/SVNLayout.html
Message-ID: <200707041117.l64BH2lM024209@zion.cs.uiuc.edu>
Changes in directory llvm-www:
SVNLayout.html added (r1.1)
---
Log message:
Add a document to discuss Subversion design issues and policy.
---
Diffs of the changes: (+219 -0)
SVNLayout.html | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 219 insertions(+)
Index: llvm-www/SVNLayout.html
diff -c /dev/null llvm-www/SVNLayout.html:1.1
*** /dev/null Wed Jul 4 06:16:50 2007
--- llvm-www/SVNLayout.html Wed Jul 4 06:16:40 2007
***************
*** 0 ****
--- 1,219 ----
+
+
+ Subversion Layout and Policy
+
+
This document contains notes about the planned layout of the Subversion
+ repository and policies surrounding its use.
+
+ - Introduction
+ - URL
+
- Top Level
+
- The llvm-top Module
+
- Rename 'llvm' as 'core'
+
- The website Module
+
- Best Practices
+
+
+
+
+
+
+
There has been some confusion recently about how the Subversion repository
+ should be laid out. This document provides some proposals for the layout
+ including some reasoning for the decisions made. It is intended to be used as
+ a working draft until we have consensus and then as the specification for the
+ actual layout work to be done.
+
Much of the content here was culled from an IRC conversation between Chris,
+ Reid, Tanya and Gordon on July 2nd 2007
+
The sub-sections below each describe one layout construct.
+
+
+
+
+
+
Right now, access to subversion is provided through URLs of this form:
+
+ - http://llvm.org/svn/llvm-project/...
+ - https://user at llvm.org/svn/llvm-project/...
+
+
The former is for anonymous access, the later for authenticated read-write
+ access.
+
Given that the URL already contains "llvm.org", the llvm-project directory
+ is redundant and should be dropped.
+
It is proposed that all URLS should be shortened to these prefixes:
+
+ - http://llvm.org/svn/...
+ - https://user at llvm.org/svn/...
+
+
Advantages:
+
+ - Shorter paths are always welcome.
+ - We don't intend for the project to have multiple repositories.
+ - No confusion about "llvm-project".
+
+
Disadvantages:
+
+ - We won't be able to utilize multiple subversion repositories (some would
+ claim this to be an advantage).
+
+
+
+
+
+
+
After much discussion, it was decided that the root of the repository
+ should contain only directories with one directory for each module
+ (sub-project). Under each of those directories are the usual trunk,
+ branches, and tags directories.
+
+ http://llvm.org/svn/llvm/
+ trunk/
+ lib/
+ include/
+ tools/
+ ...
+ tags/
+ RELEASE_10
+ ...
+ RELEASE_20
+
+ http://llvm.org/svn/llvm-gcc/
+ trunk/
+ gcc/
+ libcpp/
+ libiberty/
+ ...
+ tags/
+ branches/
+
+ ...
+
+
In other words, we are using the recommended and customary layout for the
+ repository as described in the Subversion project's
+ Best Practices.
+
+
There was some discussion about putting (only) the trunk,
+ branches, and tags directories at the top level with
+ sub-directories under each of those for the various modules. This was rejected
+ because of the following factors:
+
+ - It is not the conventional or customary arrangement for modules in a
+ repository.
+ - It goes against the standard layout recommended by the Subversion
+ Best Practices.
+ - It prevents a whole module from being dumped in a consistent state
+ because there is no top level directory that contains the trunk, the
+ branches and the tags all together. Having everything in one directory is a
+ requirement for having this history correctly mapped when you dump that
+ directory. This would make it difficult to move a module to a new
+ repository, for example.
+ - The perceived benefits of this layout be handled by the
+ llvm-top module. The original motivation
+ for this layout was:
+
+
+
+
+
+
+
+
We have decided that there should be a module, named llvm-top that
+ contains some "top level" stuff. This is the module that you should check out
+ at the top level of your working directory. It should also be the only module
+ you need to check out manually because the Makefile in llvm-top will assist
+ you with checking out, configuring, and building the other modules. This
+ module may also have some top level documentation (project policies, etc.) but
+ nothing specific about individual modules.
+
For example, we expect the typical developer scenario to go something like
+ this:
+ svn co http://llvm.org/svn/llvm-top/trunk llvm-top
+ make get-llvm # fetches the llvm module from subversion
+ make get-test-suite # fetches the llvm test suite module from subversion
+ make get-llvm-gcc # fetches the llvm-gcc module from subversion
+ make tested-C-compiler # configures and builds both llvm and llvm-gcc
+ # and runs the test suite against llvm-gcc c compiler
+
+
Note here that the user could have just done "make tested-C-compiler" which
+ would know that it depended on llvm, llvm-gcc, and
+ test-suite, checked them out automatically, and then proceeded with
+ the configure and build.
+
I have created an initial version of llvm-top in the repository already.
+ Please try it out and let me know what you think.
+
+
+
+
+
+
We would like to, at some point, rename the llvm module as
+ core (or something similar). The reasons for this are:
+
+ - The notion of checking out "llvm" from "llvm" is a bit confusing,
+ especially for folks new to the project.
+ - The name no longer reflects the reality. We will likely be moving things
+ out of llvm and into llvm-top so that it really will
+ become just the core compiler code.
+ - We thought you all would enjoy some serious confusion.
+
+
+
+
+
+
+
Because the project has become a federation of related projects, we are
+ redesigning the web site. The new website will, strangely enough, be located
+ in a module named website. This will be the site that is presented
+ for the http://llvm.org/ URL. This will describe the project as a
+ whole and then provide places where each module (sub-project) can insert its
+ own content.
+
Chris Lattner is working on a prototype for this and a proposal for the
+ site.
+
+
+
+
+
+
We intend that developers follow the
+ Best Practices
+ defined by the Subversion project. Most of the items on that page have been
+ official or unofficial practice within the LLVM development community for
+ several years. Please make sure you read these best practices and then this
+ list of notes and exceptions:
+
+ - Use a sane repository layout. The best practice recommends that
+ there be a "project root" with /trunk, /branches, and
+ /tags. We will follow that advice so that all top level directories
+ are for the modules (sub-projects) with t-t-b as a layer under each of them.
+ However, we have a slight twist. We want to have a module that gets checked
+ out first as the top level on the client side as
+ discussed above.
+ - The "issue tracker" discussed means our Bugzilla system.
+ - We will use the Branch-When-Needed system of branching.
+
+
+
+
+
+
+
+
+
Last modified: $Date: 2007/07/04 11:16:40 $
+
+
From baldrick at free.fr Wed Jul 4 06:36:11 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 4 Jul 2007 13:36:11 +0200
Subject: [llvm-commits] Handle nested try-catch statements
Message-ID: <200707041336.12890.baldrick@free.fr>
These patches, to LLVM and llvm-gcc, add support for nested
try-catch statements. Previously, only the inner most
catch or filter was being taken into account. Thanks to
inlining it is possible for a function to contain any
number of filters and catches nested within each other
(without inlining filters only occur outermost). To support
this I've junked the eh.filter intrinsic and extended the
eh.selector intrinsic so it can simultaneously contain catches
and filters. To indicate a filter, the number of typeinfos
in the filter is given as an argument, followed by the typeinfos
themselves. For example,
%s = eh.selector(exception,personality,t1,2,t2,t3,t4);
has a catch (typeinfo t1) followed by a filter of length 2
(typeinfos t2 and t3) followed by another catch (typeinfo t4).
This is not very beautiful but it is simple, effective and
unambiguous.
An alternative would have been to keep eh.filter and output
multiple filter/selector intrinsics like this:
%s1 = eh.selector(exception,personality,t4);
%s2 = eh.filter(exception,personality,t2,t3);
%s3 = eh.selector(exception,personality,t1);
(yes, in reverse order). Then %s1 and %s2 would never be used,
and %s3 would be tested against the various typeinfos, even if
they were never mentioned in the %s3 selector itself (eg t4).
It also requires extra mucking around with the live-in markings
for the exception and selector registers produced during codegen.
I decided it was better to enhance eh.selector and get rid of
eh.filter. Note that this means that eh.selector now corresponds
directly to the action sequence in the dwarf eh table.
The testcase shows the difference before and after (I've simplified
the output a bit):
Before:
%eh_select = call @llvm.eh.filter(%eh_ptr, @__gxx_personality_v0,
null) ; "empty" filter [the "null" should not be here - also fixed in this patch]
After:
%eh_select = call @llvm.eh.selector(%eh_ptr, @__gxx_personality_v0,
i32 0, ; empty filter
@_ZTI3One, ; catch
i32 1, @_ZTI3Two, ; filter of length 1
@_ZTI5Three, @_ZTI4Four, ; two catches
i32 2, @_ZTI4Five, @_ZTI3Six, ; filter of length 2
null) ; catch-all
Ciao,
Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm_part.diff
Type: text/x-diff
Size: 14442 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070704/55365299/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc_part.diff
Type: text/x-diff
Size: 8422 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070704/55365299/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2007-07-04-NestedCatches.cpp
Type: text/x-c++src
Size: 533 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070704/55365299/attachment-0002.bin
From clattner at apple.com Wed Jul 4 11:53:43 2007
From: clattner at apple.com (Chris Lattner)
Date: Wed, 4 Jul 2007 09:53:43 -0700
Subject: [llvm-commits] [llvm] r37851 -
/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
In-Reply-To: <200707041013.02760.baldrick@free.fr>
References: <200707031403.l63E3woZ011704@zion.cs.uiuc.edu>
<200707031643.14426.baldrick@free.fr>
<20070703212950.GG5693@village.us.cray.com>
<200707041013.02760.baldrick@free.fr>
Message-ID: <24BE4655-4907-4C97-A13C-6A4FA7E37E32@apple.com>
On Jul 4, 2007, at 1:13 AM, Duncan Sands wrote:
>> Looking at it a little more, I think the instcombine folds are
>> actually
>> wrong here. For example, it does X + undef -> undef, but that's
>> wrong if
>> X is a NaN.
>
> Right, that's why I suggested X + undef -> X.
Generally it's better to fold to a constant (e.g. a NAN) instead of
retaining a use of X. Folding to a NAN makes the computation of X
dead, and theoretically the nan will be folded through lots of other
operations (which probably isn't true right now, but could be
implemented).
-Chris
From resistor at mac.com Wed Jul 4 13:26:19 2007
From: resistor at mac.com (Owen Anderson)
Date: Wed, 04 Jul 2007 18:26:19 -0000
Subject: [llvm-commits] [llvm] r37871 - in /llvm/trunk:
lib/Transforms/Scalar/GVNPRE.cpp
test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll
Message-ID: <200707041826.l64IQJ4V003117@zion.cs.uiuc.edu>
Author: resistor
Date: Wed Jul 4 13:26:18 2007
New Revision: 37871
URL: http://llvm.org/viewvc/llvm-project?rev=37871&view=rev
Log:
Fix a typo that was killing GVNPRE of select instructions.
Added:
llvm/trunk/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=37871&r1=37870&r2=37871&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Wed Jul 4 13:26:18 2007
@@ -1040,7 +1040,7 @@
stack.push_back(r);
else if (m != 0 && isa(m) &&
visited.count(m) == 0)
- stack.push_back(r);
+ stack.push_back(m);
else {
vec.push_back(e);
visited.insert(e);
Added: llvm/trunk/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll?rev=37871&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll (added)
+++ llvm/trunk/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll Wed Jul 4 13:26:18 2007
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
+
+define i32* @_ZN6Solver9propagateEv(i32* %this) {
+entry:
+ %tmp15.i48 = load i8* null ; [#uses=2]
+ %tmp64.i.i51 = sub i8 0, %tmp15.i48 ; [#uses=1]
+ %tmp231.i52 = select i1 false, i8 %tmp15.i48, i8 %tmp64.i.i51 ; [#uses=0]
+ ret i32* null
+}
From sabre at nondot.org Wed Jul 4 13:42:47 2007
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 04 Jul 2007 18:42:47 -0000
Subject: [llvm-commits] [llvm] r37872 - /llvm/trunk/docs/GettingStarted.html
Message-ID: <200707041842.l64Igl3O003570@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Jul 4 13:42:47 2007
New Revision: 37872
URL: http://llvm.org/viewvc/llvm-project?rev=37872&view=rev
Log:
Make the GSG actually work.
Modified:
llvm/trunk/docs/GettingStarted.html
Modified: llvm/trunk/docs/GettingStarted.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStarted.html?rev=37872&r1=37871&r2=37872&view=diff
==============================================================================
--- llvm/trunk/docs/GettingStarted.html (original)
+++ llvm/trunk/docs/GettingStarted.html Wed Jul 4 13:42:47 2007
@@ -724,7 +724,7 @@
you get it from the Subversion repository:
cd llvm/projects
- svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
+ svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
By placing it in the llvm/projects, it will be automatically
configured by the LLVM configure script as well as automatically updated when
From reid at x10sys.com Wed Jul 4 14:28:00 2007
From: reid at x10sys.com (Reid Spencer)
Date: Wed, 4 Jul 2007 14:28:00 -0500
Subject: [llvm-commits] CVS: llvm-www/SVNLayout.html
Message-ID: <200707041928.l64JS0ct004762@zion.cs.uiuc.edu>
Changes in directory llvm-www:
SVNLayout.html updated: 1.1 -> 1.2
---
Log message:
Fix some validation errors.
---
Diffs of the changes: (+5 -5)
SVNLayout.html | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
Index: llvm-www/SVNLayout.html
diff -u llvm-www/SVNLayout.html:1.1 llvm-www/SVNLayout.html:1.2
--- llvm-www/SVNLayout.html:1.1 Wed Jul 4 06:16:40 2007
+++ llvm-www/SVNLayout.html Wed Jul 4 14:27:21 2007
@@ -90,7 +90,7 @@
In other words, we are using the recommended and customary layout for the
repository as described in the Subversion project's
- Best Practices.
+ Best Practices.
There was some discussion about putting (only) the trunk,
branches, and tags directories at the top level with
@@ -118,8 +118,8 @@
instead of:
svn co http://llvm.org/svn/llvm/trunk llvm
However, this isn't a huge inconvenience and it only needs to be
- done once for the llvm-top module. From there the
- makefile can fetch, configure and build what is needed.
+ done once for the llvm-top module. From there
+ the makefile can fetch, configure and build what is needed.
Allows master release tags and branches to be created more easily. The
idea was that the modules of the project are quite interdependent and we
would want some kind of "version lock" on them. Turns out that since
@@ -189,7 +189,7 @@
We intend that developers follow the
- Best Practices
+ Best Practices
defined by the Subversion project. Most of the items on that page have been
official or unofficial practice within the LLVM development community for
several years. Please make sure you read these best practices and then this
@@ -214,6 +214,6 @@
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">
-
Last modified: $Date: 2007/07/04 11:16:40 $
+
Last modified: $Date: 2007/07/04 19:27:21 $
From reid at x10sys.com Wed Jul 4 14:30:28 2007
From: reid at x10sys.com (Reid Spencer)
Date: Wed, 4 Jul 2007 14:30:28 -0500
Subject: [llvm-commits] CVS: llvm-www/SVNLayout.html
Message-ID: <200707041930.l64JUSMC004877@zion.cs.uiuc.edu>
Changes in directory llvm-www:
SVNLayout.html updated: 1.2 -> 1.3
---
Log message:
Make the example actually work.
---
Diffs of the changes: (+2 -1)
SVNLayout.html | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm-www/SVNLayout.html
diff -u llvm-www/SVNLayout.html:1.2 llvm-www/SVNLayout.html:1.3
--- llvm-www/SVNLayout.html:1.2 Wed Jul 4 14:27:21 2007
+++ llvm-www/SVNLayout.html Wed Jul 4 14:30:09 2007
@@ -143,6 +143,7 @@
For example, we expect the typical developer scenario to go something like
this:
svn co http://llvm.org/svn/llvm-top/trunk llvm-top
+ cd llvm-top # enter the llvm-top module you just checked out
make get-llvm # fetches the llvm module from subversion
make get-test-suite # fetches the llvm test suite module from subversion
make get-llvm-gcc # fetches the llvm-gcc module from subversion
@@ -214,6 +215,6 @@
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">
-
Last modified: $Date: 2007/07/04 19:27:21 $
+
Last modified: $Date: 2007/07/04 19:30:09 $
From reid at x10sys.com Wed Jul 4 14:50:29 2007
From: reid at x10sys.com (Reid Spencer)
Date: Wed, 4 Jul 2007 14:50:29 -0500
Subject: [llvm-commits] CVS: llvm-www/SVNLayout.html
Message-ID: <200707041950.l64JoT4H005363@zion.cs.uiuc.edu>
Changes in directory llvm-www:
SVNLayout.html updated: 1.3 -> 1.4
---
Log message:
We won't move stuff to llvm-top from llvm, but perhaps from llvm to other
modules.
---
Diffs of the changes: (+2 -2)
SVNLayout.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm-www/SVNLayout.html
diff -u llvm-www/SVNLayout.html:1.3 llvm-www/SVNLayout.html:1.4
--- llvm-www/SVNLayout.html:1.3 Wed Jul 4 14:30:09 2007
+++ llvm-www/SVNLayout.html Wed Jul 4 14:50:11 2007
@@ -167,7 +167,7 @@
The notion of checking out "llvm" from "llvm" is a bit confusing,
especially for folks new to the project.
The name no longer reflects the reality. We will likely be moving things
- out of llvm and into llvm-top so that it really will
+ out of llvm and into other modules so that it really will
become just the core compiler code.
We thought you all would enjoy some serious confusion.
@@ -215,6 +215,6 @@
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">

-
Last modified: $Date: 2007/07/04 19:30:09 $
+
Last modified: $Date: 2007/07/04 19:50:11 $
From baldrick at free.fr Wed Jul 4 15:09:16 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 04 Jul 2007 20:09:16 -0000
Subject: [llvm-commits] [test-suite] r37873 - in
/test-suite/trunk/SingleSource/UnitTests/Vector/SSE: sse.expandfft.c
sse.isamax.c sse.stepfft.c
Message-ID: <200707042009.l64K9G9s005919@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Jul 4 15:09:16 2007
New Revision: 37873
URL: http://llvm.org/viewvc/llvm-project?rev=37873&view=rev
Log:
In isamax, clearly align==1 should have been align==3.
Add bres to the indices calculated using SSE to correct
for the earlier offsetting of xp. Align xbig and indx.
For expandfft and stepfft make sure wu and wr are aligned
on a 16 byte boundary. Without these alignment fixes, the
programs crash when built with gcc 4.1, 4.2 and 4.3.
Modified:
test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.expandfft.c
test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.isamax.c
test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.stepfft.c
Modified: test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.expandfft.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.expandfft.c?rev=37873&r1=37872&r2=37873&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.expandfft.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.expandfft.c Wed Jul 4 15:09:16 2007
@@ -94,7 +94,8 @@
int jb, jc, jw, k, k2, lj, m, j, mj, mj2, pass, tgle;
float (*a)[2],(*b)[2],(*c)[2],(*d)[2];
float (*aa)[2],(*bb)[2],(*cb)[2],(*dd)[2];
- float rp,up,wr[4],wu[4];
+ float rp,up,wra[7],wua[7];
+ float *wr = wra, *wu = wua;
__m128 V0,V1,V2,V3,V4,V5,V6,V7;
__m128 V8,V9,V10,V11,V12,V13,V14,V15;
@@ -107,6 +108,8 @@
mj = 1;
mj2 = 2;
lj = n/2;
+ wr += (4 - ((unsigned int) wr >> 2)) & 0x03; // align wr
+ wu += (4 - ((unsigned int) wu >> 2)) & 0x03; // align wu
// first pass thru data: x -> y
a = (void *)&x[0][0];
b = (void *)&x[n/2][0];
Modified: test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.isamax.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.isamax.c?rev=37873&r1=37872&r2=37873&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.isamax.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.isamax.c Wed Jul 4 15:09:16 2007
@@ -30,7 +30,8 @@
float bbig,ebig,bres,*xp;
int eres,i,ibbig,iebig,align,nsegs,mb,nn;
__m128 offset4,V0,V1,V2,V3,V6,V7;
- float xbig[8],indx[8];
+ float xbiga[11],indxa[11];
+ float *xbig = xbiga, *indx = indxa;
// n < NS done in scalar mode
if(n < NS){
iebig = 0;
@@ -63,7 +64,7 @@
if(fabsf(x[1]) > bbig){
bbig = fabsf(x[1]); ibbig = 1;
}
- } else if(align == 1){ // bres = 1 case
+ } else if(align == 3){ // bres = 1 case
bbig = fabsf(x[0]); ibbig = 0;
bres = 1.0; nn = n - 1;
} else { // bres = 0 case
@@ -99,6 +100,8 @@
V7 = _mm_max_ps(V7,V3);
}
// Now finish up: segment maxima are in V0, indices in V7
+ xbig += (4 - ((unsigned int) xbig >> 2)) & 0x03; // align xbig
+ indx += (4 - ((unsigned int) indx >> 2)) & 0x03; // align indx
_mm_store_ps(xbig,V0);
_mm_store_ps(indx,V7);
if(eres>0){
@@ -112,7 +115,7 @@
for(i=0;i<4+eres;i++){
if(xbig[i] > ebig){
ebig = xbig[i];
- iebig = (int) indx[i];
+ iebig = (int) (indx[i]+bres);
}
}
return(iebig);
Modified: test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.stepfft.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.stepfft.c?rev=37873&r1=37872&r2=37873&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.stepfft.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.stepfft.c Wed Jul 4 15:09:16 2007
@@ -156,12 +156,16 @@
float a[][2],b[][2],c[][2],d[][2],w[][2],sign;
{
int j,k,jc,jw,l,lj,mj2,mseg;
- float rp,up,wr[4],wu[4];
+ float rp,up,wra[7],wua[7];
__m128 xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7;
+ float *wr = wra, *wu = wua;
mj2 = 2*mj;
lj = n/mj2;
+ wr += (4 - ((unsigned int) wr >> 2)) & 0x03; // align wr
+ wu += (4 - ((unsigned int) wu >> 2)) & 0x03; // align wu
+
for(j=0; j
Changes in directory llvm-www:
Users.html updated: 1.20 -> 1.21
---
Log message:
add faust
---
Diffs of the changes: (+6 -1)
Users.html | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.20 llvm-www/Users.html:1.21
--- llvm-www/Users.html:1.20 Wed Jun 6 15:16:55 2007
+++ llvm-www/Users.html Wed Jul 4 15:10:08 2007
@@ -238,6 +238,11 @@
PyPy Project |
Python interpreter written in Python. Targets LLVM and C. |
+
+
+ | Faust Signal Processing Language |
+ Signal processing language, uses the LLVM JIT for runtime codegen. |
+
@@ -252,6 +257,6 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Development List
- Last modified: $Date: 2007/06/06 20:16:55 $
+ Last modified: $Date: 2007/07/04 20:10:08 $
From baldrick at free.fr Wed Jul 4 15:48:48 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 04 Jul 2007 20:48:48 -0000
Subject: [llvm-commits] [llvm] r37874 -
/llvm/trunk/test/C++Frontend/2007-07-04-NestedCatches.cpp
Message-ID: <200707042048.l64Kmmp2006909@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Jul 4 15:48:48 2007
New Revision: 37874
URL: http://llvm.org/viewvc/llvm-project?rev=37874&view=rev
Log:
Nested try-catch-filter testcase.
Added:
llvm/trunk/test/C++Frontend/2007-07-04-NestedCatches.cpp
Added: llvm/trunk/test/C++Frontend/2007-07-04-NestedCatches.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/2007-07-04-NestedCatches.cpp?rev=37874&view=auto
==============================================================================
--- llvm/trunk/test/C++Frontend/2007-07-04-NestedCatches.cpp (added)
+++ llvm/trunk/test/C++Frontend/2007-07-04-NestedCatches.cpp Wed Jul 4 15:48:48 2007
@@ -0,0 +1,32 @@
+// RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | \
+// RUN: ignore grep {eh\.selector.*One.*Two.*Three.*Four.*Five.*Six.*null} | \
+// RUN: wc -l | grep {\[02\]}
+
+extern void X(void);
+
+struct One {};
+struct Two {};
+struct Three {};
+struct Four {};
+struct Five {};
+struct Six {};
+
+static void A(void) throw ()
+{
+ X();
+}
+
+static void B(void) throw (Two)
+{
+ try { A(); } catch (One) {}
+}
+
+static void C(void) throw (Six, Five)
+{
+ try { B(); } catch (Three) {} catch (Four) {}
+}
+
+int main ()
+{
+ try { C(); } catch (...) {}
+}
From clattner at apple.com Wed Jul 4 15:50:11 2007
From: clattner at apple.com (clattner at apple.com)
Date: Wed, 4 Jul 2007 13:50:11 -0700 (PDT)
Subject: [llvm-commits] [129185] Handle nested try-catch statements: From
Duncan
Message-ID: <20070704205011.D81A0C685905@src>
Revision: 129185
Author: clattner
Date: 2007-07-04 13:50:11 -0700 (Wed, 04 Jul 2007)
Log Message:
-----------
Handle nested try-catch statements: From Duncan
These patches, to LLVM and llvm-gcc, add support for nested
try-catch statements. Previously, only the inner most
catch or filter was being taken into account. Thanks to
inlining it is possible for a function to contain any
number of filters and catches nested within each other
(without inlining filters only occur outermost). To support
this I've junked the eh.filter intrinsic and extended the
eh.selector intrinsic so it can simultaneously contain catches
and filters. To indicate a filter, the number of typeinfos
in the filter is given as an argument, followed by the typeinfos
themselves. For example,
%s = eh.selector(exception,personality,t1,2,t2,t3,t4);
has a catch (typeinfo t1) followed by a filter of length 2
(typeinfos t2 and t3) followed by another catch (typeinfo t4).
This is not very beautiful but it is simple, effective and
unambiguous.
An alternative would have been to keep eh.filter and output
multiple filter/selector intrinsics like this:
%s1 = eh.selector(exception,personality,t4);
%s2 = eh.filter(exception,personality,t2,t3);
%s3 = eh.selector(exception,personality,t1);
(yes, in reverse order). Then %s1 and %s2 would never be used,
and %s3 would be tested against the various typeinfos, even if
they were never mentioned in the %s3 selector itself (eg t4).
It also requires extra mucking around with the live-in markings
for the exception and selector registers produced during codegen.
I decided it was better to enhance eh.selector and get rid of
eh.filter. Note that this means that eh.selector now corresponds
directly to the action sequence in the dwarf eh table.
The testcase shows the difference before and after (I've simplified
the output a bit):
Before:
%eh_select = call @llvm.eh.filter(%eh_ptr, @__gxx_personality_v0,
null) ; "empty" filter [the "null" should not be here - also fixed in this patch]
After:
%eh_select = call @llvm.eh.selector(%eh_ptr, @__gxx_personality_v0,
i32 0, ; empty filter
@_ZTI3One, ; catch
i32 1, @_ZTI3Two, ; filter of length 1
@_ZTI5Three, @_ZTI4Four, ; two catches
i32 2, @_ZTI4Five, @_ZTI3Six, ; filter of length 2
null) ; catch-all
Modified Paths:
--------------
apple-local/branches/llvm/gcc/llvm-convert.cpp
apple-local/branches/llvm/gcc/llvm-internal.h
Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-07-04 11:25:32 UTC (rev 129184)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-07-04 20:50:11 UTC (rev 129185)
@@ -350,7 +350,6 @@
ExceptionSelectorValue = 0;
FuncEHException = 0;
FuncEHSelector = 0;
- FuncEHFilter = 0;
FuncEHGetTypeID = 0;
FuncCPPPersonality = 0;
FuncUnwindResume = 0;
@@ -1965,16 +1964,18 @@
/// GatherTypeInfo - Walk through the expression gathering all the
/// typeinfos that are used.
void TreeToLLVM::GatherTypeInfo(tree exp,
- std::vector &TypeInfos) {
+ std::vector &TypeInfos) {
if (TREE_CODE(exp) == CATCH_EXPR || TREE_CODE(exp) == EH_FILTER_EXPR) {
tree Types = TREE_CODE(exp) == CATCH_EXPR ? CATCH_TYPES(exp)
: EH_FILTER_TYPES(exp);
if (!Types) {
- // Catch all.
- TypeInfos.push_back(
- Constant::getNullValue(PointerType::get(Type::Int8Ty))
- );
+ // Catch all or empty filter.
+ if (TREE_CODE(exp) == CATCH_EXPR)
+ // Catch all.
+ TypeInfos.push_back(
+ Constant::getNullValue(PointerType::get(Type::Int8Ty))
+ );
} else if (TREE_CODE(Types) != TREE_LIST) {
// Construct typeinfo object. Each call will produce a new expression
// even if duplicate.
@@ -1982,7 +1983,7 @@
// Produce value. Duplicate typeinfo get folded here.
Value *TypeInfo = Emit(TypeInfoNopExpr, 0);
// Capture typeinfo.
- TypeInfos.push_back(TypeInfo);
+ TypeInfos.push_back(cast(TypeInfo));
} else {
for (; Types; Types = TREE_CHAIN (Types)) {
// Construct typeinfo object. Each call will produce a new expression
@@ -1991,7 +1992,7 @@
// Produce value. Duplicate typeinfo get folded here.
Value *TypeInfo = Emit(TypeInfoNopExpr, 0);
// Capture typeinfo.
- TypeInfos.push_back(TypeInfo);
+ TypeInfos.push_back(cast(TypeInfo));
}
}
} else if (TREE_CODE(exp) == STATEMENT_LIST) {
@@ -2007,47 +2008,53 @@
/// AddLandingPad - Insert code to fetch and save the exception and exception
/// selector.
void TreeToLLVM::AddLandingPad() {
- tree TryCatch = 0;
- for (std::vector::reverse_iterator I = CurrentEHScopes.rbegin(),
- E = CurrentEHScopes.rend();
- I != E; ++I) {
- if (TREE_CODE(I->TryExpr) == TRY_CATCH_EXPR) {
- TryCatch = I->TryExpr;
- break;
- }
- }
-
CreateExceptionValues();
// Fetch and store the exception.
Value *Ex = Builder.CreateCall(FuncEHException, "eh_ptr");
Builder.CreateStore(Ex, ExceptionValue);
- if (!TryCatch) return;
-
- // Gather the typeinfo.
- std::vector TypeInfos;
- tree Catches = TREE_OPERAND(TryCatch, 1);
- GatherTypeInfo(Catches, TypeInfos);
-
- // Choose type of landing pad type.
- Function *F = FuncEHSelector;
-
- if (TREE_CODE(Catches) == STATEMENT_LIST &&
- !tsi_end_p(tsi_start(Catches)) &&
- TREE_CODE(tsi_stmt(tsi_start(Catches))) == EH_FILTER_EXPR) {
- F = FuncEHFilter;
+ // Fetch and store the exception selector.
+ std::vector Args;
+
+ for (std::vector::reverse_iterator I = CurrentEHScopes.rbegin(),
+ E = CurrentEHScopes.rend(); I != E; ++I) {
+ if (TREE_CODE(I->TryExpr) == TRY_CATCH_EXPR) {
+ if (I->InfosType == Unknown) {
+ // Gather the type info and determine the catch type.
+ tree Catches = TREE_OPERAND(I->TryExpr, 1);
+ GatherTypeInfo(Catches, I->TypeInfos);
+ I->InfosType = (TREE_CODE(Catches) == STATEMENT_LIST &&
+ !tsi_end_p(tsi_start(Catches)) &&
+ TREE_CODE(tsi_stmt(tsi_start(Catches))) ==
+ EH_FILTER_EXPR) ? FilterExpr : CatchList;
+ }
+
+ if (I->InfosType == CatchList && !I->TypeInfos.size())
+ continue;
+
+ // Lazily add the exception and the personality function.
+ if (!Args.size()) {
+ Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr"));
+ Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality,
+ PointerType::get(Type::Int8Ty)));
+ }
+
+ if (I->InfosType == FilterExpr)
+ // Filter - note the size.
+ Args.push_back(ConstantInt::get(Type::Int32Ty, I->TypeInfos.size()));
+
+ Args.reserve(Args.size() + I->TypeInfos.size());
+ for (unsigned j = 0, N = I->TypeInfos.size(); j < N; ++j)
+ Args.push_back(I->TypeInfos[j]);
+ }
}
-
- // Fetch and store exception handler.
- std::vector Args;
- Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr"));
- Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality,
- PointerType::get(Type::Int8Ty)));
- for (unsigned i = 0, N = TypeInfos.size(); i < N; ++i)
- Args.push_back(TypeInfos[i]);
- Value *Select = Builder.CreateCall(F, &Args[0], Args.size(), "eh_select");
- Builder.CreateStore(Select, ExceptionSelectorValue);
+
+ if (Args.size()) {
+ Value *Select = Builder.CreateCall(FuncEHSelector, &Args[0], Args.size(),
+ "eh_select");
+ Builder.CreateStore(Select, ExceptionSelectorValue);
+ }
}
@@ -2067,8 +2074,6 @@
Intrinsic::eh_exception);
FuncEHSelector = Intrinsic::getDeclaration(TheModule,
Intrinsic::eh_selector);
- FuncEHFilter = Intrinsic::getDeclaration(TheModule,
- Intrinsic::eh_filter);
FuncEHGetTypeID = Intrinsic::getDeclaration(TheModule,
Intrinsic::eh_typeid_for);
Modified: apple-local/branches/llvm/gcc/llvm-internal.h
===================================================================
--- apple-local/branches/llvm/gcc/llvm-internal.h 2007-07-04 11:25:32 UTC (rev 129184)
+++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-07-04 20:50:11 UTC (rev 129185)
@@ -258,25 +258,38 @@
BranchFixup(BranchInst *srcBranch, bool IsExceptionEdge)
: SrcBranch(srcBranch), isExceptionEdge(IsExceptionEdge) {}
};
-
+
+ enum CatchTypes { Unknown = 0, CatchList, FilterExpr };
+
/// EHScope - One of these scopes is maintained for each TRY_CATCH_EXPR and
/// TRY_FINALLY_EXPR blocks that we are currently in.
struct EHScope {
/// TryExpr - This is the actual TRY_CATCH_EXPR or TRY_FINALLY_EXPR.
tree_node *TryExpr;
-
+
/// UnwindBlock - A basic block in this scope that branches to the unwind
/// destination. This is lazily created by the first invoke in this scope.
BasicBlock *UnwindBlock;
-
+
// The basic blocks that are directly in this region.
std::vector Blocks;
-
+
/// BranchFixups - This is a list of fixups we need to process in this scope
/// or in a parent scope.
std::vector BranchFixups;
-
- EHScope(tree_node *expr) : TryExpr(expr), UnwindBlock(0) {}
+
+ /// InfosType - The nature of the type infos TryExpr contains: a list of
+ /// CATCH_EXPR (-> CatchList) or an EH_FILTER_EXPR (-> FilterExpr). Equal
+ /// to Unknown if type info information has not yet been gathered.
+ CatchTypes InfosType;
+
+ /// TypeInfos - The type infos corresponding to the catches or filter in
+ /// TryExpr. If InfosType is Unknown then this information has not yet
+ /// been gathered.
+ std::vector TypeInfos;
+
+ EHScope(tree_node *expr) :
+ TryExpr(expr), UnwindBlock(0), InfosType(Unknown) {}
};
/// CurrentEHScopes - The current stack of exception scopes we are
@@ -305,10 +318,6 @@
///
Function *FuncEHSelector;
- /// FuncEHFilter - Function used to handle the exception filtering.
- ///
- Function *FuncEHFilter;
-
/// FuncEHGetTypeID - Function used to return type id for give typeinfo.
///
Function *FuncEHGetTypeID;
@@ -457,7 +466,7 @@
private:
/// GatherTypeInfo - Walk through the expression gathering all the
/// typeinfos that are used.
- void GatherTypeInfo(tree_node *exp, std::vector &TypeInfos);
+ void GatherTypeInfo(tree_node *exp, std::vector &TypeInfos);
/// AddLandingPad - Insert code to fetch and save the exception and exception
/// selector.
From baldrick at free.fr Wed Jul 4 15:52:51 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 04 Jul 2007 20:52:51 -0000
Subject: [llvm-commits] [llvm] r37875 - in /llvm/trunk:
docs/ExceptionHandling.html include/llvm/Intrinsics.td
lib/CodeGen/IntrinsicLowering.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <200707042052.l64Kqpqu007057@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Jul 4 15:52:51 2007
New Revision: 37875
URL: http://llvm.org/viewvc/llvm-project?rev=37875&view=rev
Log:
Extend eh.selector to support both catches and filters.
Drop the eh.filter intrinsic.
Modified:
llvm/trunk/docs/ExceptionHandling.html
llvm/trunk/include/llvm/Intrinsics.td
llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/docs/ExceptionHandling.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ExceptionHandling.html?rev=37875&r1=37874&r2=37875&view=diff
==============================================================================
--- llvm/trunk/docs/ExceptionHandling.html (original)
+++ llvm/trunk/docs/ExceptionHandling.html Wed Jul 4 15:52:51 2007
@@ -29,7 +29,6 @@
- llvm.eh.exception
- llvm.eh.selector
- - llvm.eh.filter
- llvm.eh.typeid.for
Asm Table Formats
@@ -212,13 +211,18 @@
llvm.eh.selector takes a minimum of
three arguments. The first argument is the reference to the exception
structure. The second argument is a reference to the personality function to be
-used for this try catch sequence. The remaining arguments are references to the
-type infos for each of the catch statements in the order they should be tested.
+used for this try catch sequence. Each of the remaining arguments is either a
+reference to the type info for a catch statement, or a non-negative integer
+followed by that many type info references, representing a
+filter.
+The exception is tested against the arguments sequentially from first to last.
The catch all (...) is represented with a null i8*. The result
-of the llvm.eh.selector is the index of
-the type info in the corresponding exception table. The LLVM C++ front end
-generates code to save this value in an alloca location for further use in the
-landing pad and catch code.
+of the llvm.eh.selector is a positive
+number if the exception matched a type info, a negative number if it matched a
+filter, and zero if it didn't match anything. If a type info matched then the
+returned value is the index of the type info in the exception table.
+The LLVM C++ front end generates code to save this value in an alloca location
+for further use in the landing pad and catch code.
Once the landing pad has the type info selector, the code branches to the
code for the first catch. The catch then checks the value of the type info
@@ -268,12 +272,12 @@
C++ allows the specification of which exception types that can be thrown from
a function. To represent this a top level landing pad may exist to filter out
invalid types. To express this in LLVM code the landing pad will call llvm.eh.filter instead of llvm.eh.selector. The arguments are the
-same, but what gets created in the exception table is different. llvm.eh.filter will return a negative value
-if it doesn't find a match. If no match is found then a call to
-__cxa_call_unexpected should be made, otherwise
+number of different type infos the function may throw, followed by the type
+infos themselves.
+llvm.eh.selector will return a negative
+value if the exception does not match any of the type infos. If no match is
+found then a call to __cxa_call_unexpected should be made, otherwise
_Unwind_Resume. Each of these functions require a reference to the
exception structure.
@@ -326,32 +330,16 @@
llvm.eh.selector takes a minimum of
three arguments. The first argument is the reference to the exception
structure. The second argument is a reference to the personality function to be
-used for this try catch sequence. The remaining arguments are references to the
-type infos for each of the catch statements in the order they should be tested.
-The catch all (...) is represented with a null i8*.
-
-
-
-
-
-
-
-
- i32 %llvm.eh.filter(i8*, i8*, i8*, ...)
-
-
-
This intrinsic indicates that the exception selector is available at this
-point in the code. The backend will replace this intrinsic with code to fetch
-the second argument of a call. The effect is that the intrinsic result is the
-exception selector.
-
-
llvm.eh.filter takes a minimum of
-three arguments. The first argument is the reference to the exception
-structure. The second argument is a reference to the personality function to be
-used for this function. The remaining arguments are references to the type infos
-for each type that can be thrown by the current function.
+used for this try catch sequence. Each of the remaining arguments is either a
+reference to the type info for a catch statement, or a non-negative integer
+followed by that many type info references, representing a
+
filter.
+The exception is tested against the arguments sequentially from first to last.
+The
catch all (...) is represented with a
null i8*. The result
+of the
llvm.eh.selector is a positive
+number if the exception matched a type info, a negative number if it matched a
+filter, and zero if it didn't match anything. If a type info matched then the
+returned value is the index of the type info in the exception table.
@@ -427,15 +415,6 @@
-Need to create landing pads for code in between explicit landing pads.
-The landing pads will have a zero action and a NULL landing pad address and are
-used to inform the runtime that the exception should be rethrown.
-
-Actions for a given function should be folded to save space.
-
-Filters for inlined functions need to be handled more extensively.
-Currently it's hardwired for one filter per function.
-
Testing/Testing/Testing.
Modified: llvm/trunk/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=37875&r1=37874&r2=37875&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/Intrinsics.td Wed Jul 4 15:52:51 2007
@@ -231,8 +231,6 @@
def int_eh_exception : Intrinsic<[llvm_ptr_ty]>;
def int_eh_selector : Intrinsic<[llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty,
llvm_vararg_ty]>;
-def int_eh_filter : Intrinsic<[llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_vararg_ty]>;
def int_eh_typeid_for : Intrinsic<[llvm_i32_ty, llvm_ptr_ty]>;
//===---------------- Generic Variable Attribute Intrinsics----------------===//
Modified: llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp?rev=37875&r1=37874&r2=37875&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp Wed Jul 4 15:52:51 2007
@@ -708,7 +708,6 @@
case Intrinsic::dbg_declare:
case Intrinsic::eh_exception:
case Intrinsic::eh_selector:
- case Intrinsic::eh_filter:
break; // Simply strip out debugging and eh intrinsics
case Intrinsic::var_annotation:
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=37875&r1=37874&r2=37875&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 4 15:52:51 2007
@@ -205,12 +205,11 @@
};
}
-/// isFilterOrSelector - Return true if this instruction is a call to the
-/// eh.filter or the eh.selector intrinsic.
-static bool isFilterOrSelector(Instruction *I) {
+/// isSelector - Return true if this instruction is a call to the
+/// eh.selector intrinsic.
+static bool isSelector(Instruction *I) {
if (IntrinsicInst *II = dyn_cast(I))
- return II->getIntrinsicID() == Intrinsic::eh_selector
- || II->getIntrinsicID() == Intrinsic::eh_filter;
+ return II->getIntrinsicID() == Intrinsic::eh_selector;
return false;
}
@@ -2293,12 +2292,12 @@
}
}
-/// ExtractGlobalVariable - If C is a global variable, or a bitcast of one
+/// ExtractGlobalVariable - If V is a global variable, or a bitcast of one
/// (possibly constant folded), return it. Otherwise return NULL.
-static GlobalVariable *ExtractGlobalVariable (Constant *C) {
- if (GlobalVariable *GV = dyn_cast(C))
+static GlobalVariable *ExtractGlobalVariable (Value *V) {
+ if (GlobalVariable *GV = dyn_cast(V))
return GV;
- else if (ConstantExpr *CE = dyn_cast(C)) {
+ else if (ConstantExpr *CE = dyn_cast(V)) {
if (CE->getOpcode() == Instruction::BitCast)
return dyn_cast(CE->getOperand(0));
else if (CE->getOpcode() == Instruction::GetElementPtr) {
@@ -2311,8 +2310,16 @@
return NULL;
}
+/// ExtractTypeInfo - Extracts the type info from a value.
+static GlobalVariable *ExtractTypeInfo (Value *V) {
+ GlobalVariable *GV = ExtractGlobalVariable(V);
+ assert (GV || isa(V) &&
+ "TypeInfo must be a global variable or NULL");
+ return GV;
+}
+
/// addCatchInfo - Extract the personality and type infos from an eh.selector
-/// or eh.filter call, and add them to the specified machine basic block.
+/// call, and add them to the specified machine basic block.
static void addCatchInfo(CallInst &I, MachineModuleInfo *MMI,
MachineBasicBlock *MBB) {
// Inform the MachineModuleInfo of the personality for this landing pad.
@@ -2325,17 +2332,38 @@
// Gather all the type infos for this landing pad and pass them along to
// MachineModuleInfo.
std::vector TyInfo;
- for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) {
- Constant *C = cast(I.getOperand(i));
- GlobalVariable *GV = ExtractGlobalVariable(C);
- assert (GV || isa(C) &&
- "TypeInfo must be a global variable or NULL");
- TyInfo.push_back(GV);
+ unsigned N = I.getNumOperands();
+
+ for (unsigned i = N - 1; i > 2; --i) {
+ if (ConstantInt *CI = dyn_cast(I.getOperand(i))) {
+ unsigned FilterLength = CI->getZExtValue();
+ unsigned FirstCatch = i + FilterLength + 1;
+ assert (FirstCatch <= N && "Invalid filter length");
+
+ if (FirstCatch < N) {
+ TyInfo.reserve(N - FirstCatch);
+ for (unsigned j = FirstCatch; j < N; ++j)
+ TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
+ MMI->addCatchTypeInfo(MBB, TyInfo);
+ TyInfo.clear();
+ }
+
+ TyInfo.reserve(FilterLength);
+ for (unsigned j = i + 1; j < FirstCatch; ++j)
+ TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
+ MMI->addFilterTypeInfo(MBB, TyInfo);
+ TyInfo.clear();
+
+ N = i;
+ }
}
- if (I.getCalledFunction()->getIntrinsicID() == Intrinsic::eh_filter)
- MMI->addFilterTypeInfo(MBB, TyInfo);
- else
+
+ if (N > 3) {
+ TyInfo.reserve(N - 3);
+ for (unsigned j = 3; j < N; ++j)
+ TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
MMI->addCatchTypeInfo(MBB, TyInfo);
+ }
}
/// propagateEHRegister - The specified EH register is required in a successor
@@ -2483,8 +2511,7 @@
return 0;
}
- case Intrinsic::eh_selector:
- case Intrinsic::eh_filter:{
+ case Intrinsic::eh_selector:{
MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
if (ExceptionHandling && MMI) {
@@ -2518,10 +2545,7 @@
if (MMI) {
// Find the type id for the given typeinfo.
- Constant *C = cast(I.getOperand(1));
- GlobalVariable *GV = ExtractGlobalVariable(C);
- assert (GV || isa(C) &&
- "TypeInfo must be a global variable or NULL");
+ GlobalVariable *GV = ExtractTypeInfo(I.getOperand(1));
unsigned TypeID = MMI->getTypeIDFor(GV);
setValue(&I, DAG.getConstant(TypeID, MVT::i32));
@@ -4297,7 +4321,7 @@
assert(!FLI.MBBMap[SrcBB]->isLandingPad() &&
"Copying catch info out of a landing pad!");
for (BasicBlock::iterator I = SrcBB->begin(), E = --SrcBB->end(); I != E; ++I)
- if (isFilterOrSelector(I)) {
+ if (isSelector(I)) {
// Apply the catch info to DestBB.
addCatchInfo(cast(*I), MMI, FLI.MBBMap[DestBB]);
#ifndef NDEBUG
@@ -4341,19 +4365,19 @@
// function and list of typeids logically belong to the invoke (or, if you
// like, the basic block containing the invoke), and need to be associated
// with it in the dwarf exception handling tables. Currently however the
- // information is provided by intrinsics (eh.filter and eh.selector) that
- // can be moved to unexpected places by the optimizers: if the unwind edge
- // is critical, then breaking it can result in the intrinsics being in the
- // successor of the landing pad, not the landing pad itself. This results
- // in exceptions not being caught because no typeids are associated with
- // the invoke. This may not be the only way things can go wrong, but it
- // is the only way we try to work around for the moment.
+ // information is provided by an intrinsic (eh.selector) that can be moved
+ // to unexpected places by the optimizers: if the unwind edge is critical,
+ // then breaking it can result in the intrinsics being in the successor of
+ // the landing pad, not the landing pad itself. This results in exceptions
+ // not being caught because no typeids are associated with the invoke.
+ // This may not be the only way things can go wrong, but it is the only way
+ // we try to work around for the moment.
BranchInst *Br = dyn_cast(LLVMBB->getTerminator());
if (Br && Br->isUnconditional()) { // Critical edge?
BasicBlock::iterator I, E;
for (I = LLVMBB->begin(), E = --LLVMBB->end(); I != E; ++I)
- if (isFilterOrSelector(I))
+ if (isSelector(I))
break;
if (I == E)
From dalej at apple.com Wed Jul 4 16:07:47 2007
From: dalej at apple.com (Dale Johannesen)
Date: Wed, 04 Jul 2007 21:07:47 -0000
Subject: [llvm-commits] [llvm] r37876 - in /llvm/trunk/lib/Target/X86:
X86FloatingPoint.cpp X86ISelLowering.cpp X86InstrFPStack.td
X86InstrInfo.cpp X86RegisterInfo.cpp
Message-ID: <200707042107.l64L7lQt007571@zion.cs.uiuc.edu>
Author: johannes
Date: Wed Jul 4 16:07:47 2007
New Revision: 37876
URL: http://llvm.org/viewvc/llvm-project?rev=37876&view=rev
Log:
Refactor X87 instructions. As a side effect, all
their names are changed.
Modified:
llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86InstrFPStack.td
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=37876&r1=37875&r2=37876&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Wed Jul 4 16:07:47 2007
@@ -121,7 +121,7 @@
std::swap(Stack[RegMap[RegOnTop]], Stack[StackTop-1]);
// Emit an fxch to update the runtime processors version of the state
- BuildMI(*MBB, I, TII->get(X86::FXCH)).addReg(STReg);
+ BuildMI(*MBB, I, TII->get(X86::XCH_F)).addReg(STReg);
NumFXCH++;
}
}
@@ -130,7 +130,7 @@
unsigned STReg = getSTReg(RegNo);
pushReg(AsReg); // New register on top of stack
- BuildMI(*MBB, I, TII->get(X86::FLDrr)).addReg(STReg);
+ BuildMI(*MBB, I, TII->get(X86::LD_Frr)).addReg(STReg);
}
// popStackAfter - Pop the current value off of the top of the FP stack
@@ -324,101 +324,101 @@
// concrete X86 instruction which uses the register stack.
//
static const TableEntry OpcodeTable[] = {
- { X86::FpABS32 , X86::FABS },
- { X86::FpABS64 , X86::FABS },
- { X86::FpADD32m , X86::FADD32m },
- { X86::FpADD64m , X86::FADD64m },
- { X86::FpCHS32 , X86::FCHS },
- { X86::FpCHS64 , X86::FCHS },
- { X86::FpCMOVB32 , X86::FCMOVB },
- { X86::FpCMOVB64 , X86::FCMOVB },
- { X86::FpCMOVBE32 , X86::FCMOVBE },
- { X86::FpCMOVBE64 , X86::FCMOVBE },
- { X86::FpCMOVE32 , X86::FCMOVE },
- { X86::FpCMOVE64 , X86::FCMOVE },
- { X86::FpCMOVNB32 , X86::FCMOVNB },
- { X86::FpCMOVNB64 , X86::FCMOVNB },
- { X86::FpCMOVNBE32 , X86::FCMOVNBE },
- { X86::FpCMOVNBE64 , X86::FCMOVNBE },
- { X86::FpCMOVNE32 , X86::FCMOVNE },
- { X86::FpCMOVNE64 , X86::FCMOVNE },
- { X86::FpCMOVNP32 , X86::FCMOVNP },
- { X86::FpCMOVNP64 , X86::FCMOVNP },
- { X86::FpCMOVP32 , X86::FCMOVP },
- { X86::FpCMOVP64 , X86::FCMOVP },
- { X86::FpCOS32 , X86::FCOS },
- { X86::FpCOS64 , X86::FCOS },
- { X86::FpDIV32m , X86::FDIV32m },
- { X86::FpDIV64m , X86::FDIV64m },
- { X86::FpDIVR32m , X86::FDIVR32m },
- { X86::FpDIVR64m , X86::FDIVR64m },
- { X86::FpIADD16m32 , X86::FIADD16m },
- { X86::FpIADD16m64 , X86::FIADD16m },
- { X86::FpIADD32m32 , X86::FIADD32m },
- { X86::FpIADD32m64 , X86::FIADD32m },
- { X86::FpIDIV16m32 , X86::FIDIV16m },
- { X86::FpIDIV16m64 , X86::FIDIV16m },
- { X86::FpIDIV32m32 , X86::FIDIV32m },
- { X86::FpIDIV32m64 , X86::FIDIV32m },
- { X86::FpIDIVR16m32, X86::FIDIVR16m},
- { X86::FpIDIVR16m64, X86::FIDIVR16m},
- { X86::FpIDIVR32m32, X86::FIDIVR32m},
- { X86::FpIDIVR32m64, X86::FIDIVR32m},
- { X86::FpILD16m32 , X86::FILD16m },
- { X86::FpILD16m64 , X86::FILD16m },
- { X86::FpILD32m32 , X86::FILD32m },
- { X86::FpILD32m64 , X86::FILD32m },
- { X86::FpILD64m32 , X86::FILD64m },
- { X86::FpILD64m64 , X86::FILD64m },
- { X86::FpIMUL16m32 , X86::FIMUL16m },
- { X86::FpIMUL16m64 , X86::FIMUL16m },
- { X86::FpIMUL32m32 , X86::FIMUL32m },
- { X86::FpIMUL32m64 , X86::FIMUL32m },
- { X86::FpIST16m32 , X86::FIST16m },
- { X86::FpIST16m64 , X86::FIST16m },
- { X86::FpIST32m32 , X86::FIST32m },
- { X86::FpIST32m64 , X86::FIST32m },
- { X86::FpIST64m32 , X86::FISTP64m },
- { X86::FpIST64m64 , X86::FISTP64m },
- { X86::FpISTT16m32 , X86::FISTTP16m},
- { X86::FpISTT16m64 , X86::FISTTP16m},
- { X86::FpISTT32m32 , X86::FISTTP32m},
- { X86::FpISTT32m64 , X86::FISTTP32m},
- { X86::FpISTT64m32 , X86::FISTTP64m},
- { X86::FpISTT64m64 , X86::FISTTP64m},
- { X86::FpISUB16m32 , X86::FISUB16m },
- { X86::FpISUB16m64 , X86::FISUB16m },
- { X86::FpISUB32m32 , X86::FISUB32m },
- { X86::FpISUB32m64 , X86::FISUB32m },
- { X86::FpISUBR16m32, X86::FISUBR16m},
- { X86::FpISUBR16m64, X86::FISUBR16m},
- { X86::FpISUBR32m32, X86::FISUBR32m},
- { X86::FpISUBR32m64, X86::FISUBR32m},
- { X86::FpLD032 , X86::FLD0 },
- { X86::FpLD064 , X86::FLD0 },
- { X86::FpLD132 , X86::FLD1 },
- { X86::FpLD164 , X86::FLD1 },
- { X86::FpLD32m , X86::FLD32m },
- { X86::FpLD64m , X86::FLD64m },
- { X86::FpMUL32m , X86::FMUL32m },
- { X86::FpMUL64m , X86::FMUL64m },
- { X86::FpSIN32 , X86::FSIN },
- { X86::FpSIN64 , X86::FSIN },
- { X86::FpSQRT32 , X86::FSQRT },
- { X86::FpSQRT64 , X86::FSQRT },
- { X86::FpST32m , X86::FST32m },
- { X86::FpST64m , X86::FST64m },
- { X86::FpST64m32 , X86::FST32m },
- { X86::FpSUB32m , X86::FSUB32m },
- { X86::FpSUB64m , X86::FSUB64m },
- { X86::FpSUBR32m , X86::FSUBR32m },
- { X86::FpSUBR64m , X86::FSUBR64m },
- { X86::FpTST32 , X86::FTST },
- { X86::FpTST64 , X86::FTST },
- { X86::FpUCOMIr32 , X86::FUCOMIr },
- { X86::FpUCOMIr64 , X86::FUCOMIr },
- { X86::FpUCOMr32 , X86::FUCOMr },
- { X86::FpUCOMr64 , X86::FUCOMr },
+ { X86::ABS_Fp32 , X86::ABS_F },
+ { X86::ABS_Fp64 , X86::ABS_F },
+ { X86::ADD_Fp32m , X86::ADD_F32m },
+ { X86::ADD_Fp64m , X86::ADD_F64m },
+ { X86::ADD_FpI16m32 , X86::ADD_FI16m },
+ { X86::ADD_FpI16m64 , X86::ADD_FI16m },
+ { X86::ADD_FpI32m32 , X86::ADD_FI32m },
+ { X86::ADD_FpI32m64 , X86::ADD_FI32m },
+ { X86::CHS_Fp32 , X86::CHS_F },
+ { X86::CHS_Fp64 , X86::CHS_F },
+ { X86::CMOVBE_Fp32 , X86::CMOVBE_F },
+ { X86::CMOVBE_Fp64 , X86::CMOVBE_F },
+ { X86::CMOVB_Fp32 , X86::CMOVB_F },
+ { X86::CMOVB_Fp64 , X86::CMOVB_F },
+ { X86::CMOVE_Fp32 , X86::CMOVE_F },
+ { X86::CMOVE_Fp64 , X86::CMOVE_F },
+ { X86::CMOVNBE_Fp32 , X86::CMOVNBE_F },
+ { X86::CMOVNBE_Fp64 , X86::CMOVNBE_F },
+ { X86::CMOVNB_Fp32 , X86::CMOVNB_F },
+ { X86::CMOVNB_Fp64 , X86::CMOVNB_F },
+ { X86::CMOVNE_Fp32 , X86::CMOVNE_F },
+ { X86::CMOVNE_Fp64 , X86::CMOVNE_F },
+ { X86::CMOVNP_Fp32 , X86::CMOVNP_F },
+ { X86::CMOVNP_Fp64 , X86::CMOVNP_F },
+ { X86::CMOVP_Fp32 , X86::CMOVP_F },
+ { X86::CMOVP_Fp64 , X86::CMOVP_F },
+ { X86::COS_Fp32 , X86::COS_F },
+ { X86::COS_Fp64 , X86::COS_F },
+ { X86::DIVR_Fp32m , X86::DIVR_F32m },
+ { X86::DIVR_Fp64m , X86::DIVR_F64m },
+ { X86::DIVR_FpI16m32, X86::DIVR_FI16m},
+ { X86::DIVR_FpI16m64, X86::DIVR_FI16m},
+ { X86::DIVR_FpI32m32, X86::DIVR_FI32m},
+ { X86::DIVR_FpI32m64, X86::DIVR_FI32m},
+ { X86::DIV_Fp32m , X86::DIV_F32m },
+ { X86::DIV_Fp64m , X86::DIV_F64m },
+ { X86::DIV_FpI16m32 , X86::DIV_FI16m },
+ { X86::DIV_FpI16m64 , X86::DIV_FI16m },
+ { X86::DIV_FpI32m32 , X86::DIV_FI32m },
+ { X86::DIV_FpI32m64 , X86::DIV_FI32m },
+ { X86::ILD_Fp16m32 , X86::ILD_F16m },
+ { X86::ILD_Fp16m64 , X86::ILD_F16m },
+ { X86::ILD_Fp32m32 , X86::ILD_F32m },
+ { X86::ILD_Fp32m64 , X86::ILD_F32m },
+ { X86::ILD_Fp64m32 , X86::ILD_F64m },
+ { X86::ILD_Fp64m64 , X86::ILD_F64m },
+ { X86::ISTT_Fp16m32 , X86::ISTT_FP16m},
+ { X86::ISTT_Fp16m64 , X86::ISTT_FP16m},
+ { X86::ISTT_Fp32m32 , X86::ISTT_FP32m},
+ { X86::ISTT_Fp32m64 , X86::ISTT_FP32m},
+ { X86::ISTT_Fp64m32 , X86::ISTT_FP64m},
+ { X86::ISTT_Fp64m64 , X86::ISTT_FP64m},
+ { X86::IST_Fp16m32 , X86::IST_F16m },
+ { X86::IST_Fp16m64 , X86::IST_F16m },
+ { X86::IST_Fp32m32 , X86::IST_F32m },
+ { X86::IST_Fp32m64 , X86::IST_F32m },
+ { X86::IST_Fp64m32 , X86::IST_FP64m },
+ { X86::IST_Fp64m64 , X86::IST_FP64m },
+ { X86::LD_Fp032 , X86::LD_F0 },
+ { X86::LD_Fp064 , X86::LD_F0 },
+ { X86::LD_Fp132 , X86::LD_F1 },
+ { X86::LD_Fp164 , X86::LD_F1 },
+ { X86::LD_Fp32m , X86::LD_F32m },
+ { X86::LD_Fp64m , X86::LD_F64m },
+ { X86::MUL_Fp32m , X86::MUL_F32m },
+ { X86::MUL_Fp64m , X86::MUL_F64m },
+ { X86::MUL_FpI16m32 , X86::MUL_FI16m },
+ { X86::MUL_FpI16m64 , X86::MUL_FI16m },
+ { X86::MUL_FpI32m32 , X86::MUL_FI32m },
+ { X86::MUL_FpI32m64 , X86::MUL_FI32m },
+ { X86::SIN_Fp32 , X86::SIN_F },
+ { X86::SIN_Fp64 , X86::SIN_F },
+ { X86::SQRT_Fp32 , X86::SQRT_F },
+ { X86::SQRT_Fp64 , X86::SQRT_F },
+ { X86::ST_Fp32m , X86::ST_F32m },
+ { X86::ST_Fp64m , X86::ST_F64m },
+ { X86::ST_Fp64m32 , X86::ST_F32m },
+ { X86::SUBR_Fp32m , X86::SUBR_F32m },
+ { X86::SUBR_Fp64m , X86::SUBR_F64m },
+ { X86::SUBR_FpI16m32, X86::SUBR_FI16m},
+ { X86::SUBR_FpI16m64, X86::SUBR_FI16m},
+ { X86::SUBR_FpI32m32, X86::SUBR_FI32m},
+ { X86::SUBR_FpI32m64, X86::SUBR_FI32m},
+ { X86::SUB_Fp32m , X86::SUB_F32m },
+ { X86::SUB_Fp64m , X86::SUB_F64m },
+ { X86::SUB_FpI16m32 , X86::SUB_FI16m },
+ { X86::SUB_FpI16m64 , X86::SUB_FI16m },
+ { X86::SUB_FpI32m32 , X86::SUB_FI32m },
+ { X86::SUB_FpI32m64 , X86::SUB_FI32m },
+ { X86::TST_Fp32 , X86::TST_F },
+ { X86::TST_Fp64 , X86::TST_F },
+ { X86::UCOM_FpIr32 , X86::UCOM_FIr },
+ { X86::UCOM_FpIr64 , X86::UCOM_FIr },
+ { X86::UCOM_Fpr32 , X86::UCOM_Fr },
+ { X86::UCOM_Fpr64 , X86::UCOM_Fr },
};
static unsigned getConcreteOpcode(unsigned Opcode) {
@@ -436,27 +436,27 @@
// element is an instruction, the second is the version which pops.
//
static const TableEntry PopTable[] = {
- { X86::FADDrST0 , X86::FADDPrST0 },
+ { X86::ADD_FrST0 , X86::ADD_FPrST0 },
- { X86::FDIVRrST0, X86::FDIVRPrST0 },
- { X86::FDIVrST0 , X86::FDIVPrST0 },
+ { X86::DIVR_FrST0, X86::DIVR_FPrST0 },
+ { X86::DIV_FrST0 , X86::DIV_FPrST0 },
- { X86::FIST16m , X86::FISTP16m },
- { X86::FIST32m , X86::FISTP32m },
+ { X86::IST_F16m , X86::IST_FP16m },
+ { X86::IST_F32m , X86::IST_FP32m },
- { X86::FMULrST0 , X86::FMULPrST0 },
+ { X86::MUL_FrST0 , X86::MUL_FPrST0 },
- { X86::FST32m , X86::FSTP32m },
- { X86::FST64m , X86::FSTP64m },
- { X86::FSTrr , X86::FSTPrr },
+ { X86::ST_F32m , X86::ST_FP32m },
+ { X86::ST_F64m , X86::ST_FP64m },
+ { X86::ST_Frr , X86::ST_FPrr },
- { X86::FSUBRrST0, X86::FSUBRPrST0 },
- { X86::FSUBrST0 , X86::FSUBPrST0 },
+ { X86::SUBR_FrST0, X86::SUBR_FPrST0 },
+ { X86::SUB_FrST0 , X86::SUB_FPrST0 },
- { X86::FUCOMIr , X86::FUCOMIPr },
+ { X86::UCOM_FIr , X86::UCOM_FIPr },
- { X86::FUCOMPr , X86::FUCOMPPr },
- { X86::FUCOMr , X86::FUCOMPr },
+ { X86::UCOM_FPr , X86::UCOM_FPPr },
+ { X86::UCOM_Fr , X86::UCOM_FPr },
};
/// popStackAfter - Pop the current value off of the top of the FP stack after
@@ -474,10 +474,10 @@
int Opcode = Lookup(PopTable, ARRAY_SIZE(PopTable), I->getOpcode());
if (Opcode != -1) {
I->setInstrDescriptor(TII->get(Opcode));
- if (Opcode == X86::FUCOMPPr)
+ if (Opcode == X86::UCOM_FPPr)
I->RemoveOperand(0);
} else { // Insert an explicit pop
- I = BuildMI(*MBB, ++I, TII->get(X86::FSTPrr)).addReg(X86::ST0);
+ I = BuildMI(*MBB, ++I, TII->get(X86::ST_FPrr)).addReg(X86::ST0);
}
}
@@ -501,7 +501,7 @@
RegMap[TopReg] = OldSlot;
RegMap[FPRegNo] = ~0;
Stack[--StackTop] = ~0;
- I = BuildMI(*MBB, ++I, TII->get(X86::FSTPrr)).addReg(STReg);
+ I = BuildMI(*MBB, ++I, TII->get(X86::ST_FPrr)).addReg(STReg);
}
@@ -550,14 +550,14 @@
// Ditto FISTTP16m, FISTTP32m, FISTTP64m.
//
if (!KillsSrc &&
- (MI->getOpcode() == X86::FpIST64m32 ||
- MI->getOpcode() == X86::FpISTT16m32 ||
- MI->getOpcode() == X86::FpISTT32m32 ||
- MI->getOpcode() == X86::FpISTT64m32 ||
- MI->getOpcode() == X86::FpIST64m64 ||
- MI->getOpcode() == X86::FpISTT16m64 ||
- MI->getOpcode() == X86::FpISTT32m64 ||
- MI->getOpcode() == X86::FpISTT64m64)) {
+ (MI->getOpcode() == X86::IST_Fp64m32 ||
+ MI->getOpcode() == X86::ISTT_Fp16m32 ||
+ MI->getOpcode() == X86::ISTT_Fp32m32 ||
+ MI->getOpcode() == X86::ISTT_Fp64m32 ||
+ MI->getOpcode() == X86::IST_Fp64m64 ||
+ MI->getOpcode() == X86::ISTT_Fp16m64 ||
+ MI->getOpcode() == X86::ISTT_Fp32m64 ||
+ MI->getOpcode() == X86::ISTT_Fp64m64)) {
duplicateToTop(Reg, 7 /*temp register*/, I);
} else {
moveToTop(Reg, I); // Move to the top of the stack...
@@ -567,10 +567,10 @@
MI->RemoveOperand(NumOps-1); // Remove explicit ST(0) operand
MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode())));
- if (MI->getOpcode() == X86::FISTP64m ||
- MI->getOpcode() == X86::FISTTP16m ||
- MI->getOpcode() == X86::FISTTP32m ||
- MI->getOpcode() == X86::FISTTP64m) {
+ if (MI->getOpcode() == X86::IST_FP64m ||
+ MI->getOpcode() == X86::ISTT_FP16m ||
+ MI->getOpcode() == X86::ISTT_FP32m ||
+ MI->getOpcode() == X86::ISTT_FP64m) {
assert(StackTop > 0 && "Stack empty??");
--StackTop;
} else if (KillsSrc) { // Last use of operand?
@@ -622,50 +622,50 @@
// ForwardST0Table - Map: A = B op C into: ST(0) = ST(0) op ST(i)
static const TableEntry ForwardST0Table[] = {
- { X86::FpADD32 , X86::FADDST0r },
- { X86::FpADD64 , X86::FADDST0r },
- { X86::FpDIV32 , X86::FDIVST0r },
- { X86::FpDIV64 , X86::FDIVST0r },
- { X86::FpMUL32 , X86::FMULST0r },
- { X86::FpMUL64 , X86::FMULST0r },
- { X86::FpSUB32 , X86::FSUBST0r },
- { X86::FpSUB64 , X86::FSUBST0r },
+ { X86::ADD_Fp32 , X86::ADD_FST0r },
+ { X86::ADD_Fp64 , X86::ADD_FST0r },
+ { X86::DIV_Fp32 , X86::DIV_FST0r },
+ { X86::DIV_Fp64 , X86::DIV_FST0r },
+ { X86::MUL_Fp32 , X86::MUL_FST0r },
+ { X86::MUL_Fp64 , X86::MUL_FST0r },
+ { X86::SUB_Fp32 , X86::SUB_FST0r },
+ { X86::SUB_Fp64 , X86::SUB_FST0r },
};
// ReverseST0Table - Map: A = B op C into: ST(0) = ST(i) op ST(0)
static const TableEntry ReverseST0Table[] = {
- { X86::FpADD32 , X86::FADDST0r }, // commutative
- { X86::FpADD64 , X86::FADDST0r }, // commutative
- { X86::FpDIV32 , X86::FDIVRST0r },
- { X86::FpDIV64 , X86::FDIVRST0r },
- { X86::FpMUL32 , X86::FMULST0r }, // commutative
- { X86::FpMUL64 , X86::FMULST0r }, // commutative
- { X86::FpSUB32 , X86::FSUBRST0r },
- { X86::FpSUB64 , X86::FSUBRST0r },
+ { X86::ADD_Fp32 , X86::ADD_FST0r }, // commutative
+ { X86::ADD_Fp64 , X86::ADD_FST0r }, // commutative
+ { X86::DIV_Fp32 , X86::DIVR_FST0r },
+ { X86::DIV_Fp64 , X86::DIVR_FST0r },
+ { X86::MUL_Fp32 , X86::MUL_FST0r }, // commutative
+ { X86::MUL_Fp64 , X86::MUL_FST0r }, // commutative
+ { X86::SUB_Fp32 , X86::SUBR_FST0r },
+ { X86::SUB_Fp64 , X86::SUBR_FST0r },
};
// ForwardSTiTable - Map: A = B op C into: ST(i) = ST(0) op ST(i)
static const TableEntry ForwardSTiTable[] = {
- { X86::FpADD32 , X86::FADDrST0 }, // commutative
- { X86::FpADD64 , X86::FADDrST0 }, // commutative
- { X86::FpDIV32 , X86::FDIVRrST0 },
- { X86::FpDIV64 , X86::FDIVRrST0 },
- { X86::FpMUL32 , X86::FMULrST0 }, // commutative
- { X86::FpMUL64 , X86::FMULrST0 }, // commutative
- { X86::FpSUB32 , X86::FSUBRrST0 },
- { X86::FpSUB64 , X86::FSUBRrST0 },
+ { X86::ADD_Fp32 , X86::ADD_FrST0 }, // commutative
+ { X86::ADD_Fp64 , X86::ADD_FrST0 }, // commutative
+ { X86::DIV_Fp32 , X86::DIVR_FrST0 },
+ { X86::DIV_Fp64 , X86::DIVR_FrST0 },
+ { X86::MUL_Fp32 , X86::MUL_FrST0 }, // commutative
+ { X86::MUL_Fp64 , X86::MUL_FrST0 }, // commutative
+ { X86::SUB_Fp32 , X86::SUBR_FrST0 },
+ { X86::SUB_Fp64 , X86::SUBR_FrST0 },
};
// ReverseSTiTable - Map: A = B op C into: ST(i) = ST(i) op ST(0)
static const TableEntry ReverseSTiTable[] = {
- { X86::FpADD32 , X86::FADDrST0 },
- { X86::FpADD64 , X86::FADDrST0 },
- { X86::FpDIV32 , X86::FDIVrST0 },
- { X86::FpDIV64 , X86::FDIVrST0 },
- { X86::FpMUL32 , X86::FMULrST0 },
- { X86::FpMUL64 , X86::FMULrST0 },
- { X86::FpSUB32 , X86::FSUBrST0 },
- { X86::FpSUB64 , X86::FSUBrST0 },
+ { X86::ADD_Fp32 , X86::ADD_FrST0 },
+ { X86::ADD_Fp64 , X86::ADD_FrST0 },
+ { X86::DIV_Fp32 , X86::DIV_FrST0 },
+ { X86::DIV_Fp64 , X86::DIV_FrST0 },
+ { X86::MUL_Fp32 , X86::MUL_FrST0 },
+ { X86::MUL_Fp64 , X86::MUL_FrST0 },
+ { X86::SUB_Fp32 , X86::SUB_FrST0 },
+ { X86::SUB_Fp64 , X86::SUB_FrST0 },
};
@@ -847,10 +847,10 @@
assert(StackTop == 1 && "Stack should have one element on it to return!");
--StackTop; // "Forget" we have something on the top of stack!
break;
- case X86::FpMOV3232:
- case X86::FpMOV3264:
- case X86::FpMOV6432:
- case X86::FpMOV6464: {
+ case X86::MOV_Fp3232:
+ case X86::MOV_Fp3264:
+ case X86::MOV_Fp6432:
+ case X86::MOV_Fp6464: {
unsigned SrcReg = getFPReg(MI->getOperand(1));
unsigned DestReg = getFPReg(MI->getOperand(0));
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=37876&r1=37875&r2=37876&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 4 16:07:47 2007
@@ -4468,12 +4468,12 @@
unsigned Opc;
switch (MI->getOpcode()) {
default: assert(0 && "illegal opcode!");
- case X86::FP32_TO_INT16_IN_MEM: Opc = X86::FpIST16m32; break;
- case X86::FP32_TO_INT32_IN_MEM: Opc = X86::FpIST32m32; break;
- case X86::FP32_TO_INT64_IN_MEM: Opc = X86::FpIST64m32; break;
- case X86::FP64_TO_INT16_IN_MEM: Opc = X86::FpIST16m64; break;
- case X86::FP64_TO_INT32_IN_MEM: Opc = X86::FpIST32m64; break;
- case X86::FP64_TO_INT64_IN_MEM: Opc = X86::FpIST64m64; break;
+ case X86::FP32_TO_INT16_IN_MEM: Opc = X86::IST_Fp16m32; break;
+ case X86::FP32_TO_INT32_IN_MEM: Opc = X86::IST_Fp32m32; break;
+ case X86::FP32_TO_INT64_IN_MEM: Opc = X86::IST_Fp64m32; break;
+ case X86::FP64_TO_INT16_IN_MEM: Opc = X86::IST_Fp16m64; break;
+ case X86::FP64_TO_INT32_IN_MEM: Opc = X86::IST_Fp32m64; break;
+ case X86::FP64_TO_INT64_IN_MEM: Opc = X86::IST_Fp64m64; break;
}
X86AddressMode AM;
Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=37876&r1=37875&r2=37876&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Wed Jul 4 16:07:47 2007
@@ -66,8 +66,6 @@
return N->isExactlyValue(-1.0);
}]>;
-def extloadf64f32 : PatFrag<(ops node:$ptr), (f64 (extloadf32 node:$ptr))>;
-
// Some 'special' instructions
let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
def FP32_TO_INT16_IN_MEM : I<0, Pseudo,
@@ -100,13 +98,20 @@
let Defs = [FP0, FP1, FP2, FP3, FP4, FP5, FP6] in
def FP_REG_KILL : I<0, Pseudo, (ops), "#FP_REG_KILL", []>;
-// All FP Stack operations are represented with two instructions here. The
-// first instruction, generated by the instruction selector, uses "RFP"
-// registers: a traditional register file to reference floating point values.
-// These instructions are all psuedo instructions and use the "Fp" prefix.
+// All FP Stack operations are represented with three instructions here. The
+// first two instructions, generated by the instruction selector, uses "RFP32"
+// or "RFP64" registers: traditional register files to reference 32-bit or
+// 64-bit floating point values. These sizes apply to the values, not the
+// registers, which are always 64 bits; RFP32 and RFP64 can be copied to
+// each other without losing information. These instructions are all psuedo
+// instructions and use the "_Fp" suffix.
+// In some cases there are additional variants with a mixture of 32-bit and
+// 64-bit registers.
// The second instruction is defined with FPI, which is the actual instruction
-// emitted by the assembler. The FP stackifier pass converts one to the other
-// after register allocation occurs.
+// emitted by the assembler. These use "RST" registers, although frequently
+// the actual register(s) used are implicit. These are always 64-bits.
+// The FP stackifier pass converts one to the other after register allocation
+// occurs.
//
// Note that the FpI instruction should have instruction selection info (e.g.
// a pattern) and the FPI instruction should have emission info (e.g. opcode
@@ -141,29 +146,57 @@
FpI_, Requires<[FPStack]>;
// Register copies. Just copies, the 64->32 version does not truncate.
-def FpMOV3232 : FpI<(ops RFP32:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2
-def FpMOV3264 : FpI<(ops RFP64:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2
-def FpMOV6432 : FpI<(ops RFP32:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2
-def FpMOV6464 : FpI<(ops RFP64:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2
-
-// Arithmetic
-// Add, Sub, Mul, Div.
-def FpADD32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
- [(set RFP32:$dst, (fadd RFP32:$src1, RFP32:$src2))]>;
-def FpSUB32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
- [(set RFP32:$dst, (fsub RFP32:$src1, RFP32:$src2))]>;
-def FpMUL32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
- [(set RFP32:$dst, (fmul RFP32:$src1, RFP32:$src2))]>;
-def FpDIV32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
- [(set RFP32:$dst, (fdiv RFP32:$src1, RFP32:$src2))]>;
-def FpADD64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
- [(set RFP64:$dst, (fadd RFP64:$src1, RFP64:$src2))]>;
-def FpSUB64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
- [(set RFP64:$dst, (fsub RFP64:$src1, RFP64:$src2))]>;
-def FpMUL64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
- [(set RFP64:$dst, (fmul RFP64:$src1, RFP64:$src2))]>;
-def FpDIV64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
- [(set RFP64:$dst, (fdiv RFP64:$src1, RFP64:$src2))]>;
+def MOV_Fp3232 : FpI<(ops RFP32:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2
+def MOV_Fp3264 : FpI<(ops RFP64:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2
+def MOV_Fp6432 : FpI<(ops RFP32:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2
+def MOV_Fp6464 : FpI<(ops RFP64:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2
+
+// Factoring for arithmetic.
+multiclass FPBinary_rr {
+// Register op register -> register
+// These are separated out because they have no reversed form.
+def _Fp32 : FpI<(ops RFP32:$dst, RFP32:$src1, RFP32:$src2), TwoArgFP,
+ [(set RFP32:$dst, (OpNode RFP32:$src1, RFP32:$src2))]>;
+def _Fp64 : FpI<(ops RFP64:$dst, RFP64:$src1, RFP64:$src2), TwoArgFP,
+ [(set RFP64:$dst, (OpNode RFP64:$src1, RFP64:$src2))]>;
+}
+// The FopST0 series are not included here because of the irregularities
+// in where the 'r' goes in assembly output.
+multiclass FPBinary {
+// ST(0) = ST(0) + [mem]
+def _Fp32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (OpNode RFP32:$src1, (loadf32 addr:$src2)))]>;
+def _Fp64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (OpNode RFP64:$src1, (loadf64 addr:$src2)))]>;
+def _F32m : FPI<0xD8, fp, (ops f32mem:$src), !strconcat("f", !strconcat(asmstring, "{s} $src"))>;
+def _F64m : FPI<0xDC, fp, (ops f64mem:$src), !strconcat("f", !strconcat(asmstring, "{l} $src"))>;
+// ST(0) = ST(0) + [memint]
+def _FpI16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (OpNode RFP32:$src1,
+ (X86fild addr:$src2, i16)))]>;
+def _FpI32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP32:$dst, (OpNode RFP32:$src1,
+ (X86fild addr:$src2, i32)))]>;
+def _FpI16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (OpNode RFP64:$src1,
+ (X86fild addr:$src2, i16)))]>;
+def _FpI32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
+ [(set RFP64:$dst, (OpNode RFP64:$src1,
+ (X86fild addr:$src2, i32)))]>;
+def _FI16m : FPI<0xDE, fp, (ops i16mem:$src), !strconcat("fi", !strconcat(asmstring, "{s} $src"))>;
+def _FI32m : FPI<0xDA, fp, (ops i32mem:$src), !strconcat("fi", !strconcat(asmstring, "{l} $src"))>;
+}
+
+defm ADD : FPBinary_rr;
+defm SUB : FPBinary_rr;
+defm MUL : FPBinary_rr;
+defm DIV : FPBinary_rr;
+defm ADD : FPBinary;
+defm SUB : FPBinary;
+defm SUBR: FPBinary;
+defm MUL : FPBinary;
+defm DIV : FPBinary;
+defm DIVR: FPBinary;
class FPST0rInst o, string asm>
: FPI, D8;
@@ -172,416 +205,207 @@
class FPrST0PInst o, string asm>
: FPI, DE;
-// Binary Ops with a memory source.
-def FpADD32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fadd RFP32:$src1, (loadf32 addr:$src2)))]>;
- // ST(0) = ST(0) + [mem32]
-def FpADD64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fadd RFP64:$src1, (loadf64 addr:$src2)))]>;
- // ST(0) = ST(0) + [mem64]
-def FpMUL32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fmul RFP32:$src1, (loadf32 addr:$src2)))]>;
- // ST(0) = ST(0) * [mem32]
-def FpMUL64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fmul RFP64:$src1, (loadf64 addr:$src2)))]>;
- // ST(0) = ST(0) * [mem64]
-def FpSUB32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub RFP32:$src1, (loadf32 addr:$src2)))]>;
- // ST(0) = ST(0) - [mem32]
-def FpSUB64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub RFP64:$src1, (loadf64 addr:$src2)))]>;
- // ST(0) = ST(0) - [mem64]
-def FpSUBR32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub (loadf32 addr:$src2), RFP32:$src1))]>;
- // ST(0) = [mem32] - ST(0)
-def FpSUBR64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub (loadf64 addr:$src2), RFP64:$src1))]>;
- // ST(0) = [mem64] - ST(0)
-def FpDIV32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv RFP32:$src1, (loadf32 addr:$src2)))]>;
- // ST(0) = ST(0) / [mem32]
-def FpDIV64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv RFP64:$src1, (loadf64 addr:$src2)))]>;
- // ST(0) = ST(0) / [mem64]
-def FpDIVR32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv (loadf32 addr:$src2), RFP32:$src1))]>;
- // ST(0) = [mem32] / ST(0)
-def FpDIVR64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv (loadf64 addr:$src2), RFP64:$src1))]>;
- // ST(0) = [mem64] / ST(0)
-
-
-def FADD32m : FPI<0xD8, MRM0m, (ops f32mem:$src), "fadd{s} $src">;
-def FADD64m : FPI<0xDC, MRM0m, (ops f64mem:$src), "fadd{l} $src">;
-def FMUL32m : FPI<0xD8, MRM1m, (ops f32mem:$src), "fmul{s} $src">;
-def FMUL64m : FPI<0xDC, MRM1m, (ops f64mem:$src), "fmul{l} $src">;
-def FSUB32m : FPI<0xD8, MRM4m, (ops f32mem:$src), "fsub{s} $src">;
-def FSUB64m : FPI<0xDC, MRM4m, (ops f64mem:$src), "fsub{l} $src">;
-def FSUBR32m : FPI<0xD8, MRM5m, (ops f32mem:$src), "fsubr{s} $src">;
-def FSUBR64m : FPI<0xDC, MRM5m, (ops f64mem:$src), "fsubr{l} $src">;
-def FDIV32m : FPI<0xD8, MRM6m, (ops f32mem:$src), "fdiv{s} $src">;
-def FDIV64m : FPI<0xDC, MRM6m, (ops f64mem:$src), "fdiv{l} $src">;
-def FDIVR32m : FPI<0xD8, MRM7m, (ops f32mem:$src), "fdivr{s} $src">;
-def FDIVR64m : FPI<0xDC, MRM7m, (ops f64mem:$src), "fdivr{l} $src">;
-
-def FpIADD16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fadd RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) + [mem16int]
-def FpIADD32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fadd RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) + [mem32int]
-def FpIMUL16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fmul RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) * [mem16int]
-def FpIMUL32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fmul RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) * [mem32int]
-def FpISUB16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) - [mem16int]
-def FpISUB32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) - [mem32int]
-def FpISUBR16m32: FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub (X86fild addr:$src2, i16),
- RFP32:$src1))]>;
- // ST(0) = [mem16int] - ST(0)
-def FpISUBR32m32: FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fsub (X86fild addr:$src2, i32),
- RFP32:$src1))]>;
- // ST(0) = [mem32int] - ST(0)
-def FpIDIV16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) / [mem16int]
-def FpIDIV32m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) / [mem32int]
-def FpIDIVR16m32: FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i16),
- RFP32:$src1))]>;
- // ST(0) = [mem16int] / ST(0)
-def FpIDIVR32m32: FpI<(ops RFP32:$dst, RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (fdiv (X86fild addr:$src2, i32),
- RFP32:$src1))]>;
- // ST(0) = [mem32int] / ST(0)
-
-def FpIADD16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fadd RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) + [mem16int]
-def FpIADD32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fadd RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) + [mem32int]
-def FpIMUL16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fmul RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) * [mem16int]
-def FpIMUL32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fmul RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) * [mem32int]
-def FpISUB16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) - [mem16int]
-def FpISUB32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) - [mem32int]
-def FpISUBR16m64: FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub (X86fild addr:$src2, i16),
- RFP64:$src1))]>;
- // ST(0) = [mem16int] - ST(0)
-def FpISUBR32m64: FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fsub (X86fild addr:$src2, i32),
- RFP64:$src1))]>;
- // ST(0) = [mem32int] - ST(0)
-def FpIDIV16m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
- // ST(0) = ST(0) / [mem16int]
-def FpIDIV32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) / [mem32int]
-def FpIDIVR16m64: FpI<(ops RFP64:$dst, RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i16),
- RFP64:$src1))]>;
- // ST(0) = [mem16int] / ST(0)
-def FpIDIVR32m64: FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (fdiv (X86fild addr:$src2, i32),
- RFP64:$src1))]>;
- // ST(0) = [mem32int] / ST(0)
-
-def FIADD16m : FPI<0xDE, MRM0m, (ops i16mem:$src), "fiadd{s} $src">;
-def FIADD32m : FPI<0xDA, MRM0m, (ops i32mem:$src), "fiadd{l} $src">;
-def FIMUL16m : FPI<0xDE, MRM1m, (ops i16mem:$src), "fimul{s} $src">;
-def FIMUL32m : FPI<0xDA, MRM1m, (ops i32mem:$src), "fimul{l} $src">;
-def FISUB16m : FPI<0xDE, MRM4m, (ops i16mem:$src), "fisub{s} $src">;
-def FISUB32m : FPI<0xDA, MRM4m, (ops i32mem:$src), "fisub{l} $src">;
-def FISUBR16m : FPI<0xDE, MRM5m, (ops i16mem:$src), "fisubr{s} $src">;
-def FISUBR32m : FPI<0xDA, MRM5m, (ops i32mem:$src), "fisubr{l} $src">;
-def FIDIV16m : FPI<0xDE, MRM6m, (ops i16mem:$src), "fidiv{s} $src">;
-def FIDIV32m : FPI<0xDA, MRM6m, (ops i32mem:$src), "fidiv{l} $src">;
-def FIDIVR16m : FPI<0xDE, MRM7m, (ops i16mem:$src), "fidivr{s} $src">;
-def FIDIVR32m : FPI<0xDA, MRM7m, (ops i32mem:$src), "fidivr{l} $src">;
-
// NOTE: GAS and apparently all other AT&T style assemblers have a broken notion
// of some of the 'reverse' forms of the fsub and fdiv instructions. As such,
// we have to put some 'r's in and take them out of weird places.
-def FADDST0r : FPST0rInst <0xC0, "fadd $op">;
-def FADDrST0 : FPrST0Inst <0xC0, "fadd {%st(0), $op|$op, %ST(0)}">;
-def FADDPrST0 : FPrST0PInst<0xC0, "faddp $op">;
-def FSUBRST0r : FPST0rInst <0xE8, "fsubr $op">;
-def FSUBrST0 : FPrST0Inst <0xE8, "fsub{r} {%st(0), $op|$op, %ST(0)}">;
-def FSUBPrST0 : FPrST0PInst<0xE8, "fsub{r}p $op">;
-def FSUBST0r : FPST0rInst <0xE0, "fsub $op">;
-def FSUBRrST0 : FPrST0Inst <0xE0, "fsub{|r} {%st(0), $op|$op, %ST(0)}">;
-def FSUBRPrST0 : FPrST0PInst<0xE0, "fsub{|r}p $op">;
-def FMULST0r : FPST0rInst <0xC8, "fmul $op">;
-def FMULrST0 : FPrST0Inst <0xC8, "fmul {%st(0), $op|$op, %ST(0)}">;
-def FMULPrST0 : FPrST0PInst<0xC8, "fmulp $op">;
-def FDIVRST0r : FPST0rInst <0xF8, "fdivr $op">;
-def FDIVrST0 : FPrST0Inst <0xF8, "fdiv{r} {%st(0), $op|$op, %ST(0)}">;
-def FDIVPrST0 : FPrST0PInst<0xF8, "fdiv{r}p $op">;
-def FDIVST0r : FPST0rInst <0xF0, "fdiv $op">;
-def FDIVRrST0 : FPrST0Inst <0xF0, "fdiv{|r} {%st(0), $op|$op, %ST(0)}">;
-def FDIVRPrST0 : FPrST0PInst<0xF0, "fdiv{|r}p $op">;
+def ADD_FST0r : FPST0rInst <0xC0, "fadd $op">;
+def ADD_FrST0 : FPrST0Inst <0xC0, "fadd {%st(0), $op|$op, %ST(0)}">;
+def ADD_FPrST0 : FPrST0PInst<0xC0, "faddp $op">;
+def SUBR_FST0r : FPST0rInst <0xE8, "fsubr $op">;
+def SUB_FrST0 : FPrST0Inst <0xE8, "fsub{r} {%st(0), $op|$op, %ST(0)}">;
+def SUB_FPrST0 : FPrST0PInst<0xE8, "fsub{r}p $op">;
+def SUB_FST0r : FPST0rInst <0xE0, "fsub $op">;
+def SUBR_FrST0 : FPrST0Inst <0xE0, "fsub{|r} {%st(0), $op|$op, %ST(0)}">;
+def SUBR_FPrST0 : FPrST0PInst<0xE0, "fsub{|r}p $op">;
+def MUL_FST0r : FPST0rInst <0xC8, "fmul $op">;
+def MUL_FrST0 : FPrST0Inst <0xC8, "fmul {%st(0), $op|$op, %ST(0)}">;
+def MUL_FPrST0 : FPrST0PInst<0xC8, "fmulp $op">;
+def DIVR_FST0r : FPST0rInst <0xF8, "fdivr $op">;
+def DIV_FrST0 : FPrST0Inst <0xF8, "fdiv{r} {%st(0), $op|$op, %ST(0)}">;
+def DIV_FPrST0 : FPrST0PInst<0xF8, "fdiv{r}p $op">;
+def DIV_FST0r : FPST0rInst <0xF0, "fdiv $op">;
+def DIVR_FrST0 : FPrST0Inst <0xF0, "fdiv{|r} {%st(0), $op|$op, %ST(0)}">;
+def DIVR_FPrST0 : FPrST0PInst<0xF0, "fdiv{|r}p $op">;
// Unary operations.
-def FpCHS32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
- [(set RFP32:$dst, (fneg RFP32:$src))]>;
-def FpABS32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
- [(set RFP32:$dst, (fabs RFP32:$src))]>;
-def FpSQRT32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
- [(set RFP32:$dst, (fsqrt RFP32:$src))]>;
-def FpSIN32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
- [(set RFP32:$dst, (fsin RFP32:$src))]>;
-def FpCOS32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
- [(set RFP32:$dst, (fcos RFP32:$src))]>;
-def FpTST32 : FpI<(ops RFP32:$src), OneArgFP,
- []>;
-
-def FpCHS64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
- [(set RFP64:$dst, (fneg RFP64:$src))]>;
-def FpABS64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
- [(set RFP64:$dst, (fabs RFP64:$src))]>;
-def FpSQRT64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
- [(set RFP64:$dst, (fsqrt RFP64:$src))]>;
-def FpSIN64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
- [(set RFP64:$dst, (fsin RFP64:$src))]>;
-def FpCOS64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
- [(set RFP64:$dst, (fcos RFP64:$src))]>;
-def FpTST64 : FpI<(ops RFP64:$src), OneArgFP,
- []>;
+multiclass FPUnary opcode, string asmstring> {
+def _Fp32 : FpI<(ops RFP32:$dst, RFP32:$src), OneArgFPRW,
+ [(set RFP32:$dst, (OpNode RFP32:$src))]>;
+def _Fp64 : FpI<(ops RFP64:$dst, RFP64:$src), OneArgFPRW,
+ [(set RFP64:$dst, (OpNode RFP64:$src))]>;
+def _F : FPI, D9;
+}
-def FCHS : FPI<0xE0, RawFrm, (ops), "fchs">, D9;
-def FABS : FPI<0xE1, RawFrm, (ops), "fabs">, D9;
-def FSQRT : FPI<0xFA, RawFrm, (ops), "fsqrt">, D9;
-def FSIN : FPI<0xFE, RawFrm, (ops), "fsin">, D9;
-def FCOS : FPI<0xFF, RawFrm, (ops), "fcos">, D9;
-def FTST : FPI<0xE4, RawFrm, (ops), "ftst">, D9;
+defm CHS : FPUnary;
+defm ABS : FPUnary;
+defm SQRT: FPUnary