Patchwork [x32] PATH: Add x32_lea_immediate_operand/x32_lea_nonmemory_operand

login
register
mail settings
Submitter H.J. Lu
Date Jan. 19, 2011, 6:33 p.m.
Message ID <20110119183327.GA6048@intel.com>
Download mbox | patch
Permalink /patch/79500/
State New
Headers show

Comments

H.J. Lu - Jan. 19, 2011, 6:33 p.m.
LEA is another special pattern for x32.  I am checking in this patch to
add x32_lea_immediate_operand/x32_lea_nonmemory_operand.

H.J.
---

Patch

diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index fb31436..ca27084 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,5 +1,10 @@ 
 2011-01-19  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* config/i386/predicates.md (x32_lea_immediate_operand): New.
+	(x32_lea_nonmemory_operand): Likewise.
+
+2011-01-19  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* config/i386/constraints.md (Ys): New.
 	(Ye): Likewise.
 
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 3d06bd3..55a04e3 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1243,3 +1243,17 @@ 
 		     (match_test "flag_pic"))
     (match_operand 0 "x86_64_general_operand")
     (match_operand 0 "general_operand")))
+
+;; Return true when a constant operand can be used in lea on x32.
+(define_predicate "x32_lea_immediate_operand"
+  (match_operand 0 "immediate_operand")
+{
+  return !TARGET_X32 || !SYMBOLIC_CONST (op);
+})
+
+;; Return nonzero if OP is nonmemory operand representable in lea on x32.
+(define_predicate "x32_lea_nonmemory_operand"
+  (match_operand 0 "nonmemory_operand")
+{
+  return !TARGET_X32 || !SYMBOLIC_CONST (op);
+})