|
From: Dave A. <ai...@us...> - 2002-10-17 12:50:07
|
Update of /cvsroot/linux-vax/tools/src/gcc/config/vax
In directory usw-pr-cvs1:/tmp/cvs-serv30713
Modified Files:
Tag: tools-linuxvax-dynamic-dev
vax.h
Log Message:
DA: some more merges from NetBSD..
Index: vax.h
===================================================================
RCS file: /cvsroot/linux-vax/tools/src/gcc/config/vax/vax.h,v
retrieving revision 2.17.2.2
retrieving revision 2.17.2.3
diff -u -r2.17.2.2 -r2.17.2.3
--- vax.h 12 Oct 2002 12:15:29 -0000 2.17.2.2
+++ vax.h 17 Oct 2002 12:50:00 -0000 2.17.2.3
@@ -25,7 +25,7 @@
/* If using g-format floating point, alter math.h. */
-#define CPP_SPEC "%{mg:-DGFLOAT}"
+#define CPP_SPEC "%{mg:%{!ansi:-DGFLOAT} -D__GFLOAT}"
/* Choose proper libraries depending on float format.
Note that there are no profiling libraries for g-format.
@@ -73,13 +73,15 @@
An empty string NAME is used to identify the default VALUE. */
#define TARGET_SWITCHES \
- { {"unix", 1, "Do not output long jump instructions that old versions of as cant handle"}, \
- {"gnu", -1, "Do output long jump instructions, as we are using gas"}, \
- {"vaxc-alignment", 2, "keep same alignment as VAX C"}, \
- {"g", 4, "output code for g floating point code not d float"}, \
- {"g-float", 4, "output code for g floating point code not d float"}, \
- {"d", -4, "output code for d floating point code not g float"}, \
- {"d-float", -4, "output code for d floating point code not g float"}, \
+ { {"unix", MASK_UNIX_ASM, "Do not output long jump instructions that old versions of as cant handle"}, \
+ {"gnu", -MASK_UNIX_ASM, "Do output long jump instructions, as we are using gas"}, \
+ {"vaxc-alignment", MASK_VAXC_ALIGNMENT, "keep same alignment as VAX C"}, \
+ {"g", MASK_G_FLOAT, "output code for g floating point code not d float"}, \
+ {"g-float", MASK_G_FLOAT, "output code for g floating point code not d float"}, \
+ {"d", -MASK_G_FLOAT, "output code for d floating point code not g float"}, \
+ {"d-float", -MASK_G_FLOAT, "output code for d floating point code not g float"}, \
+ {"indirect", MASK_INDIRECT, "Allow indirect memory references in PIC code"}, \
+ {"no-indirect", -MASK_INDIRECT, "Disallow indirect memory references in PIC code"}, \
{ "", TARGET_DEFAULT, ""}}
/* Default target_flags if no switches specified. */
@@ -290,16 +292,28 @@
#define REG_CLASS_FROM_LETTER(C) NO_REGS
-/* The letters I, J, K, L and M in a register constraint string
+/* The letters I, J, K, L, M, N, and O in a register constraint string
can be used to stand for particular ranges of immediate operands.
This macro defines what the ranges are.
C is the letter, and VALUE is a constant value.
Return 1 if VALUE is in the range specified by C.
- `I' is the constant zero. */
-
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'I' ? (VALUE) == 0 \
+ `I' is the constant zero.
+ `J' is a value between 0 .. 63 (inclusive) S^#
+ `K' is a value between -128 and 127 (inclusive) B^
+ 'L' is a value between -32768 and 32767 (include) W^
+ `M' is a value between 0 and 255 (inclusive) B^
+ 'N' is a value between 0 and 65535 (inclusive) W^
+ `O' is a value between -63 and -1 (inclusive) */
+
+#define CONST_OK_FOR_LETTER_P(VALUE, C) \
+ ( (C) == 'I' ? (VALUE) == 0 \
+ : (C) == 'J' ? 0 <= (VALUE) && (VALUE) < 64 \
+ : (C) == 'O' ? -63 <= (VALUE) && (VALUE) < 0 \
+ : (C) == 'K' ? -128 <= (VALUE) && (VALUE) < 128 \
+ : (C) == 'M' ? 0 <= (VALUE) && (VALUE) < 256 \
+ : (C) == 'L' ? -32768 <= (VALUE) && (VALUE) < 32768 \
+ : (C) == 'N' ? 0 <= (VALUE) && (VALUE) < 65536 \
: 0)
/* Similar, but for floating constants, and defining letters G and H.
@@ -567,12 +581,15 @@
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
+/* This is separated out so register prefixes can be added by a target
+ if it requires them */
+#define VAX_ISTREAM_SYNC "movpsl -(sp)\n\tpushal 1(pc)\n\trei"
+
/* We copy the register-mask from the function's pure code
to the start of the trampoline. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
- emit_insn (gen_rtx (ASM_INPUT, VOIDmode, \
- "movpsl -(sp)\n\tpushal 1(pc)\n\trei")); \
+ emit_insn (gen_rtx (ASM_INPUT, VOIDmode, VAX_ISTREAM_SYNC)); \
emit_move_insn (gen_rtx (MEM, HImode, TRAMP), \
gen_rtx (MEM, HImode, FNADDR)); \
emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), CXT);\
@@ -839,8 +856,10 @@
goto LABEL; \
if (GET_CODE (ADDR) == PLUS) \
{ if (CONSTANT_ADDRESS_P (XEXP (ADDR, 0)) \
+ && (!flag_pic || GET_CODE (XEXP (ADDR, 0)) != SYMBOL_REF) \
&& GET_CODE (XEXP (ADDR, 1)) == REG); \
else if (CONSTANT_ADDRESS_P (XEXP (ADDR, 1)) \
+ && (!flag_pic || GET_CODE (XEXP (ADDR, 1)) != SYMBOL_REF) \
&& GET_CODE (XEXP (ADDR, 0)) == REG); \
else goto LABEL; }}
@@ -859,6 +878,10 @@
jumps to the default label instead. */
#define CASE_DROPS_THROUGH
+/* Indicate that jump tables go in the text section. This is
+ necessary when compiling PIC code. */
+#define JUMP_TABLES_IN_TEXT_SECTION 1
+
/* Specify the tree operation to be used to convert reals to integers. */
#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
@@ -992,6 +1015,36 @@
#define MIN_G_FLOAT .556268464626800e-308
*/
+/* Optionally define this if you have added predicates to
+ `MACHINE.c'. This macro is called within an initializer of an
+ array of structures. The first field in the structure is the
+ name of a predicate and the second field is an array of rtl
+ codes. For each predicate, list all rtl codes that can be in
+ expressions matched by the predicate. The list should have a
+ trailing comma. Here is an example of two entries in the list
+ for a typical RISC machine:
+
+ #define PREDICATE_CODES \
+ {"gen_reg_rtx_operand", {SUBREG, REG}}, \
+ {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
+
+ Defining this macro does not affect the generated code (however,
+ incorrect definitions that omit an rtl code that may be matched
+ by the predicate can cause the compiler to malfunction).
+ Instead, it allows the table built by `genrecog' to be more
+ compact and efficient, thus speeding up the compiler. The most
+ important predicates to include in the list specified by this
+ macro are thoses used in the most insn patterns. */
+
+#define PREDICATE_CODES \
+ {"vax_symbolic_operand", { SYMBOL_REF, LABEL_REF, CONST, PLUS }},\
+ {"vax_lvalue_operand", { REG, SUBREG, MEM, CONCAT, PARALLEL, \
+ STRICT_LOW_PART }}, \
+ {"vax_nonsymbolic_operand", { CONST_INT, CONST_DOUBLE, SUBREG, REG, \
+ MEM }}, \
+ {"vax_general_operand", { CONST_INT, CONST_DOUBLE, SUBREG, REG, \
+ MEM, SYMBOL_REF, LABEL_REF, CONST, PLUS }},
+
/* Tell final.c how to eliminate redundant test instructions. */
/* Here we define machine-dependent flags and fields in cc_status
@@ -1006,9 +1059,15 @@
{ if (GET_CODE (EXP) == SET) \
{ if (GET_CODE (SET_SRC (EXP)) == CALL) \
CC_STATUS_INIT; \
+ else if (GET_CODE (SET_SRC (EXP)) == COMPARE \
+ || GET_CODE (SET_SRC (EXP)) == PLUS \
+ || GET_CODE (SET_SRC (EXP)) == MINUS) \
+ { cc_status.flags = 0; \
+ cc_status.value1 = SET_DEST (EXP); \
+ cc_status.value2 = SET_SRC (EXP); } \
else if (GET_CODE (SET_DEST (EXP)) != ZERO_EXTRACT \
&& GET_CODE (SET_DEST (EXP)) != PC) \
- { cc_status.flags = 0; \
+ { cc_status.flags = CC_NO_OVERFLOW; \
cc_status.value1 = SET_DEST (EXP); \
cc_status.value2 = SET_SRC (EXP); } } \
else if (GET_CODE (EXP) == PARALLEL \
@@ -1017,7 +1076,7 @@
if (GET_CODE (SET_SRC (XVECEXP (EXP, 0, 0))) == CALL) \
CC_STATUS_INIT; \
else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) != PC) \
- { cc_status.flags = 0; \
+ { cc_status.flags = CC_NO_OVERFLOW; \
cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0)); \
cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0)); } \
else \
|