From lattner at cs.uiuc.edu Mon Nov 28 15:48:38 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 15:48:38 -0600
Subject: [llvm-commits] CVS: llvm-www/releases/checkreg.cgi quickreg.cgi
register.cgi testregister.cgi testregister.html
Message-ID: <200511282148.PAA25300@zion.cs.uiuc.edu>
Changes in directory llvm-www/releases:
checkreg.cgi (r1.4) removed
quickreg.cgi (r1.1) removed
register.cgi (r1.22) removed
testregister.cgi (r1.23) removed
testregister.html (r1.2) removed
---
Log message:
good bye registration CGI scripts, you have served us well.
---
Diffs of the changes: (+0 -0)
0 files changed
From lattner at cs.uiuc.edu Mon Nov 28 15:49:51 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 15:49:51 -0600
Subject: [llvm-commits] CVS: llvm-www/releases/register.html
Message-ID: <200511282149.PAA25380@zion.cs.uiuc.edu>
Changes in directory llvm-www/releases:
register.html (r1.9) removed
---
Log message:
this page is also dead
---
Diffs of the changes: (+0 -0)
0 files changed
From lattner at cs.uiuc.edu Mon Nov 28 16:42:26 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 16:42:26 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td
Message-ID: <200511282242.QAA25777@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target:
Target.td updated: 1.58 -> 1.59
---
Log message:
fix a typo :)
---
Diffs of the changes: (+1 -1)
Target.td | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/Target.td
diff -u llvm/lib/Target/Target.td:1.58 llvm/lib/Target/Target.td:1.59
--- llvm/lib/Target/Target.td:1.58 Sat Nov 19 01:00:10 2005
+++ llvm/lib/Target/Target.td Mon Nov 28 16:42:15 2005
@@ -31,7 +31,7 @@
def i16 : ValueType<16 , 3>; // 16-bit integer value
def i32 : ValueType<32 , 4>; // 32-bit integer value
def i64 : ValueType<64 , 5>; // 64-bit integer value
-def i128 : ValueType<128, 5>; // 128-bit integer value
+def i128 : ValueType<128, 6>; // 128-bit integer value
def f32 : ValueType<32 , 7>; // 32-bit floating point value
def f64 : ValueType<64 , 8>; // 64-bit floating point value
def f80 : ValueType<80 , 9>; // 80-bit floating point value
From criswell at cs.uiuc.edu Mon Nov 28 17:26:02 2005
From: criswell at cs.uiuc.edu (John Criswell)
Date: Mon, 28 Nov 2005 17:26:02 -0600
Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html
Message-ID: <200511282326.RAA15267@choi.cs.uiuc.edu>
Changes in directory llvm/docs:
WritingAnLLVMPass.html updated: 1.41 -> 1.42
---
Log message:
Fixed a punctuation error.
---
Diffs of the changes: (+2 -2)
WritingAnLLVMPass.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/docs/WritingAnLLVMPass.html
diff -u llvm/docs/WritingAnLLVMPass.html:1.41 llvm/docs/WritingAnLLVMPass.html:1.42
--- llvm/docs/WritingAnLLVMPass.html:1.41 Fri Jul 15 14:25:12 2005
+++ llvm/docs/WritingAnLLVMPass.html Mon Nov 28 17:25:41 2005
@@ -1217,7 +1217,7 @@
The Statistic
-class, is designed to be an easy way to expose various success
+class is designed to be an easy way to expose various success
metrics from passes. These statistics are printed at the end of a
run, when the -stats command line option is enabled on the command
line. See the Statistics section in the Programmer's Manual for details.
@@ -1593,7 +1593,7 @@
Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2005/07/15 19:25:12 $
+ Last modified: $Date: 2005/11/28 23:25:41 $
From lattner at cs.uiuc.edu Mon Nov 28 18:24:20 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 18:24:20 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td
Message-ID: <200511290024.SAA26579@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target:
Target.td updated: 1.59 -> 1.60
---
Log message:
revert my change for the time being, which broke the build
---
Diffs of the changes: (+1 -1)
Target.td | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/Target.td
diff -u llvm/lib/Target/Target.td:1.59 llvm/lib/Target/Target.td:1.60
--- llvm/lib/Target/Target.td:1.59 Mon Nov 28 16:42:15 2005
+++ llvm/lib/Target/Target.td Mon Nov 28 18:24:08 2005
@@ -31,7 +31,7 @@
def i16 : ValueType<16 , 3>; // 16-bit integer value
def i32 : ValueType<32 , 4>; // 32-bit integer value
def i64 : ValueType<64 , 5>; // 64-bit integer value
-def i128 : ValueType<128, 6>; // 128-bit integer value
+def i128 : ValueType<128, 5>; // 128-bit integer value
def f32 : ValueType<32 , 7>; // 32-bit floating point value
def f64 : ValueType<64 , 8>; // 64-bit floating point value
def f80 : ValueType<80 , 9>; // 80-bit floating point value
From lattner at cs.uiuc.edu Mon Nov 28 18:41:52 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 18:41:52 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
Message-ID: <200511290041.SAA26688@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCRegisterInfo.td updated: 1.22 -> 1.23
---
Log message:
don't say this is i128, because it isn't yet. Hopefully nate will change
this to be something sane, but in the mean time it is unused, so safe to
make something bogus.
---
Diffs of the changes: (+1 -1)
PPCRegisterInfo.td | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.22 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.23
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.22 Sat Nov 26 16:39:34 2005
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Mon Nov 28 18:41:40 2005
@@ -192,7 +192,7 @@
F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21,
F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
-def VRRC : RegisterClass<"PPC", i128, 128, [V0, V1, V2, V3, V4, V5, V6, V7, V8,
+def VRRC : RegisterClass<"PPC", f64/*FIXME*/, 128, [V0, V1, V2, V3, V4, V5, V6, V7, V8,
V9, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21, V22, V23,
V24, V25, V26, V27, V28, V29, V30, V31]>;
From lattner at cs.uiuc.edu Mon Nov 28 18:42:43 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 18:42:43 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td
Message-ID: <200511290042.SAA26769@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target:
Target.td updated: 1.60 -> 1.61
---
Log message:
refix typo
---
Diffs of the changes: (+1 -1)
Target.td | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/Target.td
diff -u llvm/lib/Target/Target.td:1.60 llvm/lib/Target/Target.td:1.61
--- llvm/lib/Target/Target.td:1.60 Mon Nov 28 18:24:08 2005
+++ llvm/lib/Target/Target.td Mon Nov 28 18:42:30 2005
@@ -31,7 +31,7 @@
def i16 : ValueType<16 , 3>; // 16-bit integer value
def i32 : ValueType<32 , 4>; // 32-bit integer value
def i64 : ValueType<64 , 5>; // 64-bit integer value
-def i128 : ValueType<128, 5>; // 128-bit integer value
+def i128 : ValueType<128, 6>; // 128-bit integer value
def f32 : ValueType<32 , 7>; // 32-bit floating point value
def f64 : ValueType<64 , 8>; // 64-bit floating point value
def f80 : ValueType<80 , 9>; // 80-bit floating point value
From lattner at cs.uiuc.edu Mon Nov 28 18:57:19 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 18:57:19 -0600
Subject: [llvm-commits] CVS: llvm/CREDITS.TXT
Message-ID: <200511290057.SAA26867@zion.cs.uiuc.edu>
Changes in directory llvm:
CREDITS.TXT updated: 1.42 -> 1.43
---
Log message:
add Evan and Jim. Please edit your entries as desired.
---
Diffs of the changes: (+8 -0)
CREDITS.TXT | 8 ++++++++
1 files changed, 8 insertions(+)
Index: llvm/CREDITS.TXT
diff -u llvm/CREDITS.TXT:1.42 llvm/CREDITS.TXT:1.43
--- llvm/CREDITS.TXT:1.42 Tue Aug 2 17:10:21 2005
+++ llvm/CREDITS.TXT Mon Nov 28 18:57:06 2005
@@ -34,6 +34,10 @@
E: ccarter at uiuc.edu
D: Fixes to the Reassociation pass, various improvement patches
+N: Evan Cheng
+E: evan.cheng at apple.com
+D: X86 backend improvements
+
N: Jeff Cohen
E: jeffc at jolt-lang.org
W: http://jolt-lang.org
@@ -69,6 +73,10 @@
E: kowshik at uiuc.edu
D: Author of the original C backend
+N: Jim Laskey
+E: jlaskey at apple.com
+D: Improvements to the PPC backend, instruction scheduling
+
N: Chris Lattner
E: sabre at nondot.org
W: http://nondot.org/~sabre/
From lattner at cs.uiuc.edu Mon Nov 28 19:07:04 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 19:07:04 -0600
Subject: [llvm-commits]
CVS: llvm/test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll
Message-ID: <200511290107.TAA27271@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/Mem2Reg:
2005-11-28-Crash.ll added (r1.1)
---
Log message:
new testcase for pr670: http://llvm.cs.uiuc.edu/PR670
---
Diffs of the changes: (+88 -0)
2005-11-28-Crash.ll | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 88 insertions(+)
Index: llvm/test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll
diff -c /dev/null llvm/test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll:1.1
*** /dev/null Mon Nov 28 19:07:01 2005
--- llvm/test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll Mon Nov 28 19:06:51 2005
***************
*** 0 ****
--- 1,88 ----
+ ; RUN: llvm-as < %s | opt -mem2reg -disable-output
+ ; PR670
+
+ void %printk(int, ...) {
+ entry:
+ %flags = alloca uint ; [#uses=2]
+ br bool false, label %then.0, label %endif.0
+
+ then.0: ; preds = %entry
+ br label %endif.0
+
+ endif.0: ; preds = %then.0, %entry
+ store uint 0, uint* %flags
+ br label %loopentry
+
+ loopentry: ; preds = %endif.3, %endif.0
+ br bool false, label %no_exit, label %loopexit
+
+ no_exit: ; preds = %loopentry
+ br bool false, label %then.1, label %endif.1
+
+ then.1: ; preds = %no_exit
+ br bool false, label %shortcirc_done.0, label %shortcirc_next.0
+
+ shortcirc_next.0: ; preds = %then.1
+ br label %shortcirc_done.0
+
+ shortcirc_done.0: ; preds = %shortcirc_next.0, %then.1
+ br bool false, label %shortcirc_done.1, label %shortcirc_next.1
+
+ shortcirc_next.1: ; preds = %shortcirc_done.0
+ br label %shortcirc_done.1
+
+ shortcirc_done.1: ; preds = %shortcirc_next.1, %shortcirc_done.0
+ br bool false, label %shortcirc_done.2, label %shortcirc_next.2
+
+ shortcirc_next.2: ; preds = %shortcirc_done.1
+ br label %shortcirc_done.2
+
+ shortcirc_done.2: ; preds = %shortcirc_next.2, %shortcirc_done.1
+ br bool false, label %then.2, label %endif.2
+
+ then.2: ; preds = %shortcirc_done.2
+ br label %endif.2
+
+ endif.2: ; preds = %then.2, %shortcirc_done.2
+ br label %endif.1
+
+ endif.1: ; preds = %endif.2, %no_exit
+ br bool false, label %then.3, label %endif.3
+
+ then.3: ; preds = %endif.1
+ br label %endif.3
+
+ endif.3: ; preds = %then.3, %endif.1
+ br label %loopentry
+
+ loopexit: ; preds = %loopentry
+ br label %endif.4
+
+ then.4: ; No predecessors!
+ %tmp.61 = load uint* %flags ; [#uses=0]
+ br label %out
+
+ dead_block_after_goto: ; No predecessors!
+ br label %endif.4
+
+ endif.4: ; preds = %dead_block_after_goto, %loopexit
+ br bool false, label %then.5, label %else
+
+ then.5: ; preds = %endif.4
+ br label %endif.5
+
+ else: ; preds = %endif.4
+ br label %endif.5
+
+ endif.5: ; preds = %else, %then.5
+ br label %out
+
+ out: ; preds = %endif.5, %then.4
+ br label %return
+
+ after_ret: ; No predecessors!
+ br label %return
+
+ return: ; preds = %after_ret, %out
+ ret void
+ }
From lattner at cs.uiuc.edu Mon Nov 28 19:07:24 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 19:07:24 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h
Message-ID: <200511290107.TAA27306@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Analysis:
Dominators.h updated: 1.50 -> 1.51
---
Log message:
Fix PR670: http://llvm.cs.uiuc.edu/PR670 and test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll
---
Diffs of the changes: (+1 -0)
Dominators.h | 1 +
1 files changed, 1 insertion(+)
Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.50 llvm/include/llvm/Analysis/Dominators.h:1.51
--- llvm/include/llvm/Analysis/Dominators.h:1.50 Fri Nov 18 01:27:33 2005
+++ llvm/include/llvm/Analysis/Dominators.h Mon Nov 28 19:07:12 2005
@@ -311,6 +311,7 @@
///
bool properlyDominates(const Node *N) const {
const Node *IDom;
+ if (this == 0 || N == 0) return false;
while ((IDom = N->getIDom()) != 0 && IDom != this)
N = IDom; // Walk up the tree
return IDom != 0;
From lattner at cs.uiuc.edu Mon Nov 28 19:35:02 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Nov 2005 19:35:02 -0600
Subject: [llvm-commits] CVS: llvm/docs/Lexicon.html
Message-ID: <200511290135.TAA27540@zion.cs.uiuc.edu>
Changes in directory llvm/docs:
Lexicon.html updated: 1.11 -> 1.12
---
Log message:
Add "SCC" to the lexicon. Patch provided by Marco Matthies, thanks!
---
Diffs of the changes: (+5 -2)
Lexicon.html | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
Index: llvm/docs/Lexicon.html
diff -u llvm/docs/Lexicon.html:1.11 llvm/docs/Lexicon.html:1.12
--- llvm/docs/Lexicon.html:1.11 Fri May 13 15:18:49 2005
+++ llvm/docs/Lexicon.html Mon Nov 28 19:34:50 2005
@@ -53,6 +53,7 @@
| - S - |
+ | SCC |
SCCP |
SSA |
@@ -150,8 +151,10 @@
+ - SCC
+ - Strongly Connected Component
- SCCP
- - Sparse Conditional Constant Propagation
+
- Sparse Conditional Constant Propagation
- SSA
- Static Single Assignment
@@ -164,7 +167,7 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
The LLVM Team
The LLVM Compiler Infrastructure
-Last modified: $Date: 2005/05/13 20:18:49 $
+Last modified: $Date: 2005/11/29 01:34:50 $
From evan.cheng at apple.com Mon Nov 28 22:59:58 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 28 Nov 2005 22:59:58 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelPattern.cpp
Message-ID: <200511290459.WAA28720@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCISelPattern.cpp updated: 1.192 -> 1.193
---
Log message:
Fixed a comment bug:
createPPCPatternInstructionSelector -> createPPCISelPattern
---
Diffs of the changes: (+1 -1)
PPCISelPattern.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/PowerPC/PPCISelPattern.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.192 llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.193
--- llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.192 Tue Nov 15 18:48:01 2005
+++ llvm/lib/Target/PowerPC/PPCISelPattern.cpp Mon Nov 28 22:59:46 2005
@@ -1713,7 +1713,7 @@
}
-/// createPPCPatternInstructionSelector - This pass converts an LLVM function
+/// createPPCISelPattern - This pass converts an LLVM function
/// into a machine code representation using pattern matching and a machine
/// description file.
///
From natebegeman at mac.com Mon Nov 28 23:45:44 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Nov 2005 23:45:44 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Message-ID: <200511290545.XAA29087@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
ValueTypes.h updated: 1.13 -> 1.14
---
Log message:
Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.
---
Diffs of the changes: (+21 -3)
ValueTypes.h | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
Index: llvm/include/llvm/CodeGen/ValueTypes.h
diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.13 llvm/include/llvm/CodeGen/ValueTypes.h:1.14
--- llvm/include/llvm/CodeGen/ValueTypes.h:1.13 Thu Nov 17 15:44:42 2005
+++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Nov 28 23:45:28 2005
@@ -48,14 +48,26 @@
// be refined into a target vector type, or
// scalarized.
+ // These are 128 bit vectors of varying packed types
+ v16i8 = 14, // 16 x i8
+ v8i16 = 15, // 8 x i16
+ v4i32 = 16, // 4 x i32
+ v2i64 = 17, // 2 x i64
+
+ v4f32 = 18, // 4 x f32
+ v2f64 = 19, // 2 x f64
+
LAST_VALUETYPE, // This always remains at the end of the list.
};
static inline bool isInteger(ValueType VT) {
- return VT >= i1 && VT <= i128;
+ return (VT >= i1 && VT <= i128) || (VT >= v16i8 && VT <= v2i64);
}
static inline bool isFloatingPoint(ValueType VT) {
- return VT >= f32 && VT <= f128;
+ return (VT >= f32 && VT <= f128) || (VT >= v4f32 && VT <= v2f64);
+ }
+ static inline bool isVector(ValueType VT) {
+ return (VT >= v16i8 && VT <= v2f64);
}
static inline unsigned getSizeInBits(ValueType VT) {
@@ -70,7 +82,13 @@
case MVT::i64 : return 64;
case MVT::f80 : return 80;
case MVT::f128:
- case MVT::i128: return 128;
+ case MVT::i128:
+ case MVT::v16i8:
+ case MVT::v8i16:
+ case MVT::v4i32:
+ case MVT::v2i64:
+ case MVT::v4f32:
+ case MVT::v2f64: return 128;
}
}
From natebegeman at mac.com Mon Nov 28 23:45:44 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Nov 2005 23:45:44 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h
Message-ID: <200511290545.XAA29094@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Target:
TargetLowering.h updated: 1.28 -> 1.29
---
Log message:
Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.
---
Diffs of the changes: (+2 -2)
TargetLowering.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.28 llvm/include/llvm/Target/TargetLowering.h:1.29
--- llvm/include/llvm/Target/TargetLowering.h:1.28 Thu Nov 17 15:44:42 2005
+++ llvm/include/llvm/Target/TargetLowering.h Mon Nov 28 23:45:28 2005
@@ -123,7 +123,7 @@
LegalizeAction getTypeAction(MVT::ValueType VT) const {
return (LegalizeAction)((ValueTypeActions >> (2*VT)) & 3);
}
- unsigned getValueTypeActions() const { return ValueTypeActions; }
+ unsigned long long getValueTypeActions() const { return ValueTypeActions; }
/// getTypeToTransformTo - For types supported by the target, this is an
/// identity function. For types that must be promoted to larger types, this
@@ -441,7 +441,7 @@
/// ValueTypeActions - This is a bitvector that contains two bits for each
/// value type, where the two bits correspond to the LegalizeAction enum.
/// This can be queried with "getTypeAction(VT)".
- unsigned ValueTypeActions;
+ unsigned long long ValueTypeActions;
/// TransformToType - For any value types we are promoting or expanding, this
/// contains the value type that we are changing to. For Expanded types, this
From natebegeman at mac.com Mon Nov 28 23:45:44 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Nov 2005 23:45:44 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td TargetLowering.cpp
Message-ID: <200511290545.XAA29090@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target:
Target.td updated: 1.61 -> 1.62
TargetLowering.cpp updated: 1.14 -> 1.15
---
Log message:
Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.
---
Diffs of the changes: (+10 -4)
Target.td | 8 +++++++-
TargetLowering.cpp | 6 +++---
2 files changed, 10 insertions(+), 4 deletions(-)
Index: llvm/lib/Target/Target.td
diff -u llvm/lib/Target/Target.td:1.61 llvm/lib/Target/Target.td:1.62
--- llvm/lib/Target/Target.td:1.61 Mon Nov 28 18:42:30 2005
+++ llvm/lib/Target/Target.td Mon Nov 28 23:45:29 2005
@@ -38,7 +38,13 @@
def f128 : ValueType<128, 10>; // 128-bit floating point value
def FlagVT : ValueType<0 , 11>; // Condition code or machine flag
def isVoid : ValueType<0 , 12>; // Produces no value
-def Vector : ValueType<0 , 13>; // Abstract vector type
+def Vector : ValueType<0 , 13>; // Abstract vector value
+def v16i8 : ValueType<128, 14>; // 16 x i8 vector value
+def v8i16 : ValueType<128, 15>; // 8 x i16 vector value
+def v4i32 : ValueType<128, 16>; // 4 x i32 vector value
+def v2i64 : ValueType<128, 17>; // 2 x i64 vector value
+def v4f32 : ValueType<128, 18>; // 4 x f32 vector value
+def v2f64 : ValueType<128, 19>; // 2 x f64 vector value
//===----------------------------------------------------------------------===//
// Register file description - These classes are used to fill in the target
Index: llvm/lib/Target/TargetLowering.cpp
diff -u llvm/lib/Target/TargetLowering.cpp:1.14 llvm/lib/Target/TargetLowering.cpp:1.15
--- llvm/lib/Target/TargetLowering.cpp:1.14 Mon Nov 21 19:29:36 2005
+++ llvm/lib/Target/TargetLowering.cpp Mon Nov 28 23:45:29 2005
@@ -42,8 +42,8 @@
TargetLowering::LegalizeAction Action,
TargetLowering &TLI,
MVT::ValueType *TransformToType,
- unsigned &ValueTypeActions) {
- ValueTypeActions |= Action << (VT*2);
+ unsigned long long &ValueTypeActions) {
+ ValueTypeActions |= (unsigned long long)Action << (VT*2);
if (Action == TargetLowering::Promote) {
MVT::ValueType PromoteTo;
if (VT == MVT::f32)
@@ -75,7 +75,7 @@
/// computeRegisterProperties - Once all of the register classes are added,
/// this allows us to compute derived properties we expose.
void TargetLowering::computeRegisterProperties() {
- assert(MVT::LAST_VALUETYPE <= 16 &&
+ assert(MVT::LAST_VALUETYPE <= 32 &&
"Too many value types for ValueTypeActions to hold!");
// Everything defaults to one.
From natebegeman at mac.com Mon Nov 28 23:45:44 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Nov 2005 23:45:44 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
Message-ID: <200511290545.XAA29093@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCRegisterInfo.td updated: 1.23 -> 1.24
---
Log message:
Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.
---
Diffs of the changes: (+1 -1)
PPCRegisterInfo.td | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.23 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.24
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.23 Mon Nov 28 18:41:40 2005
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Mon Nov 28 23:45:29 2005
@@ -192,7 +192,7 @@
F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21,
F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
-def VRRC : RegisterClass<"PPC", f64/*FIXME*/, 128, [V0, V1, V2, V3, V4, V5, V6, V7, V8,
+def VRRC : RegisterClass<"PPC", v4f32, 128, [V0, V1, V2, V3, V4, V5, V6, V7, V8,
V9, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21, V22, V23,
V24, V25, V26, V27, V28, V29, V30, V31]>;
From natebegeman at mac.com Mon Nov 28 23:45:44 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Nov 2005 23:45:44 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Message-ID: <200511290545.XAA29096@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.215 -> 1.216
---
Log message:
Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.
---
Diffs of the changes: (+2 -2)
LegalizeDAG.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.215 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.216
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.215 Tue Nov 22 12:16:00 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 28 23:45:29 2005
@@ -52,7 +52,7 @@
/// ValueTypeActions - This is a bitvector that contains two bits for each
/// value type, where the two bits correspond to the LegalizeAction enum.
/// This can be queried with "getTypeAction(VT)".
- unsigned ValueTypeActions;
+ unsigned long long ValueTypeActions;
/// NeedsAnotherIteration - This is set when we expand a large integer
/// operation into smaller integer operations, but the smaller operations are
@@ -161,7 +161,7 @@
SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag)
: TLI(dag.getTargetLoweringInfo()), DAG(dag),
ValueTypeActions(TLI.getValueTypeActions()) {
- assert(MVT::LAST_VALUETYPE <= 16 &&
+ assert(MVT::LAST_VALUETYPE <= 32 &&
"Too many value types for ValueTypeActions to hold!");
}
From natebegeman at mac.com Mon Nov 28 23:45:44 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Nov 2005 23:45:44 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/ValueTypes.cpp
Message-ID: <200511290545.XAA29108@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
ValueTypes.cpp updated: 1.5 -> 1.6
---
Log message:
Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.
---
Diffs of the changes: (+6 -0)
ValueTypes.cpp | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/lib/CodeGen/ValueTypes.cpp
diff -u llvm/lib/CodeGen/ValueTypes.cpp:1.5 llvm/lib/CodeGen/ValueTypes.cpp:1.6
--- llvm/lib/CodeGen/ValueTypes.cpp:1.5 Fri Nov 18 18:36:38 2005
+++ llvm/lib/CodeGen/ValueTypes.cpp Mon Nov 28 23:45:28 2005
@@ -34,6 +34,12 @@
case MVT::Other: return "ch";
case MVT::Flag: return "flag";
case MVT::Vector:return "vec";
+ case MVT::v16i8: return "v16i8";
+ case MVT::v8i16: return "v8i16";
+ case MVT::v4i32: return "v4i32";
+ case MVT::v2i64: return "v2i64";
+ case MVT::v4f32: return "v4f32";
+ case MVT::v2f64: return "v2f64";
}
}
From lattner at cs.uiuc.edu Tue Nov 29 00:15:51 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 00:15:51 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h
SelectionDAGNodes.h
Message-ID: <200511290615.AAA29325@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.70 -> 1.71
SelectionDAGNodes.h updated: 1.78 -> 1.79
---
Log message:
Add support for a new STRING and LOCATION node for line number support, patch
contributed by Daniel Berlin, with a few cleanups here and there by me.
---
Diffs of the changes: (+24 -1)
SelectionDAG.h | 2 ++
SelectionDAGNodes.h | 23 ++++++++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.70 llvm/include/llvm/CodeGen/SelectionDAG.h:1.71
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.70 Fri Nov 18 19:42:10 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Nov 29 00:15:39 2005
@@ -105,6 +105,7 @@
/// argument, it is used as the seed for node deletion.
void RemoveDeadNodes(SDNode *N = 0);
+ SDOperand getString(const std::string &Val);
SDOperand getConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getConstantFP(double Val, MVT::ValueType VT);
@@ -406,6 +407,7 @@
std::vector
ValueTypeNodes;
std::map ExternalSymbols;
std::map TargetExternalSymbols;
+ std::map StringNodes;
std::map > >,
SDNode*> OneResultNodes;
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.78 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.78 Tue Nov 22 12:15:59 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Nov 29 00:15:39 2005
@@ -63,7 +63,8 @@
AssertSext, AssertZext,
// Various leaf nodes.
- Constant, ConstantFP, GlobalAddress, FrameIndex, ConstantPool,
+ Constant, ConstantFP, STRING,
+ GlobalAddress, FrameIndex, ConstantPool,
BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE, Register,
// TargetConstant - Like Constant, but the DAG does not do any folding or
@@ -341,6 +342,12 @@
// HANDLENODE node - Used as a handle for various purposes.
HANDLENODE,
+ // LOCATION - This node is used to represent a source location for debug
+ // info. It takes token chain as input, then a line number, then a column
+ // number, then a filename, then a working dir. It produces a token chain
+ // as output.
+ LOCATION,
+
// BUILTIN_OP_END - This must be the last enum value in this list.
BUILTIN_OP_END,
};
@@ -846,6 +853,20 @@
SDOperand getValue() const { return getOperand(0); }
};
+class StringSDNode : public SDNode {
+ std::string Value;
+protected:
+ friend class SelectionDAG;
+ StringSDNode(const std::string &val)
+ : SDNode(ISD::STRING, MVT::Other), Value(val) {
+ }
+public:
+ const std::string &getValue() const { return Value; }
+ static bool classof(const StringSDNode *) { return true; }
+ static bool classof(const SDNode *N) {
+ return N->getOpcode() == ISD::STRING;
+ }
+};
class ConstantSDNode : public SDNode {
uint64_t Value;
From lattner at cs.uiuc.edu Tue Nov 29 00:16:34 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 00:16:34 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Message-ID: <200511290616.AAA29373@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCISelLowering.cpp updated: 1.45 -> 1.46
---
Log message:
No targets support line number info yet.
---
Diffs of the changes: (+3 -0)
PPCISelLowering.cpp | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.45 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.46
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.45 Thu Nov 17 12:55:48 2005
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Nov 29 00:16:21 2005
@@ -90,6 +90,9 @@
// PowerPC does not have truncstore for i1.
setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote);
+
+ // PowerPC doesn't have line number support yet.
+ setOperationAction(ISD::LOCATION, MVT::Other, Expand);
// We want to legalize GlobalAddress into the appropriate instructions to
// materialize the address.
From lattner at cs.uiuc.edu Tue Nov 29 00:16:35 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 00:16:35 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
Message-ID: <200511290616.AAA29377@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/Alpha:
AlphaISelLowering.cpp updated: 1.8 -> 1.9
---
Log message:
No targets support line number info yet.
---
Diffs of the changes: (+3 -0)
AlphaISelLowering.cpp | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.8 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.9
--- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.8 Wed Nov 9 13:17:08 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Tue Nov 29 00:16:21 2005
@@ -97,6 +97,9 @@
//Doesn't work yet
setOperationAction(ISD::SETCC, MVT::f32, Promote);
+
+ // We don't have line number support yet.
+ setOperationAction(ISD::LOCATION, MVT::Other, Expand);
computeRegisterProperties();
From lattner at cs.uiuc.edu Tue Nov 29 00:16:35 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 00:16:35 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Message-ID: <200511290616.AAA29383@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelLowering.cpp updated: 1.4 -> 1.5
---
Log message:
No targets support line number info yet.
---
Diffs of the changes: (+3 -0)
X86ISelLowering.cpp | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.4 llvm/lib/Target/X86/X86ISelLowering.cpp:1.5
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.4 Sun Nov 20 16:57:19 2005
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Nov 29 00:16:21 2005
@@ -116,6 +116,9 @@
setOperationAction(ISD::SELECT , MVT::i1 , Promote);
setOperationAction(ISD::SELECT , MVT::i8 , Promote);
+ // We don't have line number support yet.
+ setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+
if (X86ScalarSSE) {
// Set up the FP register classes.
addRegisterClass(MVT::f32, X86::V4F4RegisterClass);
From lattner at cs.uiuc.edu Tue Nov 29 00:16:35 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 00:16:35 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelLowering.cpp
Message-ID: <200511290616.AAA29381@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/IA64:
IA64ISelLowering.cpp updated: 1.3 -> 1.4
---
Log message:
No targets support line number info yet.
---
Diffs of the changes: (+3 -0)
IA64ISelLowering.cpp | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp
diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.3 llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.4
--- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.3 Fri Nov 4 04:01:11 2005
+++ llvm/lib/Target/IA64/IA64ISelLowering.cpp Tue Nov 29 00:16:21 2005
@@ -72,6 +72,9 @@
setOperationAction(ISD::FCOS , MVT::f32, Expand);
setOperationAction(ISD::FSQRT, MVT::f32, Expand);
+ // We don't have line number support yet.
+ setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+
//IA64 has these, but they are not implemented
setOperationAction(ISD::CTTZ , MVT::i64 , Expand);
setOperationAction(ISD::CTLZ , MVT::i64 , Expand);
From natebegeman at mac.com Tue Nov 29 00:19:50 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Tue, 29 Nov 2005 00:19:50 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeGenTarget.cpp
Message-ID: <200511290619.AAA29452@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
CodeGenTarget.cpp updated: 1.43 -> 1.44
---
Log message:
Add the new vector types to tablegen
---
Diffs of the changes: (+12 -0)
CodeGenTarget.cpp | 12 ++++++++++++
1 files changed, 12 insertions(+)
Index: llvm/utils/TableGen/CodeGenTarget.cpp
diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.43 llvm/utils/TableGen/CodeGenTarget.cpp:1.44
--- llvm/utils/TableGen/CodeGenTarget.cpp:1.43 Sat Nov 19 01:48:33 2005
+++ llvm/utils/TableGen/CodeGenTarget.cpp Tue Nov 29 00:19:38 2005
@@ -46,6 +46,12 @@
case MVT::f80: return "f80";
case MVT::f128: return "f128";
case MVT::isVoid:return "void";
+ case MVT::v16i8: return "v16i8";
+ case MVT::v8i16: return "v8i16";
+ case MVT::v4i32: return "v4i32";
+ case MVT::v2i64: return "v2i64";
+ case MVT::v4f32: return "v4f32";
+ case MVT::v2f64: return "v2f64";
default: assert(0 && "ILLEGAL VALUE TYPE!"); return "";
}
}
@@ -64,6 +70,12 @@
case MVT::f80: return "f80";
case MVT::f128: return "f128";
case MVT::isVoid:return "isVoid";
+ case MVT::v16i8: return "v16i8";
+ case MVT::v8i16: return "v8i16";
+ case MVT::v4i32: return "v4i32";
+ case MVT::v2i64: return "v2i64";
+ case MVT::v4f32: return "v4f32";
+ case MVT::v2f64: return "v2f64";
default: assert(0 && "ILLEGAL VALUE TYPE!"); return "";
}
}
From lattner at cs.uiuc.edu Tue Nov 29 00:21:18 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 00:21:18 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
SelectionDAG.cpp SelectionDAGISel.cpp SelectionDAGPrinter.cpp
Message-ID: <200511290621.AAA29525@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.216 -> 1.217
SelectionDAG.cpp updated: 1.215 -> 1.216
SelectionDAGISel.cpp updated: 1.105 -> 1.106
SelectionDAGPrinter.cpp updated: 1.28 -> 1.29
---
Log message:
Add support for a new STRING and LOCATION node for line number support, patch
contributed by Daniel Berlin, with a few cleanups here and there by me.
---
Diffs of the changes: (+113 -2)
LegalizeDAG.cpp | 27 ++++++++++++++++++
SelectionDAG.cpp | 16 +++++++++++
SelectionDAGISel.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++--
SelectionDAGPrinter.cpp | 3 ++
4 files changed, 113 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.216 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.217
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.216 Mon Nov 28 23:45:29 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Nov 29 00:21:05 2005
@@ -540,6 +540,7 @@
case ISD::CONDCODE:
case ISD::VALUETYPE:
case ISD::SRCVALUE:
+ case ISD::STRING:
switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
default: assert(0 && "This action is not supported yet!");
case TargetLowering::Custom: {
@@ -601,6 +602,32 @@
}
break;
}
+
+ case ISD::LOCATION:
+ assert(Node->getNumOperands() == 5 && "Invalid LOCATION node!");
+ Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the input chain.
+
+ switch (TLI.getOperationAction(ISD::LOCATION, MVT::Other)) {
+ case TargetLowering::Promote:
+ default: assert(0 && "This action is not supported yet!");
+ case TargetLowering::Expand:
+ // If the target doesn't support line numbers, ignore this node.
+ Result = Tmp1;
+ break;
+ case TargetLowering::Legal:
+ if (Tmp1 != Node->getOperand(0)) {
+ std::vector Ops;
+ Ops.push_back(Tmp1);
+ Ops.push_back(Node->getOperand(1)); // line # must be legal.
+ Ops.push_back(Node->getOperand(2)); // col # must be legal.
+ Ops.push_back(Node->getOperand(3)); // filename must be legal.
+ Ops.push_back(Node->getOperand(4)); // working dir # must be legal.
+ Result = DAG.getNode(ISD::LOCATION, MVT::Other, Ops);
+ }
+ break;
+ }
+ break;
+
case ISD::Constant:
// We know we don't need to expand constants here, constants only have one
// value and we check that it is fine above.
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.215 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.216
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.215 Tue Nov 22 12:16:00 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Nov 29 00:21:05 2005
@@ -274,6 +274,9 @@
Erased = ConstantFPs.erase(std::make_pair(V, N->getValueType(0)));
break;
}
+ case ISD::STRING:
+ Erased = StringNodes.erase(cast(N)->getValue());
+ break;
case ISD::CONDCODE:
assert(CondCodeNodes[cast(N)->get()] &&
"Cond code doesn't exist!");
@@ -448,6 +451,15 @@
return SDOperand(N, 0);
}
+SDOperand SelectionDAG::getString(const std::string &Val) {
+ StringSDNode *&N = StringNodes[Val];
+ if (!N) {
+ N = new StringSDNode(Val);
+ AllNodes.push_back(N);
+ }
+ return SDOperand(N, 0);
+}
+
SDOperand SelectionDAG::getTargetConstant(uint64_t Val, MVT::ValueType VT) {
assert(MVT::isInteger(VT) && "Cannot create FP integer constant!");
// Mask out any bits that are not valid for this constant.
@@ -1670,6 +1682,7 @@
case ISD::READCYCLECOUNTER: return "ReadCycleCounter";
case ISD::SRCVALUE: return "SrcValue";
case ISD::VALUETYPE: return "ValueType";
+ case ISD::STRING: return "String";
case ISD::EntryToken: return "EntryToken";
case ISD::TokenFactor: return "TokenFactor";
case ISD::AssertSext: return "AssertSext";
@@ -1787,6 +1800,9 @@
case ISD::READIO: return "readio";
case ISD::WRITEIO: return "writeio";
+ // Debug info
+ case ISD::LOCATION: return "location";
+
case ISD::CONDCODE:
switch (cast(this)->get()) {
default: assert(0 && "Unknown setcc condition!");
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.105 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.106
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.105 Tue Nov 22 12:16:00 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Nov 29 00:21:05 2005
@@ -17,6 +17,7 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/CodeGen/IntrinsicLowering.h"
@@ -719,6 +720,44 @@
CurMBB->getParent()->getFrameInfo()->CreateVariableSizedObject();
}
+/// getStringValue - Turn an LLVM constant pointer that eventually points to a
+/// global into a string value. Return an empty string if we can't do it.
+///
+static std::string getStringValue(Value *V, unsigned Offset = 0) {
+ if (GlobalVariable *GV = dyn_cast(V)) {
+ if (GV->hasInitializer() && isa(GV->getInitializer())) {
+ ConstantArray *Init = cast(GV->getInitializer());
+ if (Init->isString()) {
+ std::string Result = Init->getAsString();
+ if (Offset < Result.size()) {
+ // If we are pointing INTO The string, erase the beginning...
+ Result.erase(Result.begin(), Result.begin()+Offset);
+
+ // Take off the null terminator, and any string fragments after it.
+ std::string::size_type NullPos = Result.find_first_of((char)0);
+ if (NullPos != std::string::npos)
+ Result.erase(Result.begin()+NullPos, Result.end());
+ return Result;
+ }
+ }
+ }
+ } else if (Constant *C = dyn_cast(V)) {
+ if (GlobalValue *GV = dyn_cast(C))
+ return getStringValue(GV, Offset);
+ else if (ConstantExpr *CE = dyn_cast(C)) {
+ if (CE->getOpcode() == Instruction::GetElementPtr) {
+ // Turn a gep into the specified offset.
+ if (CE->getNumOperands() == 3 &&
+ cast(CE->getOperand(1))->isNullValue() &&
+ isa(CE->getOperand(2))) {
+ return getStringValue(CE->getOperand(0),
+ Offset+cast(CE->getOperand(2))->getRawValue());
+ }
+ }
+ }
+ }
+ return "";
+}
void SelectionDAGLowering::visitLoad(LoadInst &I) {
SDOperand Ptr = getValue(I.getOperand(0));
@@ -813,11 +852,37 @@
return 0;
case Intrinsic::dbg_stoppoint:
+ {
if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions())
return "llvm_debugger_stop";
- if (I.getType() != Type::VoidTy)
- setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));
+
+ std::string fname = "";
+ std::vector Ops;
+
+ // Pull the filename out of the the compilation unit.
+ const GlobalVariable *cunit = dyn_cast(I.getOperand(4));
+ if (cunit && cunit->hasInitializer()) {
+ ConstantStruct *CS = dyn_cast(cunit->getInitializer());
+ if (CS->getNumOperands() > 0) {
+ std::string dirname = getStringValue(CS->getOperand(4));
+ fname = dirname + "/" + getStringValue(CS->getOperand(3));
+ }
+ }
+ // Input Chain
+ Ops.push_back(getRoot());
+
+ // line number
+ Ops.push_back(getValue(I.getOperand(2)));
+
+ // column
+ Ops.push_back(getValue(I.getOperand(3)));
+
+ // filename
+ Ops.push_back(DAG.getString(fname));
+ Ops.push_back(DAG.getString(""));
+ DAG.setRoot(DAG.getNode(ISD::LOCATION, MVT::Other, Ops));
return 0;
+ }
case Intrinsic::dbg_region_start:
if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions())
return "llvm_dbg_region_start";
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.28 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.29
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.28 Sat Nov 19 21:45:52 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Nov 29 00:21:05 2005
@@ -98,7 +98,10 @@
Op += "getOffset()) + ">";
} else if (const VTSDNode *N = dyn_cast(Node)) {
Op = Op + " VT=" + getValueTypeString(N->getVT());
+ } else if (const StringSDNode *N = dyn_cast(Node)) {
+ Op = Op + "\"" + N->getValue() + "\"";
}
+
return Op;
}
From natebegeman at mac.com Tue Nov 29 02:04:56 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Tue, 29 Nov 2005 02:04:56 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrFormats.td
PPCInstrInfo.td
Message-ID: <200511290804.CAA29990@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCInstrFormats.td updated: 1.57 -> 1.58
PPCInstrInfo.td updated: 1.145 -> 1.146
---
Log message:
Add the remainder of the AltiVec 4 x float instructions. Further
enhancements will be necessary to teach the code generator that since
there is no fmul, it will have to do vmaddfp, adding +0.0.
---
Diffs of the changes: (+61 -14)
PPCInstrFormats.td | 14 ++++++++++++
PPCInstrInfo.td | 61 ++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 61 insertions(+), 14 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td
diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.57 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.58
--- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.57 Sat Nov 26 16:39:34 2005
+++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Tue Nov 29 02:04:45 2005
@@ -582,6 +582,20 @@
let Inst{21-31} = xo;
}
+class VXForm_2 xo, dag OL, string asmstr,
+ InstrItinClass itin, list pattern>
+ : I<4, OL, asmstr, itin> {
+ bits<5> VD;
+ bits<5> VB;
+
+ let Pattern = pattern;
+
+ let Inst{6-10} = VD;
+ let Inst{11-15} = 0;
+ let Inst{16-20} = VB;
+ let Inst{21-31} = xo;
+}
+
// E-4 VXR-Form
class VXRForm_1 xo, bit rc, dag OL, string asmstr,
InstrItinClass itin, list pattern>
Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.145 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.146
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.145 Sat Nov 26 16:39:34 2005
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Nov 29 02:04:45 2005
@@ -767,32 +767,65 @@
[]>, isPPC64;
// VA-Form instructions. 3-input AltiVec ops.
-def VMADDFP: VAForm_1<46, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, VRRC:$vC),
- "vmaddfp $vD, $vA, $vB, $vC", VecFP,
- []>;
+def VMADDFP : VAForm_1<46, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, VRRC:$vC),
+ "vmaddfp $vD, $vA, $vC, $vB", VecFP,
+ [(set VRRC:$vD, (fadd (fmul VRRC:$vA, VRRC:$vC),
+ VRRC:$vB))]>;
+def VNMSUBFP: VAForm_1<47, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB, VRRC:$vC),
+ "vnmsubfp $vD, $vA, $vC, $vB", VecFP,
+ [(set VRRC:$vD, (fneg (fsub (fmul VRRC:$vA,
+ VRRC:$vC),
+ VRRC:$vB)))]>;
// VX-Form instructions. AltiVec arithmetic ops.
def VADDFP : VXForm_1<10, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
"vaddfp $vD, $vA, $vB", VecFP,
- []>;
-def VADDUWM: VXForm_1<128, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
- "vadduwm $vD, $vA, $vB", VecGeneral,
- []>;
-def VAND : VXForm_1<1028, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
- "vand $vD, $vA, $vB", VecGeneral,
- []>;
+ [(set VRRC:$vD, (fadd VRRC:$vA, VRRC:$vB))]>;
def VCFSX : VXForm_1<842, (ops VRRC:$vD, u5imm:$UIMM, VRRC:$vB),
"vcfsx $vD, $vB, $UIMM", VecFP,
[]>;
def VCFUX : VXForm_1<778, (ops VRRC:$vD, u5imm:$UIMM, VRRC:$vB),
"vcfux $vD, $vB, $UIMM", VecFP,
[]>;
-def VOR : VXForm_1<1156, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
- "vor $vD, $vA, $vB", VecGeneral,
+def VCTSXS : VXForm_1<970, (ops VRRC:$vD, u5imm:$UIMM, VRRC:$vB),
+ "vctsxs $vD, $vB, $UIMM", VecFP,
[]>;
-def VXOR : VXForm_1<1220, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
- "vxor $vD, $vA, $vB", VecGeneral,
+def VCTUXS : VXForm_1<906, (ops VRRC:$vD, u5imm:$UIMM, VRRC:$vB),
+ "vctuxs $vD, $vB, $UIMM", VecFP,
[]>;
+def VEXPTEFP : VXForm_2<394, (ops VRRC:$vD, VRRC:$vB),
+ "vexptefp $vD, $vB", VecFP,
+ []>;
+def VLOGEFP : VXForm_2<458, (ops VRRC:$vD, VRRC:$vB),
+ "vlogefp $vD, $vB", VecFP,
+ []>;
+def VMAXFP : VXForm_1<1034, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
+ "vmaxfp $vD, $vA, $vB", VecFP,
+ []>;
+def VMINFP : VXForm_1<1098, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
+ "vminfp $vD, $vA, $vB", VecFP,
+ []>;
+def VREFP : VXForm_2<266, (ops VRRC:$vD, VRRC:$vB),
+ "vrefp $vD, $vB", VecFP,
+ []>;
+def VRFIM : VXForm_2<714, (ops VRRC:$vD, VRRC:$vB),
+ "vrfim $vD, $vB", VecFP,
+ []>;
+def VRFIN : VXForm_2<522, (ops VRRC:$vD, VRRC:$vB),
+ "vrfin $vD, $vB", VecFP,
+ []>;
+def VRFIP : VXForm_2<650, (ops VRRC:$vD, VRRC:$vB),
+ "vrfip $vD, $vB", VecFP,
+ []>;
+def VRFIZ : VXForm_2<586, (ops VRRC:$vD, VRRC:$vB),
+ "vrfiz $vD, $vB", VecFP,
+ []>;
+def VRSQRTEFP : VXForm_2<330, (ops VRRC:$vD, VRRC:$vB),
+ "vrsqrtefp $vD, $vB", VecFP,
+ []>;
+def VSUBFP : VXForm_1<74, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
+ "vsubfp $vD, $vA, $vB", VecFP,
+ [(set VRRC:$vD, (fsub VRRC:$vA, VRRC:$vB))]>;
//===----------------------------------------------------------------------===//
// PowerPC Instruction Patterns
From natebegeman at mac.com Tue Nov 29 02:17:31 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Tue, 29 Nov 2005 02:17:31 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Message-ID: <200511290817.CAA30194@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCISelLowering.cpp updated: 1.46 -> 1.47
---
Log message:
Hook up one type, v4f32, to the VR RegisterClass for now.
---
Diffs of the changes: (+6 -0)
PPCISelLowering.cpp | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.46 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.47
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.46 Tue Nov 29 00:16:21 2005
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Nov 29 02:17:20 2005
@@ -121,6 +121,12 @@
setOperationAction(ISD::SRA, MVT::i64, Custom);
}
+ if (TM.getSubtarget().hasAltivec()) {
+ // FIXME: AltiVec supports a wide variety of packed types. For now, we're
+ // bringing up support with just v4f32.
+ addRegisterClass(MVT::v4f32, PPC::VRRCRegisterClass);
+ }
+
setSetCCResultContents(ZeroOrOneSetCCResult);
computeRegisterProperties();
From alenhar2 at cs.uiuc.edu Tue Nov 29 09:51:32 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 29 Nov 2005 09:51:32 -0600
Subject: [llvm-commits] vector types
In-Reply-To: <200511290616.jAT6GrIp006021@dcs-maillist.cs.uiuc.edu>
References: <200511290616.jAT6GrIp006021@dcs-maillist.cs.uiuc.edu>
Message-ID: <1133279492.32542.6.camel@apoc.cs.uiuc.edu>
> Add the majority of the vector machien value types we expect to support,
> and make a few changes to the legalization machinery to support more than
> 16 types.
Just in case anyone cares, the relevant vector types for alpha are:
v8i8, v4i16, and maybe v2i32 (only one unpack operation produces this
and one pack operations consumes it). Of course all the operations that
exist are (s|u)(min|max), packing, unpacking, and comparison. Not that
I am too worried about support.
Andrew
>
>
> ---
> Diffs of the changes: (+21 -3)
>
> ValueTypes.h | 24 +++++++++++++++++++++---
> 1 files changed, 21 insertions(+), 3 deletions(-)
>
>
> Index: llvm/include/llvm/CodeGen/ValueTypes.h
> diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.13 llvm/include/llvm/CodeGen/ValueTypes.h:1.14
> --- llvm/include/llvm/CodeGen/ValueTypes.h:1.13 Thu Nov 17 15:44:42 2005
> +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Nov 28 23:45:28 2005
> @@ -48,14 +48,26 @@
> // be refined into a target vector type, or
> // scalarized.
>
> + // These are 128 bit vectors of varying packed types
> + v16i8 = 14, // 16 x i8
> + v8i16 = 15, // 8 x i16
> + v4i32 = 16, // 4 x i32
> + v2i64 = 17, // 2 x i64
> +
> + v4f32 = 18, // 4 x f32
> + v2f64 = 19, // 2 x f64
> +
> LAST_VALUETYPE, // This always remains at the end of the list.
> };
>
> static inline bool isInteger(ValueType VT) {
> - return VT >= i1 && VT <= i128;
> + return (VT >= i1 && VT <= i128) || (VT >= v16i8 && VT <= v2i64);
> }
> static inline bool isFloatingPoint(ValueType VT) {
> - return VT >= f32 && VT <= f128;
> + return (VT >= f32 && VT <= f128) || (VT >= v4f32 && VT <= v2f64);
> + }
> + static inline bool isVector(ValueType VT) {
> + return (VT >= v16i8 && VT <= v2f64);
> }
>
> static inline unsigned getSizeInBits(ValueType VT) {
> @@ -70,7 +82,13 @@
> case MVT::i64 : return 64;
> case MVT::f80 : return 80;
> case MVT::f128:
> - case MVT::i128: return 128;
> + case MVT::i128:
> + case MVT::v16i8:
> + case MVT::v8i16:
> + case MVT::v4i32:
> + case MVT::v2i64:
> + case MVT::v4f32:
> + case MVT::v2f64: return 128;
> }
> }
From sabre at nondot.org Tue Nov 29 10:36:19 2005
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 29 Nov 2005 10:36:19 -0600 (CST)
Subject: [llvm-commits] vector types
In-Reply-To: <1133279492.32542.6.camel@apoc.cs.uiuc.edu>
References: <200511290616.jAT6GrIp006021@dcs-maillist.cs.uiuc.edu>
<1133279492.32542.6.camel@apoc.cs.uiuc.edu>
Message-ID:
On Tue, 29 Nov 2005, Andrew Lenharth wrote:
>> Add the majority of the vector machien value types we expect to support,
>> and make a few changes to the legalization machinery to support more than
>> 16 types.
>
> Just in case anyone cares, the relevant vector types for alpha are:
>
> v8i8, v4i16, and maybe v2i32 (only one unpack operation produces this
> and one pack operations consumes it). Of course all the operations that
> exist are (s|u)(min|max), packing, unpacking, and comparison. Not that
> I am too worried about support.
Ok, sounds good. We figured that the list could be expanded on demand. :)
MMX also has several other supported types that aren't on the list, so we
would add those if we ever decided to add support.
-Chris
>> ---
>> Diffs of the changes: (+21 -3)
>>
>> ValueTypes.h | 24 +++++++++++++++++++++---
>> 1 files changed, 21 insertions(+), 3 deletions(-)
>>
>>
>> Index: llvm/include/llvm/CodeGen/ValueTypes.h
>> diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.13 llvm/include/llvm/CodeGen/ValueTypes.h:1.14
>> --- llvm/include/llvm/CodeGen/ValueTypes.h:1.13 Thu Nov 17 15:44:42 2005
>> +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Nov 28 23:45:28 2005
>> @@ -48,14 +48,26 @@
>> // be refined into a target vector type, or
>> // scalarized.
>>
>> + // These are 128 bit vectors of varying packed types
>> + v16i8 = 14, // 16 x i8
>> + v8i16 = 15, // 8 x i16
>> + v4i32 = 16, // 4 x i32
>> + v2i64 = 17, // 2 x i64
>> +
>> + v4f32 = 18, // 4 x f32
>> + v2f64 = 19, // 2 x f64
>> +
>> LAST_VALUETYPE, // This always remains at the end of the list.
>> };
>>
>> static inline bool isInteger(ValueType VT) {
>> - return VT >= i1 && VT <= i128;
>> + return (VT >= i1 && VT <= i128) || (VT >= v16i8 && VT <= v2i64);
>> }
>> static inline bool isFloatingPoint(ValueType VT) {
>> - return VT >= f32 && VT <= f128;
>> + return (VT >= f32 && VT <= f128) || (VT >= v4f32 && VT <= v2f64);
>> + }
>> + static inline bool isVector(ValueType VT) {
>> + return (VT >= v16i8 && VT <= v2f64);
>> }
>>
>> static inline unsigned getSizeInBits(ValueType VT) {
>> @@ -70,7 +82,13 @@
>> case MVT::i64 : return 64;
>> case MVT::f80 : return 80;
>> case MVT::f128:
>> - case MVT::i128: return 128;
>> + case MVT::i128:
>> + case MVT::v16i8:
>> + case MVT::v8i16:
>> + case MVT::v4i32:
>> + case MVT::v2i64:
>> + case MVT::v4f32:
>> + case MVT::v2f64: return 128;
>> }
>> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
From lattner at cs.uiuc.edu Tue Nov 29 12:19:41 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 12:19:41 -0600
Subject: [llvm-commits]
CVS: llvm-test/SingleSource/UnitTests/2005-11-29-LongSwitch.c
Message-ID: <200511291819.MAA08793@zion.cs.uiuc.edu>
Changes in directory llvm-test/SingleSource/UnitTests:
2005-11-29-LongSwitch.c added (r1.1)
---
Log message:
new testcase corresponding to PR671: http://llvm.cs.uiuc.edu/PR671
---
Diffs of the changes: (+19 -0)
2005-11-29-LongSwitch.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+)
Index: llvm-test/SingleSource/UnitTests/2005-11-29-LongSwitch.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/2005-11-29-LongSwitch.c:1.1
*** /dev/null Tue Nov 29 12:19:31 2005
--- llvm-test/SingleSource/UnitTests/2005-11-29-LongSwitch.c Tue Nov 29 12:19:21 2005
***************
*** 0 ****
--- 1,19 ----
+ // PR671
+
+ #include
+
+ int foo(long long v) {
+ switch (v) {
+ case 0:
+ return 1;
+ case -1:
+ return 2;
+ }
+ return 0;
+ }
+
+ int main() {
+ int r = foo(4294967295LL);
+ printf("foo = %d\n", r);
+ return r;
+ }
From lattner at cs.uiuc.edu Tue Nov 29 12:25:16 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 12:25:16 -0600
Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
llvm-representation.c llvm-representation.h
Message-ID: <200511291825.MAA08895@zion.cs.uiuc.edu>
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.117 -> 1.118
llvm-representation.c updated: 1.20 -> 1.21
llvm-representation.h updated: 1.19 -> 1.20
---
Log message:
Allow switch statements on long-long values to be correctly handled. This
fixes PR671: http://llvm.cs.uiuc.edu/PR671 and llvm-test/SingleSource/UnitTests/2005-11-29-LongSwitch.c
---
Diffs of the changes: (+25 -11)
llvm-expand.c | 23 ++++++++++++++---------
llvm-representation.c | 11 ++++++++++-
llvm-representation.h | 2 +-
3 files changed, 25 insertions(+), 11 deletions(-)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.117 llvm-gcc/gcc/llvm-expand.c:1.118
--- llvm-gcc/gcc/llvm-expand.c:1.117 Wed Sep 28 02:16:59 2005
+++ llvm-gcc/gcc/llvm-expand.c Tue Nov 29 12:25:04 2005
@@ -2022,8 +2022,8 @@
add_scope_stack(Fn, &Fn->ExpandInfo->InnermostCaseScope, CASE_NESTING);
llvm_instruction *SI = llvm_instruction_new(VoidTy, "", O_Switch, 2);
llvm_value *Val = llvm_expand_expr(Fn, expr, 0);
-
- SI->Operands[0] = cast_if_type_not_equal(Fn, Val, UIntTy);
+ assert(llvm_type_is_integral(Val->Ty) && "Not an integer switch expr!");
+ SI->Operands[0] = Val;
append_inst(Fn, SI);
thiscase->x.switchblock.SwitchInst = SI;
@@ -2083,6 +2083,15 @@
pop_and_free_scope_stack(Fn, &Fn->ExpandInfo->InnermostCaseScope);
}
+static unsigned long long getIntCstAsLongLong(tree V) {
+ unsigned HOST_WIDE_INT HI = (unsigned HOST_WIDE_INT)TREE_INT_CST_HIGH(V);
+ unsigned HOST_WIDE_INT LO = (unsigned HOST_WIDE_INT)TREE_INT_CST_LOW(V);
+ if (sizeof(LO) == 8) return LO;
+
+ assert(sizeof(LO) == 4 && "64 and 32 bit HOST_WIDE_INT's supported!");
+ return ((long long)(unsigned)HI << 32) | (long long)(unsigned)LO;
+}
+
/* Add a case label to the current switch statement. This could be a range of
case values to insert. Handle them as appropriate.
*/
@@ -2091,7 +2100,7 @@
llvm_nesting *thiscase = Fn->ExpandInfo->InnermostCaseScope;
llvm_instruction *SwitchInst;
llvm_basicblock *Block = getLabelDeclBlock(label);
- int Low, High;
+ long long Low, High;
assert(thiscase && "Case label not in case statement!");
SwitchInst = thiscase->x.switchblock.SwitchInst;
@@ -2111,12 +2120,8 @@
}
}
- if ((TREE_INT_CST_HIGH(low) != 0 || TREE_INT_CST_HIGH(high) != 0) &&
- (TREE_INT_CST_HIGH(low) != -1 || TREE_INT_CST_HIGH(high) != -1))
- LLVM_TODO_TREE(label); /* Cannot handle case values this large! */
-
- Low = (int)TREE_INT_CST_LOW(low);
- High = (int)TREE_INT_CST_LOW(high);
+ Low = getIntCstAsLongLong(low);
+ High = getIntCstAsLongLong(high);
for (; Low != High+1; ++Low) {
llvm_switch_case *NewCase = xmalloc(sizeof(llvm_switch_case));
Index: llvm-gcc/gcc/llvm-representation.c
diff -u llvm-gcc/gcc/llvm-representation.c:1.20 llvm-gcc/gcc/llvm-representation.c:1.21
--- llvm-gcc/gcc/llvm-representation.c:1.20 Sat Sep 24 03:33:56 2005
+++ llvm-gcc/gcc/llvm-representation.c Tue Nov 29 12:25:04 2005
@@ -708,7 +708,16 @@
fprintf(F, " [");
for (; C; C = C->Next) {
- fprintf(F, "\n\t\tuint %u, ", C->Value);
+ switch (Operand->Ty->ID) {
+ case UByteTyID: fprintf(F, "\n\t\tubyte %u, ", (unsigned char)C->Value); break;
+ case SByteTyID: fprintf(F, "\n\t\tsbyte %d, ", (signed char)C->Value); break;
+ case UShortTyID: fprintf(F, "\n\t\tushort %u, ", (unsigned short)C->Value); break;
+ case ShortTyID: fprintf(F, "\n\t\tshort %d, ", (signed short)C->Value); break;
+ case UIntTyID: fprintf(F, "\n\t\tuint %u, ", (unsigned)C->Value); break;
+ case IntTyID: fprintf(F, "\n\t\tint %d, ", (signed)C->Value); break;
+ case ULongTyID: fprintf(F, "\n\t\tulong %llu, ", C->Value); break;
+ case LongTyID: fprintf(F, "\n\t\tlong %lld, ", C->Value); break;
+ }
llvm_value_print_operand(D2V(C->Dest), 1, F);
}
fprintf(F, "\n\t]");
Index: llvm-gcc/gcc/llvm-representation.h
diff -u llvm-gcc/gcc/llvm-representation.h:1.19 llvm-gcc/gcc/llvm-representation.h:1.20
--- llvm-gcc/gcc/llvm-representation.h:1.19 Thu Jul 28 13:50:28 2005
+++ llvm-gcc/gcc/llvm-representation.h Tue Nov 29 12:25:04 2005
@@ -154,7 +154,7 @@
typedef struct llvm_switch_case {
struct llvm_switch_case *Next;
- unsigned Value;
+ unsigned long long Value;
struct llvm_basicblock *Dest;
} llvm_switch_case;
From evan.cheng at apple.com Tue Nov 29 12:45:10 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 12:45:10 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Message-ID: <200511291845.MAA09568@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.76 -> 1.77
---
Log message:
Better error message when unrecognized opcode is seen.
---
Diffs of the changes: (+6 -1)
DAGISelEmitter.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.76 llvm/utils/TableGen/DAGISelEmitter.cpp:1.77
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.76 Thu Nov 17 11:43:52 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Nov 29 12:44:58 2005
@@ -1952,7 +1952,12 @@
dynamic_cast(PatternsToMatch[i].first->getLeafValue())) {
PatternsByOpcode[getSDNodeNamed("imm")].push_back(&PatternsToMatch[i]);
} else {
- assert(0 && "Unknown leaf value");
+ std::cerr << "Unrecognized opcode '";
+ PatternsToMatch[i].first->dump();
+ std::cerr << "' on tree pattern '";
+ std::cerr << PatternsToMatch[i].second->getOperator()->getName();
+ std::cerr << "'!\n";
+ exit(1);
}
}
From evan.cheng at apple.com Tue Nov 29 13:39:05 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 13:39:05 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td
Message-ID: <200511291939.NAA10279@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86InstrInfo.td updated: 1.141 -> 1.142
---
Log message:
Add more X86 ISel patterns.
---
Diffs of the changes: (+464 -408)
X86InstrInfo.td | 872 +++++++++++++++++++++++++++++---------------------------
1 files changed, 464 insertions(+), 408 deletions(-)
Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.141 llvm/lib/Target/X86/X86InstrInfo.td:1.142
--- llvm/lib/Target/X86/X86InstrInfo.td:1.141 Sun Nov 20 16:13:18 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Tue Nov 29 13:38:52 2005
@@ -145,8 +145,10 @@
//===----------------------------------------------------------------------===//
// Instruction templates...
-class I o, Format f, dag ops, string asm>
- : X86Inst;
+class I o, Format f, dag ops, string asm, list pattern>
+ : X86Inst {
+ let Pattern = pattern;
+}
class Ii8 o, Format f, dag ops, string asm, list pattern>
: X86Inst {
let Pattern = pattern;
@@ -164,17 +166,17 @@
// Instruction list...
//
-def PHI : I<0, Pseudo, (ops variable_ops), "PHINODE">; // PHI node.
-def NOOP : I<0x90, RawFrm, (ops), "nop">; // nop
+def PHI : I<0, Pseudo, (ops variable_ops), "PHINODE", []>; // PHI node.
+def NOOP : I<0x90, RawFrm, (ops), "nop", []>; // nop
-def ADJCALLSTACKDOWN : I<0, Pseudo, (ops i32imm:$amt), "#ADJCALLSTACKDOWN">;
+def ADJCALLSTACKDOWN : I<0, Pseudo, (ops i32imm:$amt), "#ADJCALLSTACKDOWN", []>;
def ADJCALLSTACKUP : I<0, Pseudo, (ops i32imm:$amt1, i32imm:$amt2),
- "#ADJCALLSTACKUP">;
-def IMPLICIT_USE : I<0, Pseudo, (ops variable_ops), "#IMPLICIT_USE">;
-def IMPLICIT_DEF : I<0, Pseudo, (ops variable_ops), "#IMPLICIT_DEF">;
+ "#ADJCALLSTACKUP", []>;
+def IMPLICIT_USE : I<0, Pseudo, (ops variable_ops), "#IMPLICIT_USE", []>;
+def IMPLICIT_DEF : I<0, Pseudo, (ops variable_ops), "#IMPLICIT_DEF", []>;
let isTerminator = 1 in
let Defs = [FP0, FP1, FP2, FP3, FP4, FP5, FP6] in
- def FP_REG_KILL : I<0, Pseudo, (ops), "#FP_REG_KILL">;
+ def FP_REG_KILL : I<0, Pseudo, (ops), "#FP_REG_KILL", []>;
//===----------------------------------------------------------------------===//
// Control Flow Instructions...
@@ -182,13 +184,14 @@
// Return instructions.
let isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def RET : I<0xC3, RawFrm, (ops), "ret">;
+ def RET : I<0xC3, RawFrm, (ops), "ret", []>;
let isTerminator = 1, isReturn = 1, isBarrier = 1 in
def RETI : Ii16<0xC2, RawFrm, (ops i16imm:$amt), "ret $amt", []>;
// All branches are RawFrm, Void, Branch, and Terminators
let isBranch = 1, isTerminator = 1 in
- class IBr opcode, dag ops, string asm> : I;
+ class IBr opcode, dag ops, string asm> :
+ I;
let isBarrier = 1 in
def JMP : IBr<0xE9, (ops i32imm:$dst), "jmp $dst">;
@@ -215,18 +218,19 @@
// All calls clobber the non-callee saved registers...
let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0,
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7] in {
- def CALLpcrel32 : I<0xE8, RawFrm, (ops calltarget:$dst), "call $dst">;
- def CALL32r : I<0xFF, MRM2r, (ops R32:$dst), "call {*}$dst">;
- def CALL32m : I<0xFF, MRM2m, (ops i32mem:$dst), "call {*}$dst">;
+ def CALLpcrel32 : I<0xE8, RawFrm, (ops calltarget:$dst), "call $dst", []>;
+ def CALL32r : I<0xFF, MRM2r, (ops R32:$dst), "call {*}$dst", []>;
+ def CALL32m : I<0xFF, MRM2m, (ops i32mem:$dst), "call {*}$dst", []>;
}
// Tail call stuff.
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
def TAILJMPd : IBr<0xE9, (ops calltarget:$dst), "jmp $dst # TAIL CALL">;
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPr : I<0xFF, MRM4r, (ops R32:$dst), "jmp {*}$dst # TAIL CALL">;
+ def TAILJMPr : I<0xFF, MRM4r, (ops R32:$dst), "jmp {*}$dst # TAIL CALL", []>;
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPm : I<0xFF, MRM4m, (ops i32mem:$dst), "jmp {*}$dst # TAIL CALL">;
+ def TAILJMPm : I<0xFF, MRM4m, (ops i32mem:$dst),
+ "jmp {*}$dst # TAIL CALL", []>;
// ADJSTACKPTRri - This is a standard ADD32ri instruction, identical in every
// way, except that it is marked as being a terminator. This causes the epilog
@@ -241,63 +245,63 @@
// Miscellaneous Instructions...
//
def LEAVE : I<0xC9, RawFrm,
- (ops), "leave">, Imp<[EBP,ESP],[EBP,ESP]>;
+ (ops), "leave", []>, Imp<[EBP,ESP],[EBP,ESP]>;
def POP32r : I<0x58, AddRegFrm,
- (ops R32:$reg), "pop{l} $reg">, Imp<[ESP],[ESP]>;
+ (ops R32:$reg), "pop{l} $reg", []>, Imp<[ESP],[ESP]>;
let isTwoAddress = 1 in // R32 = bswap R32
def BSWAP32r : I<0xC8, AddRegFrm,
- (ops R32:$dst, R32:$src), "bswap{l} $dst">, TB;
+ (ops R32:$dst, R32:$src), "bswap{l} $dst", []>, TB;
def XCHG8rr : I<0x86, MRMDestReg, // xchg R8, R8
(ops R8:$src1, R8:$src2),
- "xchg{b} {$src2|$src1}, {$src1|$src2}">;
+ "xchg{b} {$src2|$src1}, {$src1|$src2}", []>;
def XCHG16rr : I<0x87, MRMDestReg, // xchg R16, R16
(ops R16:$src1, R16:$src2),
- "xchg{w} {$src2|$src1}, {$src1|$src2}">, OpSize;
+ "xchg{w} {$src2|$src1}, {$src1|$src2}", []>, OpSize;
def XCHG32rr : I<0x87, MRMDestReg, // xchg R32, R32
(ops R32:$src1, R32:$src2),
- "xchg{l} {$src2|$src1}, {$src1|$src2}">;
+ "xchg{l} {$src2|$src1}, {$src1|$src2}", []>;
def XCHG8mr : I<0x86, MRMDestMem,
(ops i8mem:$src1, R8:$src2),
- "xchg{b} {$src2|$src1}, {$src1|$src2}">;
+ "xchg{b} {$src2|$src1}, {$src1|$src2}", []>;
def XCHG16mr : I<0x87, MRMDestMem,
(ops i16mem:$src1, R16:$src2),
- "xchg{w} {$src2|$src1}, {$src1|$src2}">, OpSize;
+ "xchg{w} {$src2|$src1}, {$src1|$src2}", []>, OpSize;
def XCHG32mr : I<0x87, MRMDestMem,
(ops i32mem:$src1, R32:$src2),
- "xchg{l} {$src2|$src1}, {$src1|$src2}">;
+ "xchg{l} {$src2|$src1}, {$src1|$src2}", []>;
def XCHG8rm : I<0x86, MRMSrcMem,
(ops R8:$src1, i8mem:$src2),
- "xchg{b} {$src2|$src1}, {$src1|$src2}">;
+ "xchg{b} {$src2|$src1}, {$src1|$src2}", []>;
def XCHG16rm : I<0x87, MRMSrcMem,
(ops R16:$src1, i16mem:$src2),
- "xchg{w} {$src2|$src1}, {$src1|$src2}">, OpSize;
+ "xchg{w} {$src2|$src1}, {$src1|$src2}", []>, OpSize;
def XCHG32rm : I<0x87, MRMSrcMem,
(ops R32:$src1, i32mem:$src2),
- "xchg{l} {$src2|$src1}, {$src1|$src2}">;
+ "xchg{l} {$src2|$src1}, {$src1|$src2}", []>;
def LEA16r : I<0x8D, MRMSrcMem,
(ops R16:$dst, i32mem:$src),
- "lea{w} {$src|$dst}, {$dst|$src}">, OpSize;
+ "lea{w} {$src|$dst}, {$dst|$src}", []>, OpSize;
def LEA32r : I<0x8D, MRMSrcMem,
(ops R32:$dst, i32mem:$src),
- "lea{l} {$src|$dst}, {$dst|$src}">;
+ "lea{l} {$src|$dst}, {$dst|$src}", []>;
-def REP_MOVSB : I<0xA4, RawFrm, (ops), "{rep;movsb|rep movsb}">,
+def REP_MOVSB : I<0xA4, RawFrm, (ops), "{rep;movsb|rep movsb}", []>,
Imp<[ECX,EDI,ESI], [ECX,EDI,ESI]>, REP;
-def REP_MOVSW : I<0xA5, RawFrm, (ops), "{rep;movsw|rep movsw}">,
+def REP_MOVSW : I<0xA5, RawFrm, (ops), "{rep;movsw|rep movsw}", []>,
Imp<[ECX,EDI,ESI], [ECX,EDI,ESI]>, REP, OpSize;
-def REP_MOVSD : I<0xA5, RawFrm, (ops), "{rep;movsd|rep movsd}">,
+def REP_MOVSD : I<0xA5, RawFrm, (ops), "{rep;movsd|rep movsd}", []>,
Imp<[ECX,EDI,ESI], [ECX,EDI,ESI]>, REP;
-def REP_STOSB : I<0xAA, RawFrm, (ops), "{rep;stosb|rep stosb}">,
+def REP_STOSB : I<0xAA, RawFrm, (ops), "{rep;stosb|rep stosb}", []>,
Imp<[AL,ECX,EDI], [ECX,EDI]>, REP;
-def REP_STOSW : I<0xAB, RawFrm, (ops), "{rep;stosw|rep stosw}">,
+def REP_STOSW : I<0xAB, RawFrm, (ops), "{rep;stosw|rep stosw}", []>,
Imp<[AX,ECX,EDI], [ECX,EDI]>, REP, OpSize;
-def REP_STOSD : I<0xAB, RawFrm, (ops), "{rep;stosl|rep stosd}">,
+def REP_STOSD : I<0xAB, RawFrm, (ops), "{rep;stosl|rep stosd}", []>,
Imp<[EAX,ECX,EDI], [ECX,EDI]>, REP;
@@ -305,11 +309,11 @@
// Input/Output Instructions...
//
def IN8rr : I<0xEC, RawFrm, (ops),
- "in{b} {%dx, %al|%AL, %DX}">, Imp<[DX], [AL]>;
+ "in{b} {%dx, %al|%AL, %DX}", []>, Imp<[DX], [AL]>;
def IN16rr : I<0xED, RawFrm, (ops),
- "in{w} {%dx, %ax|%AX, %DX}">, Imp<[DX], [AX]>, OpSize;
+ "in{w} {%dx, %ax|%AX, %DX}", []>, Imp<[DX], [AX]>, OpSize;
def IN32rr : I<0xED, RawFrm, (ops),
- "in{l} {%dx, %eax|%EAX, %DX}">, Imp<[DX],[EAX]>;
+ "in{l} {%dx, %eax|%EAX, %DX}", []>, Imp<[DX],[EAX]>;
def IN8ri : Ii16<0xE4, RawFrm, (ops i16imm:$port),
"in{b} {$port, %al|%AL, $port}", []>, Imp<[], [AL]>;
@@ -319,11 +323,11 @@
"in{l} {$port, %eax|%EAX, $port}", []>, Imp<[],[EAX]>;
def OUT8rr : I<0xEE, RawFrm, (ops),
- "out{b} {%al, %dx|%DX, %AL}">, Imp<[DX, AL], []>;
+ "out{b} {%al, %dx|%DX, %AL}", []>, Imp<[DX, AL], []>;
def OUT16rr : I<0xEF, RawFrm, (ops),
- "out{w} {%ax, %dx|%DX, %AX}">, Imp<[DX, AX], []>, OpSize;
+ "out{w} {%ax, %dx|%DX, %AX}", []>, Imp<[DX, AX], []>, OpSize;
def OUT32rr : I<0xEF, RawFrm, (ops),
- "out{l} {%eax, %dx|%DX, %EAX}">, Imp<[DX, EAX], []>;
+ "out{l} {%eax, %dx|%DX, %EAX}", []>, Imp<[DX, EAX], []>;
def OUT8ir : Ii16<0xE6, RawFrm, (ops i16imm:$port),
"out{b} {%al, $port|$port, %AL}", []>, Imp<[AL], []>;
@@ -336,11 +340,11 @@
// Move Instructions...
//
def MOV8rr : I<0x88, MRMDestReg, (ops R8 :$dst, R8 :$src),
- "mov{b} {$src, $dst|$dst, $src}">;
+ "mov{b} {$src, $dst|$dst, $src}", []>;
def MOV16rr : I<0x89, MRMDestReg, (ops R16:$dst, R16:$src),
- "mov{w} {$src, $dst|$dst, $src}">, OpSize;
+ "mov{w} {$src, $dst|$dst, $src}", []>, OpSize;
def MOV32rr : I<0x89, MRMDestReg, (ops R32:$dst, R32:$src),
- "mov{l} {$src, $dst|$dst, $src}">;
+ "mov{l} {$src, $dst|$dst, $src}", []>;
def MOV8ri : Ii8 <0xB0, AddRegFrm, (ops R8 :$dst, i8imm :$src),
"mov{b} {$src, $dst|$dst, $src}",
[(set R8:$dst, imm:$src)]>;
@@ -358,85 +362,88 @@
"mov{l} {$src, $dst|$dst, $src}", []>;
def MOV8rm : I<0x8A, MRMSrcMem, (ops R8 :$dst, i8mem :$src),
- "mov{b} {$src, $dst|$dst, $src}">;
+ "mov{b} {$src, $dst|$dst, $src}", []>;
def MOV16rm : I<0x8B, MRMSrcMem, (ops R16:$dst, i16mem:$src),
- "mov{w} {$src, $dst|$dst, $src}">, OpSize;
+ "mov{w} {$src, $dst|$dst, $src}", []>, OpSize;
def MOV32rm : I<0x8B, MRMSrcMem, (ops R32:$dst, i32mem:$src),
- "mov{l} {$src, $dst|$dst, $src}">;
+ "mov{l} {$src, $dst|$dst, $src}", []>;
def MOV8mr : I<0x88, MRMDestMem, (ops i8mem :$dst, R8 :$src),
- "mov{b} {$src, $dst|$dst, $src}">;
+ "mov{b} {$src, $dst|$dst, $src}", []>;
def MOV16mr : I<0x89, MRMDestMem, (ops i16mem:$dst, R16:$src),
- "mov{w} {$src, $dst|$dst, $src}">, OpSize;
+ "mov{w} {$src, $dst|$dst, $src}", []>, OpSize;
def MOV32mr : I<0x89, MRMDestMem, (ops i32mem:$dst, R32:$src),
- "mov{l} {$src, $dst|$dst, $src}">;
+ "mov{l} {$src, $dst|$dst, $src}", []>;
//===----------------------------------------------------------------------===//
// Fixed-Register Multiplication and Division Instructions...
//
// Extra precision multiplication
-def MUL8r : I<0xF6, MRM4r, (ops R8:$src), "mul{b} $src">,
+def MUL8r : I<0xF6, MRM4r, (ops R8:$src), "mul{b} $src", []>,
Imp<[AL],[AX]>; // AL,AH = AL*R8
-def MUL16r : I<0xF7, MRM4r, (ops R16:$src), "mul{w} $src">,
+def MUL16r : I<0xF7, MRM4r, (ops R16:$src), "mul{w} $src", []>,
Imp<[AX],[AX,DX]>, OpSize; // AX,DX = AX*R16
-def MUL32r : I<0xF7, MRM4r, (ops R32:$src), "mul{l} $src">,
+def MUL32r : I<0xF7, MRM4r, (ops R32:$src), "mul{l} $src", []>,
Imp<[EAX],[EAX,EDX]>; // EAX,EDX = EAX*R32
def MUL8m : I<0xF6, MRM4m, (ops i8mem :$src),
- "mul{b} $src">, Imp<[AL],[AX]>; // AL,AH = AL*[mem8]
+ "mul{b} $src", []>, Imp<[AL],[AX]>; // AL,AH = AL*[mem8]
def MUL16m : I<0xF7, MRM4m, (ops i16mem:$src),
- "mul{w} $src">, Imp<[AX],[AX,DX]>, OpSize; // AX,DX = AX*[mem16]
+ "mul{w} $src", []>, Imp<[AX],[AX,DX]>,
+ OpSize; // AX,DX = AX*[mem16]
def MUL32m : I<0xF7, MRM4m, (ops i32mem:$src),
- "mul{l} $src">, Imp<[EAX],[EAX,EDX]>; // EAX,EDX = EAX*[mem32]
+ "mul{l} $src", []>, Imp<[EAX],[EAX,EDX]>;// EAX,EDX = EAX*[mem32]
-def IMUL8r : I<0xF6, MRM5r, (ops R8:$src), "imul{b} $src">,
+def IMUL8r : I<0xF6, MRM5r, (ops R8:$src), "imul{b} $src", []>,
Imp<[AL],[AX]>; // AL,AH = AL*R8
-def IMUL16r : I<0xF7, MRM5r, (ops R16:$src), "imul{w} $src">,
+def IMUL16r : I<0xF7, MRM5r, (ops R16:$src), "imul{w} $src", []>,
Imp<[AX],[AX,DX]>, OpSize; // AX,DX = AX*R16
-def IMUL32r : I<0xF7, MRM5r, (ops R32:$src), "imul{l} $src">,
+def IMUL32r : I<0xF7, MRM5r, (ops R32:$src), "imul{l} $src", []>,
Imp<[EAX],[EAX,EDX]>; // EAX,EDX = EAX*R32
def IMUL8m : I<0xF6, MRM5m, (ops i8mem :$src),
- "imul{b} $src">, Imp<[AL],[AX]>; // AL,AH = AL*[mem8]
+ "imul{b} $src", []>, Imp<[AL],[AX]>; // AL,AH = AL*[mem8]
def IMUL16m : I<0xF7, MRM5m, (ops i16mem:$src),
- "imul{w} $src">, Imp<[AX],[AX,DX]>, OpSize;// AX,DX = AX*[mem16]
+ "imul{w} $src", []>, Imp<[AX],[AX,DX]>,
+ OpSize; // AX,DX = AX*[mem16]
def IMUL32m : I<0xF7, MRM5m, (ops i32mem:$src),
- "imul{l} $src">, Imp<[EAX],[EAX,EDX]>; // EAX,EDX = EAX*[mem32]
+ "imul{l} $src", []>,
+ Imp<[EAX],[EAX,EDX]>; // EAX,EDX = EAX*[mem32]
// unsigned division/remainder
def DIV8r : I<0xF6, MRM6r, (ops R8:$src), // AX/r8 = AL,AH
- "div{b} $src">, Imp<[AX],[AX]>;
+ "div{b} $src", []>, Imp<[AX],[AX]>;
def DIV16r : I<0xF7, MRM6r, (ops R16:$src), // DX:AX/r16 = AX,DX
- "div{w} $src">, Imp<[AX,DX],[AX,DX]>, OpSize;
+ "div{w} $src", []>, Imp<[AX,DX],[AX,DX]>, OpSize;
def DIV32r : I<0xF7, MRM6r, (ops R32:$src), // EDX:EAX/r32 = EAX,EDX
- "div{l} $src">, Imp<[EAX,EDX],[EAX,EDX]>;
+ "div{l} $src", []>, Imp<[EAX,EDX],[EAX,EDX]>;
def DIV8m : I<0xF6, MRM6m, (ops i8mem:$src), // AX/[mem8] = AL,AH
- "div{b} $src">, Imp<[AX],[AX]>;
+ "div{b} $src", []>, Imp<[AX],[AX]>;
def DIV16m : I<0xF7, MRM6m, (ops i16mem:$src), // DX:AX/[mem16] = AX,DX
- "div{w} $src">, Imp<[AX,DX],[AX,DX]>, OpSize;
+ "div{w} $src", []>, Imp<[AX,DX],[AX,DX]>, OpSize;
def DIV32m : I<0xF7, MRM6m, (ops i32mem:$src), // EDX:EAX/[mem32] = EAX,EDX
- "div{l} $src">, Imp<[EAX,EDX],[EAX,EDX]>;
+ "div{l} $src", []>, Imp<[EAX,EDX],[EAX,EDX]>;
// Signed division/remainder.
def IDIV8r : I<0xF6, MRM7r, (ops R8:$src), // AX/r8 = AL,AH
- "idiv{b} $src">, Imp<[AX],[AX]>;
+ "idiv{b} $src", []>, Imp<[AX],[AX]>;
def IDIV16r: I<0xF7, MRM7r, (ops R16:$src), // DX:AX/r16 = AX,DX
- "idiv{w} $src">, Imp<[AX,DX],[AX,DX]>, OpSize;
+ "idiv{w} $src", []>, Imp<[AX,DX],[AX,DX]>, OpSize;
def IDIV32r: I<0xF7, MRM7r, (ops R32:$src), // EDX:EAX/r32 = EAX,EDX
- "idiv{l} $src">, Imp<[EAX,EDX],[EAX,EDX]>;
+ "idiv{l} $src", []>, Imp<[EAX,EDX],[EAX,EDX]>;
def IDIV8m : I<0xF6, MRM7m, (ops i8mem:$src), // AX/[mem8] = AL,AH
- "idiv{b} $src">, Imp<[AX],[AX]>;
+ "idiv{b} $src", []>, Imp<[AX],[AX]>;
def IDIV16m: I<0xF7, MRM7m, (ops i16mem:$src), // DX:AX/[mem16] = AX,DX
- "idiv{w} $src">, Imp<[AX,DX],[AX,DX]>, OpSize;
+ "idiv{w} $src", []>, Imp<[AX,DX],[AX,DX]>, OpSize;
def IDIV32m: I<0xF7, MRM7m, (ops i32mem:$src), // EDX:EAX/[mem32] = EAX,EDX
- "idiv{l} $src">, Imp<[EAX,EDX],[EAX,EDX]>;
+ "idiv{l} $src", []>, Imp<[EAX,EDX],[EAX,EDX]>;
// Sign-extenders for division.
def CBW : I<0x98, RawFrm, (ops),
- "{cbtw|cbw}">, Imp<[AL],[AH]>; // AX = signext(AL)
+ "{cbtw|cbw}", []>, Imp<[AL],[AH]>; // AX = signext(AL)
def CWD : I<0x99, RawFrm, (ops),
- "{cwtd|cwd}">, Imp<[AX],[DX]>; // DX:AX = signext(AX)
+ "{cwtd|cwd}", []>, Imp<[AX],[DX]>; // DX:AX = signext(AX)
def CDQ : I<0x99, RawFrm, (ops),
- "{cltd|cdq}">, Imp<[EAX],[EDX]>; // EDX:EAX = signext(EAX)
+ "{cltd|cdq}", []>, Imp<[EAX],[EDX]>; // EDX:EAX = signext(EAX)
//===----------------------------------------------------------------------===//
@@ -447,252 +454,265 @@
// Conditional moves
def CMOVB16rr : I<0x42, MRMSrcReg, // if , TB, OpSize;
+ "cmovb {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVB16rm : I<0x42, MRMSrcMem, // if , TB, OpSize;
+ "cmovb {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVB32rr : I<0x42, MRMSrcReg, // if , TB;
+ "cmovb {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVB32rm : I<0x42, MRMSrcMem, // if , TB;
+ "cmovb {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVAE16rr: I<0x43, MRMSrcReg, // if >=u, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovae {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovae {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVAE16rm: I<0x43, MRMSrcMem, // if >=u, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovae {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovae {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVAE32rr: I<0x43, MRMSrcReg, // if >=u, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovae {$src2, $dst|$dst, $src2}">, TB;
+ "cmovae {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVAE32rm: I<0x43, MRMSrcMem, // if >=u, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovae {$src2, $dst|$dst, $src2}">, TB;
+ "cmovae {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVE16rr : I<0x44, MRMSrcReg, // if ==, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmove {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmove {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVE16rm : I<0x44, MRMSrcMem, // if ==, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmove {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmove {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVE32rr : I<0x44, MRMSrcReg, // if ==, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmove {$src2, $dst|$dst, $src2}">, TB;
+ "cmove {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVE32rm : I<0x44, MRMSrcMem, // if ==, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmove {$src2, $dst|$dst, $src2}">, TB;
+ "cmove {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVNE16rr: I<0x45, MRMSrcReg, // if !=, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovne {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovne {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVNE16rm: I<0x45, MRMSrcMem, // if !=, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovne {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovne {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVNE32rr: I<0x45, MRMSrcReg, // if !=, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovne {$src2, $dst|$dst, $src2}">, TB;
+ "cmovne {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVNE32rm: I<0x45, MRMSrcMem, // if !=, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovne {$src2, $dst|$dst, $src2}">, TB;
+ "cmovne {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVBE16rr: I<0x46, MRMSrcReg, // if <=u, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovbe {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovbe {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVBE16rm: I<0x46, MRMSrcMem, // if <=u, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovbe {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovbe {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVBE32rr: I<0x46, MRMSrcReg, // if <=u, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovbe {$src2, $dst|$dst, $src2}">, TB;
+ "cmovbe {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVBE32rm: I<0x46, MRMSrcMem, // if <=u, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovbe {$src2, $dst|$dst, $src2}">, TB;
+ "cmovbe {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVA16rr : I<0x47, MRMSrcReg, // if >u, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmova {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmova {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVA16rm : I<0x47, MRMSrcMem, // if >u, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmova {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmova {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVA32rr : I<0x47, MRMSrcReg, // if >u, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmova {$src2, $dst|$dst, $src2}">, TB;
+ "cmova {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVA32rm : I<0x47, MRMSrcMem, // if >u, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmova {$src2, $dst|$dst, $src2}">, TB;
+ "cmova {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVS16rr : I<0x48, MRMSrcReg, // if signed, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovs {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovs {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVS16rm : I<0x48, MRMSrcMem, // if signed, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovs {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovs {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVS32rr : I<0x48, MRMSrcReg, // if signed, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovs {$src2, $dst|$dst, $src2}">, TB;
+ "cmovs {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVS32rm : I<0x48, MRMSrcMem, // if signed, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovs {$src2, $dst|$dst, $src2}">, TB;
+ "cmovs {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVNS16rr: I<0x49, MRMSrcReg, // if !signed, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovns {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovns {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVNS16rm: I<0x49, MRMSrcMem, // if !signed, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovns {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovns {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVNS32rr: I<0x49, MRMSrcReg, // if !signed, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovns {$src2, $dst|$dst, $src2}">, TB;
+ "cmovns {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVNS32rm: I<0x49, MRMSrcMem, // if !signed, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovns {$src2, $dst|$dst, $src2}">, TB;
+ "cmovns {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVP16rr : I<0x4A, MRMSrcReg, // if parity, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovp {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovp {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVP16rm : I<0x4A, MRMSrcMem, // if parity, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovp {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovp {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVP32rr : I<0x4A, MRMSrcReg, // if parity, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovp {$src2, $dst|$dst, $src2}">, TB;
+ "cmovp {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVP32rm : I<0x4A, MRMSrcMem, // if parity, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovp {$src2, $dst|$dst, $src2}">, TB;
+ "cmovp {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVNP16rr : I<0x4B, MRMSrcReg, // if !parity, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovnp {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovnp {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVNP16rm : I<0x4B, MRMSrcMem, // if !parity, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovnp {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovnp {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVNP32rr : I<0x4B, MRMSrcReg, // if !parity, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovnp {$src2, $dst|$dst, $src2}">, TB;
+ "cmovnp {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVNP32rm : I<0x4B, MRMSrcMem, // if !parity, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovnp {$src2, $dst|$dst, $src2}">, TB;
+ "cmovnp {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVL16rr : I<0x4C, MRMSrcReg, // if , TB, OpSize;
+ "cmovl {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVL16rm : I<0x4C, MRMSrcMem, // if , TB, OpSize;
+ "cmovl {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVL32rr : I<0x4C, MRMSrcReg, // if , TB;
+ "cmovl {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVL32rm : I<0x4C, MRMSrcMem, // if , TB;
+ "cmovl {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVGE16rr: I<0x4D, MRMSrcReg, // if >=s, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovge {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovge {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVGE16rm: I<0x4D, MRMSrcMem, // if >=s, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovge {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovge {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVGE32rr: I<0x4D, MRMSrcReg, // if >=s, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovge {$src2, $dst|$dst, $src2}">, TB;
+ "cmovge {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVGE32rm: I<0x4D, MRMSrcMem, // if >=s, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovge {$src2, $dst|$dst, $src2}">, TB;
+ "cmovge {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVLE16rr: I<0x4E, MRMSrcReg, // if <=s, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovle {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovle {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVLE16rm: I<0x4E, MRMSrcMem, // if <=s, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovle {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovle {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVLE32rr: I<0x4E, MRMSrcReg, // if <=s, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovle {$src2, $dst|$dst, $src2}">, TB;
+ "cmovle {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVLE32rm: I<0x4E, MRMSrcMem, // if <=s, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovle {$src2, $dst|$dst, $src2}">, TB;
+ "cmovle {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVG16rr : I<0x4F, MRMSrcReg, // if >s, R16 = R16
(ops R16:$dst, R16:$src1, R16:$src2),
- "cmovg {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovg {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVG16rm : I<0x4F, MRMSrcMem, // if >s, R16 = [mem16]
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "cmovg {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "cmovg {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def CMOVG32rr : I<0x4F, MRMSrcReg, // if >s, R32 = R32
(ops R32:$dst, R32:$src1, R32:$src2),
- "cmovg {$src2, $dst|$dst, $src2}">, TB;
+ "cmovg {$src2, $dst|$dst, $src2}", []>, TB;
def CMOVG32rm : I<0x4F, MRMSrcMem, // if >s, R32 = [mem32]
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "cmovg {$src2, $dst|$dst, $src2}">, TB;
+ "cmovg {$src2, $dst|$dst, $src2}", []>, TB;
// unary instructions
-def NEG8r : I<0xF6, MRM3r, (ops R8 :$dst, R8 :$src), "neg{b} $dst">;
-def NEG16r : I<0xF7, MRM3r, (ops R16:$dst, R16:$src), "neg{w} $dst">, OpSize;
-def NEG32r : I<0xF7, MRM3r, (ops R32:$dst, R32:$src), "neg{l} $dst">;
+def NEG8r : I<0xF6, MRM3r, (ops R8 :$dst, R8 :$src), "neg{b} $dst",
+ [(set R8:$dst, (ineg R8:$src))]>;
+def NEG16r : I<0xF7, MRM3r, (ops R16:$dst, R16:$src), "neg{w} $dst",
+ [(set R16:$dst, (ineg R16:$src))]>, OpSize;
+def NEG32r : I<0xF7, MRM3r, (ops R32:$dst, R32:$src), "neg{l} $dst",
+ [(set R32:$dst, (ineg R32:$src))]>;
let isTwoAddress = 0 in {
- def NEG8m : I<0xF6, MRM3m, (ops i8mem :$dst), "neg{b} $dst">;
- def NEG16m : I<0xF7, MRM3m, (ops i16mem:$dst), "neg{w} $dst">, OpSize;
- def NEG32m : I<0xF7, MRM3m, (ops i32mem:$dst), "neg{l} $dst">;
+ def NEG8m : I<0xF6, MRM3m, (ops i8mem :$dst), "neg{b} $dst", []>;
+ def NEG16m : I<0xF7, MRM3m, (ops i16mem:$dst), "neg{w} $dst", []>, OpSize;
+ def NEG32m : I<0xF7, MRM3m, (ops i32mem:$dst), "neg{l} $dst", []>;
}
-def NOT8r : I<0xF6, MRM2r, (ops R8 :$dst, R8 :$src), "not{b} $dst">;
-def NOT16r : I<0xF7, MRM2r, (ops R16:$dst, R16:$src), "not{w} $dst">, OpSize;
-def NOT32r : I<0xF7, MRM2r, (ops R32:$dst, R32:$src), "not{l} $dst">;
+def NOT8r : I<0xF6, MRM2r, (ops R8 :$dst, R8 :$src), "not{b} $dst",
+ [(set R8:$dst, (not R8:$src))]>;
+def NOT16r : I<0xF7, MRM2r, (ops R16:$dst, R16:$src), "not{w} $dst",
+ [(set R16:$dst, (not R16:$src))]>, OpSize;
+def NOT32r : I<0xF7, MRM2r, (ops R32:$dst, R32:$src), "not{l} $dst",
+ [(set R32:$dst, (not R32:$src))]>;
let isTwoAddress = 0 in {
- def NOT8m : I<0xF6, MRM2m, (ops i8mem :$dst), "not{b} $dst">;
- def NOT16m : I<0xF7, MRM2m, (ops i16mem:$dst), "not{w} $dst">, OpSize;
- def NOT32m : I<0xF7, MRM2m, (ops i32mem:$dst), "not{l} $dst">;
+ def NOT8m : I<0xF6, MRM2m, (ops i8mem :$dst), "not{b} $dst", []>;
+ def NOT16m : I<0xF7, MRM2m, (ops i16mem:$dst), "not{w} $dst", []>, OpSize;
+ def NOT32m : I<0xF7, MRM2m, (ops i32mem:$dst), "not{l} $dst", []>;
}
-def INC8r : I<0xFE, MRM0r, (ops R8 :$dst, R8 :$src), "inc{b} $dst">;
+def INC8r : I<0xFE, MRM0r, (ops R8 :$dst, R8 :$src), "inc{b} $dst",
+ [(set R8:$dst, (add R8:$src, 1))]>;
let isConvertibleToThreeAddress = 1 in { // Can transform into LEA.
-def INC16r : I<0xFF, MRM0r, (ops R16:$dst, R16:$src), "inc{w} $dst">, OpSize;
-def INC32r : I<0xFF, MRM0r, (ops R32:$dst, R32:$src), "inc{l} $dst">;
+def INC16r : I<0xFF, MRM0r, (ops R16:$dst, R16:$src), "inc{w} $dst",
+ [(set R16:$dst, (add R16:$src, 1))]>, OpSize;
+def INC32r : I<0xFF, MRM0r, (ops R32:$dst, R32:$src), "inc{l} $dst",
+ [(set R32:$dst, (add R32:$src, 1))]>;
}
let isTwoAddress = 0 in {
- def INC8m : I<0xFE, MRM0m, (ops i8mem :$dst), "inc{b} $dst">;
- def INC16m : I<0xFF, MRM0m, (ops i16mem:$dst), "inc{w} $dst">, OpSize;
- def INC32m : I<0xFF, MRM0m, (ops i32mem:$dst), "inc{l} $dst">;
+ def INC8m : I<0xFE, MRM0m, (ops i8mem :$dst), "inc{b} $dst", []>;
+ def INC16m : I<0xFF, MRM0m, (ops i16mem:$dst), "inc{w} $dst", []>, OpSize;
+ def INC32m : I<0xFF, MRM0m, (ops i32mem:$dst), "inc{l} $dst", []>;
}
-def DEC8r : I<0xFE, MRM1r, (ops R8 :$dst, R8 :$src), "dec{b} $dst">;
+def DEC8r : I<0xFE, MRM1r, (ops R8 :$dst, R8 :$src), "dec{b} $dst", []>;
let isConvertibleToThreeAddress = 1 in { // Can transform into LEA.
-def DEC16r : I<0xFF, MRM1r, (ops R16:$dst, R16:$src), "dec{w} $dst">, OpSize;
-def DEC32r : I<0xFF, MRM1r, (ops R32:$dst, R32:$src), "dec{l} $dst">;
+def DEC16r : I<0xFF, MRM1r, (ops R16:$dst, R16:$src), "dec{w} $dst", []>,
+ OpSize;
+def DEC32r : I<0xFF, MRM1r, (ops R32:$dst, R32:$src), "dec{l} $dst", []>;
}
let isTwoAddress = 0 in {
- def DEC8m : I<0xFE, MRM1m, (ops i8mem :$dst), "dec{b} $dst">;
- def DEC16m : I<0xFF, MRM1m, (ops i16mem:$dst), "dec{w} $dst">, OpSize;
- def DEC32m : I<0xFF, MRM1m, (ops i32mem:$dst), "dec{l} $dst">;
+ def DEC8m : I<0xFE, MRM1m, (ops i8mem :$dst), "dec{b} $dst", []>;
+ def DEC16m : I<0xFF, MRM1m, (ops i16mem:$dst), "dec{w} $dst", []>, OpSize;
+ def DEC32m : I<0xFF, MRM1m, (ops i32mem:$dst), "dec{l} $dst", []>;
}
// Logical operators...
let isCommutable = 1 in { // X = AND Y, Z --> X = AND Z, Y
def AND8rr : I<0x20, MRMDestReg,
(ops R8 :$dst, R8 :$src1, R8 :$src2),
- "and{b} {$src2, $dst|$dst, $src2}">;
+ "and{b} {$src2, $dst|$dst, $src2}",
+ [(set R8:$dst, (and R8:$src1, R8:$src2))]>;
def AND16rr : I<0x21, MRMDestReg,
(ops R16:$dst, R16:$src1, R16:$src2),
- "and{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "and{w} {$src2, $dst|$dst, $src2}",
+ [(set R16:$dst, (and R16:$src1, R16:$src2))]>, OpSize;
def AND32rr : I<0x21, MRMDestReg,
(ops R32:$dst, R32:$src1, R32:$src2),
- "and{l} {$src2, $dst|$dst, $src2}">;
+ "and{l} {$src2, $dst|$dst, $src2}",
+ [(set R32:$dst, (and R32:$src1, R32:$src2))]>;
}
def AND8rm : I<0x22, MRMSrcMem,
(ops R8 :$dst, R8 :$src1, i8mem :$src2),
- "and{b} {$src2, $dst|$dst, $src2}">;
+ "and{b} {$src2, $dst|$dst, $src2}",[]>;
def AND16rm : I<0x23, MRMSrcMem,
(ops R16:$dst, R16:$src1, i16mem:$src2),
- "and{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "and{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def AND32rm : I<0x23, MRMSrcMem,
(ops R32:$dst, R32:$src1, i32mem:$src2),
- "and{l} {$src2, $dst|$dst, $src2}">;
+ "and{l} {$src2, $dst|$dst, $src2}", []>;
def AND8ri : Ii8<0x80, MRM4r,
(ops R8 :$dst, R8 :$src1, i8imm :$src2),
@@ -718,13 +738,13 @@
let isTwoAddress = 0 in {
def AND8mr : I<0x20, MRMDestMem,
(ops i8mem :$dst, R8 :$src),
- "and{b} {$src, $dst|$dst, $src}">;
+ "and{b} {$src, $dst|$dst, $src}", []>;
def AND16mr : I<0x21, MRMDestMem,
(ops i16mem:$dst, R16:$src),
- "and{w} {$src, $dst|$dst, $src}">, OpSize;
+ "and{w} {$src, $dst|$dst, $src}", []>, OpSize;
def AND32mr : I<0x21, MRMDestMem,
(ops i32mem:$dst, R32:$src),
- "and{l} {$src, $dst|$dst, $src}">;
+ "and{l} {$src, $dst|$dst, $src}", []>;
def AND8mi : Ii8<0x80, MRM4m,
(ops i8mem :$dst, i8imm :$src),
"and{b} {$src, $dst|$dst, $src}", []>;
@@ -745,18 +765,21 @@
let isCommutable = 1 in { // X = OR Y, Z --> X = OR Z, Y
def OR8rr : I<0x08, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2),
- "or{b} {$src2, $dst|$dst, $src2}">;
+ "or{b} {$src2, $dst|$dst, $src2}",
+ [(set R8:$dst, (or R8:$src1, R8:$src2))]>;
def OR16rr : I<0x09, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2),
- "or{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "or{w} {$src2, $dst|$dst, $src2}",
+ [(set R16:$dst, (or R16:$src1, R16:$src2))]>, OpSize;
def OR32rr : I<0x09, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "or{l} {$src2, $dst|$dst, $src2}">;
+ "or{l} {$src2, $dst|$dst, $src2}",
+ [(set R32:$dst, (or R32:$src1, R32:$src2))]>;
}
def OR8rm : I<0x0A, MRMSrcMem , (ops R8 :$dst, R8 :$src1, i8mem :$src2),
- "or{b} {$src2, $dst|$dst, $src2}">;
+ "or{b} {$src2, $dst|$dst, $src2}", []>;
def OR16rm : I<0x0B, MRMSrcMem , (ops R16:$dst, R16:$src1, i16mem:$src2),
- "or{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "or{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def OR32rm : I<0x0B, MRMSrcMem , (ops R32:$dst, R32:$src1, i32mem:$src2),
- "or{l} {$src2, $dst|$dst, $src2}">;
+ "or{l} {$src2, $dst|$dst, $src2}", []>;
def OR8ri : Ii8 <0x80, MRM1r, (ops R8 :$dst, R8 :$src1, i8imm:$src2),
"or{b} {$src2, $dst|$dst, $src2}",
@@ -776,11 +799,11 @@
[(set R32:$dst, (or R32:$src1, immSExt8:$src2))]>;
let isTwoAddress = 0 in {
def OR8mr : I<0x08, MRMDestMem, (ops i8mem:$dst, R8:$src),
- "or{b} {$src, $dst|$dst, $src}">;
+ "or{b} {$src, $dst|$dst, $src}", []>;
def OR16mr : I<0x09, MRMDestMem, (ops i16mem:$dst, R16:$src),
- "or{w} {$src, $dst|$dst, $src}">, OpSize;
+ "or{w} {$src, $dst|$dst, $src}", []>, OpSize;
def OR32mr : I<0x09, MRMDestMem, (ops i32mem:$dst, R32:$src),
- "or{l} {$src, $dst|$dst, $src}">;
+ "or{l} {$src, $dst|$dst, $src}", []>;
def OR8mi : Ii8<0x80, MRM1m, (ops i8mem :$dst, i8imm:$src),
"or{b} {$src, $dst|$dst, $src}", []>;
def OR16mi : Ii16<0x81, MRM1m, (ops i16mem:$dst, i16imm:$src),
@@ -797,24 +820,27 @@
let isCommutable = 1 in { // X = XOR Y, Z --> X = XOR Z, Y
def XOR8rr : I<0x30, MRMDestReg,
(ops R8 :$dst, R8 :$src1, R8 :$src2),
- "xor{b} {$src2, $dst|$dst, $src2}">;
+ "xor{b} {$src2, $dst|$dst, $src2}",
+ [(set R8:$dst, (xor R8:$src1, R8:$src2))]>;
def XOR16rr : I<0x31, MRMDestReg,
(ops R16:$dst, R16:$src1, R16:$src2),
- "xor{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "xor{w} {$src2, $dst|$dst, $src2}",
+ [(set R16:$dst, (xor R16:$src1, R16:$src2))]>, OpSize;
def XOR32rr : I<0x31, MRMDestReg,
(ops R32:$dst, R32:$src1, R32:$src2),
- "xor{l} {$src2, $dst|$dst, $src2}">;
+ "xor{l} {$src2, $dst|$dst, $src2}",
+ [(set R32:$dst, (xor R32:$src1, R32:$src2))]>;
}
def XOR8rm : I<0x32, MRMSrcMem ,
(ops R8 :$dst, R8:$src1, i8mem :$src2),
- "xor{b} {$src2, $dst|$dst, $src2}">;
+ "xor{b} {$src2, $dst|$dst, $src2}", []>;
def XOR16rm : I<0x33, MRMSrcMem ,
(ops R16:$dst, R8:$src1, i16mem:$src2),
- "xor{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "xor{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def XOR32rm : I<0x33, MRMSrcMem ,
(ops R32:$dst, R8:$src1, i32mem:$src2),
- "xor{l} {$src2, $dst|$dst, $src2}">;
+ "xor{l} {$src2, $dst|$dst, $src2}", []>;
def XOR8ri : Ii8<0x80, MRM6r,
(ops R8:$dst, R8:$src1, i8imm:$src2),
@@ -839,13 +865,13 @@
let isTwoAddress = 0 in {
def XOR8mr : I<0x30, MRMDestMem,
(ops i8mem :$dst, R8 :$src),
- "xor{b} {$src, $dst|$dst, $src}">;
+ "xor{b} {$src, $dst|$dst, $src}", []>;
def XOR16mr : I<0x31, MRMDestMem,
(ops i16mem:$dst, R16:$src),
- "xor{w} {$src, $dst|$dst, $src}">, OpSize;
+ "xor{w} {$src, $dst|$dst, $src}", []>, OpSize;
def XOR32mr : I<0x31, MRMDestMem,
(ops i32mem:$dst, R32:$src),
- "xor{l} {$src, $dst|$dst, $src}">;
+ "xor{l} {$src, $dst|$dst, $src}", []>;
def XOR8mi : Ii8<0x80, MRM6m,
(ops i8mem :$dst, i8imm :$src),
"xor{b} {$src, $dst|$dst, $src}", []>;
@@ -866,11 +892,11 @@
// Shift instructions
// FIXME: provide shorter instructions when imm8 == 1
def SHL8rCL : I<0xD2, MRM4r, (ops R8 :$dst, R8 :$src),
- "shl{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shl{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHL16rCL : I<0xD3, MRM4r, (ops R16:$dst, R16:$src),
- "shl{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "shl{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def SHL32rCL : I<0xD3, MRM4r, (ops R32:$dst, R32:$src),
- "shl{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shl{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHL8ri : Ii8<0xC0, MRM4r, (ops R8 :$dst, R8 :$src1, i8imm:$src2),
"shl{b} {$src2, $dst|$dst, $src2}",
@@ -886,25 +912,25 @@
let isTwoAddress = 0 in {
def SHL8mCL : I<0xD2, MRM4m, (ops i8mem :$dst),
- "shl{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shl{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHL16mCL : I<0xD3, MRM4m, (ops i16mem:$dst),
- "shl{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "shl{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def SHL32mCL : I<0xD3, MRM4m, (ops i32mem:$dst),
- "shl{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shl{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHL8mi : Ii8<0xC0, MRM4m, (ops i8mem :$dst, i8imm:$src),
- "shl{b} {$src, $dst|$dst, $src}", []>;
+ "shl{b} {$src, $dst|$dst, $src}, []", []>;
def SHL16mi : Ii8<0xC1, MRM4m, (ops i16mem:$dst, i8imm:$src),
- "shl{w} {$src, $dst|$dst, $src}", []>, OpSize;
+ "shl{w} {$src, $dst|$dst, $src}, []", []>, OpSize;
def SHL32mi : Ii8<0xC1, MRM4m, (ops i32mem:$dst, i8imm:$src),
- "shl{l} {$src, $dst|$dst, $src}", []>;
+ "shl{l} {$src, $dst|$dst, $src}, []", []>;
}
def SHR8rCL : I<0xD2, MRM5r, (ops R8 :$dst, R8 :$src),
- "shr{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shr{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHR16rCL : I<0xD3, MRM5r, (ops R16:$dst, R16:$src),
- "shr{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "shr{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def SHR32rCL : I<0xD3, MRM5r, (ops R32:$dst, R32:$src),
- "shr{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shr{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHR8ri : Ii8<0xC0, MRM5r, (ops R8:$dst, R8:$src1, i8imm:$src2),
"shr{b} {$src2, $dst|$dst, $src2}",
@@ -918,11 +944,11 @@
let isTwoAddress = 0 in {
def SHR8mCL : I<0xD2, MRM5m, (ops i8mem :$dst),
- "shr{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shr{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHR16mCL : I<0xD3, MRM5m, (ops i16mem:$dst),
- "shr{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "shr{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def SHR32mCL : I<0xD3, MRM5m, (ops i32mem:$dst),
- "shr{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "shr{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHR8mi : Ii8<0xC0, MRM5m, (ops i8mem :$dst, i8imm:$src),
"shr{b} {$src, $dst|$dst, $src}", []>;
def SHR16mi : Ii8<0xC1, MRM5m, (ops i16mem:$dst, i8imm:$src),
@@ -932,11 +958,11 @@
}
def SAR8rCL : I<0xD2, MRM7r, (ops R8 :$dst, R8 :$src),
- "sar{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "sar{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SAR16rCL : I<0xD3, MRM7r, (ops R16:$dst, R16:$src),
- "sar{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "sar{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def SAR32rCL : I<0xD3, MRM7r, (ops R32:$dst, R32:$src),
- "sar{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "sar{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SAR8ri : Ii8<0xC0, MRM7r, (ops R8 :$dst, R8 :$src1, i8imm:$src2),
"sar{b} {$src2, $dst|$dst, $src2}",
@@ -949,11 +975,11 @@
[(set R32:$dst, (sra R32:$src1, immSExt8:$src2))]>;
let isTwoAddress = 0 in {
def SAR8mCL : I<0xD2, MRM7m, (ops i8mem :$dst),
- "sar{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "sar{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SAR16mCL : I<0xD3, MRM7m, (ops i16mem:$dst),
- "sar{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "sar{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def SAR32mCL : I<0xD3, MRM7m, (ops i32mem:$dst),
- "sar{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "sar{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SAR8mi : Ii8<0xC0, MRM7m, (ops i8mem :$dst, i8imm:$src),
"sar{b} {$src, $dst|$dst, $src}", []>;
def SAR16mi : Ii8<0xC1, MRM7m, (ops i16mem:$dst, i8imm:$src),
@@ -965,11 +991,11 @@
// Rotate instructions
// FIXME: provide shorter instructions when imm8 == 1
def ROL8rCL : I<0xD2, MRM0r, (ops R8 :$dst, R8 :$src),
- "rol{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "rol{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROL16rCL : I<0xD3, MRM0r, (ops R16:$dst, R16:$src),
- "rol{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "rol{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def ROL32rCL : I<0xD3, MRM0r, (ops R32:$dst, R32:$src),
- "rol{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "rol{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROL8ri : Ii8<0xC0, MRM0r, (ops R8 :$dst, R8 :$src1, i8imm:$src2),
"rol{b} {$src2, $dst|$dst, $src2}", []>;
@@ -980,11 +1006,11 @@
let isTwoAddress = 0 in {
def ROL8mCL : I<0xD2, MRM0m, (ops i8mem :$dst),
- "rol{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "rol{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROL16mCL : I<0xD3, MRM0m, (ops i16mem:$dst),
- "rol{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "rol{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def ROL32mCL : I<0xD3, MRM0m, (ops i32mem:$dst),
- "rol{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "rol{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROL8mi : Ii8<0xC0, MRM0m, (ops i8mem :$dst, i8imm:$src),
"rol{b} {$src, $dst|$dst, $src}", []>;
def ROL16mi : Ii8<0xC1, MRM0m, (ops i16mem:$dst, i8imm:$src),
@@ -994,11 +1020,11 @@
}
def ROR8rCL : I<0xD2, MRM1r, (ops R8 :$dst, R8 :$src),
- "ror{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "ror{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROR16rCL : I<0xD3, MRM1r, (ops R16:$dst, R16:$src),
- "ror{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "ror{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def ROR32rCL : I<0xD3, MRM1r, (ops R32:$dst, R32:$src),
- "ror{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "ror{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROR8ri : Ii8<0xC0, MRM1r, (ops R8 :$dst, R8 :$src1, i8imm:$src2),
"ror{b} {$src2, $dst|$dst, $src2}", []>;
@@ -1008,11 +1034,11 @@
"ror{l} {$src2, $dst|$dst, $src2}", []>;
let isTwoAddress = 0 in {
def ROR8mCL : I<0xD2, MRM1m, (ops i8mem :$dst),
- "ror{b} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "ror{b} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROR16mCL : I<0xD3, MRM1m, (ops i16mem:$dst),
- "ror{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize;
+ "ror{w} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>, OpSize;
def ROR32mCL : I<0xD3, MRM1m, (ops i32mem:$dst),
- "ror{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>;
+ "ror{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def ROR8mi : Ii8<0xC0, MRM1m, (ops i8mem :$dst, i8imm:$src),
"ror{b} {$src, $dst|$dst, $src}", []>;
def ROR16mi : Ii8<0xC1, MRM1m, (ops i16mem:$dst, i8imm:$src),
@@ -1026,16 +1052,16 @@
// Double shift instructions (generalizations of rotate)
def SHLD32rrCL : I<0xA5, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "shld{l} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shld{l} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB;
def SHRD32rrCL : I<0xAD, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "shrd{l} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shrd{l} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB;
def SHLD16rrCL : I<0xA5, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2),
- "shld{w} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shld{w} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB, OpSize;
def SHRD16rrCL : I<0xAD, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2),
- "shrd{w} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shrd{w} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB, OpSize;
let isCommutable = 1 in { // These instructions commute to each other.
@@ -1057,10 +1083,10 @@
let isTwoAddress = 0 in {
def SHLD32mrCL : I<0xA5, MRMDestMem, (ops i32mem:$dst, R32:$src2),
- "shld{l} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shld{l} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB;
def SHRD32mrCL : I<0xAD, MRMDestMem, (ops i32mem:$dst, R32:$src2),
- "shrd{l} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shrd{l} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB;
def SHLD32mri8 : Ii8<0xA4, MRMDestMem,
(ops i32mem:$dst, R32:$src2, i8imm:$src3),
@@ -1072,10 +1098,10 @@
TB;
def SHLD16mrCL : I<0xA5, MRMDestMem, (ops i16mem:$dst, R16:$src2),
- "shld{w} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shld{w} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB, OpSize;
def SHRD16mrCL : I<0xAD, MRMDestMem, (ops i16mem:$dst, R16:$src2),
- "shrd{w} {%cl, $src2, $dst|$dst, $src2, %CL}">,
+ "shrd{w} {%cl, $src2, $dst|$dst, $src2, %CL}", []>,
Imp<[CL],[]>, TB, OpSize;
def SHLD16mri8 : Ii8<0xA4, MRMDestMem,
(ops i16mem:$dst, R16:$src2, i8imm:$src3),
@@ -1091,20 +1117,23 @@
// Arithmetic.
let isCommutable = 1 in { // X = ADD Y, Z --> X = ADD Z, Y
def ADD8rr : I<0x00, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2),
- "add{b} {$src2, $dst|$dst, $src2}">;
+ "add{b} {$src2, $dst|$dst, $src2}",
+ [(set R8:$dst, (add R8:$src1, R8:$src2))]>;
let isConvertibleToThreeAddress = 1 in { // Can transform into LEA.
def ADD16rr : I<0x01, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2),
- "add{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "add{w} {$src2, $dst|$dst, $src2}",
+ [(set R16:$dst, (add R16:$src1, R16:$src2))]>, OpSize;
def ADD32rr : I<0x01, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "add{l} {$src2, $dst|$dst, $src2}">;
+ "add{l} {$src2, $dst|$dst, $src2}",
+ [(set R32:$dst, (add R32:$src1, R32:$src2))]>;
} // end isConvertibleToThreeAddress
} // end isCommutable
def ADD8rm : I<0x02, MRMSrcMem, (ops R8 :$dst, R8 :$src1, i8mem :$src2),
- "add{b} {$src2, $dst|$dst, $src2}">;
+ "add{b} {$src2, $dst|$dst, $src2}", []>;
def ADD16rm : I<0x03, MRMSrcMem, (ops R16:$dst, R16:$src1, i16mem:$src2),
- "add{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "add{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def ADD32rm : I<0x03, MRMSrcMem, (ops R32:$dst, R32:$src1, i32mem:$src2),
- "add{l} {$src2, $dst|$dst, $src2}">;
+ "add{l} {$src2, $dst|$dst, $src2}", []>;
def ADD8ri : Ii8<0x80, MRM0r, (ops R8:$dst, R8:$src1, i8imm:$src2),
"add{b} {$src2, $dst|$dst, $src2}",
@@ -1129,11 +1158,11 @@
let isTwoAddress = 0 in {
def ADD8mr : I<0x00, MRMDestMem, (ops i8mem :$dst, R8 :$src2),
- "add{b} {$src2, $dst|$dst, $src2}">;
+ "add{b} {$src2, $dst|$dst, $src2}", []>;
def ADD16mr : I<0x01, MRMDestMem, (ops i16mem:$dst, R16:$src2),
- "add{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "add{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def ADD32mr : I<0x01, MRMDestMem, (ops i32mem:$dst, R32:$src2),
- "add{l} {$src2, $dst|$dst, $src2}">;
+ "add{l} {$src2, $dst|$dst, $src2}", []>;
def ADD8mi : Ii8<0x80, MRM0m, (ops i8mem :$dst, i8imm :$src2),
"add{b} {$src2, $dst|$dst, $src2}", []>;
def ADD16mi : Ii16<0x81, MRM0m, (ops i16mem:$dst, i16imm:$src2),
@@ -1148,10 +1177,10 @@
let isCommutable = 1 in { // X = ADC Y, Z --> X = ADC Z, Y
def ADC32rr : I<0x11, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "adc{l} {$src2, $dst|$dst, $src2}">;
+ "adc{l} {$src2, $dst|$dst, $src2}", []>;
}
def ADC32rm : I<0x13, MRMSrcMem , (ops R32:$dst, R32:$src1, i32mem:$src2),
- "adc{l} {$src2, $dst|$dst, $src2}">;
+ "adc{l} {$src2, $dst|$dst, $src2}", []>;
def ADC32ri : Ii32<0x81, MRM2r, (ops R32:$dst, R32:$src1, i32imm:$src2),
"adc{l} {$src2, $dst|$dst, $src2}", []>;
def ADC32ri8 : Ii8<0x83, MRM2r, (ops R32:$dst, R32:$src1, i8imm:$src2),
@@ -1159,7 +1188,7 @@
let isTwoAddress = 0 in {
def ADC32mr : I<0x11, MRMDestMem, (ops i32mem:$dst, R32:$src2),
- "adc{l} {$src2, $dst|$dst, $src2}">;
+ "adc{l} {$src2, $dst|$dst, $src2}", []>;
def ADC32mi : Ii32<0x81, MRM2m, (ops i32mem:$dst, i32imm:$src2),
"adc{l} {$src2, $dst|$dst, $src2}", []>;
def ADC32mi8 : Ii8<0x83, MRM2m, (ops i32mem:$dst, i8imm :$src2),
@@ -1167,17 +1196,20 @@
}
def SUB8rr : I<0x28, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2),
- "sub{b} {$src2, $dst|$dst, $src2}">;
+ "sub{b} {$src2, $dst|$dst, $src2}",
+ [(set R8:$dst, (sub R8:$src1, R8:$src2))]>;
def SUB16rr : I<0x29, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2),
- "sub{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "sub{w} {$src2, $dst|$dst, $src2}",
+ [(set R16:$dst, (sub R16:$src1, R16:$src2))]>, OpSize;
def SUB32rr : I<0x29, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "sub{l} {$src2, $dst|$dst, $src2}">;
+ "sub{l} {$src2, $dst|$dst, $src2}",
+ [(set R32:$dst, (sub R32:$src1, R32:$src2))]>;
def SUB8rm : I<0x2A, MRMSrcMem, (ops R8 :$dst, R8 :$src1, i8mem :$src2),
- "sub{b} {$src2, $dst|$dst, $src2}">;
+ "sub{b} {$src2, $dst|$dst, $src2}", []>;
def SUB16rm : I<0x2B, MRMSrcMem, (ops R16:$dst, R16:$src1, i16mem:$src2),
- "sub{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "sub{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def SUB32rm : I<0x2B, MRMSrcMem, (ops R32:$dst, R32:$src1, i32mem:$src2),
- "sub{l} {$src2, $dst|$dst, $src2}">;
+ "sub{l} {$src2, $dst|$dst, $src2}", []>;
def SUB8ri : Ii8 <0x80, MRM5r, (ops R8:$dst, R8:$src1, i8imm:$src2),
"sub{b} {$src2, $dst|$dst, $src2}",
@@ -1196,11 +1228,11 @@
[(set R32:$dst, (sub R32:$src1, immSExt8:$src2))]>;
let isTwoAddress = 0 in {
def SUB8mr : I<0x28, MRMDestMem, (ops i8mem :$dst, R8 :$src2),
- "sub{b} {$src2, $dst|$dst, $src2}">;
+ "sub{b} {$src2, $dst|$dst, $src2}", []>;
def SUB16mr : I<0x29, MRMDestMem, (ops i16mem:$dst, R16:$src2),
- "sub{w} {$src2, $dst|$dst, $src2}">, OpSize;
+ "sub{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def SUB32mr : I<0x29, MRMDestMem, (ops i32mem:$dst, R32:$src2),
- "sub{l} {$src2, $dst|$dst, $src2}">;
+ "sub{l} {$src2, $dst|$dst, $src2}", []>;
def SUB8mi : Ii8<0x80, MRM5m, (ops i8mem :$dst, i8imm:$src2),
"sub{b} {$src2, $dst|$dst, $src2}", []>;
def SUB16mi : Ii16<0x81, MRM5m, (ops i16mem:$dst, i16imm:$src2),
@@ -1214,11 +1246,11 @@
}
def SBB32rr : I<0x19, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "sbb{l} {$src2, $dst|$dst, $src2}">;
+ "sbb{l} {$src2, $dst|$dst, $src2}", []>;
let isTwoAddress = 0 in {
def SBB32mr : I<0x19, MRMDestMem, (ops i32mem:$dst, R32:$src2),
- "sbb{l} {$src2, $dst|$dst, $src2}">;
+ "sbb{l} {$src2, $dst|$dst, $src2}", []>;
def SBB8mi : Ii32<0x80, MRM3m, (ops i8mem:$dst, i8imm:$src2),
"sbb{b} {$src2, $dst|$dst, $src2}", []>;
def SBB16mi : Ii32<0x81, MRM3m, (ops i16mem:$dst, i16imm:$src2),
@@ -1236,7 +1268,7 @@
"sbb{w} {$src2, $dst|$dst, $src2}", []>, OpSize;
def SBB32rm : I<0x1B, MRMSrcMem, (ops R32:$dst, R32:$src1, i32mem:$src2),
- "sbb{l} {$src2, $dst|$dst, $src2}">;
+ "sbb{l} {$src2, $dst|$dst, $src2}", []>;
def SBB32ri : Ii32<0x81, MRM3r, (ops R32:$dst, R32:$src1, i32imm:$src2),
"sbb{l} {$src2, $dst|$dst, $src2}", []>;
@@ -1247,14 +1279,16 @@
let isCommutable = 1 in { // X = IMUL Y, Z --> X = IMUL Z, Y
def IMUL16rr : I<0xAF, MRMSrcReg, (ops R16:$dst, R16:$src1, R16:$src2),
- "imul{w} {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "imul{w} {$src2, $dst|$dst, $src2}",
+ [(set R16:$dst, (mul R16:$src1, R16:$src2))]>, TB, OpSize;
def IMUL32rr : I<0xAF, MRMSrcReg, (ops R32:$dst, R32:$src1, R32:$src2),
- "imul{l} {$src2, $dst|$dst, $src2}">, TB;
+ "imul{l} {$src2, $dst|$dst, $src2}",
+ [(set R32:$dst, (mul R32:$src1, R32:$src2))]>, TB;
}
def IMUL16rm : I<0xAF, MRMSrcMem, (ops R16:$dst, R16:$src1, i16mem:$src2),
- "imul{w} {$src2, $dst|$dst, $src2}">, TB, OpSize;
+ "imul{w} {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
def IMUL32rm : I<0xAF, MRMSrcMem, (ops R32:$dst, R32:$src1, i32mem:$src2),
- "imul{l} {$src2, $dst|$dst, $src2}">, TB;
+ "imul{l} {$src2, $dst|$dst, $src2}", []>, TB;
} // end Two Address instructions
@@ -1295,24 +1329,24 @@
//
let isCommutable = 1 in { // TEST X, Y --> TEST Y, X
def TEST8rr : I<0x84, MRMDestReg, (ops R8:$src1, R8:$src2),
- "test{b} {$src2, $src1|$src1, $src2}">;
+ "test{b} {$src2, $src1|$src1, $src2}", []>;
def TEST16rr : I<0x85, MRMDestReg, (ops R16:$src1, R16:$src2),
- "test{w} {$src2, $src1|$src1, $src2}">, OpSize;
+ "test{w} {$src2, $src1|$src1, $src2}", []>, OpSize;
def TEST32rr : I<0x85, MRMDestReg, (ops R32:$src1, R32:$src2),
- "test{l} {$src2, $src1|$src1, $src2}">;
+ "test{l} {$src2, $src1|$src1, $src2}", []>;
}
def TEST8mr : I<0x84, MRMDestMem, (ops i8mem :$src1, R8 :$src2),
- "test{b} {$src2, $src1|$src1, $src2}">;
+ "test{b} {$src2, $src1|$src1, $src2}", []>;
def TEST16mr : I<0x85, MRMDestMem, (ops i16mem:$src1, R16:$src2),
- "test{w} {$src2, $src1|$src1, $src2}">, OpSize;
+ "test{w} {$src2, $src1|$src1, $src2}", []>, OpSize;
def TEST32mr : I<0x85, MRMDestMem, (ops i32mem:$src1, R32:$src2),
- "test{l} {$src2, $src1|$src1, $src2}">;
+ "test{l} {$src2, $src1|$src1, $src2}", []>;
def TEST8rm : I<0x84, MRMSrcMem, (ops R8 :$src1, i8mem :$src2),
- "test{b} {$src2, $src1|$src1, $src2}">;
+ "test{b} {$src2, $src1|$src1, $src2}", []>;
def TEST16rm : I<0x85, MRMSrcMem, (ops R16:$src1, i16mem:$src2),
- "test{w} {$src2, $src1|$src1, $src2}">, OpSize;
+ "test{w} {$src2, $src1|$src1, $src2}", []>, OpSize;
def TEST32rm : I<0x85, MRMSrcMem, (ops R32:$src1, i32mem:$src2),
- "test{l} {$src2, $src1|$src1, $src2}">;
+ "test{l} {$src2, $src1|$src1, $src2}", []>;
def TEST8ri : Ii8 <0xF6, MRM0r, // flags = R8 & imm8
(ops R8:$src1, i8imm:$src2),
@@ -1336,94 +1370,94 @@
// Condition code ops, incl. set if equal/not equal/...
-def SAHF : I<0x9E, RawFrm, (ops), "sahf">, Imp<[AH],[]>; // flags = AH
-def LAHF : I<0x9F, RawFrm, (ops), "lahf">, Imp<[],[AH]>; // AH = flags
+def SAHF : I<0x9E, RawFrm, (ops), "sahf", []>, Imp<[AH],[]>; // flags = AH
+def LAHF : I<0x9F, RawFrm, (ops), "lahf", []>, Imp<[],[AH]>; // AH = flags
def SETBr : I<0x92, MRM0r,
- (ops R8 :$dst), "setb $dst">, TB; // R8 = < unsign
+ (ops R8 :$dst), "setb $dst", []>, TB; // R8 = < unsign
def SETBm : I<0x92, MRM0m,
- (ops i8mem:$dst), "setb $dst">, TB; // [mem8] = < unsign
+ (ops i8mem:$dst), "setb $dst", []>, TB; // [mem8] = < unsign
def SETAEr : I<0x93, MRM0r,
- (ops R8 :$dst), "setae $dst">, TB; // R8 = >= unsign
+ (ops R8 :$dst), "setae $dst", []>, TB; // R8 = >= unsign
def SETAEm : I<0x93, MRM0m,
- (ops i8mem:$dst), "setae $dst">, TB; // [mem8] = >= unsign
+ (ops i8mem:$dst), "setae $dst", []>, TB; // [mem8] = >= unsign
def SETEr : I<0x94, MRM0r,
- (ops R8 :$dst), "sete $dst">, TB; // R8 = ==
+ (ops R8 :$dst), "sete $dst", []>, TB; // R8 = ==
def SETEm : I<0x94, MRM0m,
- (ops i8mem:$dst), "sete $dst">, TB; // [mem8] = ==
+ (ops i8mem:$dst), "sete $dst", []>, TB; // [mem8] = ==
def SETNEr : I<0x95, MRM0r,
- (ops R8 :$dst), "setne $dst">, TB; // R8 = !=
+ (ops R8 :$dst), "setne $dst", []>, TB; // R8 = !=
def SETNEm : I<0x95, MRM0m,
- (ops i8mem:$dst), "setne $dst">, TB; // [mem8] = !=
+ (ops i8mem:$dst), "setne $dst", []>, TB; // [mem8] = !=
def SETBEr : I<0x96, MRM0r,
- (ops R8 :$dst), "setbe $dst">, TB; // R8 = <= unsign
+ (ops R8 :$dst), "setbe $dst", []>, TB; // R8 = <= unsign
def SETBEm : I<0x96, MRM0m,
- (ops i8mem:$dst), "setbe $dst">, TB; // [mem8] = <= unsign
+ (ops i8mem:$dst), "setbe $dst", []>, TB; // [mem8] = <= unsign
def SETAr : I<0x97, MRM0r,
- (ops R8 :$dst), "seta $dst">, TB; // R8 = > signed
+ (ops R8 :$dst), "seta $dst", []>, TB; // R8 = > signed
def SETAm : I<0x97, MRM0m,
- (ops i8mem:$dst), "seta $dst">, TB; // [mem8] = > signed
+ (ops i8mem:$dst), "seta $dst", []>, TB; // [mem8] = > signed
def SETSr : I<0x98, MRM0r,
- (ops R8 :$dst), "sets $dst">, TB; // R8 =
+ (ops R8 :$dst), "sets $dst", []>, TB; // R8 =
def SETSm : I<0x98, MRM0m,
- (ops i8mem:$dst), "sets $dst">, TB; // [mem8] =
+ (ops i8mem:$dst), "sets $dst", []>, TB; // [mem8] =
def SETNSr : I<0x99, MRM0r,
- (ops R8 :$dst), "setns $dst">, TB; // R8 = !
+ (ops R8 :$dst), "setns $dst", []>, TB; // R8 = !
def SETNSm : I<0x99, MRM0m,
- (ops i8mem:$dst), "setns $dst">, TB; // [mem8] = !
+ (ops i8mem:$dst), "setns $dst", []>, TB; // [mem8] = !
def SETPr : I<0x9A, MRM0r,
- (ops R8 :$dst), "setp $dst">, TB; // R8 = parity
+ (ops R8 :$dst), "setp $dst", []>, TB; // R8 = parity
def SETPm : I<0x9A, MRM0m,
- (ops i8mem:$dst), "setp $dst">, TB; // [mem8] = parity
+ (ops i8mem:$dst), "setp $dst", []>, TB; // [mem8] = parity
def SETNPr : I<0x9B, MRM0r,
- (ops R8 :$dst), "setnp $dst">, TB; // R8 = not parity
+ (ops R8 :$dst), "setnp $dst", []>, TB; // R8 = not parity
def SETNPm : I<0x9B, MRM0m,
- (ops i8mem:$dst), "setnp $dst">, TB; // [mem8] = not parity
+ (ops i8mem:$dst), "setnp $dst", []>, TB; // [mem8] = not parity
def SETLr : I<0x9C, MRM0r,
- (ops R8 :$dst), "setl $dst">, TB; // R8 = < signed
+ (ops R8 :$dst), "setl $dst", []>, TB; // R8 = < signed
def SETLm : I<0x9C, MRM0m,
- (ops i8mem:$dst), "setl $dst">, TB; // [mem8] = < signed
+ (ops i8mem:$dst), "setl $dst", []>, TB; // [mem8] = < signed
def SETGEr : I<0x9D, MRM0r,
- (ops R8 :$dst), "setge $dst">, TB; // R8 = >= signed
+ (ops R8 :$dst), "setge $dst", []>, TB; // R8 = >= signed
def SETGEm : I<0x9D, MRM0m,
- (ops i8mem:$dst), "setge $dst">, TB; // [mem8] = >= signed
+ (ops i8mem:$dst), "setge $dst", []>, TB; // [mem8] = >= signed
def SETLEr : I<0x9E, MRM0r,
- (ops R8 :$dst), "setle $dst">, TB; // R8 = <= signed
+ (ops R8 :$dst), "setle $dst", []>, TB; // R8 = <= signed
def SETLEm : I<0x9E, MRM0m,
- (ops i8mem:$dst), "setle $dst">, TB; // [mem8] = <= signed
+ (ops i8mem:$dst), "setle $dst", []>, TB; // [mem8] = <= signed
def SETGr : I<0x9F, MRM0r,
- (ops R8 :$dst), "setg $dst">, TB; // R8 = < signed
+ (ops R8 :$dst), "setg $dst", []>, TB; // R8 = < signed
def SETGm : I<0x9F, MRM0m,
- (ops i8mem:$dst), "setg $dst">, TB; // [mem8] = < signed
+ (ops i8mem:$dst), "setg $dst", []>, TB; // [mem8] = < signed
// Integer comparisons
def CMP8rr : I<0x38, MRMDestReg,
(ops R8 :$src1, R8 :$src2),
- "cmp{b} {$src2, $src1|$src1, $src2}">;
+ "cmp{b} {$src2, $src1|$src1, $src2}", []>;
def CMP16rr : I<0x39, MRMDestReg,
(ops R16:$src1, R16:$src2),
- "cmp{w} {$src2, $src1|$src1, $src2}">, OpSize;
+ "cmp{w} {$src2, $src1|$src1, $src2}", []>, OpSize;
def CMP32rr : I<0x39, MRMDestReg,
(ops R32:$src1, R32:$src2),
- "cmp{l} {$src2, $src1|$src1, $src2}">;
+ "cmp{l} {$src2, $src1|$src1, $src2}", []>;
def CMP8mr : I<0x38, MRMDestMem,
(ops i8mem :$src1, R8 :$src2),
- "cmp{b} {$src2, $src1|$src1, $src2}">;
+ "cmp{b} {$src2, $src1|$src1, $src2}", []>;
def CMP16mr : I<0x39, MRMDestMem,
(ops i16mem:$src1, R16:$src2),
- "cmp{w} {$src2, $src1|$src1, $src2}">, OpSize;
+ "cmp{w} {$src2, $src1|$src1, $src2}", []>, OpSize;
def CMP32mr : I<0x39, MRMDestMem,
(ops i32mem:$src1, R32:$src2),
- "cmp{l} {$src2, $src1|$src1, $src2}">;
+ "cmp{l} {$src2, $src1|$src1, $src2}", []>;
def CMP8rm : I<0x3A, MRMSrcMem,
(ops R8 :$src1, i8mem :$src2),
- "cmp{b} {$src2, $src1|$src1, $src2}">;
+ "cmp{b} {$src2, $src1|$src1, $src2}", []>;
def CMP16rm : I<0x3B, MRMSrcMem,
(ops R16:$src1, i16mem:$src2),
- "cmp{w} {$src2, $src1|$src1, $src2}">, OpSize;
+ "cmp{w} {$src2, $src1|$src1, $src2}", []>, OpSize;
def CMP32rm : I<0x3B, MRMSrcMem,
(ops R32:$src1, i32mem:$src2),
- "cmp{l} {$src2, $src1|$src1, $src2}">;
+ "cmp{l} {$src2, $src1|$src1, $src2}", []>;
def CMP8ri : Ii8<0x80, MRM7r,
(ops R16:$src1, i8imm:$src2),
"cmp{b} {$src2, $src1|$src1, $src2}", []>;
@@ -1445,171 +1479,193 @@
// Sign/Zero extenders
def MOVSX16rr8 : I<0xBE, MRMSrcReg, (ops R16:$dst, R8 :$src),
- "movs{bw|x} {$src, $dst|$dst, $src}">, TB, OpSize;
+ "movs{bw|x} {$src, $dst|$dst, $src}",
+ [(set R16:$dst, (sext R8:$src))]>, TB, OpSize;
def MOVSX16rm8 : I<0xBE, MRMSrcMem, (ops R16:$dst, i8mem :$src),
- "movs{bw|x} {$src, $dst|$dst, $src}">, TB, OpSize;
+ "movs{bw|x} {$src, $dst|$dst, $src}", []>, TB, OpSize;
def MOVSX32rr8 : I<0xBE, MRMSrcReg, (ops R32:$dst, R8 :$src),
- "movs{bl|x} {$src, $dst|$dst, $src}">, TB;
+ "movs{bl|x} {$src, $dst|$dst, $src}",
+ [(set R32:$dst, (sext R8:$src))]>, TB;
def MOVSX32rm8 : I<0xBE, MRMSrcMem, (ops R32:$dst, i8mem :$src),
- "movs{bl|x} {$src, $dst|$dst, $src}">, TB;
+ "movs{bl|x} {$src, $dst|$dst, $src}", []>, TB;
def MOVSX32rr16: I<0xBF, MRMSrcReg, (ops R32:$dst, R16:$src),
- "movs{wl|x} {$src, $dst|$dst, $src}">, TB;
+ "movs{wl|x} {$src, $dst|$dst, $src}",
+ [(set R32:$dst, (sext R16:$src))]>, TB;
def MOVSX32rm16: I<0xBF, MRMSrcMem, (ops R32:$dst, i16mem:$src),
- "movs{wl|x} {$src, $dst|$dst, $src}">, TB;
+ "movs{wl|x} {$src, $dst|$dst, $src}", []>, TB;
def MOVZX16rr8 : I<0xB6, MRMSrcReg, (ops R16:$dst, R8 :$src),
- "movz{bw|x} {$src, $dst|$dst, $src}">, TB, OpSize;
+ "movz{bw|x} {$src, $dst|$dst, $src}",
+ [(set R16:$dst, (zext R8:$src))]>, TB, OpSize;
def MOVZX16rm8 : I<0xB6, MRMSrcMem, (ops R16:$dst, i8mem :$src),
- "movz{bw|x} {$src, $dst|$dst, $src}">, TB, OpSize;
+ "movz{bw|x} {$src, $dst|$dst, $src}", []>, TB, OpSize;
def MOVZX32rr8 : I<0xB6, MRMSrcReg, (ops R32:$dst, R8 :$src),
- "movz{bl|x} {$src, $dst|$dst, $src}">, TB;
+ "movz{bl|x} {$src, $dst|$dst, $src}",
+ [(set R32:$dst, (zext R8:$src))]>, TB;
def MOVZX32rm8 : I<0xB6, MRMSrcMem, (ops R32:$dst, i8mem :$src),
- "movz{bl|x} {$src, $dst|$dst, $src}">, TB;
+ "movz{bl|x} {$src, $dst|$dst, $src}", []>, TB;
def MOVZX32rr16: I<0xB7, MRMSrcReg, (ops R32:$dst, R16:$src),
- "movz{wl|x} {$src, $dst|$dst, $src}">, TB;
+ "movz{wl|x} {$src, $dst|$dst, $src}",
+ [(set R32:$dst, (zext R16:$src))]>, TB;
def MOVZX32rm16: I<0xB7, MRMSrcMem, (ops R32:$dst, i16mem:$src),
- "movz{wl|x} {$src, $dst|$dst, $src}">, TB;
+ "movz{wl|x} {$src, $dst|$dst, $src}", []>, TB;
//===----------------------------------------------------------------------===//
// XMM Floating point support (requires SSE2)
//===----------------------------------------------------------------------===//
def MOVSSrr : I<0x10, MRMSrcReg, (ops V4F4:$dst, V4F4:$src),
- "movss {$src, $dst|$dst, $src}">, XS;
+ "movss {$src, $dst|$dst, $src}", []>, XS;
def MOVSSrm : I<0x10, MRMSrcMem, (ops V4F4:$dst, f32mem:$src),
- "movss {$src, $dst|$dst, $src}">, XS;
+ "movss {$src, $dst|$dst, $src}", []>, XS;
def MOVSSmr : I<0x11, MRMDestMem, (ops f32mem:$dst, V4F4:$src),
- "movss {$src, $dst|$dst, $src}">, XS;
+ "movss {$src, $dst|$dst, $src}", []>, XS;
def MOVSDrr : I<0x10, MRMSrcReg, (ops V2F8:$dst, V2F8:$src),
- "movsd {$src, $dst|$dst, $src}">, XD;
+ "movsd {$src, $dst|$dst, $src}", []>, XD;
def MOVSDrm : I<0x10, MRMSrcMem, (ops V2F8:$dst, f64mem:$src),
- "movsd {$src, $dst|$dst, $src}">, XD;
+ "movsd {$src, $dst|$dst, $src}", []>, XD;
def MOVSDmr : I<0x11, MRMDestMem, (ops f64mem:$dst, V2F8:$src),
- "movsd {$src, $dst|$dst, $src}">, XD;
+ "movsd {$src, $dst|$dst, $src}", []>, XD;
def CVTTSD2SIrr: I<0x2C, MRMSrcReg, (ops R32:$dst, V2F8:$src),
- "cvttsd2si {$src, $dst|$dst, $src}">, XD;
+ "cvttsd2si {$src, $dst|$dst, $src}",
+ [(set R32:$dst, (fp_to_sint V2F8:$src))]>, XD;
def CVTTSD2SIrm: I<0x2C, MRMSrcMem, (ops R32:$dst, f64mem:$src),
- "cvttsd2si {$src, $dst|$dst, $src}">, XD;
+ "cvttsd2si {$src, $dst|$dst, $src}", []>, XD;
def CVTTSS2SIrr: I<0x2C, MRMSrcReg, (ops R32:$dst, V4F4:$src),
- "cvttss2si {$src, $dst|$dst, $src}">, XS;
+ "cvttss2si {$src, $dst|$dst, $src}",
+ [(set R32:$dst, (fp_to_sint V4F4:$src))]>, XS;
def CVTTSS2SIrm: I<0x2C, MRMSrcMem, (ops R32:$dst, f32mem:$src),
- "cvttss2si {$src, $dst|$dst, $src}">, XS;
+ "cvttss2si {$src, $dst|$dst, $src}", []>, XS;
def CVTSD2SSrr: I<0x5A, MRMSrcReg, (ops V4F4:$dst, V2F8:$src),
- "cvtsd2ss {$src, $dst|$dst, $src}">, XS;
+ "cvtsd2ss {$src, $dst|$dst, $src}",
+ [(set V4F4:$dst, (fround V2F8:$src))]>, XS;
def CVTSD2SSrm: I<0x5A, MRMSrcMem, (ops V4F4:$dst, f64mem:$src),
- "cvtsd2ss {$src, $dst|$dst, $src}">, XS;
+ "cvtsd2ss {$src, $dst|$dst, $src}", []>, XS;
def CVTSS2SDrr: I<0x5A, MRMSrcReg, (ops V2F8:$dst, V4F4:$src),
- "cvtss2sd {$src, $dst|$dst, $src}">, XD;
+ "cvtss2sd {$src, $dst|$dst, $src}",
+ [(set V2F8:$dst, (fextend V4F4:$src))]>, XD;
def CVTSS2SDrm: I<0x5A, MRMSrcMem, (ops V2F8:$dst, f32mem:$src),
- "cvtss2sd {$src, $dst|$dst, $src}">, XD;
+ "cvtss2sd {$src, $dst|$dst, $src}", []>, XD;
def CVTSI2SSrr: I<0x2A, MRMSrcReg, (ops V4F4:$dst, R32:$src),
- "cvtsi2ss {$src, $dst|$dst, $src}">, XS;
+ "cvtsi2ss {$src, $dst|$dst, $src}",
+ [(set V4F4:$dst, (sint_to_fp R32:$src))]>, XS;
def CVTSI2SSrm: I<0x2A, MRMSrcMem, (ops V4F4:$dst, i32mem:$src),
- "cvtsi2ss {$src, $dst|$dst, $src}">, XS;
+ "cvtsi2ss {$src, $dst|$dst, $src}", []>, XS;
def CVTSI2SDrr: I<0x2A, MRMSrcReg, (ops V2F8:$dst, R32:$src),
- "cvtsi2sd {$src, $dst|$dst, $src}">, XD;
+ "cvtsi2sd {$src, $dst|$dst, $src}",
+ [(set V2F8:$dst, (sint_to_fp R32:$src))]>, XD;
def CVTSI2SDrm: I<0x2A, MRMSrcMem, (ops V2F8:$dst, i32mem:$src),
- "cvtsi2sd {$src, $dst|$dst, $src}">, XD;
+ "cvtsi2sd {$src, $dst|$dst, $src}", []>, XD;
def SQRTSSrm : I<0x51, MRMSrcMem, (ops V4F4:$dst, f32mem:$src),
- "subss {$src, $dst|$dst, $src}">, XS;
+ "sqrtss {$src, $dst|$dst, $src}", []>, XS;
def SQRTSSrr : I<0x51, MRMSrcReg, (ops V4F4:$dst, V4F4:$src),
- "subss {$src, $dst|$dst, $src}">, XS;
+ "sqrtss {$src, $dst|$dst, $src}",
+ [(set V4F4:$dst, (fsqrt V4F4:$src))]>, XS;
def SQRTSDrm : I<0x51, MRMSrcMem, (ops V2F8:$dst, f64mem:$src),
- "subsd {$src, $dst|$dst, $src}">, XD;
+ "sqrtsd {$src, $dst|$dst, $src}", []>, XD;
def SQRTSDrr : I<0x51, MRMSrcReg, (ops V2F8:$dst, V2F8:$src),
- "subsd {$src, $dst|$dst, $src}">, XD;
+ "sqrtsd {$src, $dst|$dst, $src}",
+ [(set V2F8:$dst, (fsqrt V2F8:$src))]>, XD;
def UCOMISDrr: I<0x2E, MRMSrcReg, (ops V2F8:$dst, V2F8:$src),
- "ucomisd {$src, $dst|$dst, $src}">, TB, OpSize;
+ "ucomisd {$src, $dst|$dst, $src}", []>, TB, OpSize;
def UCOMISDrm: I<0x2E, MRMSrcMem, (ops V2F8:$dst, f64mem:$src),
- "ucomisd {$src, $dst|$dst, $src}">, TB, OpSize;
+ "ucomisd {$src, $dst|$dst, $src}", []>, TB, OpSize;
def UCOMISSrr: I<0x2E, MRMSrcReg, (ops V4F4:$dst, V4F4:$src),
- "ucomiss {$src, $dst|$dst, $src}">, TB;
+ "ucomiss {$src, $dst|$dst, $src}", []>, TB;
def UCOMISSrm: I<0x2E, MRMSrcMem, (ops V4F4:$dst, f32mem:$src),
- "ucomiss {$src, $dst|$dst, $src}">, TB;
+ "ucomiss {$src, $dst|$dst, $src}", []>, TB;
-// Pseudo-instructions that map to fld0 to xorps/xorpd for sse.
+// Pseudo-instructions that map fld0 to xorps/xorpd for sse.
// FIXME: remove when we can teach regalloc that xor reg, reg is ok.
def FLD0SS : I<0x57, MRMSrcReg, (ops V4F4:$dst),
- "xorps $dst, $dst">, TB;
+ "xorps $dst, $dst", []>, TB;
def FLD0SD : I<0x57, MRMSrcReg, (ops V2F8:$dst),
- "xorpd $dst, $dst">, TB, OpSize;
+ "xorpd $dst, $dst", []>, TB, OpSize;
let isTwoAddress = 1 in {
let isCommutable = 1 in {
-def ADDSSrr : I<0x58, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "addss {$src, $dst|$dst, $src}">, XS;
-def ADDSDrr : I<0x58, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "addsd {$src, $dst|$dst, $src}">, XD;
-def ANDPSrr : I<0x54, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "andps {$src, $dst|$dst, $src}">, TB;
-def ANDPDrr : I<0x54, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "andpd {$src, $dst|$dst, $src}">, TB, OpSize;
-def MULSSrr : I<0x59, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "mulss {$src, $dst|$dst, $src}">, XS;
-def MULSDrr : I<0x59, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "mulsd {$src, $dst|$dst, $src}">, XD;
-def ORPSrr : I<0x56, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "orps {$src, $dst|$dst, $src}">, TB;
-def ORPDrr : I<0x56, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "orpd {$src, $dst|$dst, $src}">, TB, OpSize;
-def XORPSrr : I<0x57, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "xorps {$src, $dst|$dst, $src}">, TB;
-def XORPDrr : I<0x57, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "xorpd {$src, $dst|$dst, $src}">, TB, OpSize;
-}
-def ANDNPSrr : I<0x55, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "andnps {$src, $dst|$dst, $src}">, TB;
-def ANDNPDrr : I<0x55, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "andnpd {$src, $dst|$dst, $src}">, TB, OpSize;
-def ADDSSrm : I<0x58, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src),
- "addss {$src, $dst|$dst, $src}">, XS;
-def ADDSDrm : I<0x58, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src),
- "addsd {$src, $dst|$dst, $src}">, XD;
-def MULSSrm : I<0x59, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src),
- "mulss {$src, $dst|$dst, $src}">, XS;
-def MULSDrm : I<0x59, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src),
- "mulsd {$src, $dst|$dst, $src}">, XD;
-
-def DIVSSrm : I<0x5E, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src),
- "divss {$src, $dst|$dst, $src}">, XS;
-def DIVSSrr : I<0x5E, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "divss {$src, $dst|$dst, $src}">, XS;
-def DIVSDrm : I<0x5E, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src),
- "divsd {$src, $dst|$dst, $src}">, XD;
-def DIVSDrr : I<0x5E, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "divsd {$src, $dst|$dst, $src}">, XD;
-
-def SUBSSrm : I<0x5C, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src),
- "subss {$src, $dst|$dst, $src}">, XS;
-def SUBSSrr : I<0x5C, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src),
- "subss {$src, $dst|$dst, $src}">, XS;
-def SUBSDrm : I<0x5C, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src),
- "subsd {$src, $dst|$dst, $src}">, XD;
-def SUBSDrr : I<0x5C, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src),
- "subsd {$src, $dst|$dst, $src}">, XD;
+def ADDSSrr : I<0x58, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "addss {$src2, $dst|$dst, $src2}",
+ [(set V4F4:$dst, (fadd V4F4:$src1, V4F4:$src2))]>, XS;
+def ADDSDrr : I<0x58, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "addsd {$src2, $dst|$dst, $src2}",
+ [(set V2F8:$dst, (fadd V2F8:$src1, V2F8:$src2))]>, XD;
+def ANDPSrr : I<0x54, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "andps {$src2, $dst|$dst, $src2}", []>, TB;
+def ANDPDrr : I<0x54, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "andpd {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
+def MULSSrr : I<0x59, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "mulss {$src2, $dst|$dst, $src2}",
+ [(set V4F4:$dst, (fmul V4F4:$src1, V4F4:$src2))]>, XS;
+def MULSDrr : I<0x59, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "mulsd {$src2, $dst|$dst, $src2}",
+ [(set V2F8:$dst, (fmul V2F8:$src1, V2F8:$src2))]>, XD;
+def ORPSrr : I<0x56, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "orps {$src2, $dst|$dst, $src2}", []>, TB;
+def ORPDrr : I<0x56, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "orpd {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
+def XORPSrr : I<0x57, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "xorps {$src2, $dst|$dst, $src2}", []>, TB;
+def XORPDrr : I<0x57, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "xorpd {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
+}
+def ANDNPSrr : I<0x55, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "andnps {$src2, $dst|$dst, $src2}", []>, TB;
+def ANDNPDrr : I<0x55, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "andnpd {$src2, $dst|$dst, $src2}", []>, TB, OpSize;
+def ADDSSrm : I<0x58, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src2),
+ "addss {$src2, $dst|$dst, $src2}", []>, XS;
+def ADDSDrm : I<0x58, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src2),
+ "addsd {$src2, $dst|$dst, $src2}", []>, XD;
+def MULSSrm : I<0x59, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src2),
+ "mulss {$src2, $dst|$dst, $src2}", []>, XS;
+def MULSDrm : I<0x59, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src2),
+ "mulsd {$src2, $dst|$dst, $src2}", []>, XD;
+
+def DIVSSrm : I<0x5E, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src2),
+ "divss {$src2, $dst|$dst, $src2}", []>, XS;
+def DIVSSrr : I<0x5E, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "divss {$src2, $dst|$dst, $src2}",
+ [(set V4F4:$dst, (fdiv V4F4:$src1, V4F4:$src2))]>, XS;
+def DIVSDrm : I<0x5E, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src2),
+ "divsd {$src2, $dst|$dst, $src2}", []>, XD;
+def DIVSDrr : I<0x5E, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "divsd {$src2, $dst|$dst, $src2}",
+ [(set V2F8:$dst, (fdiv V2F8:$src1, V2F8:$src2))]>, XD;
+
+def SUBSSrm : I<0x5C, MRMSrcMem, (ops V4F4:$dst, V4F4:$src1, f32mem:$src2),
+ "subss {$src2, $dst|$dst, $src2}", []>, XS;
+def SUBSSrr : I<0x5C, MRMSrcReg, (ops V4F4:$dst, V4F4:$src1, V4F4:$src2),
+ "subss {$src2, $dst|$dst, $src2}",
+ [(set V4F4:$dst, (fsub V4F4:$src1, V4F4:$src2))]>, XS;
+def SUBSDrm : I<0x5C, MRMSrcMem, (ops V2F8:$dst, V2F8:$src1, f64mem:$src2),
+ "subsd {$src2, $dst|$dst, $src2}", []>, XD;
+def SUBSDrr : I<0x5C, MRMSrcReg, (ops V2F8:$dst, V2F8:$src1, V2F8:$src2),
+ "subsd {$src2, $dst|$dst, $src2}",
+ [(set V2F8:$dst, (fsub V2F8:$src1, V2F8:$src2))]>, XD;
def CMPSSrr : I<0xC2, MRMSrcReg,
(ops V4F4:$dst, V4F4:$src1, V4F4:$src, SSECC:$cc),
- "cmp${cc}ss {$src, $dst|$dst, $src}">, XS;
+ "cmp${cc}ss {$src, $dst|$dst, $src}", []>, XS;
def CMPSSrm : I<0xC2, MRMSrcMem,
(ops V4F4:$dst, V4F4:$src1, f32mem:$src, SSECC:$cc),
- "cmp${cc}ss {$src, $dst|$dst, $src}">, XS;
+ "cmp${cc}ss {$src, $dst|$dst, $src}", []>, XS;
def CMPSDrr : I<0xC2, MRMSrcReg,
(ops V2F8:$dst, V2F8:$src1, V2F8:$src, SSECC:$cc),
- "cmp${cc}sd {$src, $dst|$dst, $src}">, XD;
+ "cmp${cc}sd {$src, $dst|$dst, $src}", []>, XD;
def CMPSDrm : I<0xC2, MRMSrcMem,
(ops V2F8:$dst, V2F8:$src1, f64mem:$src, SSECC:$cc),
- "cmp${cc}sd {$src, $dst|$dst, $src}">, XD;
+ "cmp${cc}sd {$src, $dst|$dst, $src}", []>, XD;
}
//===----------------------------------------------------------------------===//
// Miscellaneous Instructions
//===----------------------------------------------------------------------===//
-def RDTSC : I<0x31, RawFrm, (ops), "rdtsc">, TB, Imp<[],[EAX,EDX]>;
+def RDTSC : I<0x31, RawFrm, (ops), "rdtsc", []>, TB, Imp<[],[EAX,EDX]>;
//===----------------------------------------------------------------------===//
@@ -1849,16 +1905,16 @@
// Binary arithmetic operations...
class FPST0rInst o, dag ops, string asm>
- : I, D8 {
+ : I, D8 {
list Uses = [ST0];
list Defs = [ST0];
}
class FPrST0Inst o, dag ops, string asm>
- : I, DC {
+ : I, DC {
list Uses = [ST0];
}
class FPrST0PInst o, dag ops, string asm>
- : I, DE {
+ : I, DE {
list Uses = [ST0];
}
@@ -1913,24 +1969,24 @@
"fucom $reg">, DD, Imp<[ST0],[]>;
def FUCOMPr : I<0xE8, AddRegFrm, // FPSW = cmp ST(0) with ST(i), pop
(ops RST:$reg, variable_ops),
- "fucomp $reg">, DD, Imp<[ST0],[]>;
+ "fucomp $reg", []>, DD, Imp<[ST0],[]>;
def FUCOMPPr : I<0xE9, RawFrm, // cmp ST(0) with ST(1), pop, pop
(ops variable_ops),
- "fucompp">, DA, Imp<[ST0],[]>;
+ "fucompp", []>, DA, Imp<[ST0],[]>;
def FUCOMIr : FPI<0xE8, AddRegFrm, CompareFP, // CC = cmp ST(0) with ST(i)
(ops RST:$reg, variable_ops),
"fucomi {$reg, %ST(0)|%ST(0), $reg}">, DB, Imp<[ST0],[]>;
def FUCOMIPr : I<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i), pop
(ops RST:$reg, variable_ops),
- "fucomip {$reg, %ST(0)|%ST(0), $reg}">, DF, Imp<[ST0],[]>;
+ "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]>;
+ (ops), "fnstsw", []>, DF, Imp<[],[AX]>;
def FNSTCW16m : I<0xD9, MRM7m, // [mem16] = X87 control world
- (ops i16mem:$dst), "fnstcw $dst">;
+ (ops i16mem:$dst), "fnstcw $dst", []>;
def FLDCW16m : I<0xD9, MRM5m, // X87 control world = [mem16]
- (ops i16mem:$dst), "fldcw $dst">;
+ (ops i16mem:$dst), "fldcw $dst", []>;
From natebegeman at mac.com Tue Nov 29 16:43:02 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Tue, 29 Nov 2005 16:43:02 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrFormats.td
PPCInstrInfo.td
Message-ID: <200511292243.QAA19611@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCInstrFormats.td updated: 1.58 -> 1.59
PPCInstrInfo.td updated: 1.146 -> 1.147
---
Log message:
Represent the encoding of the SPR instructions as they actually are, so
that we can use the correct SPR numbers in the InstrInfo.td file. This is
necessary to support VRsave.
---
Diffs of the changes: (+18 -8)
PPCInstrFormats.td | 12 ++++++++++--
PPCInstrInfo.td | 14 ++++++++------
2 files changed, 18 insertions(+), 8 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td
diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.58 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.59
--- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.58 Tue Nov 29 02:04:45 2005
+++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Tue Nov 29 16:42:50 2005
@@ -361,7 +361,16 @@
bits<10> SPR;
let Inst{6-10} = RT;
- let Inst{11-20} = SPR;
+ let Inst{11} = SPR{4};
+ let Inst{12} = SPR{3};
+ let Inst{13} = SPR{2};
+ let Inst{14} = SPR{1};
+ let Inst{15} = SPR{0};
+ let Inst{16} = SPR{9};
+ let Inst{17} = SPR{8};
+ let Inst{18} = SPR{7};
+ let Inst{19} = SPR{6};
+ let Inst{20} = SPR{5};
let Inst{21-30} = xo;
let Inst{31} = 0;
}
@@ -411,7 +420,6 @@
let Inst{31} = 0;
}
-
class XFXForm_7 opcode, bits<10> xo, dag OL, string asmstr,
InstrItinClass itin>
: XFXForm_1;
Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.146 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.147
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.146 Tue Nov 29 02:04:45 2005
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Nov 29 16:42:50 2005
@@ -560,15 +560,17 @@
// Note that although LR should be listed as `8' and CTR as `9' in the SPR
// field, the manual lists the groups of bits as [5-9] = 0, [0-4] = 8 or 9
// which means the SPR value needs to be multiplied by a factor of 32.
-def MFCTR : XFXForm_1_ext<31, 339, 288, (ops GPRC:$rT), "mfctr $rT", SprMFSPR>;
-def MFLR : XFXForm_1_ext<31, 339, 256, (ops GPRC:$rT), "mflr $rT", SprMFSPR>;
+def MFCTR : XFXForm_1_ext<31, 339, 9, (ops GPRC:$rT), "mfctr $rT", SprMFSPR>;
+def MFLR : XFXForm_1_ext<31, 339, 8, (ops GPRC:$rT), "mflr $rT", SprMFSPR>;
def MFCR : XFXForm_3<31, 19, (ops GPRC:$rT), "mfcr $rT", SprMFCR>;
def MTCRF : XFXForm_5<31, 144, (ops crbitm:$FXM, GPRC:$rS),
"mtcrf $FXM, $rS", BrMCRX>;
-def MFOCRF : XFXForm_5a<31, 19, (ops GPRC:$rT, crbitm:$FXM),
- "mfcr $rT, $FXM", SprMFCR>;
-def MTCTR : XFXForm_7_ext<31, 467, 288, (ops GPRC:$rS), "mtctr $rS", SprMTSPR>;
-def MTLR : XFXForm_7_ext<31, 467, 256, (ops GPRC:$rS), "mtlr $rS", SprMTSPR>;
+def MFOCRF: XFXForm_5a<31, 19, (ops GPRC:$rT, crbitm:$FXM),
+ "mfcr $rT, $FXM", SprMFCR>;
+def MTCTR : XFXForm_7_ext<31, 467, 9, (ops GPRC:$rS), "mtctr $rS", SprMTSPR>;
+def MTLR : XFXForm_7_ext<31, 467, 8, (ops GPRC:$rS), "mtlr $rS", SprMTSPR>;
+def MTSPR : XFXForm_7<31, 467, (ops GPRC:$rS, u16imm:$UIMM), "mtspr $UIMM, $rS",
+ SprMTSPR>;
// XS-Form instructions. Just 'sradi'
//
From evan.cheng at apple.com Tue Nov 29 19:59:11 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 19:59:11 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
Message-ID: <200511300159.TAA21809@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86IntelAsmPrinter.cpp updated: 1.11 -> 1.12
---
Log message:
Fixed a minor bug: - -offset != offset iff offset == MININT
---
Diffs of the changes: (+1 -1)
X86IntelAsmPrinter.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.11 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.12
--- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.11 Mon Nov 21 17:06:54 2005
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Tue Nov 29 19:59:00 2005
@@ -117,7 +117,7 @@
if (Offset > 0)
O << " + " << Offset;
else if (Offset < 0)
- O << " - " << -Offset;
+ O << Offset;
return;
}
case MachineOperand::MO_ExternalSymbol:
From evan.cheng at apple.com Tue Nov 29 20:04:24 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 20:04:24 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
SelectionDAG.cpp SelectionDAGPrinter.cpp
Message-ID: <200511300204.UAA21884@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
ScheduleDAG.cpp updated: 1.45 -> 1.46
SelectionDAG.cpp updated: 1.216 -> 1.217
SelectionDAGPrinter.cpp updated: 1.29 -> 1.30
---
Log message:
Added an index field to GlobalAddressSDNode so it can represent X+12, etc.
---
Diffs of the changes: (+23 -3)
ScheduleDAG.cpp | 2 +-
SelectionDAG.cpp | 19 +++++++++++++++++--
SelectionDAGPrinter.cpp | 5 +++++
3 files changed, 23 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.45 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.46
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.45 Wed Nov 9 17:47:37 2005
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Tue Nov 29 20:04:11 2005
@@ -1123,7 +1123,7 @@
MI->addRegOperand(R->getReg(), MachineOperand::Use);
} else if (GlobalAddressSDNode *TGA =
dyn_cast(Node->getOperand(i))) {
- MI->addGlobalAddressOperand(TGA->getGlobal(), false, 0);
+ MI->addGlobalAddressOperand(TGA->getGlobal(), false, TGA->getOffset());
} else if (BasicBlockSDNode *BB =
dyn_cast(Node->getOperand(i))) {
MI->addMachineBasicBlockOperand(BB->getBasicBlock());
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.216 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.217
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.216 Tue Nov 29 00:21:05 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Nov 29 20:04:11 2005
@@ -500,10 +500,10 @@
}
SDOperand SelectionDAG::getTargetGlobalAddress(const GlobalValue *GV,
- MVT::ValueType VT) {
+ MVT::ValueType VT, int offset) {
SDNode *&N = TargetGlobalValues[GV];
if (N) return SDOperand(N, 0);
- N = new GlobalAddressSDNode(true, GV, VT);
+ N = new GlobalAddressSDNode(true, GV, VT, offset);
AllNodes.push_back(N);
return SDOperand(N, 0);
}
@@ -1457,6 +1457,16 @@
N->setOperands(Op1, Op2, Op3, Op4, Op5);
}
+void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
+ MVT::ValueType VT, SDOperand Op1,
+ SDOperand Op2, SDOperand Op3, SDOperand Op4,
+ SDOperand Op5, SDOperand Op6) {
+ RemoveNodeFromCSEMaps(N);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
+ N->setValueTypes(VT);
+ N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6);
+}
+
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT1, MVT::ValueType VT2,
SDOperand Op1, SDOperand Op2) {
@@ -1859,8 +1869,13 @@
std::cerr << "<" << CSDN->getValue() << ">";
} else if (const GlobalAddressSDNode *GADN =
dyn_cast(this)) {
+ int offset = GADN->getOffset();
std::cerr << "<";
WriteAsOperand(std::cerr, GADN->getGlobal()) << ">";
+ if (offset > 0)
+ std::cerr << " + " << offset;
+ else
+ std::cerr << " " << offset;
} else if (const FrameIndexSDNode *FIDN = dyn_cast(this)) {
std::cerr << "<" << FIDN->getIndex() << ">";
} else if (const ConstantPoolSDNode *CP = dyn_cast(this)){
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.29 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.30
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.29 Tue Nov 29 00:21:05 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Nov 29 20:04:11 2005
@@ -70,7 +70,12 @@
Op += ": " + ftostr(CSDN->getValue());
} else if (const GlobalAddressSDNode *GADN =
dyn_cast(Node)) {
+ int offset = GADN->getOffset();
Op += ": " + GADN->getGlobal()->getName();
+ if (offset > 0)
+ Op += "+" + itostr(offset);
+ else
+ Op += itostr(offset);
} else if (const FrameIndexSDNode *FIDN = dyn_cast(Node)) {
Op += " " + itostr(FIDN->getIndex());
} else if (const ConstantPoolSDNode *CP = dyn_cast(Node)){
From evan.cheng at apple.com Tue Nov 29 20:04:24 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 20:04:24 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h
SelectionDAGNodes.h
Message-ID: <200511300204.UAA21880@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.71 -> 1.72
SelectionDAGNodes.h updated: 1.79 -> 1.80
---
Log message:
Added an index field to GlobalAddressSDNode so it can represent X+12, etc.
---
Diffs of the changes: (+25 -2)
SelectionDAG.h | 6 +++++-
SelectionDAGNodes.h | 21 ++++++++++++++++++++-
2 files changed, 25 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.71 llvm/include/llvm/CodeGen/SelectionDAG.h:1.72
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.71 Tue Nov 29 00:15:39 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Nov 29 20:04:11 2005
@@ -110,7 +110,8 @@
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getConstantFP(double Val, MVT::ValueType VT);
SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
- SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
+ SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+ int offset=0);
SDOperand getFrameIndex(int FI, MVT::ValueType VT);
SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT);
SDOperand getConstantPool(Constant *C, MVT::ValueType VT);
@@ -283,6 +284,9 @@
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4,
SDOperand Op5);
+ void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4,
+ SDOperand Op5, SDOperand Op6);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.80
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79 Tue Nov 29 00:15:39 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Nov 29 20:04:11 2005
@@ -795,6 +795,21 @@
Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
Op4.Val->Uses.push_back(this);
}
+ void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3,
+ SDOperand Op4, SDOperand Op5) {
+ assert(NumOperands == 0 && "Should not have operands yet!");
+ OperandList = new SDOperand[6];
+ OperandList[0] = Op0;
+ OperandList[1] = Op1;
+ OperandList[2] = Op2;
+ OperandList[3] = Op3;
+ OperandList[4] = Op4;
+ OperandList[5] = Op5;
+ NumOperands = 6;
+ Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
+ Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
+ Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this);
+ }
void addUser(SDNode *User) {
Uses.push_back(User);
}
@@ -923,15 +938,19 @@
class GlobalAddressSDNode : public SDNode {
GlobalValue *TheGlobal;
+ int offset;
protected:
friend class SelectionDAG;
- GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT)
+ GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
+ int o=0)
: SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, VT) {
TheGlobal = const_cast(GA);
+ offset = o;
}
public:
GlobalValue *getGlobal() const { return TheGlobal; }
+ int getOffset() const { return offset; }
static bool classof(const GlobalAddressSDNode *) { return true; }
static bool classof(const SDNode *N) {
From evan.cheng at apple.com Tue Nov 29 20:49:33 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 20:49:33 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h
Message-ID: <200511300249.UAA22037@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.72 -> 1.73
---
Log message:
Fixed a bug introduced by my last commit: TargetGlobalValues should key on
GlobalValue * and index pair. Update getGlobalAddress() for symmetry.
---
Diffs of the changes: (+5 -4)
SelectionDAG.h | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.72 llvm/include/llvm/CodeGen/SelectionDAG.h:1.73
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.72 Tue Nov 29 20:04:11 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Nov 29 20:49:21 2005
@@ -109,9 +109,10 @@
SDOperand getConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getConstantFP(double Val, MVT::ValueType VT);
- SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
+ SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+ int offset = 0);
SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
- int offset=0);
+ int offset = 0);
SDOperand getFrameIndex(int FI, MVT::ValueType VT);
SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT);
SDOperand getConstantPool(Constant *C, MVT::ValueType VT);
@@ -399,8 +400,8 @@
std::map >,
SDNode *> Loads;
- std::map GlobalValues;
- std::map TargetGlobalValues;
+ std::map, SDNode*> GlobalValues;
+ std::map, SDNode*> TargetGlobalValues;
std::map, SDNode*> Constants;
std::map, SDNode*> TargetConstants;
std::map, SDNode*> ConstantFPs;
From evan.cheng at apple.com Tue Nov 29 20:49:34 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 20:49:34 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Message-ID: <200511300249.UAA22041@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.217 -> 1.218
---
Log message:
Fixed a bug introduced by my last commit: TargetGlobalValues should key on
GlobalValue * and index pair. Update getGlobalAddress() for symmetry.
---
Diffs of the changes: (+13 -7)
SelectionDAG.cpp | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.217 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.218
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.217 Tue Nov 29 20:04:11 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Nov 29 20:49:21 2005
@@ -283,12 +283,18 @@
Erased = CondCodeNodes[cast(N)->get()] != 0;
CondCodeNodes[cast(N)->get()] = 0;
break;
- case ISD::GlobalAddress:
- Erased = GlobalValues.erase(cast(N)->getGlobal());
+ case ISD::GlobalAddress: {
+ GlobalAddressSDNode *GN = cast(N);
+ Erased = GlobalValues.erase(std::make_pair(GN->getGlobal(),
+ GN->getOffset()));
break;
- case ISD::TargetGlobalAddress:
- Erased =TargetGlobalValues.erase(cast(N)->getGlobal());
+ }
+ case ISD::TargetGlobalAddress: {
+ GlobalAddressSDNode *GN = cast(N);
+ Erased =TargetGlobalValues.erase(std::make_pair(GN->getGlobal(),
+ GN->getOffset()));
break;
+ }
case ISD::FrameIndex:
Erased = FrameIndices.erase(cast(N)->getIndex());
break;
@@ -491,8 +497,8 @@
SDOperand SelectionDAG::getGlobalAddress(const GlobalValue *GV,
- MVT::ValueType VT) {
- SDNode *&N = GlobalValues[GV];
+ MVT::ValueType VT, int offset) {
+ SDNode *&N = GlobalValues[std::make_pair(GV, offset)];
if (N) return SDOperand(N, 0);
N = new GlobalAddressSDNode(false, GV, VT);
AllNodes.push_back(N);
@@ -501,7 +507,7 @@
SDOperand SelectionDAG::getTargetGlobalAddress(const GlobalValue *GV,
MVT::ValueType VT, int offset) {
- SDNode *&N = TargetGlobalValues[GV];
+ SDNode *&N = TargetGlobalValues[std::make_pair(GV, offset)];
if (N) return SDOperand(N, 0);
N = new GlobalAddressSDNode(true, GV, VT, offset);
AllNodes.push_back(N);
From evan.cheng at apple.com Tue Nov 29 20:51:32 2005
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Nov 2005 20:51:32 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Message-ID: <200511300251.UAA22069@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.3 -> 1.4
---
Log message:
Added support to STORE and shifts to DAG to DAG isel.
---
Diffs of the changes: (+88 -8)
X86ISelDAGToDAG.cpp | 96 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 88 insertions(+), 8 deletions(-)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.3 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.4
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.3 Fri Nov 18 20:11:08 2005
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Nov 29 20:51:20 2005
@@ -49,7 +49,7 @@
GlobalValue *GV;
X86ISelAddressMode()
- : BaseType(RegBase), Scale(1), IndexReg(), Disp(), GV(0) {
+ : BaseType(RegBase), Scale(1), IndexReg(), Disp(0), GV(0) {
}
};
}
@@ -267,7 +267,7 @@
SDOperand X86DAGToDAGISel::Select(SDOperand Op) {
SDNode *N = Op.Val;
- MVT::ValueType OpVT = Op.getValueType();
+ MVT::ValueType OpVT = N->getValueType(0);
unsigned Opc;
if (N->getOpcode() >= ISD::BUILTIN_OP_END)
@@ -275,9 +275,13 @@
switch (N->getOpcode()) {
default: break;
+
case ISD::SHL:
+ case ISD::SRL:
+ case ISD::SRA:
if (ConstantSDNode *CN = dyn_cast(N->getOperand(1))) {
- if (CN->getValue() == 1) { // X = SHL Y, 1 -> X = ADD Y, Y
+ if (N->getOpcode() == ISD::SHL && CN->getValue() == 1) {
+ // X = SHL Y, 1 -> X = ADD Y, Y
switch (OpVT) {
default: assert(0 && "Cannot shift this type!");
case MVT::i8: Opc = X86::ADD8rr; break;
@@ -288,7 +292,37 @@
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Tmp0, Tmp0);
return SDOperand(N, 0);
}
+ } else {
+ static const unsigned SHLTab[] = {
+ X86::SHL8rCL, X86::SHL16rCL, X86::SHL32rCL
+ };
+ static const unsigned SRLTab[] = {
+ X86::SHR8rCL, X86::SHR16rCL, X86::SHR32rCL
+ };
+ static const unsigned SRATab[] = {
+ X86::SAR8rCL, X86::SAR16rCL, X86::SAR32rCL
+ };
+
+ switch (OpVT) {
+ default: assert(0 && "Cannot shift this type!");
+ case MVT::i1:
+ case MVT::i8: Opc = 0; break;
+ case MVT::i16: Opc = 1; break;
+ case MVT::i32: Opc = 2; break;
+ }
+
+ switch (N->getOpcode()) {
+ default: assert(0 && "Unreachable!");
+ case ISD::SHL: Opc = SHLTab[Opc]; break;
+ case ISD::SRL: Opc = SRLTab[Opc]; break;
+ case ISD::SRA: Opc = SRATab[Opc]; break;
+ }
+
+ SDOperand Tmp0 = Select(N->getOperand(0));
+ CurDAG->SelectNodeTo(N, Opc, MVT::i32, Tmp0);
+ return SDOperand(N, 0);
}
+ break;
case ISD::RET: {
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
@@ -326,7 +360,7 @@
}
case ISD::LOAD: {
- switch (N->getValueType(0)) {
+ switch (OpVT) {
default: assert(0 && "Cannot load this type!");
case MVT::i1:
case MVT::i8: Opc = X86::MOV8rm; break;
@@ -342,23 +376,69 @@
// ???
assert(0 && "Can't handle load from constant pool!");
} else {
- SDOperand Chain = Select(N->getOperand(0)); // Token chain.
X86ISelAddressMode AM;
+ SDOperand Chain = Select(N->getOperand(0)); // Token chain.
+
SelectAddress(N->getOperand(1), AM);
SDOperand Scale = getI8Imm (AM.Scale);
- SDOperand Disp = AM.GV ? CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32)
+ SDOperand Disp = AM.GV
+ ? CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32, AM.Disp)
: getI32Imm(AM.Disp);
if (AM.BaseType == X86ISelAddressMode::RegBase) {
- CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other,
+ CurDAG->SelectNodeTo(N, Opc, OpVT, MVT::Other,
AM.Base.Reg, Scale, AM.IndexReg, Disp, Chain);
} else {
SDOperand Base = CurDAG->getFrameIndex(AM.Base.FrameIndex, MVT::i32);
- CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other,
+ CurDAG->SelectNodeTo(N, Opc, OpVT, MVT::Other,
Base, Scale, AM.IndexReg, Disp, Chain);
}
}
return SDOperand(N, Op.ResNo);
}
+
+ case ISD::STORE: {
+ SDOperand Chain = Select(N->getOperand(0)); // Token chain.
+ SDOperand Tmp1 = Select(N->getOperand(1));
+ X86ISelAddressMode AM;
+ SelectAddress(N->getOperand(2), AM);
+
+ Opc = 0;
+ if (ConstantSDNode *CN = dyn_cast(N->getOperand(1))) {
+ switch (CN->getValueType(0)) {
+ default: assert(0 && "Invalid type for operation!");
+ case MVT::i1:
+ case MVT::i8: Opc = X86::MOV8mi; break;
+ case MVT::i16: Opc = X86::MOV16mi; break;
+ case MVT::i32: Opc = X86::MOV32mi; break;
+ }
+ }
+
+ if (!Opc) {
+ switch (N->getOperand(1).getValueType()) {
+ default: assert(0 && "Cannot store this type!");
+ case MVT::i1:
+ case MVT::i8: Opc = X86::MOV8mr; break;
+ case MVT::i16: Opc = X86::MOV16mr; break;
+ case MVT::i32: Opc = X86::MOV32mr; break;
+ case MVT::f32: Opc = X86::MOVSSmr; break;
+ case MVT::f64: Opc = X86::FST64m; break;
+ }
+ }
+
+ SDOperand Scale = getI8Imm (AM.Scale);
+ SDOperand Disp = AM.GV
+ ? CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32, AM.Disp)
+ : getI32Imm(AM.Disp);
+ if (AM.BaseType == X86ISelAddressMode::RegBase) {
+ CurDAG->SelectNodeTo(N, Opc, MVT::Other,
+ AM.Base.Reg, Scale, AM.IndexReg, Disp, Tmp1,
+ Chain);
+ } else {
+ SDOperand Base = CurDAG->getFrameIndex(AM.Base.FrameIndex, MVT::i32);
+ CurDAG->SelectNodeTo(N, Opc, MVT::Other,
+ Base, Scale, AM.IndexReg, Disp, Tmp1, Chain);
+ }
+ }
}
return SelectCode(Op);
From lattner at cs.uiuc.edu Tue Nov 29 23:11:30 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 23:11:30 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td
Message-ID: <200511300511.XAA25142@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86InstrInfo.td updated: 1.142 -> 1.143
---
Log message:
Fix a bug in a recent patch that broke shifts
---
Diffs of the changes: (+3 -3)
X86InstrInfo.td | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.142 llvm/lib/Target/X86/X86InstrInfo.td:1.143
--- llvm/lib/Target/X86/X86InstrInfo.td:1.142 Tue Nov 29 13:38:52 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Tue Nov 29 23:11:18 2005
@@ -918,11 +918,11 @@
def SHL32mCL : I<0xD3, MRM4m, (ops i32mem:$dst),
"shl{l} {%cl, $dst|$dst, %CL}", []>, Imp<[CL],[]>;
def SHL8mi : Ii8<0xC0, MRM4m, (ops i8mem :$dst, i8imm:$src),
- "shl{b} {$src, $dst|$dst, $src}, []", []>;
+ "shl{b} {$src, $dst|$dst, $src}", []>;
def SHL16mi : Ii8<0xC1, MRM4m, (ops i16mem:$dst, i8imm:$src),
- "shl{w} {$src, $dst|$dst, $src}, []", []>, OpSize;
+ "shl{w} {$src, $dst|$dst, $src}", []>, OpSize;
def SHL32mi : Ii8<0xC1, MRM4m, (ops i32mem:$dst, i8imm:$src),
- "shl{l} {$src, $dst|$dst, $src}, []", []>;
+ "shl{l} {$src, $dst|$dst, $src}", []>;
}
def SHR8rCL : I<0xD2, MRM5r, (ops R8 :$dst, R8 :$src),
From reid at x10sys.com Tue Nov 29 23:21:23 2005
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 29 Nov 2005 23:21:23 -0600
Subject: [llvm-commits]
CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <200511300521.XAA25547@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.106 -> 1.107
---
Log message:
Fix a problem with llvm-ranlib that (on some platforms) caused the archive
file to become corrupted due to interactions between mmap'd memory segments
and file descriptors closing. The problem is completely avoiding by using
a third temporary file.
Patch provided by Evan Jones
---
Diffs of the changes: (+30 -0)
SelectionDAGISel.cpp | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.106 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.107
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.106 Tue Nov 29 00:21:05 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Nov 29 23:21:10 2005
@@ -1161,6 +1161,36 @@
}
void SelectionDAGLowering::visitMemIntrinsic(CallInst &I, unsigned Op) {
+#if 0
+ // If the size of the cpy/move/set is constant (known)
+ if (ConstantUInt* op3 = dyn_cast(I.getOperand(3))) {
+ uint64_t size = op3->getValue();
+ switch (Op) {
+ case ISD::MEMSET:
+ if (size <= TLI.getMaxStoresPerMemSet()) {
+ if (ConstantUInt* op4 = dyn_cast(I.getOperand(4))) {
+ uint64_t TySize = TLI.getTargetData().getTypeSize(Ty);
+ uint64_t align = op4.getValue();
+ while (size > align) {
+ size -=align;
+ }
+ Value *SrcV = I.getOperand(0);
+ SDOperand Src = getValue(SrcV);
+ SDOperand Ptr = getValue(I.getOperand(1));
+ DAG.setRoot(DAG.getNode(ISD::STORE, MVT::Other, getRoot(), Src, Ptr,
+ DAG.getSrcValue(I.getOperand(1))));
+ }
+ break;
+ }
+ break; // don't do this optimization, use a normal memset
+ case ISD::MEMMOVE:
+ case ISD::MEMCPY:
+ break; // FIXME: not implemented yet
+ }
+ }
+#endif
+
+ // Non-optimized version
std::vector Ops;
Ops.push_back(getRoot());
Ops.push_back(getValue(I.getOperand(1)));
From reid at x10sys.com Tue Nov 29 23:21:23 2005
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 29 Nov 2005 23:21:23 -0600
Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/Archive.cpp
ArchiveWriter.cpp
Message-ID: <200511300521.XAA25543@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Bytecode/Archive:
Archive.cpp updated: 1.9 -> 1.10
ArchiveWriter.cpp updated: 1.20 -> 1.21
---
Log message:
Fix a problem with llvm-ranlib that (on some platforms) caused the archive
file to become corrupted due to interactions between mmap'd memory segments
and file descriptors closing. The problem is completely avoiding by using
a third temporary file.
Patch provided by Evan Jones
---
Diffs of the changes: (+72 -36)
Archive.cpp | 24 ++++++++++++++-
ArchiveWriter.cpp | 84 ++++++++++++++++++++++++++++++++----------------------
2 files changed, 72 insertions(+), 36 deletions(-)
Index: llvm/lib/Bytecode/Archive/Archive.cpp
diff -u llvm/lib/Bytecode/Archive/Archive.cpp:1.9 llvm/lib/Bytecode/Archive/Archive.cpp:1.10
--- llvm/lib/Bytecode/Archive/Archive.cpp:1.9 Thu May 5 17:32:02 2005
+++ llvm/lib/Bytecode/Archive/Archive.cpp Tue Nov 29 23:21:10 2005
@@ -140,13 +140,28 @@
}
}
-// Archive destructor - just clean up memory
-Archive::~Archive() {
+void Archive::cleanUpMemory() {
// Shutdown the file mapping
if (mapfile) {
mapfile->close();
delete mapfile;
+
+ mapfile = 0;
+ base = 0;
}
+
+ // Forget the entire symbol table
+ symTab.clear();
+ symTabSize = 0;
+
+ firstFileOffset = 0;
+
+ // Free the foreign symbol table member
+ if (foreignST) {
+ delete foreignST;
+ foreignST = 0;
+ }
+
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result
// of symbol table searches.
for (ModuleMap::iterator I=modules.begin(), E=modules.end(); I != E; ++I ) {
@@ -155,3 +170,8 @@
}
}
+// Archive destructor - just clean up memory
+Archive::~Archive() {
+ cleanUpMemory();
+}
+
Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.20 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.21
--- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.20 Thu Jul 7 22:08:58 2005
+++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Tue Nov 29 23:21:10 2005
@@ -421,42 +421,58 @@
sys::MappedFile arch(TmpArchive);
const char* base = (const char*) arch.map();
- // Open the final file to write and check it.
- std::ofstream FinalFile(archPath.c_str(), io_mode);
- if ( !FinalFile.is_open() || FinalFile.bad() ) {
- throw std::string("Error opening archive file: ") + archPath.toString();
+ // Open another temporary file in order to avoid invalidating the mmapped data
+ sys::Path FinalFilePath = archPath;
+ FinalFilePath.createTemporaryFileOnDisk();
+ sys::RemoveFileOnSignal(FinalFilePath);
+ try {
+
+
+ std::ofstream FinalFile(FinalFilePath.c_str(), io_mode);
+ if ( !FinalFile.is_open() || FinalFile.bad() ) {
+ throw std::string("Error opening archive file: ") + FinalFilePath.toString();
+ }
+
+ // Write the file magic number
+ FinalFile << ARFILE_MAGIC;
+
+ // If there is a foreign symbol table, put it into the file now. Most
+ // ar(1) implementations require the symbol table to be first but llvm-ar
+ // can deal with it being after a foreign symbol table. This ensures
+ // compatibility with other ar(1) implementations as well as allowing the
+ // archive to store both native .o and LLVM .bc files, both indexed.
+ if (foreignST) {
+ writeMember(*foreignST, FinalFile, false, false, false);
+ }
+
+ // Put out the LLVM symbol table now.
+ writeSymbolTable(FinalFile);
+
+ // Copy the temporary file contents being sure to skip the file's magic
+ // number.
+ FinalFile.write(base + sizeof(ARFILE_MAGIC)-1,
+ arch.size()-sizeof(ARFILE_MAGIC)+1);
+
+ // Close up shop
+ FinalFile.close();
+ arch.close();
+
+ // Move the final file over top of TmpArchive
+ FinalFilePath.renamePathOnDisk(TmpArchive);
+ } catch (...) {
+ // Make sure we clean up.
+ if (FinalFilePath.exists())
+ FinalFilePath.eraseFromDisk();
+ throw;
}
-
- // Write the file magic number
- FinalFile << ARFILE_MAGIC;
-
- // If there is a foreign symbol table, put it into the file now. Most
- // ar(1) implementations require the symbol table to be first but llvm-ar
- // can deal with it being after a foreign symbol table. This ensures
- // compatibility with other ar(1) implementations as well as allowing the
- // archive to store both native .o and LLVM .bc files, both indexed.
- if (foreignST) {
- writeMember(*foreignST, FinalFile, false, false, false);
- }
-
- // Put out the LLVM symbol table now.
- writeSymbolTable(FinalFile);
-
- // Copy the temporary file contents being sure to skip the file's magic
- // number.
- FinalFile.write(base + sizeof(ARFILE_MAGIC)-1,
- arch.size()-sizeof(ARFILE_MAGIC)+1);
-
- // Close up shop
- FinalFile.close();
- arch.close();
- TmpArchive.eraseFromDisk();
-
- } else {
- // We don't have to insert the symbol table, so just renaming the temp
- // file to the correct name will suffice.
- TmpArchive.renamePathOnDisk(archPath);
}
+
+ // Before we replace the actual archive, we need to forget all the
+ // members, since they point to data in that old archive. We need to do
+ // we cannot replace an open file on Windows.
+ cleanUpMemory();
+
+ TmpArchive.renamePathOnDisk(archPath);
} catch (...) {
// Make sure we clean up.
if (TmpArchive.exists())
From reid at x10sys.com Tue Nov 29 23:21:24 2005
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 29 Nov 2005 23:21:24 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Archive.h
Message-ID: <200511300521.XAA25552@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Bytecode:
Archive.h updated: 1.11 -> 1.12
---
Log message:
Fix a problem with llvm-ranlib that (on some platforms) caused the archive
file to become corrupted due to interactions between mmap'd memory segments
and file descriptors closing. The problem is completely avoiding by using
a third temporary file.
Patch provided by Evan Jones
---
Diffs of the changes: (+3 -0)
Archive.h | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/include/llvm/Bytecode/Archive.h
diff -u llvm/include/llvm/Bytecode/Archive.h:1.11 llvm/include/llvm/Bytecode/Archive.h:1.12
--- llvm/include/llvm/Bytecode/Archive.h:1.11 Thu Apr 21 15:34:13 2005
+++ llvm/include/llvm/Bytecode/Archive.h Tue Nov 29 23:21:10 2005
@@ -489,6 +489,9 @@
bool fillHeader(const ArchiveMember&mbr,
ArchiveMemberHeader& hdr,int sz, bool TruncateNames) const;
+ /// @brief Frees all the members and unmaps the archive file.
+ void Archive::cleanUpMemory();
+
/// This type is used to keep track of bytecode modules loaded from the
/// symbol table. It maps the file offset to a pair that consists of the
/// associated ArchiveMember and the ModuleProvider.
From lattner at cs.uiuc.edu Tue Nov 29 23:26:15 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Nov 2005 23:26:15 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Archive.h
Message-ID: <200511300526.XAA27700@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Bytecode:
Archive.h updated: 1.12 -> 1.13
---
Log message:
minor cleanup
---
Diffs of the changes: (+1 -1)
Archive.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/include/llvm/Bytecode/Archive.h
diff -u llvm/include/llvm/Bytecode/Archive.h:1.12 llvm/include/llvm/Bytecode/Archive.h:1.13
--- llvm/include/llvm/Bytecode/Archive.h:1.12 Tue Nov 29 23:21:10 2005
+++ llvm/include/llvm/Bytecode/Archive.h Tue Nov 29 23:26:03 2005
@@ -490,7 +490,7 @@
ArchiveMemberHeader& hdr,int sz, bool TruncateNames) const;
/// @brief Frees all the members and unmaps the archive file.
- void Archive::cleanUpMemory();
+ void cleanUpMemory();
/// This type is used to keep track of bytecode modules loaded from the
/// symbol table. It maps the file offset to a pair that consists of the
From lattner at cs.uiuc.edu Wed Nov 30 00:31:40 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 00:31:40 -0600
Subject: [llvm-commits] CVS: llvm/docs/Makefile
Message-ID: <200511300631.AAA20691@zion.cs.uiuc.edu>
Changes in directory llvm/docs:
Makefile updated: 1.10 -> 1.11
---
Log message:
copy the doxygen tarball into the HTML directory after building it
---
Diffs of the changes: (+1 -0)
Makefile | 1 +
1 files changed, 1 insertion(+)
Index: llvm/docs/Makefile
diff -u llvm/docs/Makefile:1.10 llvm/docs/Makefile:1.11
--- llvm/docs/Makefile:1.10 Mon May 16 13:29:13 2005
+++ llvm/docs/Makefile Wed Nov 30 00:31:28 2005
@@ -63,6 +63,7 @@
$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
$(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
$(Verb) $(GZIP) $(PROJ_OBJ_DIR)/doxygen.tar
+ $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
From lattner at cs.uiuc.edu Wed Nov 30 00:35:46 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 00:35:46 -0600
Subject: [llvm-commits] CVS: llvm/docs/index.html
Message-ID: <200511300635.AAA26042@zion.cs.uiuc.edu>
Changes in directory llvm/docs:
index.html updated: 1.47 -> 1.48
---
Log message:
Add a link to the doxygen tarball
---
Diffs of the changes: (+5 -2)
index.html | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
Index: llvm/docs/index.html
diff -u llvm/docs/index.html:1.47 llvm/docs/index.html:1.48
--- llvm/docs/index.html:1.47 Sun Apr 24 12:46:56 2005
+++ llvm/docs/index.html Wed Nov 30 00:35:34 2005
@@ -148,7 +148,10 @@
Doxygen generated
documentation (classes)
+href="http://llvm.cs.uiuc.edu/doxygen/inherits.html">classes)
+
+(tarball)
+
CVSWeb CVS Tree
Browser
@@ -242,6 +245,6 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Compiler Infrastructure
- Last modified: $Date: 2005/04/24 17:46:56 $
+ Last modified: $Date: 2005/11/30 06:35:34 $
From alenhar2 at cs.uiuc.edu Wed Nov 30 00:43:15 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 00:43:15 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Message-ID: <200511300643.AAA31721@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.217 -> 1.218
---
Log message:
add support for custom lowering SINT_TO_FP
---
Diffs of the changes: (+13 -0)
LegalizeDAG.cpp | 13 +++++++++++++
1 files changed, 13 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.217 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.218
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.217 Tue Nov 29 00:21:05 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Nov 30 00:43:03 2005
@@ -1956,6 +1956,19 @@
return Result;
case TargetLowering::Legal:
break;
+ case TargetLowering::Custom: {
+ Tmp1 = LegalizeOp(Node->getOperand(0));
+ SDOperand Tmp =
+ DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1);
+ Tmp = TLI.LowerOperation(Tmp, DAG);
+ if (Tmp.Val) {
+ AddLegalizedOperand(Op, Tmp);
+ NeedsAnotherIteration = true;
+ return Tmp;
+ } else {
+ assert(0 && "Target Must Lower this");
+ }
+ }
}
Tmp1 = LegalizeOp(Node->getOperand(0));
From alenhar2 at cs.uiuc.edu Wed Nov 30 01:14:38 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 01:14:38 -0600
Subject: [llvm-commits] CVS: llvm-test/Makefile.programs
Message-ID: <200511300714.BAA08086@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.programs updated: 1.179 -> 1.180
---
Log message:
Why not. Performance sucks, but correctness sucks more, so sounds just right for beta. Maybe I will be surprised.
---
Diffs of the changes: (+2 -2)
Makefile.programs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.179 llvm-test/Makefile.programs:1.180
--- llvm-test/Makefile.programs:1.179 Sat Nov 12 13:21:05 2005
+++ llvm-test/Makefile.programs Wed Nov 30 01:14:26 2005
@@ -190,8 +190,8 @@
LLCBETAOPTION := -sched=simple
endif
ifeq ($(ARCH),Alpha)
-LLCBETAOPTION := -enable-alpha-intfpdiv
-# -enable-alpha-FTOI
+LLCBETAOPTION := -enable-dag-isel-for-alpha
+# -enable-alpha-FTOI -enable-alpha-intfpdiv
endif
ifeq ($(ARCH),IA64)
LLCBETAOPTION := -enable-ia64-dag-isel
From alenhar2 at cs.uiuc.edu Wed Nov 30 01:20:09 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 01:20:09 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
AlphaISelLowering.cpp AlphaISelLowering.h
AlphaISelPattern.cpp AlphaInstrFormats.td AlphaInstrInfo.td
AlphaRegisterInfo.td
Message-ID: <200511300720.BAA08305@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/Alpha:
AlphaISelDAGToDAG.cpp updated: 1.6 -> 1.7
AlphaISelLowering.cpp updated: 1.9 -> 1.10
AlphaISelLowering.h updated: 1.3 -> 1.4
AlphaISelPattern.cpp updated: 1.188 -> 1.189
AlphaInstrFormats.td updated: 1.14 -> 1.15
AlphaInstrInfo.td updated: 1.73 -> 1.74
AlphaRegisterInfo.td updated: 1.13 -> 1.14
---
Log message:
All sorts of stuff.
Getting in on the custom lowering thing, yay
evilness with fp setcc, yuck
trivial int select, hmmm
in memory args for functions, yay
DIV and REM, always handy. They should be custom lowered though.
Lots more stuff compiles now (go go single source!). Of course, none of it
probably works, but that is what the nightly tester can find out :)
---
Diffs of the changes: (+203 -32)
AlphaISelDAGToDAG.cpp | 90 ++++++++++++++++++++++++++++++++++++++++++++++++--
AlphaISelLowering.cpp | 35 ++++++++++++++++++-
AlphaISelLowering.h | 10 +++++
AlphaISelPattern.cpp | 22 ++++++------
AlphaInstrFormats.td | 10 +++++
AlphaInstrInfo.td | 62 +++++++++++++++++++++++++++-------
AlphaRegisterInfo.td | 6 +--
7 files changed, 203 insertions(+), 32 deletions(-)
Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.6 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.7
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.6 Mon Nov 21 22:20:06 2005
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Nov 30 01:19:56 2005
@@ -16,6 +16,7 @@
#include "AlphaTargetMachine.h"
#include "AlphaISelLowering.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/SSARegMap.h"
#include "llvm/CodeGen/SelectionDAG.h"
@@ -278,6 +279,7 @@
CurDAG->SelectNodeTo(N, Alpha::LDAr, MVT::i64, CPI, Tmp);
return SDOperand(N, 0);
}
+ break;
}
case ISD::ConstantFP:
if (ConstantFPSDNode *CN = dyn_cast(N)) {
@@ -296,7 +298,76 @@
} else {
abort();
}
+ break;
}
+ case ISD::SDIV:
+ case ISD::UDIV:
+ case ISD::UREM:
+ case ISD::SREM:
+ if (MVT::isInteger(N->getValueType(0))) {
+ const char* opstr = 0;
+ switch(N->getOpcode()) {
+ case ISD::UREM: opstr = "__remqu"; break;
+ case ISD::SREM: opstr = "__remq"; break;
+ case ISD::UDIV: opstr = "__divqu"; break;
+ case ISD::SDIV: opstr = "__divq"; break;
+ }
+ SDOperand Tmp1 = Select(N->getOperand(0)),
+ Tmp2 = Select(N->getOperand(1)),
+ Addr = CurDAG->getExternalSymbol(opstr, AlphaLowering.getPointerTy());
+ SDOperand Tmp3 = Select(Addr);
+ SDOperand Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R24,
+ Tmp1, SDOperand());
+ Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R25,
+ Tmp2, Chain.getValue(1));
+ Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R27,
+ Tmp3, Chain.getValue(1));
+ Chain = CurDAG->getTargetNode(Alpha::JSRs, MVT::i64, MVT::Flag,
+ CurDAG->getRegister(Alpha::R27, MVT::i64),
+ getI64Imm(0));
+ return CurDAG->getCopyFromReg(Chain.getValue(1), Alpha::R27, MVT::i64,
+ Chain.getValue(1));
+ }
+ break;
+
+ case ISD::SETCC:
+ if (MVT::isFloatingPoint(N->getOperand(0).Val->getValueType(0))) {
+ unsigned Opc = Alpha::WTF;
+ ISD::CondCode CC = cast(N->getOperand(2))->get();
+ bool rev = false;
+ switch(CC) {
+ default: N->dump(); assert(0 && "Unknown FP comparison!");
+ case ISD::SETEQ: Opc = Alpha::CMPTEQ; break;
+ case ISD::SETLT: Opc = Alpha::CMPTLT; break;
+ case ISD::SETLE: Opc = Alpha::CMPTLE; break;
+ case ISD::SETGT: Opc = Alpha::CMPTLT; rev = true; break;
+ case ISD::SETGE: Opc = Alpha::CMPTLE; rev = true; break;
+ //case ISD::SETNE: Opc = Alpha::CMPTEQ; inv = true; break;
+ };
+ SDOperand tmp1 = Select(N->getOperand(0)),
+ tmp2 = Select(N->getOperand(1));
+ SDOperand cmp = CurDAG->getTargetNode(Opc, MVT::f64,
+ rev?tmp2:tmp1,
+ rev?tmp1:tmp2);
+ SDOperand LD;
+ if (AlphaLowering.hasITOF()) {
+ LD = CurDAG->getNode(AlphaISD::FTOIT_, MVT::i64, cmp);
+ } else {
+ int FrameIdx =
+ CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
+ SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64);
+ SDOperand ST = CurDAG->getTargetNode(Alpha::STT, MVT::Other,
+ cmp, FI, CurDAG->getRegister(Alpha::R31, MVT::i64));
+ LD = CurDAG->getTargetNode(Alpha::LDQ, MVT::i64, FI,
+ CurDAG->getRegister(Alpha::R31, MVT::i64),
+ ST);
+ }
+ SDOperand FP = CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64,
+ CurDAG->getRegister(Alpha::R31, MVT::i64),
+ LD);
+ return FP;
+ }
+ break;
}
return SelectCode(Op);
@@ -328,13 +399,26 @@
for (int i = 0; i < std::min(6, count); ++i) {
if (MVT::isInteger(TypeOperands[i])) {
Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i]);
- } else if (TypeOperands[i] == MVT::f64 || TypeOperands[i] == MVT::f64) {
+ } else if (TypeOperands[i] == MVT::f32 || TypeOperands[i] == MVT::f64) {
Chain = CurDAG->getCopyToReg(Chain, args_float[i], CallOperands[i]);
} else
assert(0 && "Unknown operand");
}
-
- assert(CallOperands.size() <= 6 && "Too big a call");
+ for (int i = 6; i < count; ++i) {
+ unsigned Opc = Alpha::WTF;
+ if (MVT::isInteger(TypeOperands[i])) {
+ Opc = Alpha::STQ;
+ } else if (TypeOperands[i] == MVT::f32) {
+ Opc = Alpha::STS;
+ } else if (TypeOperands[i] == MVT::f64) {
+ Opc = Alpha::STT;
+ } else
+ assert(0 && "Unknown operand");
+ Chain = CurDAG->getTargetNode(Opc, MVT::Other, CallOperands[i],
+ getI64Imm((i - 6) * 8),
+ CurDAG->getRegister(Alpha::R30, MVT::i64),
+ Chain);
+ }
Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr);
// Finally, once everything is in registers to pass to the call, emit the
Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.9 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.10
--- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.9 Tue Nov 29 00:16:21 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Wed Nov 30 01:19:56 2005
@@ -72,6 +72,7 @@
setOperationAction(ISD::FREM, MVT::f64, Expand);
setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand);
+ setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
if (!TM.getSubtarget().hasCT()) {
setOperationAction(ISD::CTPOP , MVT::i64 , Expand);
@@ -101,10 +102,12 @@
// We don't have line number support yet.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- computeRegisterProperties();
-
addLegalFPImmediate(+0.0); //F31
addLegalFPImmediate(-0.0); //-F31
+
+ computeRegisterProperties();
+
+ useITOF = TM.getSubtarget().hasF2I();
}
@@ -385,3 +388,31 @@
}
+/// LowerOperation - Provide custom lowering hooks for some operations.
+///
+SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
+ switch (Op.getOpcode()) {
+ default: assert(0 && "Wasn't expecting to be able to lower this!");
+ case ISD::SINT_TO_FP: {
+ assert(MVT::i64 == Op.getOperand(0).getValueType() &&
+ "Unhandled SINT_TO_FP type in custom expander!");
+ SDOperand LD;
+ bool isDouble = MVT::f64 == Op.getValueType();
+ if (useITOF) {
+ LD = DAG.getNode(AlphaISD::ITOFT_, MVT::f64, Op.getOperand(0));
+ } else {
+ int FrameIdx =
+ DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
+ SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64);
+ SDOperand ST = DAG.getNode(ISD::STORE, MVT::Other, DAG.getEntryNode(),
+ Op.getOperand(0), FI, DAG.getSrcValue(0));
+ LD = DAG.getLoad(MVT::f64, ST, FI, DAG.getSrcValue(0));
+ }
+ SDOperand FP = DAG.getNode(isDouble?AlphaISD::CVTQT_:AlphaISD::CVTQS_,
+ isDouble?MVT::f64:MVT::f32, LD);
+ return FP;
+ }
+ }
+ return SDOperand();
+}
+
Index: llvm/lib/Target/Alpha/AlphaISelLowering.h
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.3 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.4
--- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.3 Sat Oct 22 17:06:58 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.h Wed Nov 30 01:19:56 2005
@@ -25,6 +25,8 @@
enum NodeType {
// Start the numbering where the builting ops and target ops leave off.
FIRST_NUMBER = ISD::BUILTIN_OP_END+Alpha::INSTRUCTION_LIST_END,
+ //These corrospond to the identical Instruction
+ ITOFT_, FTOIT_, CVTQT_, CVTQS_,
};
}
@@ -33,9 +35,14 @@
int VarArgsBase; // What is the base FrameIndex
unsigned GP; //GOT vreg
unsigned RA; //Return Address
+ bool useITOF;
public:
AlphaTargetLowering(TargetMachine &TM);
-
+
+ /// LowerOperation - Provide custom lowering hooks for some operations.
+ ///
+ virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
+
/// LowerArguments - This hook must be implemented to indicate how we should
/// lower the arguments for the specified function, into the specified DAG.
virtual std::vector
@@ -61,6 +68,7 @@
void restoreRA(MachineBasicBlock* BB);
unsigned getVRegGP() { return GP; }
unsigned getVRegRA() { return RA; }
+ bool hasITOF() { return useITOF; }
};
}
Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.188 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.189
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.188 Tue Nov 22 14:59:00 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Wed Nov 30 01:19:56 2005
@@ -1559,17 +1559,17 @@
}
return Result;
- case ISD::SINT_TO_FP:
- {
- assert (N.getOperand(0).getValueType() == MVT::i64
- && "only quads can be loaded from");
- Tmp1 = SelectExpr(N.getOperand(0)); // Get the operand register
- Tmp2 = MakeReg(MVT::f64);
- MoveInt2FP(Tmp1, Tmp2, true);
- Opc = DestType == MVT::f64 ? Alpha::CVTQT : Alpha::CVTQS;
- BuildMI(BB, Opc, 1, Result).addReg(Tmp2);
- return Result;
- }
+ case AlphaISD::CVTQT_:
+ BuildMI(BB, Alpha::CVTQT, 1, Result).addReg(SelectExpr(N.getOperand(0)));
+ return Result;
+
+ case AlphaISD::CVTQS_:
+ BuildMI(BB, Alpha::CVTQS, 1, Result).addReg(SelectExpr(N.getOperand(0)));
+ return Result;
+
+ case AlphaISD::ITOFT_:
+ BuildMI(BB, Alpha::ITOFT, 1, Result).addReg(SelectExpr(N.getOperand(0)));
+ return Result;
case ISD::AssertSext:
case ISD::AssertZext:
Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td
diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.14 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.15
--- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.14 Mon Nov 21 22:20:06 2005
+++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Wed Nov 30 01:19:56 2005
@@ -40,6 +40,16 @@
}
//3.3.1
+class MFormAlt opcode, string asmstr>
+ : InstAlphaAlt {
+ bits<5> Ra;
+ bits<16> disp;
+ bits<5> Rb;
+
+ let Inst{25-21} = Ra;
+ let Inst{20-16} = Rb;
+ let Inst{15-0} = disp;
+}
class MForm opcode, string asmstr>
: InstAlpha {
bits<5> Ra;
Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.73 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.74
--- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.73 Mon Nov 21 22:20:06 2005
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Nov 30 01:19:56 2005
@@ -13,6 +13,20 @@
include "AlphaInstrFormats.td"
//********************
+//Custom DAG Nodes
+//********************
+
+def SDTFPUnaryOpUnC : SDTypeProfile<1, 1, [
+ SDTCisFP<1>, SDTCisFP<0>
+]>;
+
+def Alpha_itoft : SDNode<"AlphaISD::ITOFT_", SDTIntToFPOp, []>;
+def Alpha_ftoit : SDNode<"AlphaISD::FTOIT_", SDTFPToIntOp, []>;
+def Alpha_cvtqt : SDNode<"AlphaISD::CVTQT_", SDTFPUnaryOpUnC, []>;
+def Alpha_cvtqs : SDNode<"AlphaISD::CVTQS_", SDTFPUnaryOpUnC, []>;
+
+
+//********************
//Paterns for matching
//********************
@@ -143,6 +157,10 @@
def CMOVNE : OForm4< 0x11, 0x26, "cmovne $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND != zero
def CMOVNEi : OForm4L< 0x11, 0x26, "cmovne $RCOND,$L,$RDEST">; //CMOVE if RCOND != zero
+//FIXME: fold setcc with select
+def : Pat<(select GPRC:$which, GPRC:$src1, GPRC:$src2),
+ (CMOVEQ GPRC:$src1, GPRC:$src2, GPRC:$which)>;
+
//conditional moves, fp
let OperandList = (ops F8RC:$RDEST, F8RC:$RSRC2, F8RC:$RSRC, F8RC:$RCOND),
isTwoAddress = 1 in {
@@ -409,12 +427,16 @@
def LDWU : MForm<0x0C, "ldwu $RA,$DISP($RB)">; //Load zero-extended word
//Stores, float
-def STS : MForm<0x26, "sts $RA,$DISP($RB)">; //Store S_floating
-def STT : MForm<0x27, "stt $RA,$DISP($RB)">; //Store T_floating
+let OperandList = (ops F4RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def STS : MFormAlt<0x26, "sts $RA,$DISP($RB)">; //Store S_floating
+let OperandList = (ops F8RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def STT : MFormAlt<0x27, "stt $RA,$DISP($RB)">; //Store T_floating
//Loads, float
-def LDS : MForm<0x22, "lds $RA,$DISP($RB)">; //Load S_floating
-def LDT : MForm<0x23, "ldt $RA,$DISP($RB)">; //Load T_floating
+let OperandList = (ops F4RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def LDS : MFormAlt<0x22, "lds $RA,$DISP($RB)">; //Load S_floating
+let OperandList = (ops F8RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def LDT : MFormAlt<0x23, "ldt $RA,$DISP($RB)">; //Load T_floating
//Load address
def LDA : MForm<0x08, "lda $RA,$DISP($RB)">; //Load address
@@ -428,8 +450,10 @@
def LDWUr : MForm<0x0C, "ldwu $RA,$DISP($RB)\t\t!gprellow">; //Load zero-extended word
//Loads, float, Rellocated Low form
-def LDSr : MForm<0x22, "lds $RA,$DISP($RB)\t\t!gprellow">; //Load S_floating
-def LDTr : MForm<0x23, "ldt $RA,$DISP($RB)\t\t!gprellow">; //Load T_floating
+let OperandList = (ops F4RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def LDSr : MFormAlt<0x22, "lds $RA,$DISP($RB)\t\t!gprellow">; //Load S_floating
+let OperandList = (ops F8RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def LDTr : MFormAlt<0x23, "ldt $RA,$DISP($RB)\t\t!gprellow">; //Load T_floating
//Load address, rellocated low and high form
def LDAr : MForm<0x08, "lda $RA,$DISP($RB)\t\t!gprellow">; //Load address
@@ -450,8 +474,10 @@
def STQr : MForm<0x2D, "stq $RA,$DISP($RB)\t\t!gprellow">; //Store quadword
//Stores, float
-def STSr : MForm<0x26, "sts $RA,$DISP($RB)\t\t!gprellow">; //Store S_floating
-def STTr : MForm<0x27, "stt $RA,$DISP($RB)\t\t!gprellow">; //Store T_floating
+let OperandList = (ops F4RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def STSr : MFormAlt<0x26, "sts $RA,$DISP($RB)\t\t!gprellow">; //Store S_floating
+let OperandList = (ops F8RC:$RA, s16imm:$DISP, GPRC:$RB) in
+def STTr : MFormAlt<0x27, "stt $RA,$DISP($RB)\t\t!gprellow">; //Store T_floating
//Branches, int
@@ -533,17 +559,21 @@
let OperandList = (ops GPRC:$RC, F4RC:$RA), Fb = 31 in
def FTOIS : FPForm<0x1C, 0x078, "ftois $RA,$RC",[]>; //Floating to integer move, S_floating
let OperandList = (ops GPRC:$RC, F8RC:$RA), Fb = 31 in
-def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC",[]>; //Floating to integer move, T_floating
+def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC",
+ [(set GPRC:$RC, (Alpha_ftoit F8RC:$RA))]>; //Floating to integer move
let OperandList = (ops F4RC:$RC, GPRC:$RA), Fb = 31 in
def ITOFS : FPForm<0x14, 0x004, "itofs $RA,$RC",[]>; //Integer to floating move, S_floating
let OperandList = (ops F8RC:$RC, GPRC:$RA), Fb = 31 in
-def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC",[]>; //Integer to floating move, T_floating
+def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC",
+ [(set F8RC:$RC, (Alpha_itoft GPRC:$RA))]>; //Integer to floating move
let OperandList = (ops F4RC:$RC, F8RC:$RB), Fa = 31 in
-def CVTQS : FPForm<0x16, 0x7BC, "cvtqs/sui $RB,$RC",[]>; //Convert quadword to S_floating
+def CVTQS : FPForm<0x16, 0x7BC, "cvtqs/sui $RB,$RC",
+ [(set F4RC:$RC, (Alpha_cvtqs F8RC:$RB))]>;
let OperandList = (ops F8RC:$RC, F8RC:$RB), Fa = 31 in
-def CVTQT : FPForm<0x16, 0x7BE, "cvtqt/sui $RB,$RC",[]>; //Convert quadword to T_floating
+def CVTQT : FPForm<0x16, 0x7BE, "cvtqt/sui $RB,$RC",
+ [(set F8RC:$RC, (Alpha_cvtqt F8RC:$RB))]>;
let OperandList = (ops F8RC:$RC, F8RC:$RB), Fa = 31 in
def CVTTQ : FPForm<0x16, 0x52F, "cvttq/svc $RB,$RC",[]>; //Convert T_floating to quadword
let OperandList = (ops F8RC:$RC, F4RC:$RB), Fa = 31 in
@@ -648,3 +678,11 @@
def : Pat<(select GPRC:$which, GPRC:$src1, GPRC:$src2),
(CMOVEQ GPRC:$src1, GPRC:$src2, GPRC:$which)>; //may be CMOVNE
+def : Pat<(fabs F8RC:$RB),
+ (CPYST F31, F8RC:$RB)>;
+def : Pat<(fabs F4RC:$RB),
+ (CPYSS F31, F4RC:$RB)>;
+def : Pat<(fneg F8RC:$RB),
+ (CPYSNT F8RC:$RB, F8RC:$RB)>;
+def : Pat<(fneg F4RC:$RB),
+ (CPYSNS F4RC:$RB, F4RC:$RB)>;
Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.td
diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.13 llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.14
--- llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.13 Wed Nov 9 13:17:08 2005
+++ llvm/lib/Target/Alpha/AlphaRegisterInfo.td Wed Nov 30 01:19:56 2005
@@ -78,7 +78,6 @@
// $28 is undefined after any and all calls
/// Register classes
-// Don't allocate 15, 28, 30, 31
def GPRC : RegisterClass<"Alpha", i64, 64,
// Volatile
[R0, R1, R2, R3, R4, R5, R6, R7, R8, R16, R17, R18, R19, R20, R21, R22,
@@ -89,7 +88,8 @@
R29, //global offset table address
// Non-volatile
R9, R10, R11, R12, R13, R14,
- R31 ]> //zero
+// Don't allocate 15, 30, 31
+ R15, R30, R31 ]> //zero
{
let MethodProtos = [{
iterator allocation_order_end(MachineFunction &MF) const;
@@ -97,7 +97,7 @@
let MethodBodies = [{
GPRCClass::iterator
GPRCClass::allocation_order_end(MachineFunction &MF) const {
- return end()-1;
+ return end()-3;
}
}];
}
From natebegeman at mac.com Wed Nov 30 02:22:41 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 02:22:41 -0600
Subject: [llvm-commits]
CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <200511300822.CAA15122@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.107 -> 1.108
---
Log message:
First chunk of actually generating vector code for packed types. These
changes allow us to generate the following code:
_foo:
li r2, 0
lvx v0, r2, r3
vaddfp v0, v0, v0
stvx v0, r2, r3
blr
for this llvm:
void %foo(<4 x float>* %a) {
entry:
%tmp1 = load <4 x float>* %a
%tmp2 = add <4 x float> %tmp1, %tmp1
store <4 x float> %tmp2, <4 x float>* %a
ret void
}
---
Diffs of the changes: (+12 -2)
SelectionDAGISel.cpp | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.107 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.108
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.107 Tue Nov 29 23:21:10 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Nov 30 02:22:07 2005
@@ -520,12 +520,19 @@
const PackedType *PTy = cast(Ty);
unsigned NumElements = PTy->getNumElements();
MVT::ValueType PVT = TLI.getValueType(PTy->getElementType());
+ MVT::ValueType TVT = MVT::getVectorType(PVT, NumElements);
// Immediately scalarize packed types containing only one element, so that
- // the Legalize pass does not have to deal with them.
+ // the Legalize pass does not have to deal with them. Similarly, if the
+ // abstract vector is going to turn into one that the target natively
+ // supports, generate that type now so that Legalize doesn't have to deal
+ // with that either. These steps ensure that Legalize only has to handle
+ // vector types in its Expand case.
+ unsigned Opc = MVT::isFloatingPoint(PVT) ? FPOp : IntOp;
if (NumElements == 1) {
- unsigned Opc = MVT::isFloatingPoint(PVT) ? FPOp : IntOp;
setValue(&I, DAG.getNode(Opc, PVT, Op1, Op2));
+ } else if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
+ setValue(&I, DAG.getNode(Opc, TVT, Op1, Op2));
} else {
SDOperand Num = DAG.getConstant(NumElements, MVT::i32);
SDOperand Typ = DAG.getValueType(PVT);
@@ -777,11 +784,14 @@
const PackedType *PTy = cast(Ty);
unsigned NumElements = PTy->getNumElements();
MVT::ValueType PVT = TLI.getValueType(PTy->getElementType());
+ MVT::ValueType TVT = MVT::getVectorType(PVT, NumElements);
// Immediately scalarize packed types containing only one element, so that
// the Legalize pass does not have to deal with them.
if (NumElements == 1) {
L = DAG.getLoad(PVT, Root, Ptr, DAG.getSrcValue(I.getOperand(0)));
+ } else if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
+ L = DAG.getLoad(TVT, Root, Ptr, DAG.getSrcValue(I.getOperand(0)));
} else {
L = DAG.getVecLoad(NumElements, PVT, Root, Ptr,
DAG.getSrcValue(I.getOperand(0)));
From natebegeman at mac.com Wed Nov 30 02:22:41 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 02:22:41 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Message-ID: <200511300822.CAA15120@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCISelDAGToDAG.cpp updated: 1.130 -> 1.131
---
Log message:
First chunk of actually generating vector code for packed types. These
changes allow us to generate the following code:
_foo:
li r2, 0
lvx v0, r2, r3
vaddfp v0, v0, v0
stvx v0, r2, r3
blr
for this llvm:
void %foo(<4 x float>* %a) {
entry:
%tmp1 = load <4 x float>* %a
%tmp2 = add <4 x float> %tmp1, %tmp1
store <4 x float> %tmp2, <4 x float>* %a
ret void
}
---
Diffs of the changes: (+51 -11)
PPCISelDAGToDAG.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 51 insertions(+), 11 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.130 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.131
--- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.130 Thu Nov 17 12:26:56 2005
+++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Wed Nov 30 02:22:07 2005
@@ -73,6 +73,11 @@
/// load/store instruction, and return true if it should be an indexed [r+r]
/// operation.
bool SelectAddr(SDOperand Addr, SDOperand &Op1, SDOperand &Op2);
+
+ /// SelectAddrIndexed - Given the specified addressed, force it to be
+ /// represented as an indexed [r+r] operation, rather than possibly
+ /// returning [r+imm] as SelectAddr may.
+ void SelectAddrIndexed(SDOperand Addr, SDOperand &Op1, SDOperand &Op2);
SDOperand BuildSDIVSequence(SDNode *N);
SDOperand BuildUDIVSequence(SDNode *N);
@@ -428,7 +433,7 @@
}
}
- if (FrameIndexSDNode *FI = dyn_cast(Addr)) {
+ if (FrameIndexSDNode *FI = dyn_cast(Addr)) {
Op1 = getI32Imm(0);
Op2 = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32);
return false;
@@ -445,6 +450,26 @@
return false;
}
+/// SelectAddrIndexed - Given the specified addressed, force it to be
+/// represented as an indexed [r+r] operation, rather than possibly
+/// returning [r+imm] as SelectAddr may.
+void PPCDAGToDAGISel::SelectAddrIndexed(SDOperand Addr, SDOperand &Op1,
+ SDOperand &Op2) {
+ if (Addr.getOpcode() == ISD::ADD) {
+ Op1 = Select(Addr.getOperand(0));
+ Op2 = Select(Addr.getOperand(1));
+ return;
+ }
+
+ if (FrameIndexSDNode *FI = dyn_cast(Addr)) {
+ Op1 = CurDAG->getTargetNode(PPC::LI, MVT::i32, getI32Imm(0));
+ Op2 = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32);
+ return;
+ }
+ Op1 = CurDAG->getTargetNode(PPC::LI, MVT::i32, getI32Imm(0));
+ Op2 = Select(Addr);
+}
+
/// SelectCC - Select a comparison of the specified values with the specified
/// condition code, returning the CR# of the expression.
SDOperand PPCDAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS,
@@ -916,9 +941,8 @@
}
}
- CurDAG->SelectNodeTo(N, Ty == MVT::f64 ? PPC::FADD : PPC::FADDS, Ty,
- Select(N->getOperand(0)), Select(N->getOperand(1)));
- return SDOperand(N, 0);
+ // Other cases are autogenerated.
+ break;
}
case ISD::FSUB: {
MVT::ValueType Ty = N->getValueType(0);
@@ -942,10 +966,9 @@
return SDOperand(N, 0);
}
}
- CurDAG->SelectNodeTo(N, Ty == MVT::f64 ? PPC::FSUB : PPC::FSUBS, Ty,
- Select(N->getOperand(0)),
- Select(N->getOperand(1)));
- return SDOperand(N, 0);
+
+ // Other cases are autogenerated.
+ break;
}
case ISD::SDIV: {
// FIXME: since this depends on the setting of the carry flag from the srawi
@@ -1074,10 +1097,17 @@
case ISD::ZEXTLOAD:
case ISD::SEXTLOAD: {
SDOperand Op1, Op2;
- bool isIdx = SelectAddr(N->getOperand(1), Op1, Op2);
-
+ // If this is a vector load, then force this to be indexed addressing, since
+ // altivec does not have immediate offsets for loads.
+ bool isIdx = true;
+ if (N->getOpcode() == ISD::LOAD && MVT::isVector(N->getValueType(0))) {
+ SelectAddrIndexed(N->getOperand(1), Op1, Op2);
+ } else {
+ isIdx = SelectAddr(N->getOperand(1), Op1, Op2);
+ }
MVT::ValueType TypeBeingLoaded = (N->getOpcode() == ISD::LOAD) ?
N->getValueType(0) : cast(N->getOperand(3))->getVT();
+
unsigned Opc;
switch (TypeBeingLoaded) {
default: N->dump(); assert(0 && "Cannot load this type!");
@@ -1093,6 +1123,7 @@
case MVT::i32: Opc = isIdx ? PPC::LWZX : PPC::LWZ; break;
case MVT::f32: Opc = isIdx ? PPC::LFSX : PPC::LFS; break;
case MVT::f64: Opc = isIdx ? PPC::LFDX : PPC::LFD; break;
+ case MVT::v4f32: Opc = PPC::LVX; break;
}
// If this is an f32 -> f64 load, emit the f32 load, then use an 'extending
@@ -1119,7 +1150,15 @@
case ISD::TRUNCSTORE:
case ISD::STORE: {
SDOperand AddrOp1, AddrOp2;
- bool isIdx = SelectAddr(N->getOperand(2), AddrOp1, AddrOp2);
+ // If this is a vector store, then force this to be indexed addressing,
+ // since altivec does not have immediate offsets for stores.
+ bool isIdx = true;
+ if (N->getOpcode() == ISD::STORE &&
+ MVT::isVector(N->getOperand(1).getValueType())) {
+ SelectAddrIndexed(N->getOperand(2), AddrOp1, AddrOp2);
+ } else {
+ isIdx = SelectAddr(N->getOperand(2), AddrOp1, AddrOp2);
+ }
unsigned Opc;
if (N->getOpcode() == ISD::STORE) {
@@ -1128,6 +1167,7 @@
case MVT::i32: Opc = isIdx ? PPC::STWX : PPC::STW; break;
case MVT::f64: Opc = isIdx ? PPC::STFDX : PPC::STFD; break;
case MVT::f32: Opc = isIdx ? PPC::STFSX : PPC::STFS; break;
+ case MVT::v4f32: Opc = PPC::STVX;
}
} else { //ISD::TRUNCSTORE
switch(cast(N->getOperand(4))->getVT()) {
From natebegeman at mac.com Wed Nov 30 02:22:41 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 02:22:41 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Message-ID: <200511300822.CAA15121@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
ValueTypes.h updated: 1.14 -> 1.15
---
Log message:
First chunk of actually generating vector code for packed types. These
changes allow us to generate the following code:
_foo:
li r2, 0
lvx v0, r2, r3
vaddfp v0, v0, v0
stvx v0, r2, r3
blr
for this llvm:
void %foo(<4 x float>* %a) {
entry:
%tmp1 = load <4 x float>* %a
%tmp2 = add <4 x float> %tmp1, %tmp1
store <4 x float> %tmp2, <4 x float>* %a
ret void
}
---
Diffs of the changes: (+17 -4)
ValueTypes.h | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
Index: llvm/include/llvm/CodeGen/ValueTypes.h
diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.14 llvm/include/llvm/CodeGen/ValueTypes.h:1.15
--- llvm/include/llvm/CodeGen/ValueTypes.h:1.14 Mon Nov 28 23:45:28 2005
+++ llvm/include/llvm/CodeGen/ValueTypes.h Wed Nov 30 02:22:02 2005
@@ -45,10 +45,8 @@
isVoid = 12, // This has no value
Vector = 13, // This is an abstract vector type, which will
- // be refined into a target vector type, or
- // scalarized.
-
- // These are 128 bit vectors of varying packed types
+ // be expanded into a target vector type, or scalars
+ // if no matching vector type is available.
v16i8 = 14, // 16 x i8
v8i16 = 15, // 8 x i16
v4i32 = 16, // 4 x i32
@@ -70,6 +68,21 @@
return (VT >= v16i8 && VT <= v2f64);
}
+ /// getVectorType - Returns the ValueType that represents a vector NumElements
+ /// in length, where each element is of type VT. If there is no ValueType
+ /// that represents this vector, a ValueType of Other is returned.
+ ///
+ static inline ValueType getVectorType(ValueType VT, unsigned NumElements) {
+ switch (VT) {
+ default:
+ break;
+ case MVT::f32:
+ if (NumElements == 4) return MVT::v4f32;
+ break;
+ }
+ return MVT::Other;
+ }
+
static inline unsigned getSizeInBits(ValueType VT) {
switch (VT) {
default: assert(0 && "ValueType has no known size!");
From alenhar2 at cs.uiuc.edu Wed Nov 30 10:10:48 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 10:10:48 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
AlphaISelLowering.cpp AlphaISelLowering.h
AlphaISelPattern.cpp AlphaInstrInfo.td
Message-ID: <200511301610.KAA28430@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/Alpha:
AlphaISelDAGToDAG.cpp updated: 1.7 -> 1.8
AlphaISelLowering.cpp updated: 1.10 -> 1.11
AlphaISelLowering.h updated: 1.4 -> 1.5
AlphaISelPattern.cpp updated: 1.189 -> 1.190
AlphaInstrInfo.td updated: 1.74 -> 1.75
---
Log message:
FPSelect and more custom lowering
---
Diffs of the changes: (+69 -25)
AlphaISelDAGToDAG.cpp | 29 ++++++++++++++++++++++++++++-
AlphaISelLowering.cpp | 27 +++++++++++++++++++++++++--
AlphaISelLowering.h | 2 +-
AlphaISelPattern.cpp | 28 ++++++++--------------------
AlphaInstrInfo.td | 8 +++++++-
5 files changed, 69 insertions(+), 25 deletions(-)
Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.7 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.8
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.7 Wed Nov 30 01:19:56 2005
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Nov 30 10:10:29 2005
@@ -368,8 +368,35 @@
return FP;
}
break;
+
+ case ISD::SELECT:
+ if (MVT::isFloatingPoint(N->getValueType(0))) {
+ //move int to fp
+ SDOperand LD,
+ cond = Select(N->getOperand(0)),
+ TV = Select(N->getOperand(1)),
+ FV = Select(N->getOperand(2));
+
+ if (AlphaLowering.hasITOF()) {
+ LD = CurDAG->getNode(AlphaISD::ITOFT_, MVT::f64, cond);
+ } else {
+ int FrameIdx =
+ CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
+ SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64);
+ SDOperand ST = CurDAG->getTargetNode(Alpha::STQ, MVT::Other,
+ cond, FI, CurDAG->getRegister(Alpha::R31, MVT::i64));
+ LD = CurDAG->getTargetNode(Alpha::LDT, MVT::f64, FI,
+ CurDAG->getRegister(Alpha::R31, MVT::i64),
+ ST);
+ }
+ SDOperand FP = CurDAG->getTargetNode(Alpha::FCMOVEQ, MVT::f64, TV, FV, LD);
+ return FP;
+ }
+ break;
+
+
}
-
+
return SelectCode(Op);
}
Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.10 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.11
--- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.10 Wed Nov 30 01:19:56 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Wed Nov 30 10:10:29 2005
@@ -73,7 +73,9 @@
setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand);
setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
-
+ setOperationAction(ISD::FP_TO_UINT, MVT::i64, Expand);
+ setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
+
if (!TM.getSubtarget().hasCT()) {
setOperationAction(ISD::CTPOP , MVT::i64 , Expand);
setOperationAction(ISD::CTTZ , MVT::i64 , Expand);
@@ -412,7 +414,28 @@
isDouble?MVT::f64:MVT::f32, LD);
return FP;
}
+ case ISD::FP_TO_SINT: {
+ bool isDouble = MVT::f64 == Op.getOperand(0).getValueType();
+ SDOperand src = Op.getOperand(0);
+
+ if (!isDouble) //Promote
+ src = DAG.getNode(ISD::FP_EXTEND, MVT::f64, src);
+
+ src = DAG.getNode(AlphaISD::CVTTQ_, MVT::f64, src);
+
+ if (useITOF) {
+ return DAG.getNode(AlphaISD::FTOIT_, MVT::i64, src);
+ } else {
+ int FrameIdx =
+ DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
+ SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64);
+ SDOperand ST = DAG.getNode(ISD::STORE, MVT::Other, DAG.getEntryNode(),
+ src, FI, DAG.getSrcValue(0));
+ return DAG.getLoad(MVT::i64, ST, FI, DAG.getSrcValue(0));
+ }
+ }
+
}
+
return SDOperand();
}
-
Index: llvm/lib/Target/Alpha/AlphaISelLowering.h
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.4 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.5
--- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.4 Wed Nov 30 01:19:56 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.h Wed Nov 30 10:10:29 2005
@@ -26,7 +26,7 @@
// Start the numbering where the builting ops and target ops leave off.
FIRST_NUMBER = ISD::BUILTIN_OP_END+Alpha::INSTRUCTION_LIST_END,
//These corrospond to the identical Instruction
- ITOFT_, FTOIT_, CVTQT_, CVTQS_,
+ ITOFT_, FTOIT_, CVTQT_, CVTQS_, CVTTQ_,
};
}
Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.189 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.190
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.189 Wed Nov 30 01:19:56 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Wed Nov 30 10:10:29 2005
@@ -1297,26 +1297,6 @@
return Result;
}
- case ISD::FP_TO_UINT:
- case ISD::FP_TO_SINT:
- {
- assert (DestType == MVT::i64 && "only quads can be loaded to");
- MVT::ValueType SrcType = N.getOperand(0).getValueType();
- assert (SrcType == MVT::f32 || SrcType == MVT::f64);
- Tmp1 = SelectExpr(N.getOperand(0)); // Get the operand register
- if (SrcType == MVT::f32)
- {
- Tmp2 = MakeReg(MVT::f64);
- BuildMI(BB, Alpha::CVTST, 1, Tmp2).addReg(Tmp1);
- Tmp1 = Tmp2;
- }
- Tmp2 = MakeReg(MVT::f64);
- BuildMI(BB, Alpha::CVTTQ, 1, Tmp2).addReg(Tmp1);
- MoveFP2Int(Tmp2, Result, true);
-
- return Result;
- }
-
case ISD::SELECT:
if (isFP) {
//Tmp1 = SelectExpr(N.getOperand(0)); //Cond
@@ -1567,10 +1547,18 @@
BuildMI(BB, Alpha::CVTQS, 1, Result).addReg(SelectExpr(N.getOperand(0)));
return Result;
+ case AlphaISD::CVTTQ_:
+ BuildMI(BB, Alpha::CVTTQ, 1, Result).addReg(SelectExpr(N.getOperand(0)));
+ return Result;
+
case AlphaISD::ITOFT_:
BuildMI(BB, Alpha::ITOFT, 1, Result).addReg(SelectExpr(N.getOperand(0)));
return Result;
+ case AlphaISD::FTOIT_:
+ BuildMI(BB, Alpha::FTOIT, 1, Result).addReg(SelectExpr(N.getOperand(0)));
+ return Result;
+
case ISD::AssertSext:
case ISD::AssertZext:
return SelectExpr(N.getOperand(0));
Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.74 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.75
--- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.74 Wed Nov 30 01:19:56 2005
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Nov 30 10:10:29 2005
@@ -24,6 +24,7 @@
def Alpha_ftoit : SDNode<"AlphaISD::FTOIT_", SDTFPToIntOp, []>;
def Alpha_cvtqt : SDNode<"AlphaISD::CVTQT_", SDTFPUnaryOpUnC, []>;
def Alpha_cvtqs : SDNode<"AlphaISD::CVTQS_", SDTFPUnaryOpUnC, []>;
+def Alpha_cvttq : SDNode<"AlphaISD::CVTTQ_", SDTFPUnaryOp, []>;
//********************
@@ -575,7 +576,8 @@
def CVTQT : FPForm<0x16, 0x7BE, "cvtqt/sui $RB,$RC",
[(set F8RC:$RC, (Alpha_cvtqt F8RC:$RB))]>;
let OperandList = (ops F8RC:$RC, F8RC:$RB), Fa = 31 in
-def CVTTQ : FPForm<0x16, 0x52F, "cvttq/svc $RB,$RC",[]>; //Convert T_floating to quadword
+def CVTTQ : FPForm<0x16, 0x52F, "cvttq/svc $RB,$RC",
+ [(set F8RC:$RC, (Alpha_cvttq F8RC:$RB))]>;
let OperandList = (ops F8RC:$RC, F4RC:$RB), Fa = 31 in
def CVTST : FPForm<0x16, 0x6AC, "cvtst/s $RB,$RC",
[(set F8RC:$RC, (fextend F4RC:$RB))]>;
@@ -686,3 +688,7 @@
(CPYSNT F8RC:$RB, F8RC:$RB)>;
def : Pat<(fneg F4RC:$RB),
(CPYSNS F4RC:$RB, F4RC:$RB)>;
+//Yes, signed multiply high is ugly
+def : Pat<(mulhs GPRC:$RA, GPRC:$RB),
+ (SUBQ (UMULH GPRC:$RA, GPRC:$RB), (ADDQ (CMOVGE GPRC:$RB, R31, GPRC:$RA),
+ (CMOVGE GPRC:$RA, R31, GPRC:$RB)))>;
From alenhar2 at cs.uiuc.edu Wed Nov 30 11:11:32 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 11:11:32 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
AlphaISelLowering.cpp AlphaISelPattern.cpp AlphaInstrInfo.td
Message-ID: <200511301711.LAA28872@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/Alpha:
AlphaISelDAGToDAG.cpp updated: 1.8 -> 1.9
AlphaISelLowering.cpp updated: 1.11 -> 1.12
AlphaISelPattern.cpp updated: 1.190 -> 1.191
AlphaInstrInfo.td updated: 1.75 -> 1.76
---
Log message:
Make typesafe that which isn't: FCMOVxx
---
Diffs of the changes: (+52 -26)
AlphaISelDAGToDAG.cpp | 12 +++++++++---
AlphaISelLowering.cpp | 3 +--
AlphaISelPattern.cpp | 32 +++++++++++++++++++++-----------
AlphaInstrInfo.td | 31 +++++++++++++++++++++----------
4 files changed, 52 insertions(+), 26 deletions(-)
Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.8 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.9
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.8 Wed Nov 30 10:10:29 2005
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Nov 30 11:11:20 2005
@@ -335,6 +335,7 @@
unsigned Opc = Alpha::WTF;
ISD::CondCode CC = cast(N->getOperand(2))->get();
bool rev = false;
+ bool isNE = false;
switch(CC) {
default: N->dump(); assert(0 && "Unknown FP comparison!");
case ISD::SETEQ: Opc = Alpha::CMPTEQ; break;
@@ -342,13 +343,17 @@
case ISD::SETLE: Opc = Alpha::CMPTLE; break;
case ISD::SETGT: Opc = Alpha::CMPTLT; rev = true; break;
case ISD::SETGE: Opc = Alpha::CMPTLE; rev = true; break;
- //case ISD::SETNE: Opc = Alpha::CMPTEQ; inv = true; break;
+ case ISD::SETNE: Opc = Alpha::CMPTEQ; isNE = true; break;
};
SDOperand tmp1 = Select(N->getOperand(0)),
tmp2 = Select(N->getOperand(1));
SDOperand cmp = CurDAG->getTargetNode(Opc, MVT::f64,
rev?tmp2:tmp1,
rev?tmp1:tmp2);
+ if (isNE)
+ cmp = CurDAG->getTargetNode(Alpha::CMPTEQ, MVT::f64, cmp,
+ CurDAG->getRegister(Alpha::F31, MVT::f64));
+
SDOperand LD;
if (AlphaLowering.hasITOF()) {
LD = CurDAG->getNode(AlphaISD::FTOIT_, MVT::i64, cmp);
@@ -372,6 +377,7 @@
case ISD::SELECT:
if (MVT::isFloatingPoint(N->getValueType(0))) {
//move int to fp
+ bool isDouble = N->getValueType(0) == MVT::f64;
SDOperand LD,
cond = Select(N->getOperand(0)),
TV = Select(N->getOperand(1)),
@@ -389,12 +395,12 @@
CurDAG->getRegister(Alpha::R31, MVT::i64),
ST);
}
- SDOperand FP = CurDAG->getTargetNode(Alpha::FCMOVEQ, MVT::f64, TV, FV, LD);
+ SDOperand FP = CurDAG->getTargetNode(isDouble?Alpha::FCMOVEQT:Alpha::FCMOVEQS,
+ MVT::f64, TV, FV, LD);
return FP;
}
break;
-
}
return SelectCode(Op);
Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.11 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.12
--- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.11 Wed Nov 30 10:10:29 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Wed Nov 30 11:11:20 2005
@@ -98,8 +98,7 @@
setOperationAction(ISD::FCOS , MVT::f32, Expand);
setOperationAction(ISD::FSQRT, MVT::f32, Expand);
- //Doesn't work yet
- setOperationAction(ISD::SETCC, MVT::f32, Promote);
+ setOperationAction(ISD::SETCC, MVT::f32, Promote);
// We don't have line number support yet.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.190 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.191
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.190 Wed Nov 30 10:10:29 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Wed Nov 30 11:11:20 2005
@@ -1317,7 +1317,7 @@
bool invTest = false;
unsigned Tmp3;
-
+ bool isD = CC.getOperand(0).getValueType() == MVT::f64;
ConstantFPSDNode *CN;
if ((CN = dyn_cast(CC.getOperand(1)))
&& (CN->isExactlyValue(+0.0) || CN->isExactlyValue(-0.0)))
@@ -1332,21 +1332,31 @@
{
unsigned Tmp1 = SelectExpr(CC.getOperand(0));
unsigned Tmp2 = SelectExpr(CC.getOperand(1));
- bool isD = CC.getOperand(0).getValueType() == MVT::f64;
Tmp3 = MakeReg(isD ? MVT::f64 : MVT::f32);
BuildMI(BB, isD ? Alpha::SUBT : Alpha::SUBS, 2, Tmp3)
.addReg(Tmp1).addReg(Tmp2);
}
- switch (cast(CC.getOperand(2))->get()) {
- default: CC.Val->dump(); assert(0 && "Unknown FP comparison!");
- case ISD::SETEQ: Opc = invTest ? Alpha::FCMOVNE : Alpha::FCMOVEQ; break;
- case ISD::SETLT: Opc = invTest ? Alpha::FCMOVGT : Alpha::FCMOVLT; break;
- case ISD::SETLE: Opc = invTest ? Alpha::FCMOVGE : Alpha::FCMOVLE; break;
- case ISD::SETGT: Opc = invTest ? Alpha::FCMOVLT : Alpha::FCMOVGT; break;
- case ISD::SETGE: Opc = invTest ? Alpha::FCMOVLE : Alpha::FCMOVGE; break;
- case ISD::SETNE: Opc = invTest ? Alpha::FCMOVEQ : Alpha::FCMOVNE; break;
- }
+ if(isD)
+ switch (cast(CC.getOperand(2))->get()) {
+ default: CC.Val->dump(); assert(0 && "Unknown FP comparison!");
+ case ISD::SETEQ: Opc = invTest ? Alpha::FCMOVNET : Alpha::FCMOVEQT; break;
+ case ISD::SETLT: Opc = invTest ? Alpha::FCMOVGTT : Alpha::FCMOVLTT; break;
+ case ISD::SETLE: Opc = invTest ? Alpha::FCMOVGET : Alpha::FCMOVLET; break;
+ case ISD::SETGT: Opc = invTest ? Alpha::FCMOVLTT : Alpha::FCMOVGTT; break;
+ case ISD::SETGE: Opc = invTest ? Alpha::FCMOVLET : Alpha::FCMOVGET; break;
+ case ISD::SETNE: Opc = invTest ? Alpha::FCMOVEQT : Alpha::FCMOVNET; break;
+ }
+ else
+ switch (cast(CC.getOperand(2))->get()) {
+ default: CC.Val->dump(); assert(0 && "Unknown FP comparison!");
+ case ISD::SETEQ: Opc = invTest ? Alpha::FCMOVNES : Alpha::FCMOVEQS; break;
+ case ISD::SETLT: Opc = invTest ? Alpha::FCMOVGTS : Alpha::FCMOVLTS; break;
+ case ISD::SETLE: Opc = invTest ? Alpha::FCMOVGES : Alpha::FCMOVLES; break;
+ case ISD::SETGT: Opc = invTest ? Alpha::FCMOVLTS : Alpha::FCMOVGTS; break;
+ case ISD::SETGE: Opc = invTest ? Alpha::FCMOVLES : Alpha::FCMOVGES; break;
+ case ISD::SETNE: Opc = invTest ? Alpha::FCMOVEQS : Alpha::FCMOVNES; break;
+ }
BuildMI(BB, Opc, 3, Result).addReg(FV).addReg(TV).addReg(Tmp3);
return Result;
}
Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.75 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.76
--- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.75 Wed Nov 30 10:10:29 2005
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Nov 30 11:11:20 2005
@@ -162,16 +162,6 @@
def : Pat<(select GPRC:$which, GPRC:$src1, GPRC:$src2),
(CMOVEQ GPRC:$src1, GPRC:$src2, GPRC:$which)>;
-//conditional moves, fp
-let OperandList = (ops F8RC:$RDEST, F8RC:$RSRC2, F8RC:$RSRC, F8RC:$RCOND),
- isTwoAddress = 1 in {
-def FCMOVEQ : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if = zero
-def FCMOVGE : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if >= zero
-def FCMOVGT : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if > zero
-def FCMOVLE : FPForm<0x17, 0x02E, "fcmovle $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if <= zero
-def FCMOVLT : FPForm<0x17, 0x02C, "fcmovlt $RCOND,$RSRC,$RDEST",[]>; // FCMOVE if < zero
-def FCMOVNE : FPForm<0x17, 0x02B, "fcmovne $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if != zero
-}
def ADDL : OForm< 0x10, 0x00, "addl $RA,$RB,$RC",
[(set GPRC:$RC, (intop (add GPRC:$RA, GPRC:$RB)))]>;
@@ -555,6 +545,27 @@
}
//TODO: Add lots more FP patterns
+//conditional moves, floats
+let OperandList = (ops F4RC:$RDEST, F4RC:$RSRC2, F4RC:$RSRC, F8RC:$RCOND),
+ isTwoAddress = 1 in {
+def FCMOVEQS : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if = zero
+def FCMOVGES : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if >= zero
+def FCMOVGTS : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if > zero
+def FCMOVLES : FPForm<0x17, 0x02E, "fcmovle $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if <= zero
+def FCMOVLTS : FPForm<0x17, 0x02C, "fcmovlt $RCOND,$RSRC,$RDEST",[]>; // FCMOVE if < zero
+def FCMOVNES : FPForm<0x17, 0x02B, "fcmovne $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if != zero
+}
+//conditional moves, doubles
+let OperandList = (ops F8RC:$RDEST, F8RC:$RSRC2, F8RC:$RSRC, F8RC:$RCOND),
+ isTwoAddress = 1 in {
+def FCMOVEQT : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if = zero
+def FCMOVGET : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if >= zero
+def FCMOVGTT : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if > zero
+def FCMOVLET : FPForm<0x17, 0x02E, "fcmovle $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if <= zero
+def FCMOVLTT : FPForm<0x17, 0x02C, "fcmovlt $RCOND,$RSRC,$RDEST",[]>; // FCMOVE if < zero
+def FCMOVNET : FPForm<0x17, 0x02B, "fcmovne $RCOND,$RSRC,$RDEST",[]>; //FCMOVE if != zero
+}
+
let OperandList = (ops GPRC:$RC, F4RC:$RA), Fb = 31 in
From alenhar2 at cs.uiuc.edu Wed Nov 30 11:12:38 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 11:12:38 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Message-ID: <200511301712.LAA28900@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.218 -> 1.219
---
Log message:
At long last, you can say that f32 isn't supported for setcc
---
Diffs of the changes: (+28 -1)
LegalizeDAG.cpp | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.218 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.219
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.218 Wed Nov 30 00:43:03 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Nov 30 11:12:26 2005
@@ -1438,10 +1438,37 @@
default:
assert(0 && "Cannot handle this action for SETCC yet!");
break;
- case TargetLowering::Promote:
+ case TargetLowering::Promote: {
+ // First step, figure out the appropriate operation to use.
+ // Allow SETCC to not be supported for all legal data types
+ // Mostly this targets FP
+ MVT::ValueType NewInTy = Node->getOperand(0).getValueType();
+ MVT::ValueType OldVT = NewInTy;
+
+ // Scan for the appropriate larger type to use.
+ while (1) {
+ NewInTy = (MVT::ValueType)(NewInTy+1);
+
+ assert(MVT::isInteger(NewInTy) == MVT::isInteger(OldVT) &&
+ "Fell off of the edge of the integer world");
+ assert(MVT::isFloatingPoint(NewInTy) == MVT::isFloatingPoint(OldVT) &&
+ "Fell off of the edge of the floating point world");
+
+ // If the target supports SETCC of this type, use it.
+ if (TLI.getOperationAction(ISD::SETCC, NewInTy) == TargetLowering::Legal)
+ break;
+ }
+ if (MVT::isInteger(NewInTy))
+ assert(0 && "Cannot promote Legal Integer SETCC yet");
+ else {
+ Tmp1 = DAG.getNode(ISD::FP_EXTEND, NewInTy, Tmp1);
+ Tmp2 = DAG.getNode(ISD::FP_EXTEND, NewInTy, Tmp2);
+ }
+
Result = DAG.getNode(ISD::SETCC, Node->getValueType(0), Tmp1, Tmp2,
Node->getOperand(2));
break;
+ }
case TargetLowering::Legal:
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1))
Result = DAG.getNode(ISD::SETCC, Node->getValueType(0), Tmp1, Tmp2,
From alenhar2 at cs.uiuc.edu Wed Nov 30 11:14:23 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Wed, 30 Nov 2005 11:14:23 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
Message-ID: <200511301714.LAA28931@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/Alpha:
AlphaISelPattern.cpp updated: 1.191 -> 1.192
---
Log message:
remove redundant code
---
Diffs of the changes: (+2 -14)
AlphaISelPattern.cpp | 16 ++--------------
1 files changed, 2 insertions(+), 14 deletions(-)
Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.191 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.192
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.191 Wed Nov 30 11:11:20 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Wed Nov 30 11:14:11 2005
@@ -365,21 +365,9 @@
//Can only compare doubles, and dag won't promote for me
if (SetCC->getOperand(0).getValueType() == MVT::f32)
- {
- //assert(0 && "Setcc On float?\n");
- std::cerr << "Setcc on float!\n";
- Tmp3 = MakeReg(MVT::f64);
- BuildMI(BB, Alpha::CVTST, 1, Tmp3).addReg(Tmp1);
- Tmp1 = Tmp3;
- }
+ assert(0 && "Setcc On float?\n");
if (SetCC->getOperand(1).getValueType() == MVT::f32)
- {
- //assert (0 && "Setcc On float?\n");
- std::cerr << "Setcc on float!\n";
- Tmp3 = MakeReg(MVT::f64);
- BuildMI(BB, Alpha::CVTST, 1, Tmp3).addReg(Tmp2);
- Tmp2 = Tmp3;
- }
+ assert (0 && "Setcc On float?\n");
if (rev) std::swap(Tmp1, Tmp2);
//do the comparison
From lattner at cs.uiuc.edu Wed Nov 30 12:21:04 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 12:21:04 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Message-ID: <200511301821.MAA29744@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.218 -> 1.219
---
Log message:
CALLSEQ_START/END nodes don't get memoized, do not add them in when
replaceAllUses'ing.
---
Diffs of the changes: (+4 -0)
SelectionDAG.cpp | 4 ++++
1 files changed, 4 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.218 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.219
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.218 Tue Nov 29 20:49:21 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Nov 30 12:20:52 2005
@@ -387,6 +387,10 @@
///
SDNode *SelectionDAG::AddNonLeafNodeToCSEMaps(SDNode *N) {
assert(N->getNumOperands() && "This is a leaf node!");
+ if (N->getOpcode() == ISD::CALLSEQ_START ||
+ N->getOpcode() == ISD::CALLSEQ_END)
+ return 0;
+
if (N->getOpcode() == ISD::LOAD) {
SDNode *&L = Loads[std::make_pair(N->getOperand(1),
std::make_pair(N->getOperand(0),
From natebegeman at mac.com Wed Nov 30 12:37:26 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:37:26 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/Record.cpp
Message-ID: <200511301837.MAA29832@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
Record.cpp updated: 1.47 -> 1.48
---
Log message:
Fix some copy and paste typos.
---
Diffs of the changes: (+2 -2)
Record.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/utils/TableGen/Record.cpp
diff -u llvm/utils/TableGen/Record.cpp:1.47 llvm/utils/TableGen/Record.cpp:1.48
--- llvm/utils/TableGen/Record.cpp:1.47 Fri Oct 28 17:49:02 2005
+++ llvm/utils/TableGen/Record.cpp Wed Nov 30 12:37:14 2005
@@ -741,7 +741,7 @@
if (IntInit *II = dynamic_cast(R->getValue()))
return II->getValue();
throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a list initializer!";
+ "' does not have an int initializer!";
}
/// getValueAsDef - This method looks up the specified field and returns its
@@ -757,7 +757,7 @@
if (DefInit *DI = dynamic_cast(R->getValue()))
return DI->getDef();
throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a list initializer!";
+ "' does not have a def initializer!";
}
/// getValueAsBit - This method looks up the specified field and returns its
From natebegeman at mac.com Wed Nov 30 12:54:48 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:54:48 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Message-ID: <200511301854.MAA29978@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCAsmPrinter.cpp updated: 1.121 -> 1.122
---
Log message:
No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function. Requires some slight
tweaks to x86, the only user.
---
Diffs of the changes: (+17 -30)
PPCAsmPrinter.cpp | 47 +++++++++++++++++------------------------------
1 files changed, 17 insertions(+), 30 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.121 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.122
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.121 Mon Nov 21 02:26:15 2005
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Wed Nov 30 12:54:35 2005
@@ -27,7 +27,6 @@
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/CommandLine.h"
@@ -81,7 +80,7 @@
void printMachineInstruction(const MachineInstr *MI);
void printOp(const MachineOperand &MO);
- void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){
+ void printOperand(const MachineInstr *MI, unsigned OpNo){
const MachineOperand &MO = MI->getOperand(OpNo);
if (MO.getType() == MachineOperand::MO_MachineRegister) {
assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physreg??");
@@ -93,32 +92,26 @@
}
}
- void printU5ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printU5ImmOperand(const MachineInstr *MI, unsigned OpNo) {
unsigned char value = MI->getOperand(OpNo).getImmedValue();
assert(value <= 31 && "Invalid u5imm argument!");
O << (unsigned int)value;
}
- void printU6ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printU6ImmOperand(const MachineInstr *MI, unsigned OpNo) {
unsigned char value = MI->getOperand(OpNo).getImmedValue();
assert(value <= 63 && "Invalid u6imm argument!");
O << (unsigned int)value;
}
- void printS16ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printS16ImmOperand(const MachineInstr *MI, unsigned OpNo) {
O << (short)MI->getOperand(OpNo).getImmedValue();
}
- void printU16ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printU16ImmOperand(const MachineInstr *MI, unsigned OpNo) {
O << (unsigned short)MI->getOperand(OpNo).getImmedValue();
}
- void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo) {
O << (short)MI->getOperand(OpNo).getImmedValue()*4;
}
- void printBranchOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printBranchOperand(const MachineInstr *MI, unsigned OpNo) {
// Branches can take an immediate operand. This is used by the branch
// selection pass to print $+8, an eight byte displacement from the PC.
if (MI->getOperand(OpNo).isImmediate()) {
@@ -127,8 +120,7 @@
printOp(MI->getOperand(OpNo));
}
}
- void printCallOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
const MachineOperand &MO = MI->getOperand(OpNo);
if (!PPCGenerateStaticCode) {
if (MO.getType() == MachineOperand::MO_ExternalSymbol) {
@@ -149,20 +141,17 @@
printOp(MI->getOperand(OpNo));
}
- void printAbsAddrOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printAbsAddrOperand(const MachineInstr *MI, unsigned OpNo) {
O << (int)MI->getOperand(OpNo).getImmedValue()*4;
}
- void printPICLabel(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printPICLabel(const MachineInstr *MI, unsigned OpNo) {
// FIXME: should probably be converted to cout.width and cout.fill
O << "\"L0000" << getFunctionNumber() << "$pb\"\n";
O << "\"L0000" << getFunctionNumber() << "$pb\":";
}
- void printSymbolHi(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printSymbolHi(const MachineInstr *MI, unsigned OpNo) {
if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo, VT);
+ printS16ImmOperand(MI, OpNo);
} else {
O << "ha16(";
printOp(MI->getOperand(OpNo));
@@ -172,10 +161,9 @@
O << ')';
}
}
- void printSymbolLo(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printSymbolLo(const MachineInstr *MI, unsigned OpNo) {
if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo, VT);
+ printS16ImmOperand(MI, OpNo);
} else {
O << "lo16(";
printOp(MI->getOperand(OpNo));
@@ -185,8 +173,7 @@
O << ')';
}
}
- void printcrbitm(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printcrbitm(const MachineInstr *MI, unsigned OpNo) {
unsigned CCReg = MI->getOperand(OpNo).getReg();
unsigned RegNo = enumRegToMachineReg(CCReg);
O << (0x80 >> RegNo);
@@ -356,9 +343,9 @@
SH = 32-SH;
}
if (FoundMnemonic) {
- printOperand(MI, 0, MVT::i64);
+ printOperand(MI, 0);
O << ", ";
- printOperand(MI, 1, MVT::i64);
+ printOperand(MI, 1);
O << ", " << (unsigned int)SH << "\n";
return;
}
From natebegeman at mac.com Wed Nov 30 12:54:48 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:54:48 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
Message-ID: <200511301854.MAA29982@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/IA64:
IA64AsmPrinter.cpp updated: 1.20 -> 1.21
---
Log message:
No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function. Requires some slight
tweaks to x86, the only user.
---
Diffs of the changes: (+8 -16)
IA64AsmPrinter.cpp | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
Index: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
diff -u llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.20 llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.21
--- llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.20 Mon Nov 21 02:40:17 2005
+++ llvm/lib/Target/IA64/IA64AsmPrinter.cpp Wed Nov 30 12:54:35 2005
@@ -23,7 +23,6 @@
#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/Statistic.h"
@@ -65,7 +64,7 @@
bool printInstruction(const MachineInstr *MI);
// This method is used by the tablegen'erated instruction printer.
- void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){
+ void printOperand(const MachineInstr *MI, unsigned OpNo){
const MachineOperand &MO = MI->getOperand(OpNo);
if (MO.getType() == MachineOperand::MO_MachineRegister) {
assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physref??");
@@ -76,30 +75,25 @@
}
}
- void printS8ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printS8ImmOperand(const MachineInstr *MI, unsigned OpNo) {
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
if(val>=128) val=val-256; // if negative, flip sign
O << val;
}
- void printS14ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printS14ImmOperand(const MachineInstr *MI, unsigned OpNo) {
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
if(val>=8192) val=val-16384; // if negative, flip sign
O << val;
}
- void printS22ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printS22ImmOperand(const MachineInstr *MI, unsigned OpNo) {
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
if(val>=2097152) val=val-4194304; // if negative, flip sign
O << val;
}
- void printU64ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printU64ImmOperand(const MachineInstr *MI, unsigned OpNo) {
O << (uint64_t)MI->getOperand(OpNo).getImmedValue();
}
- void printS64ImmOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printS64ImmOperand(const MachineInstr *MI, unsigned OpNo) {
// XXX : nasty hack to avoid GPREL22 "relocation truncated to fit" linker
// errors - instead of add rX = @gprel(CPI), r1;; we now
// emit movl rX = @gprel(CPIgetOperand(OpNo), false); // this is NOT a br.call instruction
}
- void printCallOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
}
From natebegeman at mac.com Wed Nov 30 12:54:49 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:54:49 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/AsmWriterEmitter.cpp
Message-ID: <200511301854.MAA30002@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
AsmWriterEmitter.cpp updated: 1.22 -> 1.23
---
Log message:
No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function. Requires some slight
tweaks to x86, the only user.
---
Diffs of the changes: (+6 -12)
AsmWriterEmitter.cpp | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
Index: llvm/utils/TableGen/AsmWriterEmitter.cpp
diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.22 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.23
--- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.22 Wed Jul 27 01:12:35 2005
+++ llvm/utils/TableGen/AsmWriterEmitter.cpp Wed Nov 30 12:54:35 2005
@@ -38,21 +38,16 @@
/// machine instruction.
unsigned MIOpNo;
- /// OpVT - For isMachineInstrOperand, this is the value type for the
- /// operand.
- MVT::ValueType OpVT;
-
AsmWriterOperand(const std::string &LitStr)
- : OperandType(isLiteralTextOperand), Str(LitStr) {}
+ : OperandType(isLiteralTextOperand), Str(LitStr) {}
- AsmWriterOperand(const std::string &Printer, unsigned OpNo,
- MVT::ValueType VT) : OperandType(isMachineInstrOperand),
- Str(Printer), MIOpNo(OpNo), OpVT(VT){}
+ AsmWriterOperand(const std::string &Printer, unsigned OpNo)
+ : OperandType(isMachineInstrOperand), Str(Printer), MIOpNo(OpNo) {}
bool operator!=(const AsmWriterOperand &Other) const {
if (OperandType != Other.OperandType || Str != Other.Str) return true;
if (OperandType == isMachineInstrOperand)
- return MIOpNo != Other.MIOpNo || OpVT != Other.OpVT;
+ return MIOpNo != Other.MIOpNo;
return false;
}
bool operator==(const AsmWriterOperand &Other) const {
@@ -90,7 +85,7 @@
if (OperandType == isLiteralTextOperand)
OS << "O << \"" << Str << "\"; ";
else
- OS << Str << "(MI, " << MIOpNo << ", MVT::" << getEnumName(OpVT) << "); ";
+ OS << Str << "(MI, " << MIOpNo << "); ";
}
@@ -204,8 +199,7 @@
--MIOp;
}
- Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName,
- MIOp, OpInfo.Ty));
+ Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, MIOp));
LastEmitted = VarEnd;
}
}
From natebegeman at mac.com Wed Nov 30 12:54:49 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:54:49 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
Message-ID: <200511301854.MAA29998@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/Alpha:
AlphaAsmPrinter.cpp updated: 1.26 -> 1.27
---
Log message:
No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function. Requires some slight
tweaks to x86, the only user.
---
Diffs of the changes: (+2 -3)
AlphaAsmPrinter.cpp | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.26 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.27
--- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.26 Mon Nov 21 02:29:17 2005
+++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Wed Nov 30 12:54:34 2005
@@ -18,7 +18,6 @@
#include "llvm/Module.h"
#include "llvm/Type.h"
#include "llvm/Assembly/Writer.h"
-#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/Mangler.h"
@@ -54,7 +53,7 @@
}
bool printInstruction(const MachineInstr *MI);
void printOp(const MachineOperand &MO, bool IsCallOp = false);
- void printOperand(const MachineInstr *MI, int opNum, MVT::ValueType VT);
+ void printOperand(const MachineInstr *MI, int opNum);
void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true);
void printMachineInstruction(const MachineInstr *MI);
bool runOnMachineFunction(MachineFunction &F);
@@ -75,7 +74,7 @@
#include "AlphaGenAsmWriter.inc"
-void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum, MVT::ValueType VT)
+void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum)
{
const MachineOperand &MO = MI->getOperand(opNum);
if (MO.getType() == MachineOperand::MO_MachineRegister) {
From natebegeman at mac.com Wed Nov 30 12:54:49 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:54:49 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
X86ATTAsmPrinter.h X86InstrInfo.td X86IntelAsmPrinter.cpp
X86IntelAsmPrinter.h
Message-ID: <200511301854.MAA29994@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.16 -> 1.17
X86ATTAsmPrinter.h updated: 1.2 -> 1.3
X86InstrInfo.td updated: 1.143 -> 1.144
X86IntelAsmPrinter.cpp updated: 1.12 -> 1.13
X86IntelAsmPrinter.h updated: 1.2 -> 1.3
---
Log message:
No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function. Requires some slight
tweaks to x86, the only user.
---
Diffs of the changes: (+65 -40)
X86ATTAsmPrinter.cpp | 3 +--
X86ATTAsmPrinter.h | 32 +++++++++++++++++++++++---------
X86InstrInfo.td | 22 +++++++++++-----------
X86IntelAsmPrinter.cpp | 3 +--
X86IntelAsmPrinter.h | 45 +++++++++++++++++++++++++++++----------------
5 files changed, 65 insertions(+), 40 deletions(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.16 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.17
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.16 Mon Nov 21 17:06:54 2005
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Nov 30 12:54:35 2005
@@ -145,8 +145,7 @@
}
}
-void X86ATTAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op,
- MVT::ValueType VT) {
+void X86ATTAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op) {
unsigned char value = MI->getOperand(Op).getImmedValue();
assert(value <= 7 && "Invalid ssecc argument!");
switch (value) {
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.h
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.h:1.2 llvm/lib/Target/X86/X86ATTAsmPrinter.h:1.3
--- llvm/lib/Target/X86/X86ATTAsmPrinter.h:1.2 Thu Jul 14 17:52:25 2005
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.h Wed Nov 30 12:54:35 2005
@@ -35,23 +35,37 @@
bool printInstruction(const MachineInstr *MI);
// This method is used by the tablegen'erated instruction printer.
- void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){
+ void printOperand(const MachineInstr *MI, unsigned OpNo){
printOp(MI->getOperand(OpNo));
}
-
- void printCallOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
printOp(MI->getOperand(OpNo), true); // Don't print '$' prefix.
}
-
- void printMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printi8mem(const MachineInstr *MI, unsigned OpNo) {
printMemReference(MI, OpNo);
}
-
+ void printi16mem(const MachineInstr *MI, unsigned OpNo) {
+ printMemReference(MI, OpNo);
+ }
+ void printi32mem(const MachineInstr *MI, unsigned OpNo) {
+ printMemReference(MI, OpNo);
+ }
+ void printi64mem(const MachineInstr *MI, unsigned OpNo) {
+ printMemReference(MI, OpNo);
+ }
+ void printf32mem(const MachineInstr *MI, unsigned OpNo) {
+ printMemReference(MI, OpNo);
+ }
+ void printf64mem(const MachineInstr *MI, unsigned OpNo) {
+ printMemReference(MI, OpNo);
+ }
+ void printf80mem(const MachineInstr *MI, unsigned OpNo) {
+ printMemReference(MI, OpNo);
+ }
+
void printMachineInstruction(const MachineInstr *MI);
void printOp(const MachineOperand &MO, bool isCallOperand = false);
- void printSSECC(const MachineInstr *MI, unsigned Op, MVT::ValueType VT);
+ void printSSECC(const MachineInstr *MI, unsigned Op);
void printMemReference(const MachineInstr *MI, unsigned Op);
bool runOnMachineFunction(MachineFunction &F);
};
Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.143 llvm/lib/Target/X86/X86InstrInfo.td:1.144
--- llvm/lib/Target/X86/X86InstrInfo.td:1.143 Tue Nov 29 23:11:18 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Wed Nov 30 12:54:35 2005
@@ -15,24 +15,24 @@
// *mem - Operand definitions for the funky X86 addressing mode operands.
//
-
-class X86MemOperand : Operand {
- let PrintMethod = "printMemoryOperand";
+class X86MemOperand : Operand {
+ let PrintMethod = printMethod;
let NumMIOperands = 4;
let MIOperandInfo = (ops R32, i8imm, R32, i32imm);
}
+
+def i8mem : X86MemOperand;
+def i16mem : X86MemOperand;
+def i32mem : X86MemOperand;
+def i64mem : X86MemOperand;
+def f32mem : X86MemOperand;
+def f64mem : X86MemOperand;
+def f80mem : X86MemOperand;
+
def SSECC : Operand {
let PrintMethod = "printSSECC";
}
-def i8mem : X86MemOperand;
-def i16mem : X86MemOperand;
-def i32mem : X86MemOperand;
-def i64mem : X86MemOperand;
-def f32mem : X86MemOperand;
-def f64mem : X86MemOperand;
-def f80mem : X86MemOperand;
-
// A couple of more descriptive operand definitions.
// 16-bits but only 8 bits are significant.
def i16i8imm : Operand;
Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.12 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.13
--- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.12 Tue Nov 29 19:59:00 2005
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Wed Nov 30 12:54:35 2005
@@ -59,8 +59,7 @@
return false;
}
-void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op,
- MVT::ValueType VT) {
+void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op) {
unsigned char value = MI->getOperand(Op).getImmedValue();
assert(value <= 7 && "Invalid ssecc argument!");
switch (value) {
Index: llvm/lib/Target/X86/X86IntelAsmPrinter.h
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.2 llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.3
--- llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.2 Thu Jul 14 17:52:25 2005
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.h Wed Nov 30 12:54:35 2005
@@ -37,7 +37,7 @@
bool printInstruction(const MachineInstr *MI);
// This method is used by the tablegen'erated instruction printer.
- void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){
+ void printOperand(const MachineInstr *MI, unsigned OpNo){
const MachineOperand &MO = MI->getOperand(OpNo);
if (MO.getType() == MachineOperand::MO_MachineRegister) {
assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physref??");
@@ -48,29 +48,42 @@
}
}
- void printCallOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
+ void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
printOp(MI->getOperand(OpNo), true); // Don't print "OFFSET".
}
- void printMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- MVT::ValueType VT) {
- switch (VT) {
- default: assert(0 && "Unknown arg size!");
- case MVT::i8: O << "BYTE PTR "; break;
- case MVT::i16: O << "WORD PTR "; break;
- case MVT::i32:
- case MVT::f32: O << "DWORD PTR "; break;
- case MVT::i64:
- case MVT::f64: O << "QWORD PTR "; break;
- case MVT::f80: O << "XWORD PTR "; break;
- }
+ void printi8mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "BYTE PTR ";
+ printMemReference(MI, OpNo);
+ }
+ void printi16mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "WORD PTR ";
+ printMemReference(MI, OpNo);
+ }
+ void printi32mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "WORD PTR ";
+ printMemReference(MI, OpNo);
+ }
+ void printi64mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "DWORD PTR ";
+ printMemReference(MI, OpNo);
+ }
+ void printf32mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "DWORD PTR ";
+ printMemReference(MI, OpNo);
+ }
+ void printf64mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "QWORD PTR ";
+ printMemReference(MI, OpNo);
+ }
+ void printf80mem(const MachineInstr *MI, unsigned OpNo) {
+ O << "XWORD PTR ";
printMemReference(MI, OpNo);
}
void printMachineInstruction(const MachineInstr *MI);
void printOp(const MachineOperand &MO, bool elideOffsetKeyword = false);
- void printSSECC(const MachineInstr *MI, unsigned Op, MVT::ValueType VT);
+ void printSSECC(const MachineInstr *MI, unsigned Op);
void printMemReference(const MachineInstr *MI, unsigned Op);
bool runOnMachineFunction(MachineFunction &F);
bool doInitialization(Module &M);
From natebegeman at mac.com Wed Nov 30 12:57:50 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Wed, 30 Nov 2005 12:57:50 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.h
Message-ID: <200511301857.MAA30023@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86IntelAsmPrinter.h updated: 1.3 -> 1.4
---
Log message:
Fix a typo in my latest change
---
Diffs of the changes: (+2 -2)
X86IntelAsmPrinter.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/X86/X86IntelAsmPrinter.h
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.3 llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.4
--- llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.3 Wed Nov 30 12:54:35 2005
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.h Wed Nov 30 12:57:39 2005
@@ -61,11 +61,11 @@
printMemReference(MI, OpNo);
}
void printi32mem(const MachineInstr *MI, unsigned OpNo) {
- O << "WORD PTR ";
+ O << "DWORD PTR ";
printMemReference(MI, OpNo);
}
void printi64mem(const MachineInstr *MI, unsigned OpNo) {
- O << "DWORD PTR ";
+ O << "QWORD PTR ";
printMemReference(MI, OpNo);
}
void printf32mem(const MachineInstr *MI, unsigned OpNo) {
From lattner at cs.uiuc.edu Wed Nov 30 13:31:34 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 13:31:34 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h
Message-ID: <200511301931.NAA30353@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Analysis:
AliasSetTracker.h updated: 1.25 -> 1.26
---
Log message:
Add a simple clear() method
---
Diffs of the changes: (+5 -0)
AliasSetTracker.h | 5 +++++
1 files changed, 5 insertions(+)
Index: llvm/include/llvm/Analysis/AliasSetTracker.h
diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.25 llvm/include/llvm/Analysis/AliasSetTracker.h:1.26
--- llvm/include/llvm/Analysis/AliasSetTracker.h:1.25 Thu Apr 21 15:16:31 2005
+++ llvm/include/llvm/Analysis/AliasSetTracker.h Wed Nov 30 13:31:23 2005
@@ -290,6 +290,11 @@
bool remove(InvokeInst *II) { return remove(CallSite(II)); }
bool remove(Instruction *I);
void remove(AliasSet &AS);
+
+ void clear() {
+ PointerMap.clear();
+ AliasSets.clear();
+ }
/// getAliasSets - Return the alias sets that are active.
///
From lattner at cs.uiuc.edu Wed Nov 30 13:37:19 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 13:37:19 -0600
Subject: [llvm-commits]
CVS: llvm/test/Regression/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
Message-ID: <200511301937.NAA30503@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/DeadStoreElimination:
2005-11-30-vaarg.ll added (r1.1)
---
Log message:
new testcase dse is miscompiling
---
Diffs of the changes: (+9 -0)
2005-11-30-vaarg.ll | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/test/Regression/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
diff -c /dev/null llvm/test/Regression/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll:1.1
*** /dev/null Wed Nov 30 13:37:18 2005
--- llvm/test/Regression/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll Wed Nov 30 13:37:08 2005
***************
*** 0 ****
--- 1,9 ----
+ ; RUN: llvm-as < %s | opt -dse | llvm-dis | grep store
+
+ double %foo(sbyte* %X) {
+ %X_addr = alloca sbyte*
+ store sbyte* %X, sbyte** %X_addr ;; not a dead store.
+ %tmp.0 = va_arg sbyte** %X_addr, double
+ ret double %tmp.0
+ }
+
From lattner at cs.uiuc.edu Wed Nov 30 13:38:34 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 13:38:34 -0600
Subject: [llvm-commits]
CVS: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Message-ID: <200511301938.NAA30524@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
DeadStoreElimination.cpp updated: 1.12 -> 1.13
---
Log message:
Fix a bug where we didn't realize that vaarg reads memory. This fixes
Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
---
Diffs of the changes: (+7 -0)
DeadStoreElimination.cpp | 7 +++++++
1 files changed, 7 insertions(+)
Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.12 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.13
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.12 Thu Apr 21 18:45:12 2005
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Nov 30 13:38:22 2005
@@ -96,6 +96,13 @@
}
if (!isa(I) || cast(I)->isVolatile()) {
+ // If this is a vaarg instruction, it reads its operand. We don't model
+ // it correctly, so just conservatively remove all entries.
+ if (isa(I)) {
+ KillLocs.clear();
+ continue;
+ }
+
// If this is a non-store instruction, it makes everything referenced no
// longer killed. Remove anything aliased from the alias set tracker.
KillLocs.remove(I);
From lattner at cs.uiuc.edu Wed Nov 30 14:40:39 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 14:40:39 -0600
Subject: [llvm-commits]
CVS: llvm/test/Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll
Message-ID: <200511302040.OAA31058@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/PowerPC:
2005-11-30-vastart-crash.ll added (r1.1)
---
Log message:
Test that crashes the ppc backend.
---
Diffs of the changes: (+17 -0)
2005-11-30-vastart-crash.ll | 17 +++++++++++++++++
1 files changed, 17 insertions(+)
Index: llvm/test/Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll
diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll:1.1
*** /dev/null Wed Nov 30 14:40:38 2005
--- llvm/test/Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll Wed Nov 30 14:40:28 2005
***************
*** 0 ****
--- 1,17 ----
+ ; RUN: llvm-as < %s | llc
+ target endian = big
+ target pointersize = 32
+ target triple = "powerpc-apple-darwin8.2.0"
+ implementation ; Functions:
+
+ void %bar(int %G, int %E, int %F, int %A, int %B, int %C, int %D, sbyte* %fmt, ...) {
+ %ap = alloca sbyte* ; [#uses=2]
+ call void %llvm.va_start( sbyte** %ap )
+ %tmp.1 = load sbyte** %ap ; [#uses=1]
+ %tmp.0 = call double %foo( sbyte* %tmp.1 ) ; [#uses=0]
+ ret void
+ }
+
+ declare void %llvm.va_start(sbyte**)
+
+ declare double %foo(sbyte*)
From lattner at cs.uiuc.edu Wed Nov 30 14:41:06 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 14:41:06 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Message-ID: <200511302041.OAA31113@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCISelLowering.cpp updated: 1.47 -> 1.48
---
Log message:
Fix Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll
---
Diffs of the changes: (+6 -2)
PPCISelLowering.cpp | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.47 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.48
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.47 Tue Nov 29 02:17:20 2005
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 30 14:40:54 2005
@@ -434,7 +434,8 @@
needsLoad = true;
}
break;
- case MVT::i64: ObjSize = 8;
+ case MVT::i64:
+ ObjSize = 8;
if (!ArgLive) break;
if (GPR_remaining > 0) {
SDOperand argHi, argLo;
@@ -530,7 +531,10 @@
SDOperand PtrOff = DAG.getConstant(4, getPointerTy());
FIN = DAG.getNode(ISD::ADD, MVT::i32, FIN, PtrOff);
}
- DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, MemOps));
+ if (!MemOps.empty()) {
+ MemOps.push_back(DAG.getRoot());
+ DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, MemOps));
+ }
}
// Finally, inform the code generator which regs we return values in.
From lattner at cs.uiuc.edu Wed Nov 30 16:44:49 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Nov 2005 16:44:49 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h
Message-ID: <200511302244.QAA02653@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.73 -> 1.74
---
Log message:
Make SelectNodeTo return N
---
Diffs of the changes: (+30 -28)
SelectionDAG.h | 58 +++++++++++++++++++++++++++++----------------------------
1 files changed, 30 insertions(+), 28 deletions(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.73 llvm/include/llvm/CodeGen/SelectionDAG.h:1.74
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.73 Tue Nov 29 20:49:21 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Wed Nov 30 16:44:37 2005
@@ -20,7 +20,7 @@
#include