public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: linux-xtensa@linux-xtensa.org,
	Sterling Augustine <augustine.sterling@gmail.com>,
	Max Filippov <jcmvbkbc@gmail.com>
Subject: [RFC 5/5] libgcc: xtensa: use built-in configuration
Date: Mon, 22 May 2017 21:09:00 -0000	[thread overview]
Message-ID: <1495487362-18969-6-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1495487362-18969-1-git-send-email-jcmvbkbc@gmail.com>

Now that gcc provides __XCHAL_* definitions use them instead of XCHAL_*
definitions from the include/xtensa-config.h. That makes libgcc
dynamically configurable for the target xtensa core.

2017-05-22  Max Filippov  <jcmvbkbc@gmail.com>
include/
	* xtensa-config-builtin.h: New File.

libgcc/
	* config/xtensa/crti.S (xtensa-config.h): Replace #inlcude with
	xtensa-config-builtin.h.
	* config/xtensa/crtn.S: Likewise.
	* config/xtensa/lib1funcs.S: Likewise.
	* config/xtensa/lib2funcs.S: Likewise.
---
 include/xtensa-config-builtin.h  | 191 +++++++++++++++++++++++++++++++++++++++
 libgcc/config/xtensa/crti.S      |   2 +-
 libgcc/config/xtensa/crtn.S      |   2 +-
 libgcc/config/xtensa/lib1funcs.S |   2 +-
 libgcc/config/xtensa/lib2funcs.S |   2 +-
 5 files changed, 195 insertions(+), 4 deletions(-)
 create mode 100644 include/xtensa-config-builtin.h

diff --git a/include/xtensa-config-builtin.h b/include/xtensa-config-builtin.h
new file mode 100644
index 0000000..785d62c
--- /dev/null
+++ b/include/xtensa-config-builtin.h
@@ -0,0 +1,191 @@
+/* Xtensa configuration settings.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef XTENSA_CONFIG_BUILTIN_H
+#define XTENSA_CONFIG_BUILTIN_H
+
+/* The macros defined here match those with the same names in the Xtensa
+   compile-time HAL (Hardware Abstraction Layer).  Please refer to the
+   Xtensa System Software Reference Manual for documentation of these
+   macros.  */
+
+#undef XCHAL_HAVE_BE
+#define XCHAL_HAVE_BE			__XCHAL_HAVE_BE
+
+#undef XCHAL_HAVE_DENSITY
+#define XCHAL_HAVE_DENSITY		__XCHAL_HAVE_DENSITY
+
+#undef XCHAL_HAVE_CONST16
+#define XCHAL_HAVE_CONST16		__XCHAL_HAVE_CONST16
+
+#undef XCHAL_HAVE_ABS
+#define XCHAL_HAVE_ABS			__XCHAL_HAVE_ABS
+
+#undef XCHAL_HAVE_ADDX
+#define XCHAL_HAVE_ADDX			__XCHAL_HAVE_ADDX
+
+#undef XCHAL_HAVE_L32R
+#define XCHAL_HAVE_L32R			__XCHAL_HAVE_L32R
+
+#undef XSHAL_USE_ABSOLUTE_LITERALS
+#define XSHAL_USE_ABSOLUTE_LITERALS	__XSHAL_USE_ABSOLUTE_LITERALS
+
+#undef XSHAL_HAVE_TEXT_SECTION_LITERALS
+#define XSHAL_HAVE_TEXT_SECTION_LITERALS __XSHAL_HAVE_TEXT_SECTION_LITERALS
+
+#undef XCHAL_HAVE_MAC16
+#define XCHAL_HAVE_MAC16		__XCHAL_HAVE_MAC16
+
+#undef XCHAL_HAVE_MUL16
+#define XCHAL_HAVE_MUL16		__XCHAL_HAVE_MUL16
+
+#undef XCHAL_HAVE_MUL32
+#define XCHAL_HAVE_MUL32		__XCHAL_HAVE_MUL32
+
+#undef XCHAL_HAVE_MUL32_HIGH
+#define XCHAL_HAVE_MUL32_HIGH		__XCHAL_HAVE_MUL32_HIGH
+
+#undef XCHAL_HAVE_DIV32
+#define XCHAL_HAVE_DIV32		__XCHAL_HAVE_DIV32
+
+#undef XCHAL_HAVE_NSA
+#define XCHAL_HAVE_NSA			__XCHAL_HAVE_NSA
+
+#undef XCHAL_HAVE_MINMAX
+#define XCHAL_HAVE_MINMAX		__XCHAL_HAVE_MINMAX
+
+#undef XCHAL_HAVE_SEXT
+#define XCHAL_HAVE_SEXT			__XCHAL_HAVE_SEXT
+
+#undef XCHAL_HAVE_LOOPS
+#define XCHAL_HAVE_LOOPS		__XCHAL_HAVE_LOOPS
+
+#undef XCHAL_HAVE_THREADPTR
+#define XCHAL_HAVE_THREADPTR		__XCHAL_HAVE_THREADPTR
+
+#undef XCHAL_HAVE_RELEASE_SYNC
+#define XCHAL_HAVE_RELEASE_SYNC		__XCHAL_HAVE_RELEASE_SYNC
+
+#undef XCHAL_HAVE_S32C1I
+#define XCHAL_HAVE_S32C1I		__XCHAL_HAVE_S32C1I
+
+#undef XCHAL_HAVE_BOOLEANS
+#define XCHAL_HAVE_BOOLEANS		__XCHAL_HAVE_BOOLEANS
+
+#undef XCHAL_HAVE_FP
+#define XCHAL_HAVE_FP			__XCHAL_HAVE_FP
+
+#undef XCHAL_HAVE_FP_DIV
+#define XCHAL_HAVE_FP_DIV		__XCHAL_HAVE_FP_DIV
+
+#undef XCHAL_HAVE_FP_RECIP
+#define XCHAL_HAVE_FP_RECIP		__XCHAL_HAVE_FP_RECIP
+
+#undef XCHAL_HAVE_FP_SQRT
+#define XCHAL_HAVE_FP_SQRT		__XCHAL_HAVE_FP_SQRT
+
+#undef XCHAL_HAVE_FP_RSQRT
+#define XCHAL_HAVE_FP_RSQRT		__XCHAL_HAVE_FP_RSQRT
+
+#undef XCHAL_HAVE_FP_POSTINC
+#define XCHAL_HAVE_FP_POSTINC		__XCHAL_HAVE_FP_POSTINC
+
+#undef XCHAL_HAVE_DFP
+#define XCHAL_HAVE_DFP			__XCHAL_HAVE_DFP
+
+#undef XCHAL_HAVE_DFP_DIV
+#define XCHAL_HAVE_DFP_DIV		__XCHAL_HAVE_DFP_DIV
+
+#undef XCHAL_HAVE_DFP_RECIP
+#define XCHAL_HAVE_DFP_RECIP		__XCHAL_HAVE_DFP_RECIP
+
+#undef XCHAL_HAVE_DFP_SQRT
+#define XCHAL_HAVE_DFP_SQRT		__XCHAL_HAVE_DFP_SQRT
+
+#undef XCHAL_HAVE_DFP_RSQRT
+#define XCHAL_HAVE_DFP_RSQRT		__XCHAL_HAVE_DFP_RSQRT
+
+#undef XCHAL_HAVE_WINDOWED
+#define XCHAL_HAVE_WINDOWED		__XCHAL_HAVE_WINDOWED
+
+#undef XCHAL_NUM_AREGS
+#define XCHAL_NUM_AREGS			__XCHAL_NUM_AREGS2
+
+#undef XCHAL_HAVE_WIDE_BRANCHES
+#define XCHAL_HAVE_WIDE_BRANCHES	__XCHAL_HAVE_WIDE_BRANCHES
+
+#undef XCHAL_HAVE_PREDICTED_BRANCHES
+#define XCHAL_HAVE_PREDICTED_BRANCHES	__XCHAL_HAVE_PREDICTED_BRANCHES
+
+
+#undef XCHAL_ICACHE_SIZE
+#define XCHAL_ICACHE_SIZE		__XCHAL_ICACHE_SIZE6384
+
+#undef XCHAL_DCACHE_SIZE
+#define XCHAL_DCACHE_SIZE		__XCHAL_DCACHE_SIZE6384
+
+#undef XCHAL_ICACHE_LINESIZE
+#define XCHAL_ICACHE_LINESIZE		__XCHAL_ICACHE_LINESIZE2
+
+#undef XCHAL_DCACHE_LINESIZE
+#define XCHAL_DCACHE_LINESIZE		__XCHAL_DCACHE_LINESIZE2
+
+#undef XCHAL_ICACHE_LINEWIDTH
+#define XCHAL_ICACHE_LINEWIDTH		__XCHAL_ICACHE_LINEWIDTH
+
+#undef XCHAL_DCACHE_LINEWIDTH
+#define XCHAL_DCACHE_LINEWIDTH		__XCHAL_DCACHE_LINEWIDTH
+
+#undef XCHAL_DCACHE_IS_WRITEBACK
+#define XCHAL_DCACHE_IS_WRITEBACK	__XCHAL_DCACHE_IS_WRITEBACK
+
+
+#undef XCHAL_HAVE_MMU
+#define XCHAL_HAVE_MMU			__XCHAL_HAVE_MMU
+
+#undef XCHAL_MMU_MIN_PTE_PAGE_SIZE
+#define XCHAL_MMU_MIN_PTE_PAGE_SIZE	__XCHAL_MMU_MIN_PTE_PAGE_SIZE2
+
+
+#undef XCHAL_HAVE_DEBUG
+#define XCHAL_HAVE_DEBUG		__XCHAL_HAVE_DEBUG
+
+#undef XCHAL_NUM_IBREAK
+#define XCHAL_NUM_IBREAK		__XCHAL_NUM_IBREAK
+
+#undef XCHAL_NUM_DBREAK
+#define XCHAL_NUM_DBREAK		__XCHAL_NUM_DBREAK
+
+#undef XCHAL_DEBUGLEVEL
+#define XCHAL_DEBUGLEVEL		__XCHAL_DEBUGLEVEL
+
+
+#undef XCHAL_MAX_INSTRUCTION_SIZE
+#define XCHAL_MAX_INSTRUCTION_SIZE	__XCHAL_MAX_INSTRUCTION_SIZE
+
+#undef XCHAL_INST_FETCH_WIDTH
+#define XCHAL_INST_FETCH_WIDTH		__XCHAL_INST_FETCH_WIDTH
+
+
+#undef XSHAL_ABI
+#undef XTHAL_ABI_WINDOWED
+#undef XTHAL_ABI_CALL0
+#define XSHAL_ABI			__XSHAL_ABITHAL_ABI_WINDOWED
+#define XTHAL_ABI_WINDOWED		__XTHAL_ABI_WINDOWED
+#define XTHAL_ABI_CALL0			__XTHAL_ABI_CALL0
+
+#endif /* !XTENSA_CONFIG_BUILTIN_H */
diff --git a/libgcc/config/xtensa/crti.S b/libgcc/config/xtensa/crti.S
index 58bb19a..0e23bfc 100644
--- a/libgcc/config/xtensa/crti.S
+++ b/libgcc/config/xtensa/crti.S
@@ -24,7 +24,7 @@
 # .init sections.  Users may put any desired instructions in those
 # sections.
 
-#include "xtensa-config.h"
+#include "xtensa-config-builtin.h"
 
 	.section .init
 	.globl _init
diff --git a/libgcc/config/xtensa/crtn.S b/libgcc/config/xtensa/crtn.S
index 27e5253..85d0bc1 100644
--- a/libgcc/config/xtensa/crtn.S
+++ b/libgcc/config/xtensa/crtn.S
@@ -25,7 +25,7 @@
 # fact return.  Users may put any desired instructions in those sections.
 # This file is the last thing linked into any executable.
 
-#include "xtensa-config.h"
+#include "xtensa-config-builtin.h"
 
 	.section .init
 #if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
diff --git a/libgcc/config/xtensa/lib1funcs.S b/libgcc/config/xtensa/lib1funcs.S
index e0ea2dc..02f066c 100644
--- a/libgcc/config/xtensa/lib1funcs.S
+++ b/libgcc/config/xtensa/lib1funcs.S
@@ -23,7 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-#include "xtensa-config.h"
+#include "xtensa-config-builtin.h"
 
 /* Define macros for the ABS and ADDX* instructions to handle cases
    where they are not included in the Xtensa processor configuration.  */
diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S
index 2e047a8..3076eeb 100644
--- a/libgcc/config/xtensa/lib2funcs.S
+++ b/libgcc/config/xtensa/lib2funcs.S
@@ -23,7 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-#include "xtensa-config.h"
+#include "xtensa-config-builtin.h"
 
 /* __xtensa_libgcc_window_spill: This function flushes out all but the
    current register window.  This is used to set up the stack so that
-- 
2.1.4

  parent reply	other threads:[~2017-05-22 21:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 21:09 [RFC 0/5] xtensa: support dynamic configuration Max Filippov
2017-05-22 21:09 ` [RFC 3/5] gcc: xtensa: support dynconfig on windows Max Filippov
2017-05-22 21:09 ` [RFC 4/5] gcc: xtensa: add __XCHAL_* builtins Max Filippov
2017-05-22 21:09 ` [RFC 2/5] gcc: xtensa: make configuration dynamic Max Filippov
2017-05-25 18:25   ` augustine.sterling
2017-05-25 20:57     ` Max Filippov
2017-05-26 15:04       ` Ian Lance Taylor via gcc-patches
2017-05-26 18:48         ` Max Filippov
2017-05-22 21:09 ` Max Filippov [this message]
2017-05-22 21:31 ` [RFC 1/5] gcc: xtensa: allow XCHAL_* macros to be non-constant Max Filippov
2017-05-22 21:49   ` augustine.sterling
2017-05-23  2:19     ` Max Filippov
2017-05-25 18:24   ` augustine.sterling
2017-06-14 17:23     ` Max Filippov

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=1495487362-18969-6-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=augustine.sterling@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linux-xtensa@linux-xtensa.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).