diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-11-09 20:33:40 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-11-09 20:33:40 +0000 |
commit | 6471b0200ef4f907b49ace2190fbacdc9ae5acca (patch) | |
tree | 5d33c2d1554cf8942149e0ae3141717061303e7d | |
parent | 1011c64efc9e57864fbae29f9fbe47dec1abc4ce (diff) |
Port the gcc 2.95 m88k fixes to the gcc 3 codebase, except for the function
frame setup and varargs handling, which need some more work at the moment.
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config.gcc | 12 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h | 5 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k.c | 44 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k.h | 72 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k.md | 55 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/openbsd.h | 57 |
6 files changed, 158 insertions, 87 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config.gcc b/gnu/usr.bin/gcc/gcc/config.gcc index c3ac22263c2..cbc64f263d0 100644 --- a/gnu/usr.bin/gcc/gcc/config.gcc +++ b/gnu/usr.bin/gcc/gcc/config.gcc @@ -1,4 +1,4 @@ -# $OpenBSD: config.gcc,v 1.20 2010/03/18 19:39:48 kettenis Exp $ +# $OpenBSD: config.gcc,v 1.21 2012/11/09 20:33:37 miod Exp $ # GCC build-, host- and target-specific configuration file. # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -213,8 +213,7 @@ target_gtfiles= # Obsolete configurations. case $machine in - m88k-*-* \ - | mn10200-*-* \ + mn10200-*-* \ | romp-*-* \ | alpha*-*-interix* \ | alpha*-*-linux*libc1* \ @@ -1800,9 +1799,10 @@ m88k-*-aout*) tm_file=m88k/m88k-aout.h ;; m88k-*-openbsd*) - tmake_file="${tmake_file} m88k/t-luna-gas" - tm_file="m88k/aout-dbx.h aoutos.h m88k/m88k.h openbsd.h ${tm_file}" - tm_file="${tm_file} exec-stack.h" + tmake_file="t-libc-ok t-openbsd" +# tm_file="${tm_file} exec-stack.h" + use_collect2=yes + gas=yes ;; m88k-*-sysv4*) xm_defines=POSIX diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h b/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h index b7bba671916..2a50634dac4 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h @@ -90,6 +90,9 @@ extern void output_ascii PARAMS ((FILE *, const char *, int, const char *, int)); extern void output_label PARAMS ((int)); extern struct rtx_def *m88k_builtin_saveregs PARAMS ((void)); +extern void m88k_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, + enum machine_mode, tree, int *, + int)); extern enum m88k_instruction classify_integer PARAMS ((enum machine_mode, int)); extern int mak_mask_p PARAMS ((int)); @@ -97,6 +100,8 @@ extern int mak_mask_p PARAMS ((int)); extern struct rtx_def *m88k_function_arg PARAMS ((CUMULATIVE_ARGS, enum machine_mode, tree, int)); +extern void m88k_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, + enum machine_mode, tree, int)); extern struct rtx_def *m88k_va_arg PARAMS ((tree, tree)); extern tree m88k_build_va_list PARAMS ((void)); #endif /* TREE_CODE */ diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c index fde0d14a2a1..f558048c740 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c @@ -43,8 +43,6 @@ Boston, MA 02111-1307, USA. */ #include "target.h" #include "target-def.h" -extern FILE *asm_out_file; - const char *m88k_pound_sign = ""; /* Either # for SVR4 or empty for SVR3 */ const char *m88k_short_data; const char *m88k_version; @@ -516,8 +514,10 @@ static const int best_from_align[3][9] = { 0, 0, 0, MOVSTR_DI_LIMIT_88000} }; +#if 0 static void block_move_loop PARAMS ((rtx, rtx, rtx, rtx, int, int)); static void block_move_no_loop PARAMS ((rtx, rtx, rtx, rtx, int, int)); +#endif static void block_move_sequence PARAMS ((rtx, rtx, rtx, rtx, int, int, int)); static void output_short_branch_defs PARAMS ((FILE *)); static int output_option PARAMS ((FILE *, const char *, const char *, @@ -539,7 +539,9 @@ expand_block_move (dest_mem, src_mem, operands) int align = INTVAL (operands[3]); int constp = (GET_CODE (operands[2]) == CONST_INT); int bytes = (constp ? INTVAL (operands[2]) : 0); +#if 0 int target = (int) m88k_cpu; +#endif if (! (PROCESSOR_M88100 == 0 && PROCESSOR_M88110 == 1 @@ -559,13 +561,15 @@ expand_block_move (dest_mem, src_mem, operands) block_move_sequence (operands[0], dest_mem, operands[1], src_mem, bytes, align, 0); - else if (constp && bytes <= best_from_align[target][align]) +#if 0 + else if (constp && bytes <= best_from_align[target][align] && !TARGET_MEMCPY) block_move_no_loop (operands[0], dest_mem, operands[1], src_mem, bytes, align); - else if (constp && align == 4 && TARGET_88100) + else if (constp && align == 4 && TARGET_88100 && !TARGET_MEMCPY) block_move_loop (operands[0], dest_mem, operands[1], src_mem, bytes, align); +#endif else { @@ -590,6 +594,7 @@ expand_block_move (dest_mem, src_mem, operands) } } +#if 0 /* Emit code to perform a block move by calling a looping movstr library function. SIZE and ALIGN are known constants. DEST and SRC are registers. */ @@ -702,18 +707,29 @@ block_move_no_loop (dest, dest_mem, src, src_mem, size, align) MEM_COPY_ATTRIBUTES (value_rtx, src_mem); value_reg = ((((most - (size - remainder)) / align) & 1) == 0 - ? (align == 8 ? 6 : 5) : 4); + ? (mode == DImode ? 6 : 5) : 4); - emit_insn (gen_call_block_move - (gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (entry_name)), - dest, src, offset_rtx, value_rtx, - gen_rtx_REG (mode, value_reg))); + if (mode == DImode) + { + emit_insn (gen_call_block_move_DI + (gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (entry_name)), + dest, src, offset_rtx, value_rtx, + gen_rtx_REG (mode, value_reg))); + } + else + { + emit_insn (gen_call_block_move + (gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (entry_name)), + dest, src, offset_rtx, value_rtx, + gen_rtx_REG (mode, value_reg))); + } if (remainder) block_move_sequence (gen_rtx_REG (Pmode, 2), dest_mem, gen_rtx_REG (Pmode, 3), src_mem, remainder, align, most); } +#endif /* Emit code to perform a block move with an offset sequence of ld/st instructions (..., ld 0, st 1, ld 1, st 0, ...). SIZE and ALIGN are @@ -2513,12 +2529,9 @@ m88k_function_arg (args_so_far, mode, type, named) && (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE)) mode = BLKmode; - if (mode == BLKmode && TARGET_WARN_PASS_STRUCT) - warning ("argument #%d is a structure", args_so_far + 1); - if ((args_so_far & 1) != 0 && (mode == DImode || mode == DFmode - || (type != 0 && TYPE_ALIGN (type) > 32))) + || (type != 0 && TYPE_ALIGN (type) > BITS_PER_WORD))) args_so_far++; #ifdef ESKIT @@ -2530,14 +2543,13 @@ m88k_function_arg (args_so_far, mode, type, named) abort (); /* m88k_function_arg argument `type' is NULL for BLKmode. */ bytes = (mode != BLKmode) ? GET_MODE_SIZE (mode) : int_size_in_bytes (type); - words = (bytes + 3) / 4; + words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; if (args_so_far + words > 8) return (rtx) 0; /* args have exhausted registers */ else if (mode == BLKmode - && (TYPE_ALIGN (type) != BITS_PER_WORD - || bytes != UNITS_PER_WORD)) + && (TYPE_ALIGN (type) != BITS_PER_WORD || bytes != UNITS_PER_WORD)) return (rtx) 0; return gen_rtx_REG (((mode == BLKmode) ? TYPE_MODE (type) : mode), diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h index 659f5fbe801..ec49987f556 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h @@ -150,11 +150,9 @@ extern int flag_pic; /* -fpic */ Redefined in sysv3.h, sysv4.h, dgux.h, and luna.h. */ #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -D__CLASSIFY_TYPE__=2" -#define TARGET_VERSION fprintf (stderr, " (%s)", VERSION_INFO1) +#define TARGET_VERSION fprintf (stderr, " (%s)", VERSION_INFO) -#ifndef VERSION_INFO1 -#define VERSION_INFO1 "m88k" -#endif +#define VERSION_INFO "m88k" /* Run-time compilation parameters selecting different hardware subsets. */ @@ -182,6 +180,7 @@ extern int flag_pic; /* -fpic */ #define MASK_WARN_PASS_STRUCT 0x00002000 /* Warn about passed structs */ #define MASK_OPTIMIZE_ARG_AREA 0x00004000 /* Save stack space */ #define MASK_NO_SERIALIZE_VOLATILE 0x00008000 /* Serialize volatile refs */ +#define MASK_MEMCPY 0x00010000 /* Always use memcpy for movstr */ #define MASK_EITHER_LARGE_SHIFT (MASK_TRAP_LARGE_SHIFT | \ MASK_HANDLE_LARGE_SHIFT) #define MASK_OMIT_LEAF_FRAME_POINTER 0x00020000 /* omit leaf frame pointers */ @@ -205,6 +204,7 @@ extern int flag_pic; /* -fpic */ #define TARGET_WARN_PASS_STRUCT (target_flags & MASK_WARN_PASS_STRUCT) #define TARGET_OPTIMIZE_ARG_AREA (target_flags & MASK_OPTIMIZE_ARG_AREA) #define TARGET_SERIALIZE_VOLATILE (!(target_flags & MASK_NO_SERIALIZE_VOLATILE)) +#define TARGET_MEMCPY (target_flags & MASK_MEMCPY) #define TARGET_EITHER_LARGE_SHIFT (target_flags & MASK_EITHER_LARGE_SHIFT) #define TARGET_OMIT_LEAF_FRAME_POINTER (target_flags & MASK_OMIT_LEAF_FRAME_POINTER) @@ -239,6 +239,8 @@ extern int flag_pic; /* -fpic */ { "serialize-volatile", -MASK_NO_SERIALIZE_VOLATILE }, \ { "omit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER }, \ { "no-omit-leaf-frame-pointer", -MASK_OMIT_LEAF_FRAME_POINTER }, \ + { "memcpy", MASK_MEMCPY }, \ + { "no-memcpy", -MASK_MEMCPY }, \ SUBTARGET_SWITCHES \ /* Default switches */ \ { "", TARGET_DEFAULT }, \ @@ -268,7 +270,7 @@ extern int flag_pic; /* -fpic */ } \ \ m88k_cpu = (TARGET_88000 ? PROCESSOR_M88000 \ - : (TARGET_88100 ? PROCESSOR_M88100 : PROCESSOR_M88110)); \ + : (TARGET_88100 ? PROCESSOR_M88100 : PROCESSOR_M88110)); \ \ if (TARGET_BIG_PIC) \ flag_pic = 2; \ @@ -305,8 +307,8 @@ extern int flag_pic; /* -fpic */ if (flag_pic) \ error ("-mshort-data-%s and PIC are incompatible", m88k_short_data); \ } \ - if (TARGET_OMIT_LEAF_FRAME_POINTER) /* keep nonleaf frame pointers */ \ - flag_omit_frame_pointer = 1; \ + if (TARGET_OMIT_LEAF_FRAME_POINTER) /* keep nonleaf frame pointers */ \ + flag_omit_frame_pointer = 1; \ } while (0) /*** Storage Layout ***/ @@ -592,7 +594,7 @@ extern int flag_pic; /* -fpic */ registers. The compiler should be allowed to use these as a fast spill area. */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ - (XRF_REGNO_P(REGNO) \ + (XRF_REGNO_P (REGNO) \ ? (TARGET_88110 && GET_MODE_CLASS (MODE) == MODE_FLOAT) \ : (((MODE) != DImode && (MODE) != DFmode && (MODE) != DCmode) \ || ((REGNO) & 1) == 0)) @@ -725,7 +727,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, reg number REGNO. This could be a conditional expression or could index an array. */ #define REGNO_REG_CLASS(REGNO) \ - ((REGNO) ? ((REGNO < 32) ? GENERAL_REGS : XRF_REGS) : AP_REG) + ((REGNO) ? ((REGNO) < 32 ? GENERAL_REGS : XRF_REGS) : AP_REG) /* The class value for index registers, and the one for base regs. */ #define BASE_REG_CLASS AGRF_REGS @@ -756,7 +758,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, in some cases it is preferable to use a more restrictive class. Double constants should be in a register iff they can be made cheaply. */ #define PREFERRED_RELOAD_CLASS(X,CLASS) \ - (CONSTANT_P(X) && (CLASS == XRF_REGS) ? NO_REGS : (CLASS)) + (CONSTANT_P (X) && ((CLASS) == XRF_REGS) ? NO_REGS : (CLASS)) /* Return the register class of a scratch register needed to load IN into a register of class CLASS in MODE. On the m88k, when PIC, we @@ -791,16 +793,16 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, /* Quick tests for certain values. */ #define SMALL_INT(X) (SMALL_INTVAL (INTVAL (X))) -#define SMALL_INTVAL(I) ((unsigned) (I) < 0x10000) +#define SMALL_INTVAL(I) ((unsigned HOST_WIDE_INT) (I) < 0x10000) #define ADD_INT(X) (ADD_INTVAL (INTVAL (X))) -#define ADD_INTVAL(I) ((unsigned) (I) + 0xffff < 0x1ffff) +#define ADD_INTVAL(I) ((unsigned HOST_WIDE_INT) (I) + 0xffff < 0x1ffff) #define POWER_OF_2(I) ((I) && POWER_OF_2_or_0(I)) -#define POWER_OF_2_or_0(I) (((I) & ((unsigned)(I) - 1)) == 0) +#define POWER_OF_2_or_0(I) (((I) & ((unsigned HOST_WIDE_INT)(I) - 1)) == 0) #define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? SMALL_INTVAL (VALUE) \ : (C) == 'J' ? SMALL_INTVAL (-(VALUE)) \ - : (C) == 'K' ? (unsigned)(VALUE) < 32 \ + : (C) == 'K' ? (unsigned HOST_WIDE_INT)(VALUE) < 32 \ : (C) == 'L' ? ((VALUE) & 0xffff) == 0 \ : (C) == 'M' ? integer_ok_for_set (VALUE) \ : (C) == 'N' ? (VALUE) < 0 \ @@ -915,14 +917,13 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, /* Define this if it differs from FUNCTION_VALUE. */ /* #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) ... */ -/* Disable the promotion of some structures and unions to registers. */ +/* Disable the promotion of some structures and unions to registers. + Note that this matches FUNCTION_ARG behaviour. */ #define RETURN_IN_MEMORY(TYPE) \ (TYPE_MODE (TYPE) == BLKmode \ - || ((TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE) \ - && !(TYPE_MODE (TYPE) == SImode \ - || (TYPE_MODE (TYPE) == BLKmode \ - && TYPE_ALIGN (TYPE) == BITS_PER_WORD \ - && int_size_in_bytes (TYPE) == UNITS_PER_WORD)))) + || ((TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE) \ + && (TYPE_ALIGN (TYPE) != BITS_PER_WORD || \ + GET_MODE_SIZE (TYPE_MODE (TYPE)) != UNITS_PER_WORD))) /* Don't default to pcc-struct-return, because we have already specified exactly how to return structures in the RETURN_IN_MEMORY macro. */ @@ -1084,6 +1085,10 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, /*** Trampolines for Nested Functions ***/ +#ifndef FINALIZE_TRAMPOLINE +#define FINALIZE_TRAMPOLINE(TRAMP) +#endif + /* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. @@ -1142,6 +1147,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, { \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 40)), FNADDR); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 36)), CXT); \ + FINALIZE_TRAMPOLINE (TRAMP); \ } /*** Library Subroutine Names ***/ @@ -1238,23 +1244,17 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ? RTX_OK_FOR_BASE_P (_x1) \ : (GET_CODE (_x1) == SYMBOL_REF \ || GET_CODE (_x1) == LABEL_REF))) \ - || (REG_P (_x0) \ - && (REG_OK_FOR_BASE_P (_x0) \ - && LEGITIMATE_INDEX_P (_x1, MODE))) \ - || (REG_P (_x1) \ - && (REG_OK_FOR_BASE_P (_x1) \ - && LEGITIMATE_INDEX_P (_x0, MODE)))) \ + || (RTX_OK_FOR_BASE_P (_x0) \ + && LEGITIMATE_INDEX_P (_x1, MODE)) \ + || (RTX_OK_FOR_BASE_P (_x1) \ + && LEGITIMATE_INDEX_P (_x0, MODE))) \ goto ADDR; \ } \ else if (GET_CODE (X) == LO_SUM) \ { \ register rtx _x0 = XEXP (X, 0); \ register rtx _x1 = XEXP (X, 1); \ - if (((REG_P (_x0) \ - && REG_OK_FOR_BASE_P (_x0)) \ - || (GET_CODE (_x0) == SUBREG \ - && REG_P (SUBREG_REG (_x0)) \ - && REG_OK_FOR_BASE_P (SUBREG_REG (_x0)))) \ + if (RTX_OK_FOR_BASE_P (_x0) \ && CONSTANT_P (_x1)) \ goto ADDR; \ } \ @@ -1394,7 +1394,9 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, {"partial_ccmode_register_operand", { SUBREG, REG}}, \ {"relop_no_unsigned", {EQ, NE, LT, LE, GE, GT}}, \ {"equality_op", {EQ, NE}}, \ - {"pc_or_label_ref", {PC, LABEL_REF}}, + {"pc_or_label_ref", {PC, LABEL_REF}}, \ + {"label_ref", {LABEL_REF}}, + /* A list of predicates that do special things with modes, and so should not elicit warnings for VOIDmode match_operand. */ @@ -1497,13 +1499,13 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, && GET_CODE (PATTERN (RTX)) == SET \ && ((GET_CODE (SET_SRC (PATTERN (RTX))) == MEM \ && MEM_VOLATILE_P (SET_SRC (PATTERN (RTX))))))) \ - LENGTH += 1; \ + (LENGTH) += 1; \ else if (GET_CODE (RTX) == NOTE \ && NOTE_LINE_NUMBER (RTX) == NOTE_INSN_PROLOGUE_END) \ { \ if (current_function_profile) \ - LENGTH += (FUNCTION_PROFILER_LENGTH + REG_PUSH_LENGTH \ - + REG_POP_LENGTH); \ + (LENGTH) += (FUNCTION_PROFILER_LENGTH + REG_PUSH_LENGTH \ + + REG_POP_LENGTH); \ } \ /* Track the state of the last volatile memory reference. Clear the diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md index edefd23db08..3b2f7d7b96b 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md @@ -438,7 +438,7 @@ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + operands[4] = gen_rtx_ROTATE (CCEVENmode, operands[4], GEN_INT (((cv2 & ~1) - (cv1 & ~1)) & 0x1f)); /* Reverse the condition if needed. */ @@ -472,7 +472,7 @@ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + operands[4] = gen_rtx_ROTATE (CCEVENmode, operands[4], GEN_INT ((cv2 - cv1) & 0x1f)); }") @@ -503,7 +503,7 @@ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[2] = gen_rtx_ROTATE (CCmode, operands[2], + operands[2] = gen_rtx_ROTATE (CCEVENmode, operands[2], GEN_INT (((cv1 & ~1) - (cv2 & ~1)) & 0x1f)); }") @@ -625,7 +625,7 @@ /* Make the condition pairs line up by rotating the compare word. */ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + operands[4] = gen_rtx_ROTATE (CCEVENmode, operands[4], GEN_INT ((cv2 - cv1) & 0x1f)); }") @@ -655,7 +655,7 @@ /* Make the condition pairs line up by rotating the compare word. */ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[2] = gen_rtx_ROTATE (CCmode, operands[2], + operands[2] = gen_rtx_ROTATE (CCEVENmode, operands[2], GEN_INT (((cv1 & ~1) - (cv2 & ~1)) & 0x1f)); }") @@ -2177,7 +2177,7 @@ ;; operand 2 is the source pointer ;; operand 3 is the offset for the source and destination pointers ;; operand 4 is the first value to be loaded -;; operand 5 is the register to hold the value (r4 or r5) +;; operand 5 is the register to hold the value (r4 or r5, or r4 or r6 if DImode) (define_expand "call_block_move" [(set (reg:SI 3) (minus:SI (match_operand:SI 2 "register_operand" "") @@ -2188,7 +2188,26 @@ (match_dup 3))) (use (reg:SI 2)) (use (reg:SI 3)) - (use (match_dup 5)) + (use (reg:SI 4)) + (use (reg:SI 5)) + (parallel [(set (reg:DI 2) + (call (mem:SI (match_operand 0 "" "")) + (const_int 0))) + (clobber (reg:SI 1))])] + "" + "") + +(define_expand "call_block_move_DI" + [(set (reg:SI 3) (minus:SI (match_operand:SI 2 "register_operand" "") + (match_operand:SI 3 "immediate_operand" ""))) + (set (match_operand 5 "register_operand" "") + (match_operand 4 "memory_operand" "")) + (set (reg:SI 2) (minus:SI (match_operand:SI 1 "register_operand" "") + (match_dup 3))) + (use (reg:SI 2)) + (use (reg:SI 3)) + (use (reg:DI 4)) + (use (reg:DI 6)) (parallel [(set (reg:DI 2) (call (mem:SI (match_operand 0 "" "")) (const_int 0))) @@ -2294,13 +2313,19 @@ ;;- sign extension instructions -(define_expand "extendsidi2" - [(set (subreg:SI (match_operand:DI 0 "register_operand" "=r") 4) - (match_operand:SI 1 "general_operand" "g")) - (set (subreg:SI (match_dup 0) 0) - (ashiftrt:SI (subreg:SI (match_dup 0) 4) - (const_int 31)))] +(define_insn "extendsidi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI (match_operand:SI 1 "register_operand" "r")))] "" + "#") + +(define_split + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI (match_operand:SI 1 "register_operand" "r")))] + "reload_completed" + [(set (subreg:SI (match_dup 0) 1) (match_dup 1)) + (set (subreg:SI (match_dup 0) 0) + (ashiftrt:SI (match_dup 1) (const_int 31)))] "") (define_expand "extendhisi2" @@ -2454,8 +2479,8 @@ (define_insn "addsi3" [(set (match_operand:SI 0 "register_operand" "=r,r") - (plus:SI (match_operand:SI 1 "add_operand" "%r,r") - (match_operand:SI 2 "add_operand" "rI,J")))] + (plus:SI (match_operand:SI 1 "arith32_operand" "%r,r") + (match_operand:SI 2 "arith32_operand" "rI,J")))] "" "@ addu %0,%1,%2 diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/openbsd.h b/gnu/usr.bin/gcc/gcc/config/m88k/openbsd.h index 7f72b007f58..04e05ebf395 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/openbsd.h +++ b/gnu/usr.bin/gcc/gcc/config/m88k/openbsd.h @@ -18,19 +18,35 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Identify the compiler. */ -#undef VERSION_INFO1 -#define VERSION_INFO1 "Motorola m88k, " +#include <m88k/aout-dbx.h> +#include <aoutos.h> +#include <m88k/m88k.h> + +/* <m88k/m88k.h> provided wrong GLOBAL_ASM_OP and SET_ASM_OP */ +#undef SET_ASM_OP +#define SET_ASM_OP "equ" +#undef GLOBAL_ASM_OP +#define GLOBAL_ASM_OP ".globl" + +/* <m88k/m88k.h> provided wrong SUPPORTS_WEAK and SUPPORTS_ONE_ONLY values */ +#undef SUPPORTS_WEAK +#undef SUPPORTS_ONE_ONLY + +#define OBSD_HAS_CORRECT_ASM_OPS +#define OBSD_OLD_GAS +#define OBSD_NO_DYNAMIC_LIBRARIES + +#include <openbsd.h> /* Macros to be automatically defined. */ #define CPP_PREDEFINES \ - "-D__m88k__ -D__unix__ -D__OpenBSD__ -D__CLASSIFY_TYPE__=2 -Asystem=unix -Asystem=OpenBSD -Acpu=m88k -Amachine=m88k" + "-D__m88k__ -D__unix__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(m88k) -Amachine(m88k)" /* If -m88000 is in effect, add -Dmc88000; similarly for -m88100 and -m88110. However, reproduce the effect of -Dmc88100 previously in CPP_PREDEFINES. Here, the CPU_DEFAULT is assumed to be -m88100. */ -#undef CPP_SPEC -#define CPP_SPEC "%{m88000:-D__mc88000__} \ +#undef CPP_SPEC +#define CPP_SPEC "%{m88000:-D__mc88000__} \ %{!m88000:%{m88100:%{m88110:-D__mc88000__}}} \ %{!m88000:%{!m88100:%{m88110:-D__mc88110__}}} \ %{!m88000:%{!m88110:-D__mc88100__ -D__mc88100}} \ @@ -62,12 +78,23 @@ Boston, MA 02111-1307, USA. */ #undef STRUCTURE_SIZE_BOUNDARY #define STRUCTURE_SIZE_BOUNDARY 16 -/* Stack & calling: aggregate returns. */ - -/* Don't default to pcc-struct-return, because gcc is the only compiler, and - we want to retain compatibility with older gcc versions. */ -#define DEFAULT_PCC_STRUCT_RETURN 0 - -#undef SET_ASM_OP -#define SET_ASM_OP "\t.def\t" - +/* Due to the split instruction and data caches, trampolines must cause the + data cache to be synced before attempting to execute the trampoline code. + Under OpenBSD, this is done by invoking trap #451 with r2 and r3 set to + the address of the trampoline area and its size, respectively. */ +#undef FINALIZE_TRAMPOLINE +#define FINALIZE_TRAMPOLINE(TRAMP) \ + emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__dcache_sync"), \ + 0, VOIDmode, 2, (TRAMP), Pmode, \ + GEN_INT (TRAMPOLINE_SIZE), Pmode) + +#undef TRANSFER_FROM_TRAMPOLINE +#define TRANSFER_FROM_TRAMPOLINE \ +extern void __dcache_sync(int, int); \ +void \ +__dcache_sync (addr, len) \ + int addr, len; \ +{ \ + /* r2 and r3 are set by the caller and need not be modified */ \ + __asm __volatile ("tb0 0, r0, 451"); \ +} |