]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/epiphany/epiphany.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / epiphany / epiphany.h
index 92b781f5cea4a93301c6ddbc71ecb39b3b5be206..676fc63c56fa3c56a0744ed4f2c3873e477c2c12 100644 (file)
@@ -1,6 +1,5 @@
 /* Definitions of target machine for GNU compiler, Argonaut EPIPHANY cpu.
-   Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
-   2007, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1994-2020 Free Software Foundation, Inc.
    Contributed by Embecosm on behalf of Adapteva, Inc.
 
 This file is part of GCC.
@@ -58,6 +57,17 @@ along with GCC; see the file COPYING3.  If not see
 
 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
 
+#define EPIPHANY_LIBRARY_EXTRA_SPEC \
+  "-ffixed-r40 -ffixed-r41 -ffixed-r42 -ffixed-r43"
+
+/* In the "spec:" rule,, t-epiphany changes this to epiphany_library_stub_spec
+   and epiphany_library_extra_spec, respectively.  */
+#define EXTRA_SPECS \
+  { "epiphany_library_extra_spec", "" }, \
+  { "epiphany_library_build_spec", EPIPHANY_LIBRARY_EXTRA_SPEC }, \
+
+#define DRIVER_SELF_SPECS " %(epiphany_library_extra_spec) "
+
 #undef USER_LABEL_PREFIX
 #define USER_LABEL_PREFIX "_"
 
@@ -137,12 +147,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #define MALLOC_ABI_ALIGNMENT BIGGEST_ALIGNMENT
 
-/* Make strings dword-aligned so strcpy from constants will be faster.  */
-#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
-  ((TREE_CODE (EXP) == STRING_CST      \
-    && (ALIGN) < FASTEST_ALIGNMENT)    \
-   ? FASTEST_ALIGNMENT : (ALIGN))
-
 /* Make arrays of chars dword-aligned for the same reasons.
    Also, align arrays of SImode items.  */
 #define DATA_ALIGNMENT(TYPE, ALIGN)            \
@@ -177,8 +181,8 @@ along with GCC; see the file COPYING3.  If not see
                                       (SPECIFIED_ALIGN)) \
   : MAX ((MANGLED_ALIGN), (SPECIFIED_ALIGN)))
 
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
-  epiphany_adjust_field_align((FIELD), (COMPUTED))
+#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
+  epiphany_adjust_field_align((TYPE), (COMPUTED))
 \f
 /* Layout of source language data types.  */
 
@@ -230,7 +234,7 @@ along with GCC; see the file COPYING3.  If not see
        0, 0, 0, 0, 0, 0, 0, 0,         /* 016-023, gr16 - gr23 */      \
        0, 0, 0, 0, 1, 1, 1, 1,         /* 024-031, gr24 - gr31 */      \
        0, 0, 0, 0, 0, 0, 0, 0,         /* 032-039, gr32 - gr39 */      \
-       1, 1, 1, 1, 0, 0, 0, 0,         /* 040-047, gr40 - gr47 */      \
+       0, 0, 0, 0, 0, 0, 0, 0,         /* 040-047, gr40 - gr47 */      \
        0, 0, 0, 0, 0, 0, 0, 0,         /* 048-055, gr48 - gr55 */      \
        0, 0, 0, 0, 0, 0, 0, 0,         /* 056-063, gr56 - gr63 */      \
        /* Other registers */                                           \
@@ -259,7 +263,7 @@ along with GCC; see the file COPYING3.  If not see
        1, 1, 1, 1, 1, 1, 1, 1,         /* 016-023, gr16 - gr23 */      \
        1, 1, 1, 1, 1, 1, 1, 1,         /* 024-031, gr24 - gr31 */      \
        0, 0, 0, 0, 0, 0, 0, 0,         /* 032-039, gr32 - gr38 */      \
-       1, 1, 1, 1, 1, 1, 1, 1,         /* 040-047, gr40 - gr47 */      \
+       0, 0, 0, 0, 1, 1, 1, 1,         /* 040-047, gr40 - gr47 */      \
        1, 1, 1, 1, 1, 1, 1, 1,         /* 048-055, gr48 - gr55 */      \
        1, 1, 1, 1, 1, 1, 1, 1,         /* 056-063, gr56 - gr63 */      \
        1,                              /* 64 AP   - fake arg ptr */    \
@@ -283,35 +287,14 @@ along with GCC; see the file COPYING3.  If not see
     4, 5, 6, 7, /* Calle-saved 'small' registers.  */ \
     15, /* Calle-saved unpaired register.  */ \
     8, 9, 10, 11, /* Calle-saved registers.  */ \
-    32, 33, 34, 35, 36, 37, 38, 39, \
+    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, \
     14, 13, /* Link register, stack pointer.  */ \
-    40, 41, 42, 43, /* Usually constant, but might be made callee-saved.  */ \
     /* Can't allocate, but must name these... */ \
     28, 29, 30, 31, \
     64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 \
   }
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.  */
-#define HARD_REGNO_NREGS(REGNO, MODE) \
-((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
-/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.  */
-extern const unsigned int epiphany_hard_regno_mode_ok[];
-extern unsigned int epiphany_mode_class[];
-#define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok((REGNO), (MODE))
-
-/* A C expression that is nonzero if it is desirable to choose
-   register allocation so as to avoid move instructions between a
-   value of mode MODE1 and a value of mode MODE2.
-
-   If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
-   MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
-   MODE2)' must be zero.  */
-
-#define MODES_TIEABLE_P(MODE1, MODE2) 1
+#define HARD_REGNO_RENAME_OK(SRC, DST) epiphany_regno_rename_ok (SRC, DST)
 
 /* Register classes and constants.  */
 
@@ -395,7 +378,8 @@ extern enum reg_class epiphany_regno_reg_class[FIRST_PSEUDO_REGISTER];
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 #define REGNO_OK_FOR_BASE_P(REGNO) \
 ((REGNO) < FIRST_PSEUDO_REGISTER || (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
 #define REGNO_OK_FOR_INDEX_P(REGNO) \
@@ -438,6 +422,7 @@ typedef struct GTY (()) machine_function
   unsigned pretend_args_odd : 1;
   unsigned lr_clobbered : 1;
   unsigned control_use_inserted : 1;
+  unsigned lr_slot_known : 1;
   unsigned sw_entities_processed : 6;
   long lr_slot_offset;
   rtx and_mask;
@@ -454,7 +439,7 @@ typedef struct GTY (()) machine_function
 
 /* Define this macro if pushing a word onto the stack moves the stack
    pointer to a smaller address.  */
-#define STACK_GROWS_DOWNWARD
+#define STACK_GROWS_DOWNWARD 1
 
 /* Define this to nonzero if the nominal address of the stack frame
    is at the high-address end of the local variables;
@@ -462,12 +447,6 @@ typedef struct GTY (()) machine_function
    goes at a more negative offset in the frame.  */
 #define FRAME_GROWS_DOWNWARD 1
 
-/* Offset within stack frame to start allocating local variables at.
-   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
-   first local allocated.  Otherwise, it is the offset to the BEGINNING
-   of the first local allocated.  */
-#define STARTING_FRAME_OFFSET epiphany_stack_offset
-
 /* Offset from the stack pointer register to the first location at which
    outgoing arguments are placed.  */
 #define STACK_POINTER_OFFSET epiphany_stack_offset
@@ -628,7 +607,8 @@ typedef struct GTY (()) machine_function
 
 #define RTX_OK_FOR_OFFSET_P(MODE, X) \
   RTX_OK_FOR_OFFSET_1 (GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
-                      && epiphany_vect_align == 4 ? SImode : (MODE), X)
+                      && epiphany_vect_align == 4 \
+                      ? (machine_mode) SImode : (machine_mode) (MODE), X)
 #define RTX_OK_FOR_OFFSET_1(MODE, X) \
   (GET_CODE (X) == CONST_INT \
    && !(INTVAL (X) & (GET_MODE_SIZE (MODE) - 1)) \
@@ -679,7 +659,7 @@ typedef struct GTY (()) machine_function
 /* Define this macro if it is as good or better to call a constant
    function address than to call an address kept in a register.  */
 /* On the EPIPHANY, calling through registers is slow.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 \f
 /* Section selection.  */
 /* WARNING: These section names also appear in dwarf2out.c.  */
@@ -778,9 +758,16 @@ do {                                                       \
 /* This is how to output an assembler line
    that says to advance the location counter
    to a multiple of 2**LOG bytes.  */
-#define ASM_OUTPUT_ALIGN(FILE,LOG) \
+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
 do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
 
+/* Inside the text section, align with nops rather than zeros.  */
+#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE, LOG) \
+do \
+{ \
+  if ((LOG) != 0) fprintf (FILE, "\t.balignw %d,0x01a2\n", 1 << (LOG)); \
+} while (0)
+
 /* This is how to declare the size of a function.  */
 #undef ASM_DECLARE_FUNCTION_SIZE
 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                   \
@@ -825,7 +812,7 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
 
 /* Define if operations between registers always perform the operation
    on the full register even if a narrower mode is specified.  */
-#define WORD_REGISTER_OPERATIONS
+#define WORD_REGISTER_OPERATIONS 1
 
 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
    will either zero-extend or sign-extend.  The value of this macro should
@@ -841,10 +828,6 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
    few bits.  */
 #define SHIFT_COUNT_TRUNCATED 1
 
-/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
-   is done just by pretending it is already truncated.  */
-#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
-
 /* Specify the machine mode that pointers have.
    After generation of rtl, the compiler makes no further distinction
    between pointers and any other objects of this machine mode.  */
@@ -876,20 +859,8 @@ enum epiphany_function_type
    finally an entity that runs in a second mode switching pass to
    resolve FP_MODE_ROUND_UNKNOWN.  */
 #define NUM_MODES_FOR_MODE_SWITCHING \
-  { 2, 2, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE }
-
-#define MODE_NEEDED(ENTITY, INSN) epiphany_mode_needed((ENTITY), (INSN))
-
-#define MODE_PRIORITY_TO_MODE(ENTITY, N) \
-  (epiphany_mode_priority_to_mode ((ENTITY), (N)))
-
-#define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \
-  emit_set_fp_mode ((ENTITY), (MODE), (HARD_REGS_LIVE))
-
-#define MODE_ENTRY(ENTITY) (epiphany_mode_entry_exit ((ENTITY), false))
-#define MODE_EXIT(ENTITY) (epiphany_mode_entry_exit ((ENTITY), true))
-#define MODE_AFTER(LAST_MODE, INSN) \
-  (epiphany_mode_after (e, (LAST_MODE), (INSN)))
+  { 2, 2, 2, \
+    FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE }
 
 #define TARGET_INSERT_MODE_SWITCH_USE epiphany_insert_mode_switch_use
 
@@ -898,16 +869,20 @@ enum
 {
   EPIPHANY_MSW_ENTITY_AND,
   EPIPHANY_MSW_ENTITY_OR,
+  EPIPHANY_MSW_ENTITY_CONFIG, /* 1 means config is known or saved.  */
   EPIPHANY_MSW_ENTITY_NEAREST,
   EPIPHANY_MSW_ENTITY_TRUNC,
   EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN,
   EPIPHANY_MSW_ENTITY_ROUND_KNOWN,
-  EPIPHANY_MSW_ENTITY_FPU_OMNIBUS
+  EPIPHANY_MSW_ENTITY_FPU_OMNIBUS,
+  EPIPHANY_MSW_ENTITY_NUM
 };
 
 extern int epiphany_normal_fp_rounding;
-extern struct rtl_opt_pass pass_mode_switch_use;
-extern struct rtl_opt_pass pass_resolve_sw_modes;
+#ifndef USED_FOR_TARGET
+extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);
+#endif
 
 /* This will need to be adjusted when FP_CONTRACT_ON is properly
    implemented.  */
@@ -917,4 +892,15 @@ extern struct rtl_opt_pass pass_resolve_sw_modes;
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
   epiphany_start_function ((FILE), (NAME), (DECL))
 
+/* This is how we tell the assembler that two symbols have the same value.  */
+#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
+  do                                      \
+    {                                     \
+      assemble_name (FILE, NAME1);        \
+      fputs (" = ", FILE);                \
+      assemble_name (FILE, NAME2);        \
+      fputc ('\n', FILE);                 \
+    }                                     \
+  while (0)
+
 #endif /* !GCC_EPIPHANY_H */