gcc/config/cris: Remove shared-library and CRIS v32 support.

Part of the removal of crisv32-* and cris-*-linux* (cris-elf remains).

Essentially everything is gone, including functions and
target-specific definitions and most obvious knock-on effects,
like removing unused functions and arguments.

There's one exception: the register-class effects of the CRIS v32
ACR register are deliberately excluded and left in (i.e. its
use by-number is removed and the ACE_REGS regclass is always
unusable - but present).  Changing register class definitions to
remove ACR_REGS and related classes (folding their uses into
remaining classes), causes extra register moves in libgcc (as an
immediate observation; actual net effect unknown), which is
unwanted both for performance reasons and also causing extra
work comparing before/after cc0-machinery-conversion changes
ahead.  The actual cause and solution for these negative effects
of cleaning up the register-classes will at the moment have to
remain to-be-investigated.

If CRIS v32 support is reinstated, consider doing the .md part
not as separate patterns with opposite conditions but merged
patterns with necessarily-different alternatives using the
"enabled" attribute (which was not invented back then).

Also, a single ACR-related RTL-dump example in a cris.md
comment, related to a strict_low_part issue is kept, but marked
as obsolete.

Note that the "b" register-constraint (non-ACR registers; can be
used for post-increment) is left in, as that may have extant
uses outside of gcc.  Its availability is tested by
gcc.target/cris/asm-b-1.c.  When ACR register classes are
removed, it's probably best to make it equal to GENERAL_REGS.

gcc:
	* config/cris: Remove shared-library and CRIS v32 support.
This commit is contained in:
Hans-Peter Nilsson 2020-01-22 05:52:16 +01:00
parent 0e44849e9e
commit d0780379c1
9 changed files with 204 additions and 2278 deletions

View File

@ -7,6 +7,7 @@
* config/cris/t-linux, config/cris/linux.h, config/cris/linux.opt:
Remove.
* config/cris/t-elfmulti: Remove crisv32 multilib.
* config/cris: Remove shared-library and CRIS v32 support.
2020-05-08 Vladimir Makarov <vmakarov@redhat.com>

View File

@ -18,9 +18,6 @@
;; <http://www.gnu.org/licenses/>.
;; Register constraints.
(define_register_constraint "a" "ACR_REGS"
"@internal")
(define_register_constraint "b" "GENNONACR_REGS"
"@internal")
@ -106,7 +103,7 @@
;; A [reg] or (int) [reg], maybe with post-increment.
(match_test "cris_bdap_index_p (op, reload_in_progress
|| reload_completed)")
(match_test "cris_constant_index_p (op)")))
(match_test "CONSTANT_P (op)")))
(define_constraint "T"
"Memory three-address operand."
@ -118,14 +115,14 @@
reload_in_progress
|| reload_completed)"))
;; Just an explicit indirect reference: [const]?
(match_test "CRIS_CONSTANT_P (XEXP (op, 0))")
(match_test "CONSTANT_P (XEXP (op, 0))")
;; Something that is indexed; [...+...]?
(and (match_code "plus" "0")
;; A BDAP constant: [reg+(8|16|32)bit offset]?
(ior (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 0),
reload_in_progress
|| reload_completed)")
(match_test "cris_constant_index_p (XEXP (XEXP (op, 0), 1))"))
(match_test "CONSTANT_P (XEXP (XEXP (op, 0), 1))"))
;; A BDAP register: [reg+[reg(+)].S]?
(and (match_test "cris_base_p (XEXP (XEXP (op, 0), 0),
reload_in_progress
@ -149,18 +146,3 @@
(match_test "cris_biap_index_p (XEXP (XEXP (op, 0), 0),
reload_in_progress
|| reload_completed)")))))))
(define_constraint "S"
"PIC-constructs for symbols."
(and (match_test "flag_pic")
(match_code "const")
(match_test "cris_valid_pic_const (op, false)")))
(define_constraint "U"
"@internal"
(and (match_test "flag_pic")
;; We're just interested in the ..._or_callable_symbol part.
;; (Using CRIS_CONSTANT_P would exclude that too.)
(match_test "CONSTANT_P (op)")
(match_operand 0 "cris_nonmemory_operand_or_callable_symbol")))

View File

@ -27,14 +27,8 @@ extern void cris_notice_update_cc (rtx, rtx_insn *);
extern bool cris_reload_address_legitimized (rtx, machine_mode, int, int, int);
extern int cris_side_effect_mode_ok (enum rtx_code, rtx *, int, int,
int, int, int);
extern bool cris_cc0_user_requires_cmp (rtx_insn *);
extern rtx cris_return_addr_rtx (int, rtx);
extern rtx cris_split_movdx (rtx *);
extern int cris_legitimate_pic_operand (rtx);
extern enum cris_symbol_type cris_symbol_type_of (const_rtx);
extern bool cris_valid_pic_const (const_rtx, bool);
extern bool cris_legitimate_constant_p (machine_mode, rtx);
extern bool cris_constant_index_p (const_rtx);
extern bool cris_base_p (const_rtx, bool);
extern bool cris_base_or_autoincr_p (const_rtx, bool);
extern bool cris_bdap_index_p (const_rtx, bool);
@ -44,11 +38,9 @@ extern bool cris_legitimate_address_p (machine_mode, rtx, bool);
extern bool cris_store_multiple_op_p (rtx);
extern bool cris_movem_load_rest_p (rtx, int);
extern void cris_asm_output_symbol_ref (FILE *, rtx);
extern int cris_cfun_uses_pic_table (void);
extern void cris_asm_output_case_end (FILE *, int, rtx_insn *);
extern rtx cris_gen_movem_load (rtx, rtx, int);
extern rtx cris_emit_movem_store (rtx, rtx, int, bool);
extern void cris_expand_pic_call_address (rtx *, rtx *);
extern void cris_order_for_addsi3 (rtx *, int);
extern void cris_emit_trap_for_misalignment (rtx);
#endif /* RTX_CODE */

File diff suppressed because it is too large Load Diff

View File

@ -64,15 +64,6 @@ along with GCC; see the file COPYING3. If not see
never clash with it for GCC purposes. */
#define CRIS_CANONICAL_CC0_REGNUM (16 + 13)
/* When generating PIC, these suffixes are added to the names of non-local
functions when being output. Contrary to other ports, we have offsets
relative to the GOT, not the PC. We might implement PC-relative PLT
semantics later for the general case; they are used in some cases right
now, such as MI thunks. */
#define CRIS_GOTPLT_SUFFIX ":GOTPLT"
#define CRIS_PLT_GOTOFFSET_SUFFIX ":PLTG"
#define CRIS_PLT_PCOFFSET_SUFFIX ":PLT"
#define CRIS_FUNCTION_ARG_SIZE(MODE, TYPE) \
((MODE) != BLKmode ? GET_MODE_SIZE (MODE) \
: (unsigned) int_size_in_bytes (TYPE))
@ -115,19 +106,10 @@ extern int cris_cpu_version;
#define CRIS_DEFAULT_ASM_ARCH_OPTION ""
#ifdef TARGET_CPU_DEFAULT
#if TARGET_CPU_DEFAULT != 32 && TARGET_CPU_DEFAULT != 10
#if TARGET_CPU_DEFAULT != 10
#error "Due to '()'; e.g. '#define TARGET_CPU_DEFAULT (10)', stringize TARGET_CPU_DEFAULT isn't useful: update manually."
#endif
#if TARGET_CPU_DEFAULT == 32
#undef CRIS_DEFAULT_TUNE
#define CRIS_DEFAULT_TUNE "32"
/* To enable use of "generic" cris-axis-elf binutils, always pass the
architecture option to GAS. (We don't do this for non-v32.) */
#undef CRIS_DEFAULT_ASM_ARCH_OPTION
#define CRIS_DEFAULT_ASM_ARCH_OPTION "--march=v32"
#endif
#undef CRIS_ARCH_CPP_DEFAULT
#define CRIS_ARCH_CPP_DEFAULT \
"%{!march=*:\
@ -183,8 +165,7 @@ extern int cris_cpu_version;
"%(asm_subtarget)\
%{march=*:%{mcpu=*:%edo not specify both -march=... and -mcpu=...}}\
%{march=v0|mcpu=v0|march=v3|mcpu=v3|march=v8|mcpu=v8:--march=v0_v10}\
%{march=v10|mcpu=v10:--march=v10}\
%{march=v32|mcpu=v32:--march=v32}"
%{march=v10|mcpu=v10:--march=v10}"
/* For the cris-*-elf subtarget. */
#define CRIS_ASM_SUBTARGET_SPEC \
@ -252,10 +233,6 @@ extern int cris_cpu_version;
} \
while (0)
/* Previously controlled by target_flags. Note that this is *not* set
for -melinux. */
#define TARGET_LINUX 0
/* For the cris-*-elf subtarget. */
#define CRIS_SUBTARGET_DEFAULT 0
@ -263,24 +240,17 @@ extern int cris_cpu_version;
#define CRIS_CPU_ETRAX4 3 /* Just lz added. */
#define CRIS_CPU_SVINTO 8 /* Added swap, jsrc & Co., 32-bit accesses. */
#define CRIS_CPU_NG 10 /* Added mul[su]. */
#define CRIS_CPU_V32 32 /* Major changes. */
#ifndef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT CRIS_CPU_BASE
#endif
/* Default target_flags if no switches specified.
The alignment-by-32 is to make builtin atomic support for v10 and v32
The alignment-by-32 is to make builtin atomic support for v10
work for *-elf for types without specified alignment (like plain
"int"). See top comment in sync.md. */
#ifndef TARGET_DEFAULT
# if TARGET_CPU_DEFAULT == 32
# define TARGET_DEFAULT \
(MASK_STACK_ALIGN \
+ MASK_CONST_ALIGN + MASK_DATA_ALIGN \
+ MASK_ALIGN_BY_32 \
+ MASK_PROLOGUE_EPILOGUE)
# elif TARGET_CPU_DEFAULT == 10
# if TARGET_CPU_DEFAULT == 10
# define TARGET_DEFAULT \
(MASK_SIDE_EFFECT_PREFIXES + MASK_STACK_ALIGN \
+ MASK_CONST_ALIGN + MASK_DATA_ALIGN \
@ -301,16 +271,15 @@ extern int cris_cpu_version;
#define TARGET_HAS_LZ (cris_cpu_version >= CRIS_CPU_ETRAX4)
#define TARGET_HAS_BREAK (cris_cpu_version >= CRIS_CPU_ETRAX4)
#define TARGET_HAS_SWAP (cris_cpu_version >= CRIS_CPU_SVINTO)
#define TARGET_V32 (cris_cpu_version >= CRIS_CPU_V32)
/* The "break" instruction was introduced with ETRAX 4. */
#define TARGET_TRAP_USING_BREAK8 \
(cris_trap_using_break8 == 2 ? TARGET_HAS_BREAK : cris_trap_using_break8)
/* Call library functions by default for GNU/Linux. */
/* This condition controls whether to expand atomics inline or call
library functions. */
#define TARGET_ATOMICS_MAY_CALL_LIBFUNCS \
(cris_atomics_calling_libfunc == 2 \
? TARGET_LINUX : cris_atomics_calling_libfunc)
(cris_atomics_calling_libfunc != 2 && cris_atomics_calling_libfunc != 0)
/* The < v10 atomics turn off interrupts, so they don't need alignment.
Incidentally, by default alignment is off there causing variables to
@ -319,7 +288,7 @@ extern int cris_cpu_version;
specify as aligned. */
#define TARGET_TRAP_UNALIGNED_ATOMIC \
(cris_trap_unaligned_atomic == 2 \
? (TARGET_V32 || cris_cpu_version == 10) \
? cris_cpu_version == 10 \
: cris_trap_unaligned_atomic)
/* Node: Storage Layout */
@ -450,13 +419,6 @@ extern int cris_cpu_version;
#define REG_ALLOC_ORDER \
{9, 13, 12, 11, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 17, 16, 18, 19}
/* Use MOF and ACR. Prefer ACR before any other register. Prefer MOF
then SRP after saved registers. The *after* is because they're only
useful for storage, not for things being computed, which is
apparently more common. */
#define REG_ALLOC_ORDER_V32 \
{15, 9, 13, 12, 11, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 16, 14, 18, 19}
/* Node: Leaf Functions */
/* (no definitions) */
@ -542,14 +504,6 @@ enum reg_class
|| (unsigned) reg_renumber[REGNO] <= CRIS_LAST_GENERAL_REGISTER \
|| (unsigned) reg_renumber[REGNO] == ARG_POINTER_REGNUM)
/* REGNO_OK_FOR_BASE_P seems to be obsolete wrt. this one, but not yet
documented as such. */
#define REGNO_MODE_CODE_OK_FOR_BASE_P(REGNO, MODE, AS, OCODE, ICODE) \
(REGNO_OK_FOR_BASE_P (REGNO) \
&& ((OCODE) != POST_INC \
|| !((REGNO) == CRIS_ACR_REGNUM \
|| (unsigned) reg_renumber[REGNO] == CRIS_ACR_REGNUM)))
/* See REGNO_OK_FOR_BASE_P. */
#define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO)
@ -566,11 +520,6 @@ enum reg_class
GENERAL_REGS))) \
? GENERAL_REGS : NO_REGS)
/* FIXME: Fix regrename.c; it should check validity of replacements,
not just with a silly pass-specific macro. We may miss some
opportunities, but we must stop regrename from creating acr++. */
#define HARD_REGNO_RENAME_OK(FROM, TO) ((TO) != CRIS_ACR_REGNUM)
/* For CRIS, this is always the size of MODE in words,
since all registers are the same size. To use omitted modes in
patterns with reload constraints, you must say the widest size
@ -716,7 +665,7 @@ struct cum_args {int regs;};
/* Node: Trampolines */
#define TRAMPOLINE_SIZE (TARGET_V32 ? 58 : 32)
#define TRAMPOLINE_SIZE 32
/* CRIS wants instructions on word-boundary. */
#define TRAMPOLINE_ALIGNMENT 16
@ -735,8 +684,6 @@ struct cum_args {int regs;};
#define CONSTANT_ADDRESS_P(X) \
(CONSTANT_P (X) && cris_legitimate_address_p (QImode, X, false))
/* Must be a compile-time constant, so we go with the highest value
among all CRIS variants. */
#define MAX_REGS_PER_ADDRESS 2
/* Fix reloads known to cause suboptimal spilling. */
@ -748,12 +695,6 @@ struct cum_args {int regs;};
} \
while (0)
/* The mode argument to cris_legitimate_constant_p isn't used, so just
pass a cheap dummy. N.B. we have to cast away const from the
parameter rather than adjust the parameter, as it's type is mandated
by the TARGET_LEGITIMATE_CONSTANT_P target hook interface. */
#define CRIS_CONSTANT_P(X) \
(CONSTANT_P (X) && cris_legitimate_constant_p (VOIDmode, CONST_CAST_RTX (X)))
/* Node: Condition Code */
@ -789,25 +730,6 @@ struct cum_args {int regs;};
#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Node: PIC */
/* Helper type. */
enum cris_symbol_type
{
cris_no_symbol = 0,
cris_got_symbol = 1,
cris_rel_symbol = 2,
cris_got_symbol_needing_fixup = 3,
cris_unspec = 7,
cris_offsettable_symbol = 8
};
#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? CRIS_GOT_REGNUM : INVALID_REGNUM)
#define LEGITIMATE_PIC_OPERAND_P(X) cris_legitimate_pic_operand (X)
/* Node: File Framework */
/* We don't want an .ident for gcc. To avoid that but still support
@ -898,10 +820,10 @@ enum cris_symbol_type
#define REGISTER_NAMES \
{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
"r9", "r10", "r11", "r12", "r13", "sp", "acr", "srp", "mof", "faked_ap", "dccr"}
"r9", "r10", "r11", "r12", "r13", "sp", "pc", "srp", "mof", "faked_ap", "dccr"}
#define ADDITIONAL_REGISTER_NAMES \
{{"r14", 14}, {"r15", 15}, {"pc", 15}}
{{"r14", 14}, {"r15", 15}}
/* Output an empty line to illustrate the presence of the delay slot. */
#define DBR_OUTPUT_SEQEND(FILE) \
@ -922,10 +844,7 @@ enum cris_symbol_type
#define USER_LABEL_PREFIX "_"
#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \
fprintf (FILE, \
TARGET_V32 \
? "\tsubq 4,$sp\n\tmove $%s,[$sp]\n" : "\tpush $%s\n", \
reg_names[REGNO])
fprintf (FILE, "\tpush $%s\n", reg_names[REGNO])
#define ASM_OUTPUT_REG_POP(FILE, REGNO) \
fprintf (FILE, "\tmove [$sp+],$%s\n", reg_names[REGNO])
@ -934,14 +853,7 @@ enum cris_symbol_type
/* Node: Dispatch Tables */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do \
{ \
if (TARGET_V32) \
asm_fprintf (FILE, "\t.word %LL%d-.\n", VALUE); \
else \
asm_fprintf (FILE, "\t.word %LL%d-%LL%d\n", VALUE, REL); \
} \
while (0)
asm_fprintf (FILE, "\t.word %LL%d-%LL%d\n", VALUE, REL)
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
asm_fprintf (FILE, "\t.dword %LL%d\n", VALUE)

File diff suppressed because it is too large Load Diff

View File

@ -196,7 +196,3 @@ Mask(SVINTO)
; TARGET_ALIGN_BY_32: Say that all alignment specifications say
; to prefer 32 rather than 16 bits.
Mask(ALIGN_BY_32)
; TARGET_AVOID_GOTPLT is referred to in the .c and the .md so we
; need to allocate the flag and macros here.
Mask(AVOID_GOTPLT)

View File

@ -61,9 +61,7 @@
;; Operand helper predicates.
(define_predicate "cris_bdap_const_operand"
(and (match_code "label_ref, symbol_ref, const_int, const_double, const")
(ior (not (match_test "flag_pic"))
(match_test "cris_valid_pic_const (op, true)"))))
(match_operand 0 "immediate_operand"))
(define_predicate "cris_simple_address_operand"
(ior (match_operand:SI 0 "register_operand")
@ -132,59 +130,3 @@
(define_predicate "cris_bdap_biap_operand"
(ior (match_operand 0 "cris_bdap_operand")
(match_operand 0 "cris_biap_mult_operand")))
;; Since with -fPIC, not all symbols are valid PIC symbols or indeed
;; general_operands, we have to have a predicate that matches it for the
;; "movsi" expander.
;; FIXME: Can s/special_// when PR 20413 is fixed.
(define_special_predicate "cris_general_operand_or_symbol"
(ior (match_operand 0 "general_operand")
(and (match_code "const, symbol_ref, label_ref")
; The following test is actually just an assertion.
(match_test "cris_symbol_type_of (op) != cris_no_symbol"))))
;; A predicate for the anon movsi expansion, one that fits a PCREL
;; operand as well as general_operand.
(define_special_predicate "cris_general_operand_or_pic_source"
(ior (match_operand 0 "general_operand")
(and (match_test "flag_pic")
(match_test "cris_valid_pic_const (op, false)"))))
;; Since a PLT symbol is not a general_operand, we have to have a
;; predicate that matches it when we need it. We use this in the expanded
;; "call" and "call_value" anonymous patterns.
(define_predicate "cris_nonmemory_operand_or_callable_symbol"
(ior (match_operand 0 "nonmemory_operand")
(and (match_code "const")
(and
(match_test "GET_CODE (XEXP (op, 0)) == UNSPEC")
(ior
(match_test "XINT (XEXP (op, 0), 1) == CRIS_UNSPEC_PLT_PCREL")
(match_test "XINT (XEXP (op, 0), 1) == CRIS_UNSPEC_PCREL"))))))
;; This matches a (MEM (general_operand)) or
;; (MEM (cris_general_operand_or_symbol)). The second one isn't a valid
;; memory_operand, so we need this predicate to recognize call
;; destinations before we change them to a PLT operand (by wrapping in
;; UNSPEC CRIS_UNSPEC_PLT).
(define_predicate "cris_mem_call_operand"
(and (match_code "mem")
(ior (match_operand 0 "memory_operand")
(match_test "cris_general_operand_or_symbol (XEXP (op, 0),
Pmode)"))))
;; A marker for the call-insn: (const_int 0) for a call to a
;; hidden or static function and non-pic and
;; pic_offset_table_rtx for a call that *might* go through the
;; PLT.
(define_predicate "cris_call_type_marker"
(ior (and (match_operand 0 "const_int_operand")
(match_test "op == const0_rtx"))
(and (and (match_operand 0 "register_operand")
(match_test "op == pic_offset_table_rtx"))
(match_test "flag_pic != 0"))))

View File

@ -22,17 +22,12 @@
;;
;; - Plain old CRIS v0 (..v8)
;; - CRIS v10 (as used in ETRAX 100 LX)
;; - CRIS v32 (as used in ETRAX FS)
;;
;; The last two alternatives are similar, of LL/SC type. They may
;; The second alternative is of LL/SC type. It may
;; fail for other reasons; an exception, a cache miss or a bus request
;; from other parts of the system. The difference between them is
;; just in what condition-codes are used to track LL and success or
;; failure for the store. See the chapter on integral read-write
;; from other parts of the system. See the chapter on integral read-write
;; operations, chapter 1.13 in "ETRAX 100LX Programmers Manual",
;; <http://www.axis.com/files/tech_notes/etrax_100lx_prog_man-050519.pdf>
;; and chapter 2.1 in "ETRAX FS Designer's reference",
;; <http://www.axis.com/files/manuals/etrax_fs_des_ref-070821.pdf>.
;; <http://www.axis.com/files/tech_notes/etrax_100lx_prog_man-050519.pdf>.
;; Note that the datum being stored has to be contained fully within a
;; cache-line to be integral. A failure to store the data integrally
;; will be flagged, but the store may still have happened in part,
@ -134,18 +129,7 @@
/* Can't be too sure; better ICE if this happens. */
gcc_assert (!reg_overlap_mentioned_p (operands[2], operands[1]));
if (TARGET_V32)
return
"clearf p\n"
".Lsync.%=:\;"
"move<m> %1,%0\;"
"move.d %0,%3\;"
"<atomic_op_mnem_pre_op2>,%3\;<atomic_op_mnem_post_op3>"
"ax\;"
"move<m> %3,%1\;"
"bcs .Lsync.%=\;"
"clearf p";
else if (cris_cpu_version == 10)
if (cris_cpu_version == 10)
return
"clearf\n"
".Lsync.%=:\;"
@ -245,20 +229,7 @@
CRIS_UNSPEC_ATOMIC_SWAP_MEM))]
"<MODE>mode == QImode || !TARGET_ATOMICS_MAY_CALL_LIBFUNCS"
{
if (TARGET_V32)
return
"\n.Lsync.repeat.%=:\;"
"clearf p\;"
"move<m> %2,%1\;"
"cmp<qm3> %3,%1\;"
"bne .Lsync.after.%=\;"
"ax\;"
"move<m> %4,%2\;"
"bcs .Lsync.repeat.%=\n"
".Lsync.after.%=:\;"
"seq %0";
else if (cris_cpu_version == 10)
if (cris_cpu_version == 10)
return
"\n.Lsync.repeat.%=:\;"
"clearf\;"