Subject: Re: gcc-2.6.0
To: Julian H Stacey <Julian.H.Stacey@regent.e-technik.tu-muenchen.de>
From: None <ra!leo@marco.de>
List: port-pc532
Date: 08/19/1994 08:53:04
>
> Matthias,
>
> Is the generic unpatched gcc-2.6.0 safe to use to regenerate pc532-netbsd
> or must I use patches (which & where, can you mail them please ?)
There are patches necessary. I did not check if gcc compiles a kernel without
the patches. At least you can't generate shared libs without the patches.
(appended to this mail).
> PS The make later crashed with:
> > /usr/p/julian/src/gcc-2.6.0/xgcc -B/usr/p/julian/src/gcc-2.6.0/ -O -c -DIN_GCC -g -I./include -I. -I.. -I/usr/p/julian/src/gcc-2.6.0 -I/usr/p/julian/src/gcc-2.6.0/config hash.c
> > In file included from runtime.h:32,
> > from hash.c:31:
> > /usr/p/julian/src/gcc-2.6.0/include/stdio.h:257: parse error before `_BSD_DUMMY_VA_LIST_'
> Any fix suggestion ?
Since I'm somewhat lazy I do not run the complete gcc-make in general.
conigure ./configure ns32k-pc532-netbsd; gmake CFLAGS="-O -fomit-frame-pointer" cc1
cp cc1 /usr/libexec/cc1
is in general all I do to test a new compiler. But I *do* stage1 - stage3
every time I get a new source tree. So I had no chance to see this bug :-)
> PS Matthias if your worried about international mail charges when
> releasing patches, to the lists, send them to me & I'll do it on your behalf.
I have already sent the patch to Richard Kenner and Phil Nelson. I'll
put the 532bsd list on cc. For small amounts of data I have no problem with
mailing by myself.
Matthias
Sun Aug 7 22:16:03 1994 Matthias Pfaller (leo@marco.de)
* ns32k.md (all patterns that use ins/inss and ext/exts):
Disallow use of these instructions when -mnobitfield is
specified.
* ns32k.h (TARGET_BITFIELD): New macro.
(TARGET_SWITCHES): Support for TARGET_BITFIELD.
* netbsd.h (TARGET_DEFAULT): Added -mnobitfield.
(CPP_PREDEFINES): Added -Dpc532.
(WCHAR_{TYPE, UNSIGNED, TYPE_SIZE}): Changed to match new definition
in NetBSD 1.0.
* ns32k.c (print_operand_address): A patch for 2.5.8 ended up at the
wrong place. Moved.
*** 1.1 1994/08/07 20:02:52
--- netbsd.h 1994/08/07 20:12:58
***************
*** 23,31 ****
#include "ns32k/ns32k.h"
/* Compile for the floating point unit & 32532 by default;
! Don't assume SB is zero */
! #define TARGET_DEFAULT 57
/* 32-bit alignment for efficiency */
--- 23,32 ----
#include "ns32k/ns32k.h"
/* Compile for the floating point unit & 32532 by default;
! Don't assume SB is zero;
! Don't use bitfield instructions; */
! #define TARGET_DEFAULT 121
/* 32-bit alignment for efficiency */
***************
*** 68,74 ****
/* Names to predefine in the preprocessor for this target machine. */
#undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dns32k -Dns32000 -Dns32532 -D__NetBSD__ -Dunix"
/* Specify -k to assembler for pic generation. PIC needs -K too. */
--- 69,75 ----
/* Names to predefine in the preprocessor for this target machine. */
#undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dns32k -Dns32000 -Dns32532 -D__NetBSD__ -Dunix -Dpc532"
/* Specify -k to assembler for pic generation. PIC needs -K too. */
***************
*** 93,104 ****
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE
! #define WCHAR_TYPE "short unsigned int"
! #define WCHAR_UNSIGNED 1
#undef WCHAR_TYPE_SIZE
! #define WCHAR_TYPE_SIZE 16
/* This is BSD, so it wants DBX format. */
--- 94,105 ----
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE
! #define WCHAR_TYPE "int"
! #define WCHAR_UNSIGNED 0
#undef WCHAR_TYPE_SIZE
! #define WCHAR_TYPE_SIZE 32
/* This is BSD, so it wants DBX format. */
*** 1.1 1994/08/07 20:03:58
--- ns32k.c 1994/08/07 10:47:08
***************
*** 767,772 ****
--- 767,791 ----
if (base)
fprintf (file, "(%s)", reg_names[REGNO (base)]);
#ifdef BASE_REG_NEEDED
+ else if (TARGET_SB)
+ fprintf (file, "(sb)");
+ else
+ abort ();
+ #endif
+ fprintf (file, ")");
+ break;
+
+ default:
+ abort ();
+ }
+ #ifdef PC_RELATIVE
+ else if (GET_CODE (offset) == LABEL_REF
+ || GET_CODE (offset) == SYMBOL_REF
+ || GET_CODE (offset) == CONST
+ || GET_CODE (offset) == PLUS)
+ fprintf (file, "(pc)");
+ #endif
+ #ifdef BASE_REG_NEEDED
else
{
/* Abs. addresses don't need a base (I think). */
***************
*** 785,810 ****
abort ();
}
}
- #endif
- fprintf (file, ")");
- break;
-
- default:
- abort ();
- }
- #ifdef PC_RELATIVE
- else if (GET_CODE (offset) == LABEL_REF
- || GET_CODE (offset) == SYMBOL_REF
- || GET_CODE (offset) == CONST
- || GET_CODE (offset) == PLUS)
- fprintf (file, "(pc)");
- #endif
- #ifdef BASE_REG_NEEDED /* this is defined if the assembler always
- needs a base register */
- else if (TARGET_SB)
- fprintf (file, "(sb)");
- else
- abort ();
#endif
/* now print index if we have one */
if (indexexp)
--- 804,809 ----
*** 1.1 1994/08/07 20:03:25
--- ns32k.h 1994/08/06 11:11:39
***************
*** 82,87 ****
--- 82,90 ----
/* Ok to use the static base register (and presume it's 0) */
#define TARGET_SB ((target_flags & 32) == 0)
+ /* Compile using bitfield insns. */
+ #define TARGET_BITFIELD ((target_flags & 64) == 0)
+
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }
***************
*** 101,106 ****
--- 104,111 ----
{ "32032", -24}, \
{ "sb", -32}, \
{ "nosb", 32}, \
+ { "bitfield", -64}, \
+ { "nobitfield", 64}, \
{ "", TARGET_DEFAULT}}
/* TARGET_DEFAULT is defined in encore.h, pc532.h, etc. */
*** 1.1 1994/08/07 20:04:20
--- ns32k.md 1994/08/07 07:57:43
***************
*** 1861,1867 ****
return \"adjspb %$-4\";
}")
! ;; The extsd/extd isntructions have the problem that they always access
;; 32 bits even if the bitfield is smaller. For example the instruction
;; extsd 7(r1),r0,2,5
;; would read not only at address 7(r1) but also at 8(r1) to 10(r1).
--- 1861,1867 ----
return \"adjspb %$-4\";
}")
! ;; The exts/ext instructions have the problem that they always access
;; 32 bits even if the bitfield is smaller. For example the instruction
;; extsd 7(r1),r0,2,5
;; would read not only at address 7(r1) but also at 8(r1) to 10(r1).
***************
*** 1876,1889 ****
;; extsd 7(r1),r0,2,5 5 bytes
;; takes about 21 cycles.
;;
! ;; So lets forget about extsd/extd on the 532.
(define_insn ""
[(set (match_operand:SI 0 "general_operand" "=g<")
(zero_extract:SI (match_operand:SI 1 "register_operand" "g")
(match_operand:SI 2 "const_int_operand" "i")
(match_operand:SI 3 "general_operand" "rK")))]
! "! TARGET_32532"
"*
{ if (GET_CODE (operands[3]) == CONST_INT)
return \"extsd %1,%0,%3,%2\";
--- 1876,1892 ----
;; extsd 7(r1),r0,2,5 5 bytes
;; takes about 21 cycles.
;;
! ;; The inss/ins instructions suffer from the same problem.
! ;;
! ;; A machine specific option (-mbitfield/-mnobitfield) is used
! ;; to allow/disallow the use of these instructions.
(define_insn ""
[(set (match_operand:SI 0 "general_operand" "=g<")
(zero_extract:SI (match_operand:SI 1 "register_operand" "g")
(match_operand:SI 2 "const_int_operand" "i")
(match_operand:SI 3 "general_operand" "rK")))]
! "TARGET_BITFIELD"
"*
{ if (GET_CODE (operands[3]) == CONST_INT)
return \"extsd %1,%0,%3,%2\";
***************
*** 1895,1901 ****
(zero_extract:SI (match_operand:QI 1 "general_operand" "g")
(match_operand:SI 2 "const_int_operand" "i")
(match_operand:SI 3 "general_operand" "rK")))]
! "! TARGET_32532"
"*
{ if (GET_CODE (operands[3]) == CONST_INT)
return \"extsd %1,%0,%3,%2\";
--- 1898,1904 ----
(zero_extract:SI (match_operand:QI 1 "general_operand" "g")
(match_operand:SI 2 "const_int_operand" "i")
(match_operand:SI 3 "general_operand" "rK")))]
! "TARGET_BITFIELD"
"*
{ if (GET_CODE (operands[3]) == CONST_INT)
return \"extsd %1,%0,%3,%2\";
***************
*** 1907,1913 ****
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "general_operand" "rn"))
(match_operand:SI 3 "general_operand" "rm"))]
! ""
"*
{ if (GET_CODE (operands[2]) == CONST_INT)
{
--- 1910,1916 ----
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "general_operand" "rn"))
(match_operand:SI 3 "general_operand" "rm"))]
! "TARGET_BITFIELD"
"*
{ if (GET_CODE (operands[2]) == CONST_INT)
{
***************
*** 1932,1938 ****
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "general_operand" "rK"))
(match_operand:SI 3 "general_operand" "rm"))]
! ""
"*
{ if (GET_CODE (operands[2]) == CONST_INT)
if (INTVAL (operands[1]) <= 8)
--- 1935,1941 ----
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "general_operand" "rK"))
(match_operand:SI 3 "general_operand" "rm"))]
! "TARGET_BITFIELD"
"*
{ if (GET_CODE (operands[2]) == CONST_INT)
if (INTVAL (operands[1]) <= 8)
***************
*** 1949,1955 ****
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "general_operand" "rK"))
(match_operand:SI 3 "general_operand" "rm"))]
! ""
"*
{ if (GET_CODE (operands[2]) == CONST_INT)
if (INTVAL (operands[1]) <= 8)
--- 1952,1958 ----
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "general_operand" "rK"))
(match_operand:SI 3 "general_operand" "rm"))]
! "TARGET_BITFIELD"
"*
{ if (GET_CODE (operands[2]) == CONST_INT)
if (INTVAL (operands[1]) <= 8)
------------------------------------------------------------------------------