Commit 4c54e4e4 by Ian Dall Committed by Richard Henderson

ns32k update from Ian Dall and Hans-Peter Nilsson.

Co-Authored-By: Hans-Peter Nilsson <hp@bitrange.com>

From-SVN: r31648
parent f85cedde
2000-01-27 Ian Dall <ian@sibyl.beware.dropbear.id.au>
Hans-Peter Nilsson <hp@bitrange.com>
* ns32k/xm-ns32k.h (memcpy, memset, memcmp): Delete.
Remove redundant include of xm-ns32k.h.
* ns32k/xm-genix.h (memcpy, memset, memcmp): Add definitions.
Remove redundant include of xm-ns32k.h.
* ns32k/xm-netbsd.h (memcpy, memset, memcmp): No longer undefine.
Remove redundant include of xm-ns32k.h.
* ns32k/netbsd.h (TARGET_DEFAULT): Enable multiply-add instructions.
* ns32k/ns32k.h: Update comment on multiply-add instructions.
(TARGET_SWITCHES): Add documentation strings.
(DWARF_FRAME_REGNUM): Override default definition.
(REG_CLASS_CONTENTS): Add comments.
(SUBSET_P): Format to reduce line length.
(SMALL_REGISTER_CLASSES): Make a run time option.
(GO_IF_NONINDEXED_ADDRESS): Reformat.
(GO_IF_LEGITIMATE_ADDRESS): Ensure that cfun is non NULL before
dereferencing it. Braces to avoid "ambiguous else" were misplaced.
(regclass_map): fix typo in comment.
* ns32k/ns32k.c: Add spaces before parentheses for consistant style.
Prefer gen_rtx_FOO(...) to gen_rtx(FOO,...).
(trace, reg_or_mem_operand): Delete, unused function.
(calc_address_cost): Small offsets are cheaper than large ones.
(expand_block_move): Generate more efficient code when bytes is a
known at compile time.
* ns32k/ns32k.md: Alternate constraints for multiply-add instructions.
(udivmodsi4, udivmodhi4, udivmodqi4): Use nonimmediate_operand
instead of reg_or_mem_operand. Use VOIDmode for load or push
effective address.
* ns32k/ns32k.md: Use nonimmediate_operand or stricter for outputs,
not general_operand. Similarly use "=rm" or stricter, not "=g".
For input operands, use stricter constraints than "g" if not
general_operand. Similarly use stricter predicate than
"general_operand" when stricter constraints than "g" are present,
except for matching constraints.
(movstrsi): Use "memory_operand" for operands 0 and 1.
(truncsiqi2, truncsihi2, trunchiqi2): Remove.
(udivmoddisi4_internal): Use nonimmediate_operand for operand 0,
not reg_or_mem_operand.
(udivmoddisi4): Ditto.
Use nonimmediate_operand for operand 1, not reg_or_mem_operand.
Use nonimmediate_operand for operand 3, not register_operand.
(udivmoddiqi4_internal): Use register_operand for operand 1, not
reg_or_mem_operand.
2000-01-27 Fred Fish <fnf@be.com> 2000-01-27 Fred Fish <fnf@be.com>
* gthr-posix.h: Fix typo; compatibily -> compatibility. * gthr-posix.h: Fix typo; compatibily -> compatibility.
......
...@@ -25,9 +25,10 @@ Boston, MA 02111-1307, USA. ...@@ -25,9 +25,10 @@ Boston, MA 02111-1307, USA.
/* Compile for the floating point unit & 32532 by default; /* Compile for the floating point unit & 32532 by default;
Don't assume SB is zero; Don't assume SB is zero;
Don't use bitfield instructions; Don't use bitfield instructions;
FPU is 32381; */ FPU is 32381;
Use multiply-add instructions */
#define TARGET_DEFAULT (1 + 24 + 32 + 64 + 256) #define TARGET_DEFAULT (1 + 24 + 32 + 64 + 256 + 512)
/* 32-bit alignment for efficiency */ /* 32-bit alignment for efficiency */
...@@ -110,4 +111,3 @@ Boston, MA 02111-1307, USA. ...@@ -110,4 +111,3 @@ Boston, MA 02111-1307, USA.
/* Until they use ELF or something that handles dwarf2 unwinds /* Until they use ELF or something that handles dwarf2 unwinds
and initialization stuff better. */ and initialization stuff better. */
#define DWARF2_UNWIND_INFO 0 #define DWARF2_UNWIND_INFO 0
...@@ -66,13 +66,8 @@ extern int target_flags; ...@@ -66,13 +66,8 @@ extern int target_flags;
#define TARGET_32081 (target_flags & 1) #define TARGET_32081 (target_flags & 1)
#define TARGET_32381 (target_flags & 256) #define TARGET_32381 (target_flags & 256)
/* The use of multiply-add instructions is optional because it can /* The use of multiply-add instructions is optional because there may
* cause an abort due to being unable to find a spill register. The * be cases where it produces worse code.
* main problem is that the multiply-add instructions require f0 and
* f0 is not available for spilling because it is "explicitly
* mentioned" in the rtl for function return values. This can be fixed
* by defining SMALL_REGISTER_CLASSES, but that causes worse code for
* the (more common) integer case. We really need better reload code.
*/ */
#define TARGET_MULT_ADD (target_flags & 512) #define TARGET_MULT_ADD (target_flags & 512)
...@@ -103,27 +98,29 @@ extern int target_flags; ...@@ -103,27 +98,29 @@ extern int target_flags;
where VALUE is the bits to set or minus the bits to clear. where VALUE is the bits to set or minus the bits to clear.
An empty string NAME is used to identify the default VALUE. */ An empty string NAME is used to identify the default VALUE. */
#define TARGET_SWITCHES \ #define TARGET_SWITCHES \
{ { "32081", 1}, \ { { "32081", 1, "Use hardware fp"}, \
{ "soft-float", -257}, \ { "soft-float", -257, "Don't use hardware fp"}, \
{ "rtd", 2}, \ { "rtd", 2, "Alternative calling convention"}, \
{ "nortd", -2}, \ { "nortd", -2, "Use normal calling convention"}, \
{ "regparm", 4}, \ { "regparm", 4, "Pass some arguments in registers"}, \
{ "noregparm", -4}, \ { "noregparm", -4, "Pass all arguments on stack"}, \
{ "32532", 24}, \ { "32532", 24, "Optimize for 32532 cpu"}, \
{ "32332", -8}, \ { "32332", 16, "Optimize for 32332 cpu"}, \
{ "32332", 16}, \ { "32332", -8, 0}, \
{ "32032", -24}, \ { "32032", -24, "Optimize for 32032"}, \
{ "sb", -32}, \ { "sb", -32, "Register sb is zero. Use for absolute addressing"}, \
{ "nosb", 32}, \ { "nosb", 32, "Do not use register sb"}, \
{ "bitfield", -64}, \ { "bitfield", -64, "Do not use bitfield instructions"}, \
{ "nobitfield", 64}, \ { "nobitfield", 64, "Use bitfield instructions"}, \
{ "himem", 128}, \ { "himem", 128, "Generate code for high memory"}, \
{ "nohimem", -128}, \ { "nohimem", -128, "Generate code for low memory"}, \
{ "32381", 256}, \ { "32381", 256, "32381 fpu"}, \
{ "mult-add", 512}, \ { "mult-add", 512, "Use multiply-accumulate fp instructions"}, \
{ "nomult-add", -512}, \ { "nomult-add", -512, "Do not use multiply-accumulate fp instructions" }, \
{ "", TARGET_DEFAULT}} { "src", 1024, "\"Small register classes\" kludge"}, \
{ "nosrc", -1024, "No \"Small register classes\" kludge"}, \
{ "", TARGET_DEFAULT, 0}}
/* TARGET_DEFAULT is defined in encore.h, pc532.h, etc. */ /* TARGET_DEFAULT is defined in encore.h, pc532.h, etc. */
...@@ -304,6 +301,11 @@ while (0) ...@@ -304,6 +301,11 @@ while (0)
: (REGNO) == FRAME_POINTER_REGNUM? 17 \ : (REGNO) == FRAME_POINTER_REGNUM? 17 \
: 16) : 16)
/* dwarf2out.c can't understand the funny DBX register numbering.
* We use dwarf2out.c for exception handling even though we use DBX
* for debugging
*/
#define DWARF_FRAME_REGNUM(REGNO) (REGNO)
...@@ -408,13 +410,23 @@ enum reg_class ...@@ -408,13 +410,23 @@ enum reg_class
This is an initializer for a vector of HARD_REG_SET This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */ of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS {{0}, {0x00ff}, {0x100}, {0x300}, {0xff00}, \ #define REG_CLASS_CONTENTS \
{0xffff00}, {0xffffff}, {0x1000000}, {0x2000000}, \ {{0}, /* NO_REGS */ \
{0x30000ff}, {0x3ffffff} } {0x00ff}, /* GENERAL_REGS */ \
{0x100}, /* FLOAT_REG0 */ \
#define SUBSET_P(CLASS1, CLASS2) \ {0x300}, /* LONG_FLOAT_REG0 */ \
((ns32k_reg_class_contents[CLASS1][0] & ~ns32k_reg_class_contents[CLASS2][0]) \ {0xff00}, /* FLOAT_REGS */ \
== 0) {0xffff00}, /* FP_REGS */ \
{0xffffff}, /* GEN_AND_FP_REGS */ \
{0x1000000}, /* FRAME_POINTER_REG */ \
{0x2000000}, /* STACK_POINTER_REG */ \
{0x30000ff}, /* GEN_AND_MEM_REGS */ \
{0x3ffffff} /* ALL_REGS */ \
}
#define SUBSET_P(CLASS1, CLASS2) \
((ns32k_reg_class_contents[CLASS1][0] \
& ~ns32k_reg_class_contents[CLASS2][0]) == 0)
/* The same information, inverted: /* The same information, inverted:
Return the class number of the smallest class containing Return the class number of the smallest class containing
...@@ -1036,10 +1048,10 @@ __transfer_from_trampoline () \ ...@@ -1036,10 +1048,10 @@ __transfer_from_trampoline () \
secondary_memory_needed(CLASS1, CLASS2, M) secondary_memory_needed(CLASS1, CLASS2, M)
#endif #endif
/* SMALL_REGISTER_CLASSES is true only if we have said we are using the /* SMALL_REGISTER_CLASSES is a run time option. This should no longer
* multiply-add instructions. be necessay and should go when we have confidence that we won't run
*/ out of spill registers */
#define SMALL_REGISTER_CLASSES (target_flags & 512) #define SMALL_REGISTER_CLASSES (target_flags & 1024)
/* A C expression whose value is nonzero if pseudos that have been /* A C expression whose value is nonzero if pseudos that have been
assigned to registers of class CLASS would likely be spilled assigned to registers of class CLASS would likely be spilled
...@@ -1144,13 +1156,14 @@ __transfer_from_trampoline () \ ...@@ -1144,13 +1156,14 @@ __transfer_from_trampoline () \
/* Go to ADDR if X is a valid address not using indexing. /* Go to ADDR if X is a valid address not using indexing.
(This much is the easy part.) */ (This much is the easy part.) */
#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \ #define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \
{ if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; \ { \
if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR; \ if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; \
if (GET_CODE (X) == PLUS) \ if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR; \
if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1))) \ if (GET_CODE (X) == PLUS) \
if (INDIRECTABLE_2_ADDRESS_P (XEXP (X, 0))) \ if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1))) \
goto ADDR; \ if (INDIRECTABLE_2_ADDRESS_P (XEXP (X, 0))) \
goto ADDR; \
} }
/* Go to ADDR if X is a valid address not using indexing. /* Go to ADDR if X is a valid address not using indexing.
...@@ -1189,11 +1202,11 @@ __transfer_from_trampoline () \ ...@@ -1189,11 +1202,11 @@ __transfer_from_trampoline () \
((xfoo2 < 4 && xfoo2 != 2) || xfoo2 == 7)) ((xfoo2 < 4 && xfoo2 != 2) || xfoo2 == 7))
/* Note that xfoo0, xfoo1, xfoo2 are used in some of the submacros above. */ /* Note that xfoo0, xfoo1, xfoo2 are used in some of the submacros above. */
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
{ register rtx xfooy, xfoo0, xfoo1; \ { register rtx xfooy, xfoo0, xfoo1; \
unsigned xfoo2; \ unsigned xfoo2; \
xfooy = X; \ xfooy = X; \
if (flag_pic && ! current_function_uses_pic_offset_table \ if (flag_pic && cfun && ! current_function_uses_pic_offset_table \
&& global_symbolic_reference_mentioned_p (X, 1)) \ && global_symbolic_reference_mentioned_p (X, 1)) \
current_function_uses_pic_offset_table = 1; \ current_function_uses_pic_offset_table = 1; \
GO_IF_NONINDEXED_ADDRESS (xfooy, ADDR); \ GO_IF_NONINDEXED_ADDRESS (xfooy, ADDR); \
...@@ -1212,8 +1225,8 @@ __transfer_from_trampoline () \ ...@@ -1212,8 +1225,8 @@ __transfer_from_trampoline () \
else if (GET_CODE (xfooy) == PRE_DEC) \ else if (GET_CODE (xfooy) == PRE_DEC) \
{ \ { \
if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR; \ if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR; \
else abort (); \
} \ } \
else abort (); \
} }
/* Try machine-dependent ways of modifying an illegitimate address /* Try machine-dependent ways of modifying an illegitimate address
...@@ -1679,7 +1692,7 @@ do { \ ...@@ -1679,7 +1692,7 @@ do { \
extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1]; extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1];
extern const char *const ns32k_out_reg_names[]; extern const char *const ns32k_out_reg_names[];
extern enum reg_class regclass_map[]; /* smalled class containing REGNO */ extern enum reg_class regclass_map[]; /* smallest class containing REGNO */
/* /*
Local variables: Local variables:
......
/* Config file for ns32k running system V. */ /* Config file for ns32k running system V. */
#include "ns32k/xm-ns32k.h" #define memcpy(src,dst,len) bcopy ((dst),(src),(len))
#define memset gcc_memset
#define memcmp(left,right,len) bcmp ((left),(right),(len))
#define USG #define USG
/* Configuration for GCC for ns32k running NetBSD as host. */ /* Configuration for GCC for ns32k running NetBSD as host. */
#include <ns32k/xm-ns32k.h> /* Nothing needs to be done */
/* ns32k/xm-ns32k.h defines these macros, but we don't need them */
#undef memcmp
#undef memcpy
#undef memset
...@@ -36,7 +36,3 @@ Boston, MA 02111-1307, USA. */ ...@@ -36,7 +36,3 @@ Boston, MA 02111-1307, USA. */
/* Arguments to use with `exit'. */ /* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0 #define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33 #define FATAL_EXIT_CODE 33
#define memcpy(src,dst,len) bcopy ((dst),(src),(len))
#define memset gcc_memset
#define memcmp(left,right,len) bcmp ((left),(right),(len))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment