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>
* gthr-posix.h: Fix typo; compatibily -> compatibility.
......
......@@ -25,9 +25,10 @@ Boston, MA 02111-1307, USA.
/* Compile for the floating point unit & 32532 by default;
Don't assume SB is zero;
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 */
......@@ -110,4 +111,3 @@ Boston, MA 02111-1307, USA.
/* Until they use ELF or something that handles dwarf2 unwinds
and initialization stuff better. */
#define DWARF2_UNWIND_INFO 0
......@@ -66,13 +66,8 @@ extern int target_flags;
#define TARGET_32081 (target_flags & 1)
#define TARGET_32381 (target_flags & 256)
/* The use of multiply-add instructions is optional because it can
* cause an abort due to being unable to find a spill register. The
* 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.
/* The use of multiply-add instructions is optional because there may
* be cases where it produces worse code.
*/
#define TARGET_MULT_ADD (target_flags & 512)
......@@ -104,26 +99,28 @@ extern int target_flags;
An empty string NAME is used to identify the default VALUE. */
#define TARGET_SWITCHES \
{ { "32081", 1}, \
{ "soft-float", -257}, \
{ "rtd", 2}, \
{ "nortd", -2}, \
{ "regparm", 4}, \
{ "noregparm", -4}, \
{ "32532", 24}, \
{ "32332", -8}, \
{ "32332", 16}, \
{ "32032", -24}, \
{ "sb", -32}, \
{ "nosb", 32}, \
{ "bitfield", -64}, \
{ "nobitfield", 64}, \
{ "himem", 128}, \
{ "nohimem", -128}, \
{ "32381", 256}, \
{ "mult-add", 512}, \
{ "nomult-add", -512}, \
{ "", TARGET_DEFAULT}}
{ { "32081", 1, "Use hardware fp"}, \
{ "soft-float", -257, "Don't use hardware fp"}, \
{ "rtd", 2, "Alternative calling convention"}, \
{ "nortd", -2, "Use normal calling convention"}, \
{ "regparm", 4, "Pass some arguments in registers"}, \
{ "noregparm", -4, "Pass all arguments on stack"}, \
{ "32532", 24, "Optimize for 32532 cpu"}, \
{ "32332", 16, "Optimize for 32332 cpu"}, \
{ "32332", -8, 0}, \
{ "32032", -24, "Optimize for 32032"}, \
{ "sb", -32, "Register sb is zero. Use for absolute addressing"}, \
{ "nosb", 32, "Do not use register sb"}, \
{ "bitfield", -64, "Do not use bitfield instructions"}, \
{ "nobitfield", 64, "Use bitfield instructions"}, \
{ "himem", 128, "Generate code for high memory"}, \
{ "nohimem", -128, "Generate code for low memory"}, \
{ "32381", 256, "32381 fpu"}, \
{ "mult-add", 512, "Use multiply-accumulate fp instructions"}, \
{ "nomult-add", -512, "Do not use multiply-accumulate fp instructions" }, \
{ "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. */
......@@ -304,6 +301,11 @@ while (0)
: (REGNO) == FRAME_POINTER_REGNUM? 17 \
: 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
This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS {{0}, {0x00ff}, {0x100}, {0x300}, {0xff00}, \
{0xffff00}, {0xffffff}, {0x1000000}, {0x2000000}, \
{0x30000ff}, {0x3ffffff} }
#define REG_CLASS_CONTENTS \
{{0}, /* NO_REGS */ \
{0x00ff}, /* GENERAL_REGS */ \
{0x100}, /* FLOAT_REG0 */ \
{0x300}, /* LONG_FLOAT_REG0 */ \
{0xff00}, /* FLOAT_REGS */ \
{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)
((ns32k_reg_class_contents[CLASS1][0] \
& ~ns32k_reg_class_contents[CLASS2][0]) == 0)
/* The same information, inverted:
Return the class number of the smallest class containing
......@@ -1036,10 +1048,10 @@ __transfer_from_trampoline () \
secondary_memory_needed(CLASS1, CLASS2, M)
#endif
/* SMALL_REGISTER_CLASSES is true only if we have said we are using the
* multiply-add instructions.
*/
#define SMALL_REGISTER_CLASSES (target_flags & 512)
/* SMALL_REGISTER_CLASSES is a run time option. This should no longer
be necessay and should go when we have confidence that we won't run
out of spill registers */
#define SMALL_REGISTER_CLASSES (target_flags & 1024)
/* A C expression whose value is nonzero if pseudos that have been
assigned to registers of class CLASS would likely be spilled
......@@ -1145,7 +1157,8 @@ __transfer_from_trampoline () \
/* Go to ADDR if X is a valid address not using indexing.
(This much is the easy part.) */
#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \
{ if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; \
{ \
if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; \
if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR; \
if (GET_CODE (X) == PLUS) \
if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1))) \
......@@ -1193,7 +1206,7 @@ __transfer_from_trampoline () \
{ register rtx xfooy, xfoo0, xfoo1; \
unsigned xfoo2; \
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)) \
current_function_uses_pic_offset_table = 1; \
GO_IF_NONINDEXED_ADDRESS (xfooy, ADDR); \
......@@ -1212,8 +1225,8 @@ __transfer_from_trampoline () \
else if (GET_CODE (xfooy) == PRE_DEC) \
{ \
if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR; \
} \
else abort (); \
} \
}
/* Try machine-dependent ways of modifying an illegitimate address
......@@ -1679,7 +1692,7 @@ do { \
extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1];
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:
......
/* 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
/* Configuration for GCC for ns32k running NetBSD as host. */
#include <ns32k/xm-ns32k.h>
/* ns32k/xm-ns32k.h defines these macros, but we don't need them */
#undef memcmp
#undef memcpy
#undef memset
/* Nothing needs to be done */
......@@ -36,7 +36,3 @@ Boston, MA 02111-1307, USA. */
/* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0
#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