aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2016-09-07 04:44:40 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2016-09-07 04:44:40 +0000
commit9bed5535322505f1d5f983f22f8179716a898eb2 (patch)
treef86096023619f76a05b01a50a4e22a31295c4a76 /gcc
parentcdc65c28a6ac260232f578d236630aaf1504e8f5 (diff)
downloadgcc-9bed5535322505f1d5f983f22f8179716a898eb2.zip
gcc-9bed5535322505f1d5f983f22f8179716a898eb2.tar.gz
gcc-9bed5535322505f1d5f983f22f8179716a898eb2.tar.bz2
[SH] Move definitions for atomic models to sh.h from sh-protos.h.
From-SVN: r240023
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/sh/sh-protos.h53
-rw-r--r--gcc/config/sh/sh.h57
3 files changed, 69 insertions, 53 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7fb0212..9a62e12 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2016-09-07 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh-protos.h (struct sh_atomic_model,
+ selected_atomic_model, TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT,
+ TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS,
+ TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_IMASK): Move to...
+ * config/sh/sh.h (struct sh_atomic_model,
+ selected_atomic_model, TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT,
+ TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS,
+ TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_IMASK): ...here.
+ Guard with __cplusplus.
+
2016-09-06 Jakub Jelinek <jakub@redhat.com>
PR target/69255
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index fecbb88..f611dab 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -35,59 +35,6 @@ enum sh_function_kind {
SFUNC_STATIC
};
-/* Atomic model. */
-struct sh_atomic_model
-{
- enum enum_type
- {
- none = 0,
- soft_gusa,
- hard_llcs,
- soft_tcb,
- soft_imask,
-
- num_models
- };
-
- /* If strict is set, disallow mixing of different models, as it would
- happen on SH4A. */
- bool strict;
- enum_type type;
-
- /* Name string as it was specified on the command line. */
- const char* name;
-
- /* Name string as it is used in C/C++ defines. */
- const char* cdef_name;
-
- /* GBR offset variable for TCB model. */
- int tcb_gbr_offset;
-};
-
-extern const sh_atomic_model& selected_atomic_model (void);
-
-/* Shortcuts to check the currently selected atomic model. */
-#define TARGET_ATOMIC_ANY \
- (selected_atomic_model ().type != sh_atomic_model::none)
-
-#define TARGET_ATOMIC_STRICT \
- (selected_atomic_model ().strict)
-
-#define TARGET_ATOMIC_SOFT_GUSA \
- (selected_atomic_model ().type == sh_atomic_model::soft_gusa)
-
-#define TARGET_ATOMIC_HARD_LLCS \
- (selected_atomic_model ().type == sh_atomic_model::hard_llcs)
-
-#define TARGET_ATOMIC_SOFT_TCB \
- (selected_atomic_model ().type == sh_atomic_model::soft_tcb)
-
-#define TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX \
- GEN_INT (selected_atomic_model ().tcb_gbr_offset)
-
-#define TARGET_ATOMIC_SOFT_IMASK \
- (selected_atomic_model ().type == sh_atomic_model::soft_imask)
-
#ifdef RTX_CODE
extern rtx sh_fsca_sf2int (void);
extern rtx sh_fsca_int2sf (void);
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 0403616..25b6cee 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -333,6 +333,63 @@ extern enum sh_divide_strategy_e sh_div_strategy;
#define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL_DIV1
#endif
+#ifdef __cplusplus
+
+/* Atomic model. */
+struct sh_atomic_model
+{
+ enum enum_type
+ {
+ none = 0,
+ soft_gusa,
+ hard_llcs,
+ soft_tcb,
+ soft_imask,
+
+ num_models
+ };
+
+ /* If strict is set, disallow mixing of different models, as it would
+ happen on SH4A. */
+ bool strict;
+ enum_type type;
+
+ /* Name string as it was specified on the command line. */
+ const char* name;
+
+ /* Name string as it is used in C/C++ defines. */
+ const char* cdef_name;
+
+ /* GBR offset variable for TCB model. */
+ int tcb_gbr_offset;
+};
+
+extern const sh_atomic_model& selected_atomic_model (void);
+
+/* Shortcuts to check the currently selected atomic model. */
+#define TARGET_ATOMIC_ANY \
+ (selected_atomic_model ().type != sh_atomic_model::none)
+
+#define TARGET_ATOMIC_STRICT \
+ (selected_atomic_model ().strict)
+
+#define TARGET_ATOMIC_SOFT_GUSA \
+ (selected_atomic_model ().type == sh_atomic_model::soft_gusa)
+
+#define TARGET_ATOMIC_HARD_LLCS \
+ (selected_atomic_model ().type == sh_atomic_model::hard_llcs)
+
+#define TARGET_ATOMIC_SOFT_TCB \
+ (selected_atomic_model ().type == sh_atomic_model::soft_tcb)
+
+#define TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX \
+ GEN_INT (selected_atomic_model ().tcb_gbr_offset)
+
+#define TARGET_ATOMIC_SOFT_IMASK \
+ (selected_atomic_model ().type == sh_atomic_model::soft_imask)
+
+#endif // __cplusplus
+
#define SUBTARGET_OVERRIDE_OPTIONS (void) 0