Patch: several m68k fixes

Roman Zippel zippel@linux-m68k.org
Fri Aug 24 11:56:00 GMT 2001


Hi,

This patch fixes several problems in the m68k port:
- defining FPBIT/DPBIT fixes gcc.c-torture/execute/ieee/fp-cmp-4.c, which
failed with undefined references to __unorddf2
- the subreg fixes were provided by Jan, I just checked and tested them
and they are needed to bootstrap
- the adddi_dilshr32, adddi_dishl32 changes fix a bug described here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=105622

Bootstrapped and regression tested on m68k-linux.

bye, Roman

2001-07-24  Roman Zippel  <zippel@linux-m68k.org>

	* config/m68k/m68k.md: subreg fixes
	(pushqi1): new, generate correct byte push
	(adddi_dilshr32, adddi_dishl32): only data register can be source
	for mem destination
	* config/m68k/t-linux: define FPBIT/DPBIT


Index: gcc/config/m68k/m68k.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/m68k/m68k.md,v
retrieving revision 1.44
diff -u -r1.44 m68k.md
--- m68k.md	2001/07/31 03:45:08	1.44
+++ m68k.md	2001/08/22 15:52:24
@@ -1425,6 +1433,15 @@
 	(match_operand:SI 1 "address_operand" "p"))]
   ""
   "pea %a1")
+
+(define_expand "pushqi1"
+  [(set (reg:SI 15)
+	(plus:SI (reg:SI 15) (const_int -2)))
+   (set (mem:QI (plus:SI (reg:SI 15)
+		      (const_int 1)))
+	(match_operand:QI 0 "general_operand" ""))]
+  "!TARGET_5200"
+  "")

 ;; truncation instructions
 (define_insn "truncsiqi2"
@@ -2136,7 +2153,7 @@
 ;;    (plus:DI (match_operand:DI 2 "general_operand" "%0")
 ;;	(lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
 ;;            (const_int 32))))]
-    (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,r")
+    (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")
             (const_int 32))
         (match_operand:DI 2 "general_operand" "0,0")))]
   ""
@@ -2155,7 +2172,7 @@
 ;;    (plus:DI (match_operand:DI 2 "general_operand" "%0")
 ;;	(ashift:DI (match_operand:DI 1 "general_operand" "ro")
 ;;            (const_int 32))))]
-    (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,r")
+    (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,d")
             (const_int 32))
         (match_operand:DI 2 "general_operand" "0,0")))]
   ""
@@ -4718,7 +4735,7 @@
 (define_insn "subreghi1ashrdi_const32"
   [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
     (subreg:HI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
-            (const_int 32)) 4))]
+            (const_int 32)) 6))]
   ""
   "*
 {
@@ -5197,7 +5214,7 @@
 (define_insn "bsetmemqi"
   [(set (match_operand:QI 0 "memory_operand" "+m")
 	(ior:QI (subreg:QI (ashift:SI (const_int 1)
-		(match_operand:SI 1 "general_operand" "d")) 0)
+		(match_operand:SI 1 "general_operand" "d")) 3)
 	(match_dup 0)))]
   ""
   "*
@@ -5211,7 +5228,7 @@
   [(set (match_operand:QI 0 "memory_operand" "+m")
 	(ior:QI (subreg:QI (ashift:SI (const_int 1)
 	    (match_operator:SI 2 "extend_operator"
-		[(match_operand 1 "general_operand" "d")])) 0)
+		[(match_operand 1 "general_operand" "d")])) 3)
 	(match_dup 0)))]
   ""
   "*
@@ -7182,7 +7362,7 @@
 (define_peephole
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(const_int 0))
-   (set (strict_low_part (subreg:HI (match_dup 0) 0))
+   (set (strict_low_part (subreg:HI (match_dup 0) 2))
 	(match_operand:HI 1 "general_operand" "rmn"))]
   "strict_low_part_peephole_ok (HImode, prev_nonnote_insn (insn), operands[0])"
   "*
Index: gcc/config/m68k/t-linux
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/m68k/t-linux,v
retrieving revision 1.4
diff -u -r1.4 t-linux
--- t-linux	1998/12/16 21:07:26	1.4
+++ t-linux	2001/08/22 15:52:25
@@ -1,2 +1,12 @@
 # On GNU/Linux we can print long double
 ENQUIRE_CFLAGS = -DNO_MEM -O0
+
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+	cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#define FLOAT' > fp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> fp-bit.c





More information about the Gcc-patches mailing list