From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] gcc: xtensa: add data alignment properties to dynconfig
Date: Sat, 12 Aug 2023 01:01:14 +0000 (GMT) [thread overview]
Message-ID: <20230812010114.1FD923858D32@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=db863e7870e9986f2c8e61bb0ae5e0d19b6ede62
commit db863e7870e9986f2c8e61bb0ae5e0d19b6ede62
Author: Max Filippov <jcmvbkbc@gmail.com>
Date: Mon Aug 7 13:07:31 2023 +0200
gcc: xtensa: add data alignment properties to dynconfig
include/
* xtensa-dynconfig.h (xtensa_config_v4): New struct.
(XCHAL_DATA_WIDTH, XCHAL_UNALIGNED_LOAD_EXCEPTION)
(XCHAL_UNALIGNED_STORE_EXCEPTION, XCHAL_UNALIGNED_LOAD_HW)
(XCHAL_UNALIGNED_STORE_HW, XTENSA_CONFIG_V4_ENTRY_LIST): New
definitions.
(XTENSA_CONFIG_INSTANCE_LIST): Add xtensa_config_v4 instance.
(XTENSA_CONFIG_ENTRY_LIST): Add XTENSA_CONFIG_V4_ENTRY_LIST.
Diff:
---
include/xtensa-dynconfig.h | 59 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 58 insertions(+), 1 deletion(-)
diff --git a/include/xtensa-dynconfig.h b/include/xtensa-dynconfig.h
index 19e42349510..45d54dcd0e0 100644
--- a/include/xtensa-dynconfig.h
+++ b/include/xtensa-dynconfig.h
@@ -112,12 +112,22 @@ struct xtensa_config_v3
int xchal_have_xea3;
};
+struct xtensa_config_v4
+{
+ int xchal_data_width;
+ int xchal_unaligned_load_exception;
+ int xchal_unaligned_store_exception;
+ int xchal_unaligned_load_hw;
+ int xchal_unaligned_store_hw;
+};
+
extern const void *xtensa_load_config (const char *name,
const void *no_plugin_def,
const void *no_name_def);
extern const struct xtensa_config_v1 *xtensa_get_config_v1 (void);
extern const struct xtensa_config_v2 *xtensa_get_config_v2 (void);
extern const struct xtensa_config_v3 *xtensa_get_config_v3 (void);
+extern const struct xtensa_config_v4 *xtensa_get_config_v4 (void);
#ifdef XTENSA_CONFIG_DEFINITION
@@ -205,6 +215,26 @@ extern const struct xtensa_config_v3 *xtensa_get_config_v3 (void);
#define XCHAL_HAVE_XEA3 0
#endif
+#ifndef XCHAL_DATA_WIDTH
+#define XCHAL_DATA_WIDTH 16
+#endif
+
+#ifndef XCHAL_UNALIGNED_LOAD_EXCEPTION
+#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1
+#endif
+
+#ifndef XCHAL_UNALIGNED_STORE_EXCEPTION
+#define XCHAL_UNALIGNED_STORE_EXCEPTION 1
+#endif
+
+#ifndef XCHAL_UNALIGNED_LOAD_HW
+#define XCHAL_UNALIGNED_LOAD_HW 0
+#endif
+
+#ifndef XCHAL_UNALIGNED_STORE_HW
+#define XCHAL_UNALIGNED_STORE_HW 0
+#endif
+
#define XTENSA_CONFIG_ENTRY(a) a
#define XTENSA_CONFIG_V1_ENTRY_LIST \
@@ -274,6 +304,13 @@ extern const struct xtensa_config_v3 *xtensa_get_config_v3 (void);
XTENSA_CONFIG_ENTRY(XCHAL_HAVE_EXCLUSIVE), \
XTENSA_CONFIG_ENTRY(XCHAL_HAVE_XEA3)
+#define XTENSA_CONFIG_V4_ENTRY_LIST \
+ XTENSA_CONFIG_ENTRY(XCHAL_DATA_WIDTH), \
+ XTENSA_CONFIG_ENTRY(XCHAL_UNALIGNED_LOAD_EXCEPTION), \
+ XTENSA_CONFIG_ENTRY(XCHAL_UNALIGNED_STORE_EXCEPTION), \
+ XTENSA_CONFIG_ENTRY(XCHAL_UNALIGNED_LOAD_HW), \
+ XTENSA_CONFIG_ENTRY(XCHAL_UNALIGNED_STORE_HW)
+
#define XTENSA_CONFIG_INSTANCE_LIST \
const struct xtensa_config_v1 xtensa_config_v1 = { \
XTENSA_CONFIG_V1_ENTRY_LIST, \
@@ -283,12 +320,16 @@ const struct xtensa_config_v2 xtensa_config_v2 = { \
}; \
const struct xtensa_config_v3 xtensa_config_v3 = { \
XTENSA_CONFIG_V3_ENTRY_LIST, \
+}; \
+const struct xtensa_config_v4 xtensa_config_v4 = { \
+ XTENSA_CONFIG_V4_ENTRY_LIST, \
}
#define XTENSA_CONFIG_ENTRY_LIST \
XTENSA_CONFIG_V1_ENTRY_LIST, \
XTENSA_CONFIG_V2_ENTRY_LIST, \
- XTENSA_CONFIG_V3_ENTRY_LIST
+ XTENSA_CONFIG_V3_ENTRY_LIST, \
+ XTENSA_CONFIG_V4_ENTRY_LIST
#else /* XTENSA_CONFIG_DEFINITION */
@@ -480,6 +521,22 @@ const struct xtensa_config_v3 xtensa_config_v3 = { \
#undef XCHAL_HAVE_XEA3
#define XCHAL_HAVE_XEA3 (xtensa_get_config_v3 ()->xchal_have_xea3)
+
+#undef XCHAL_DATA_WIDTH
+#define XCHAL_DATA_WIDTH (xtensa_get_config_v4 ()->xchal_data_width)
+
+#undef XCHAL_UNALIGNED_LOAD_EXCEPTION
+#define XCHAL_UNALIGNED_LOAD_EXCEPTION (xtensa_get_config_v4 ()->xchal_unaligned_load_exception)
+
+#undef XCHAL_UNALIGNED_STORE_EXCEPTION
+#define XCHAL_UNALIGNED_STORE_EXCEPTION (xtensa_get_config_v4 ()->xchal_unaligned_store_exception)
+
+#undef XCHAL_UNALIGNED_LOAD_HW
+#define XCHAL_UNALIGNED_LOAD_HW (xtensa_get_config_v4 ()->xchal_unaligned_load_hw)
+
+#undef XCHAL_UNALIGNED_STORE_HW
+#define XCHAL_UNALIGNED_STORE_HW (xtensa_get_config_v4 ()->xchal_unaligned_store_hw)
+
#endif /* XTENSA_CONFIG_DEFINITION */
#ifdef __cplusplus
reply other threads:[~2023-08-12 1:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230812010114.1FD923858D32@sourceware.org \
--to=amodra@sourceware.org \
--cc=bfd-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).