Mail Archives: pgcc/1999/04/22/00:25:54
Well, I'm no expert as this is the first time I've looked at the gcc
code. Seems like there is a problem with the signed extension (insn
extendsidi2) in pgcc-1.1.2. The following patch just reverts to the
egcs-1.1.2 machine definition but it got me through a bootstrap and
built the window manager im using :)
-Rodric
--- gcc/config/i386/i386.md.orig Wed Apr 21 16:30:25 1999
+++ gcc/config/i386/i386.md Wed Apr 21 16:31:04 1999
@@ -2146,40 +2146,26 @@
;;- sign extension instructions
(define_insn "extendsidi2"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=A,?r,?Ar,*o")
- (sign_extend:DI (match_operand:SI 1 "register_operand" "0,0,r,*r")))
- (clobber (match_scratch:SI 2 "=X,X,X,&r"))]
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (sign_extend:DI (match_operand:SI 1 "register_operand" "0")))]
""
- "#")
-;; Extend to register case. Optimize case where source and destination
-;; registers match and cases where we can use cltd.
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (sign_extend:DI (match_operand:SI 1 "register_operand" "")))
- (clobber (match_scratch:SI 2 ""))]
- "reload_completed"
- [(const_int 0)]
- "
+ "*
{
- split_di (&operands[0], 1, &operands[3], &operands[4]);
- if (true_regnum (operands[3]) != true_regnum (operands[1]))
- emit_move_insn (operands[3], operands[1]);
- /* Generate a cltd if possible and doing so it profitable. */
- if (true_regnum (operands[3]) == 0
- && (optimize_size || !TARGET_PENTIUM))
+ if (REGNO (operands[0]) == 0)
{
- emit_insn (gen_ashrsi3_31 (operands[4], operands[3]));
- DONE;
+ /* This used to be cwtl, but that extends HI to SI somehow. */
+#ifdef INTEL_SYNTAX
+ return \"cdq\";
+#else
+ return \"cltd\";
+#endif
}
- if (true_regnum (operands[4]) != true_regnum (operands[1]))
- emit_move_insn (operands[4], operands[1]);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
+ output_asm_insn (AS2 (mov%L0,%0,%1), operands);
- emit_insn (gen_ashrsi3_31 (operands[4], operands[4]));
- DONE;
+ operands[0] = GEN_INT (31);
+ return AS2 (sar%L1,%0,%1);
}")
;; Note that the i386 programmers' manual says that the opcodes
- Raw text -