This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Little cleanups for i386 - Target
- To: egcs mailing list <egcs at cygnus dot com>
- Subject: Little cleanups for i386 - Target
- From: Frank dot Heldt at t-online dot de (Frank Heldt)
- Date: Sun, 02 Nov 1997 12:44:02 +0100
- Organization: Total disorganisation
Hello everybody,
the attached patches clean up the i386 - Target a little bit.
* in i386.h better readable use of the prozessor TARGET defines
* in i386.md put the define_attr "cpu" at top and delete a
double comment for it
* in i386.md combine identical define_insn with
"&& TARGET_MOVE" and "&& !TARGET_MOVE"
Bye
Frank
--
Frank Heldt
mailto:Frank.Heldt@t-online.de *** Linux, for IQ's higher than 95
mailto:Frank.Heldt@mahr.de
--- i386.h.org Sun Nov 2 09:26:20 1997
+++ i386.h Sun Nov 2 09:31:27 1997
@@ -151,23 +151,23 @@
#define TARGET_MOVE ((target_flags & MASK_NO_MOVE) == 0) /* Don't generate memory->memory */
#define TARGET_PSEUDO ((target_flags & MASK_NO_PSEUDO) == 0) /* Move op's args into pseudos */
+#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
+
#define TARGET_386 (ix86_cpu == PROCESSOR_I386)
#define TARGET_486 (ix86_cpu == PROCESSOR_I486)
#define TARGET_PENTIUM (ix86_cpu == PROCESSOR_PENTIUM)
#define TARGET_PENTIUMPRO (ix86_cpu == PROCESSOR_PENTIUMPRO)
-#define TARGET_USE_LEAVE (ix86_cpu == PROCESSOR_I386)
-#define TARGET_PUSH_MEMORY (ix86_cpu == PROCESSOR_I386)
-#define TARGET_ZERO_EXTEND_WITH_AND (ix86_cpu != PROCESSOR_I386 \
- && ix86_cpu != PROCESSOR_PENTIUMPRO)
-#define TARGET_DOUBLE_WITH_ADD (ix86_cpu != PROCESSOR_I386)
-#define TARGET_USE_BIT_TEST (ix86_cpu == PROCESSOR_I386)
-#define TARGET_UNROLL_STRLEN (ix86_cpu != PROCESSOR_I386)
-#define TARGET_USE_Q_REG (ix86_cpu == PROCESSOR_PENTIUM \
- || ix86_cpu == PROCESSOR_PENTIUMPRO)
-#define TARGET_USE_ANY_REG (ix86_cpu == PROCESSOR_I486)
+
+#define TARGET_USE_LEAVE (TARGET_386)
+#define TARGET_PUSH_MEMORY (TARGET_386)
+#define TARGET_ZERO_EXTEND_WITH_AND (TARGET_486 || TARGET_PENTIUM)
+#define TARGET_DOUBLE_WITH_ADD (!TARGET_386)
+#define TARGET_USE_BIT_TEST (TARGET_386)
+#define TARGET_UNROLL_STRLEN (!TARGET_386)
+#define TARGET_USE_Q_REG (TARGET_PENTIUM || TARGET_PENTIUMPRO)
+#define TARGET_USE_ANY_REG (TARGET_486)
+#define TARGET_DEEP_BRANCH_PREDICTION (TARGET_PENTIUMPRO)
#define TARGET_CMOVE (ix86_arch == PROCESSOR_PENTIUMPRO)
-#define TARGET_DEEP_BRANCH_PREDICTION (ix86_cpu == PROCESSOR_PENTIUMPRO)
-#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
#define TARGET_SWITCHES \
{ { "80387", MASK_80387 }, \
--- i386.md.org Sat Nov 1 17:14:40 1997
+++ i386.md Sat Nov 1 17:20:54 1997
@@ -64,11 +64,11 @@
;; prevent insns referencing it being scheduled across the initial
;; decrement of the stack pointer.
-;; This shadows the processor_type enumeration, so changes must be made
-;; to i386.h at the same time.
+;; Processor type -- this attribute must exactly match the processor_type
+;; enumeration in i386.h.
-(define_attr "type" "integer,idiv,imul,fld,fpop,fpdiv,fpmul"
- (const_string "integer"))
+(define_attr "cpu" "i386,i486,pentium,pentiumpro"
+ (const (symbol_ref "ix86_cpu")))
;; Functional units
@@ -85,6 +85,9 @@
; pentium has two integer pipelines, the main u pipe and the secondary v pipe.
; and a float pipeline
+(define_attr "type" "integer,idiv,imul,fld,fpop,fpdiv,fpmul"
+ (const_string "integer"))
+
;; Floating point
(define_function_unit "fp" 1 0
@@ -136,12 +139,6 @@
;; actually generating RTL. The bCOND or sCOND (emitted immediately
;; after the tstM or cmp) will actually emit the tstM or cmpM.
-;; Processor type -- this attribute must exactly match the processor_type
-;; enumeration in i386.h.
-
-(define_attr "cpu" "i386,i486,pentium,pentiumpro"
- (const (symbol_ref "ix86_cpu")))
-
(define_insn "tstsi_1"
[(set (cc0)
(match_operand:SI 0 "nonimmediate_operand" "rm"))]
@@ -844,13 +841,7 @@
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "ri"))]
- "!TARGET_PUSH_MEMORY && TARGET_MOVE"
- "push%L0 %1")
-
-(define_insn ""
- [(set (match_operand:SI 0 "push_operand" "=<")
- (match_operand:SI 1 "nonmemory_operand" "ri"))]
- "!TARGET_PUSH_MEMORY && !TARGET_MOVE"
+ "!TARGET_PUSH_MEMORY"
"push%L0 %1")
;; General case of fullword move.
@@ -918,13 +909,7 @@
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
(match_operand:HI 1 "nonmemory_operand" "ri"))]
- "!TARGET_PUSH_MEMORY && TARGET_MOVE"
- "push%W0 %1")
-
-(define_insn ""
- [(set (match_operand:HI 0 "push_operand" "=<")
- (match_operand:HI 1 "nonmemory_operand" "ri"))]
- "!TARGET_PUSH_MEMORY && !TARGET_MOVE"
+ "!TARGET_PUSH_MEMORY"
"push%W0 %1")
;; On i486, an incl and movl are both faster than incw and movw.
@@ -1038,7 +1023,7 @@
[(set (match_operand:QI 0 "push_operand" "=<")
(match_operand:QI 1 "const_int_operand" "n"))]
""
- "* return AS1 (push%W0,%1);")
+ "push%W0 %1")
(define_insn ""
[(set (match_operand:QI 0 "push_operand" "=<")