From patchwork Mon May 22 21:09:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 765591 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wWrsj0WSwz9ryr for ; Tue, 23 May 2017 07:10:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="lJlH9kpW"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=oZbjS7oFrirU+4dMt5DFuVl1vbMv+y30mqMQdhYDsl6WfsxQBaA4y 9Ij1XdyPMKYEaiyAZQREx5a0QZ18g7rxWC8h60MfVDysapebMNlyYN8nY75gSdoj rNncWNpl66UrNe5kusBW8FprInIG0/6QlzqRWQ5bEDU21bDHmia2sk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=u6qNOJaEVPP/um8caDIR+1fdpaY=; b=lJlH9kpWPcmw9xTalqQ8 pBfYaLWRprRtD4KtgK1tNxNE2cM+MnHOfT6fLKLxoFlE1qqIXljSeS9zRJ/0YP+Q k95JPK1Oddrw+FxqxZ/Ah2ZY0AoBDo5cE9Zkyisn7V4pXgSouzepWrwBzfTk7pL7 /F5uwc9bH4Z09mBblk1KW/Y= Received: (qmail 120943 invoked by alias); 22 May 2017 21:09:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 120818 invoked by uid 89); 22 May 2017 21:09:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-22.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS, UNSUBSCRIBE_BODY autolearn=ham version=3.3.2 spammy=Franklin, franklin X-HELO: mail-lf0-f67.google.com Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 May 2017 21:09:39 +0000 Received: by mail-lf0-f67.google.com with SMTP id h4so6437901lfj.3 for ; Mon, 22 May 2017 14:09:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jQ3kyWUjpSOu6cQlDvQ5ZWx0dOcstOQICaI0ZQ5FDL0=; b=pvBYmX6dSbthmdUXrVooIX0B5J5Tf6A/MFWAlf1uGPo1J0v3E/cjncyBqkUB2/T+uN QcUn6ELM3gCtIzyaxBq9M16JWzzZcqbzBhwq66bOKrWQpNkkSmva5T81bog7G8SBz/ql vxbJSa5GezG+gsuSGktPputU+yaFcZrumSpcK9COKEg2rjRwJAqh+euKFCi5wXsi966T VV70FKSWYox9ed7EPAYcUwizBqALrTR/5a5kvqfmCxoULkTPaVf0iQ2twvw153Pyng42 A0Pac+g0PMNAjdtV9PbJfJ36ek4khCbxLrWEJDA4aCBcQ8i6RvEimjp1cef6NsbeTIO5 hgpQ== X-Gm-Message-State: AODbwcCIUY1DsJVhZciFuGtuGioGn0Y6nCk/w3xGCsiL9sN84XDZS51R w7u+5XL60mDgsM7E X-Received: by 10.25.16.161 with SMTP id 33mr5873207lfq.3.1495487379420; Mon, 22 May 2017 14:09:39 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id 95sm3447374lja.49.2017.05.22.14.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 May 2017 14:09:38 -0700 (PDT) From: Max Filippov To: gcc-patches@gcc.gnu.org Cc: linux-xtensa@linux-xtensa.org, Sterling Augustine , Max Filippov Subject: [RFC 2/5] gcc: xtensa: make configuration dynamic Date: Mon, 22 May 2017 14:09:19 -0700 Message-Id: <1495487362-18969-3-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1495487362-18969-1-git-send-email-jcmvbkbc@gmail.com> References: <1495487362-18969-1-git-send-email-jcmvbkbc@gmail.com> X-IsSubscribed: yes Now that XCHAL_* macros don't have to be preprocessor constants add include/xtensa-dynconfig.h that defines them as fields of a structure returned from the xtensa_get_config function. Define that structure and fill it with default parameter values specified in the include/xtensa-config.h. Define reusable function xtensa_load_config that tries to load configuration and return an address of an exported object from it. Define the function xtensa_get_config that uses xtensa_load_config to get structure xtensa_config, either dynamically configured or the default. 2017-05-22 Max Filippov gcc/ * Makefile.in (PLUGIN_HEADERS): Add include/xtensa-dynconfig.h. * config.gcc (xtensa*-*-*): Add xtensa-config.o to extra_objs. * gcc/config/xtensa/t-xtensa (xtensa-config.o): New rule. * gcc/config/xtensa/xtensa-config.c: New file. * gcc/config/xtensa/xtensa.h (xtensa-config.h): Replace #include with xtensa-dynconfig.h (XCHAL_HAVE_MUL32_HIGH, XCHAL_HAVE_RELEASE_SYNC, XCHAL_HAVE_S32C1I, XCHAL_HAVE_THREADPTR, XCHAL_HAVE_FP_POSTINC): Drop definitions. include/ * xtensa-dynconfig.h: New file. --- gcc/Makefile.in | 2 +- gcc/config.gcc | 1 + gcc/config/xtensa/t-xtensa | 5 + gcc/config/xtensa/xtensa-config.c | 79 ++++++++ gcc/config/xtensa/xtensa.h | 17 +- include/xtensa-dynconfig.h | 373 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 460 insertions(+), 17 deletions(-) create mode 100644 gcc/config/xtensa/xtensa-config.c create mode 100644 include/xtensa-dynconfig.h diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 2411671..f59a29f 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3433,7 +3433,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ tree-ssa-threadupdate.h inchash.h wide-int.h signop.h hash-map.h \ hash-set.h dominance.h cfg.h cfgrtl.h cfganal.h cfgbuild.h cfgcleanup.h \ lcm.h cfgloopmanip.h builtins.def chkp-builtins.def pass-instances.def \ - params.list + params.list $(srcdir)/../include/xtensa-dynconfig.h # generate the 'build fragment' b-header-vars s-header-vars: Makefile diff --git a/gcc/config.gcc b/gcc/config.gcc index b8bb4d6..f65bb2e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -489,6 +489,7 @@ tic6x-*-*) ;; xtensa*-*-*) extra_options="${extra_options} fused-madd.opt" + extra_objs="xtensa-config.o" ;; tilegx*-*-*) cpu_type=tilegx diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa index f762873..28d3756 100644 --- a/gcc/config/xtensa/t-xtensa +++ b/gcc/config/xtensa/t-xtensa @@ -17,3 +17,8 @@ # . $(out_object_file): gt-xtensa.h + +xtensa-config.o: $(srcdir)/config/xtensa/xtensa-config.c \ + $(CONFIG_H) $(SYSTEM_H) $(srcdir)/../include/xtensa-dynconfig.h \ + $(srcdir)/../include/xtensa-config.h + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< diff --git a/gcc/config/xtensa/xtensa-config.c b/gcc/config/xtensa/xtensa-config.c new file mode 100644 index 0000000..296caf4 --- /dev/null +++ b/gcc/config/xtensa/xtensa-config.c @@ -0,0 +1,79 @@ +#include +#include +#define XTENSA_CONFIG_DEFINITION +#include "xtensa-config.h" +#include "xtensa-dynconfig.h" + +static struct xtensa_config xtensa_defconfig = XTENSA_CONFIG_INITIALIZER; + +void *xtensa_load_config (const char *name ATTRIBUTE_UNUSED, void *def) +{ + static int init; +#ifdef ENABLE_PLUGIN + static void *handle; + void *p; + + if (!init) + { + char *path = getenv ("XTENSA_GNU_CONFIG"); + + init = 1; + if (!path) + return def; + handle = dlopen (path, RTLD_LAZY); + if (!handle) + { + fprintf (stderr, + "XTENSA_GNU_CONFIG is defined but could not be loaded: %s\n", + dlerror ()); + abort (); + } + } + else if (!handle) + { + return def; + } + + p = dlsym (handle, name); + if (!p) + { + fprintf (stderr, + "XTENSA_GNU_CONFIG is loaded but symbol \"%s\" is not found: %s\n", + name, dlerror ()); + abort (); + } + return p; +#else + if (!init) + { + char *path = getenv ("XTENSA_GNU_CONFIG"); + + init = 1; + if (path) + { + fprintf (stderr, + "XTENSA_GNU_CONFIG is defined but plugin support is disabled\n"); + abort (); + } + } + return def; +#endif +} + +struct xtensa_config *xtensa_get_config (void) +{ + static struct xtensa_config *config; + + if (!config) + config = (struct xtensa_config *) xtensa_load_config ("xtensa_config", + &xtensa_defconfig); + + if (config->config_size < sizeof(struct xtensa_config)) + { + fprintf (stderr, + "Old or incompatible configuration is loaded: config_size = %ld, expected: %ld\n", + config->config_size, sizeof (struct xtensa_config)); + abort (); + } + return config; +} diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 59d6b00..7852f44 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -19,27 +19,12 @@ along with GCC; see the file COPYING3. If not see . */ /* Get Xtensa configuration settings */ -#include "xtensa-config.h" +#include "xtensa-dynconfig.h" /* External variables defined in xtensa.c. */ /* Macros used in the machine description to select various Xtensa configuration options. */ -#ifndef XCHAL_HAVE_MUL32_HIGH -#define XCHAL_HAVE_MUL32_HIGH 0 -#endif -#ifndef XCHAL_HAVE_RELEASE_SYNC -#define XCHAL_HAVE_RELEASE_SYNC 0 -#endif -#ifndef XCHAL_HAVE_S32C1I -#define XCHAL_HAVE_S32C1I 0 -#endif -#ifndef XCHAL_HAVE_THREADPTR -#define XCHAL_HAVE_THREADPTR 0 -#endif -#ifndef XCHAL_HAVE_FP_POSTINC -#define XCHAL_HAVE_FP_POSTINC 0 -#endif #define TARGET_BIG_ENDIAN XCHAL_HAVE_BE #define TARGET_DENSITY XCHAL_HAVE_DENSITY #define TARGET_MAC16 XCHAL_HAVE_MAC16 diff --git a/include/xtensa-dynconfig.h b/include/xtensa-dynconfig.h new file mode 100644 index 0000000..12181be --- /dev/null +++ b/include/xtensa-dynconfig.h @@ -0,0 +1,373 @@ +/* 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_DYNAMIC_CONFIG_H +#define XTENSA_DYNAMIC_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct xtensa_config { + unsigned long config_size; + unsigned int xchal_have_be; + unsigned int xchal_have_density; + unsigned int xchal_have_const16; + unsigned int xchal_have_abs; + unsigned int xchal_have_addx; + unsigned int xchal_have_l32r; + unsigned int xshal_use_absolute_literals; + unsigned int xshal_have_text_section_literals; + unsigned int xchal_have_mac16; + unsigned int xchal_have_mul16; + unsigned int xchal_have_mul32; + unsigned int xchal_have_mul32_high; + unsigned int xchal_have_div32; + unsigned int xchal_have_nsa; + unsigned int xchal_have_minmax; + unsigned int xchal_have_sext; + unsigned int xchal_have_loops; + unsigned int xchal_have_threadptr; + unsigned int xchal_have_release_sync; + unsigned int xchal_have_s32c1i; + unsigned int xchal_have_booleans; + unsigned int xchal_have_fp; + unsigned int xchal_have_fp_div; + unsigned int xchal_have_fp_recip; + unsigned int xchal_have_fp_sqrt; + unsigned int xchal_have_fp_rsqrt; + unsigned int xchal_have_fp_postinc; + unsigned int xchal_have_dfp; + unsigned int xchal_have_dfp_div; + unsigned int xchal_have_dfp_recip; + unsigned int xchal_have_dfp_sqrt; + unsigned int xchal_have_dfp_rsqrt; + unsigned int xchal_have_windowed; + unsigned int xchal_num_aregs; + unsigned int xchal_have_wide_branches; + unsigned int xchal_have_predicted_branches; + unsigned int xchal_icache_size; + unsigned int xchal_dcache_size; + unsigned int xchal_icache_linesize; + unsigned int xchal_dcache_linesize; + unsigned int xchal_icache_linewidth; + unsigned int xchal_dcache_linewidth; + unsigned int xchal_dcache_is_writeback; + unsigned int xchal_have_mmu; + unsigned int xchal_mmu_min_pte_page_size; + unsigned int xchal_have_debug; + unsigned int xchal_num_ibreak; + unsigned int xchal_num_dbreak; + unsigned int xchal_debuglevel; + unsigned int xchal_max_instruction_size; + unsigned int xchal_inst_fetch_width; + unsigned int xshal_abi; + unsigned int xthal_abi_windowed; + unsigned int xthal_abi_call0; +}; + +typedef struct xtensa_isa_internal_struct xtensa_isa_internal; + +extern void *xtensa_load_config (const char *name, void *def); +extern struct xtensa_config *xtensa_get_config (void); + +#ifdef XTENSA_CONFIG_DEFINITION + +#ifndef XCHAL_HAVE_MUL32_HIGH +#define XCHAL_HAVE_MUL32_HIGH 0 +#endif + +#ifndef XCHAL_HAVE_RELEASE_SYNC +#define XCHAL_HAVE_RELEASE_SYNC 0 +#endif + +#ifndef XCHAL_HAVE_S32C1I +#define XCHAL_HAVE_S32C1I 0 +#endif + +#ifndef XCHAL_HAVE_THREADPTR +#define XCHAL_HAVE_THREADPTR 0 +#endif + +#ifndef XCHAL_HAVE_FP_POSTINC +#define XCHAL_HAVE_FP_POSTINC 0 +#endif + +#ifndef XCHAL_HAVE_DFP +#define XCHAL_HAVE_DFP 0 +#endif + +#ifndef XCHAL_HAVE_DFP_DIV +#define XCHAL_HAVE_DFP_DIV 0 +#endif + +#ifndef XCHAL_HAVE_DFP_RECIP +#define XCHAL_HAVE_DFP_RECIP 0 +#endif + +#ifndef XCHAL_HAVE_DFP_SQRT +#define XCHAL_HAVE_DFP_SQRT 0 +#endif + +#ifndef XCHAL_HAVE_DFP_RSQRT +#define XCHAL_HAVE_DFP_RSQRT 0 +#endif + +#ifndef XSHAL_HAVE_TEXT_SECTION_LITERALS +#define XSHAL_HAVE_TEXT_SECTION_LITERALS 0 +#endif + +#ifndef XCHAL_MMU_MIN_PTE_PAGE_SIZE +#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 1 +#endif + +#define XTENSA_CONFIG_ENTRY(a) a + +#define XTENSA_CONFIG_ENTRY_LIST \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_BE), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DENSITY), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_CONST16), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_ABS), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_ADDX), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_L32R), \ + XTENSA_CONFIG_ENTRY(XSHAL_USE_ABSOLUTE_LITERALS), \ + XTENSA_CONFIG_ENTRY(XSHAL_HAVE_TEXT_SECTION_LITERALS), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_MAC16), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_MUL16), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_MUL32), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_MUL32_HIGH), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DIV32), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_NSA), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_MINMAX), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_SEXT), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_LOOPS), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_THREADPTR), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_RELEASE_SYNC), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_S32C1I), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_BOOLEANS), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_FP), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_FP_DIV), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_FP_RECIP), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_FP_SQRT), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_FP_RSQRT), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_FP_POSTINC), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DFP), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DFP_DIV), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DFP_RECIP), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DFP_SQRT), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DFP_RSQRT), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_WINDOWED), \ + XTENSA_CONFIG_ENTRY(XCHAL_NUM_AREGS), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_WIDE_BRANCHES), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_PREDICTED_BRANCHES), \ + XTENSA_CONFIG_ENTRY(XCHAL_ICACHE_SIZE), \ + XTENSA_CONFIG_ENTRY(XCHAL_DCACHE_SIZE), \ + XTENSA_CONFIG_ENTRY(XCHAL_ICACHE_LINESIZE), \ + XTENSA_CONFIG_ENTRY(XCHAL_DCACHE_LINESIZE), \ + XTENSA_CONFIG_ENTRY(XCHAL_ICACHE_LINEWIDTH), \ + XTENSA_CONFIG_ENTRY(XCHAL_DCACHE_LINEWIDTH), \ + XTENSA_CONFIG_ENTRY(XCHAL_DCACHE_IS_WRITEBACK), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_MMU), \ + XTENSA_CONFIG_ENTRY(XCHAL_MMU_MIN_PTE_PAGE_SIZE), \ + XTENSA_CONFIG_ENTRY(XCHAL_HAVE_DEBUG), \ + XTENSA_CONFIG_ENTRY(XCHAL_NUM_IBREAK), \ + XTENSA_CONFIG_ENTRY(XCHAL_NUM_DBREAK), \ + XTENSA_CONFIG_ENTRY(XCHAL_DEBUGLEVEL), \ + XTENSA_CONFIG_ENTRY(XCHAL_MAX_INSTRUCTION_SIZE), \ + XTENSA_CONFIG_ENTRY(XCHAL_INST_FETCH_WIDTH), \ + XTENSA_CONFIG_ENTRY(XSHAL_ABI), \ + XTENSA_CONFIG_ENTRY(XTHAL_ABI_WINDOWED), \ + XTENSA_CONFIG_ENTRY(XTHAL_ABI_CALL0) + +#define XTENSA_CONFIG_INITIALIZER { \ + sizeof (struct xtensa_config), \ + XTENSA_CONFIG_ENTRY_LIST, \ +} + +#else /* XTENSA_CONFIG_DEFINITION */ + +#undef XCHAL_HAVE_BE +#define XCHAL_HAVE_BE (xtensa_get_config ()->xchal_have_be) + +#undef XCHAL_HAVE_DENSITY +#define XCHAL_HAVE_DENSITY (xtensa_get_config ()->xchal_have_density) + +#undef XCHAL_HAVE_CONST16 +#define XCHAL_HAVE_CONST16 (xtensa_get_config ()->xchal_have_const16) + +#undef XCHAL_HAVE_ABS +#define XCHAL_HAVE_ABS (xtensa_get_config ()->xchal_have_abs) + +#undef XCHAL_HAVE_ADDX +#define XCHAL_HAVE_ADDX (xtensa_get_config ()->xchal_have_addx) + +#undef XCHAL_HAVE_L32R +#define XCHAL_HAVE_L32R (xtensa_get_config ()->xchal_have_l32r) + +#undef XSHAL_USE_ABSOLUTE_LITERALS +#define XSHAL_USE_ABSOLUTE_LITERALS (xtensa_get_config ()->xshal_use_absolute_literals) + +#undef XSHAL_HAVE_TEXT_SECTION_LITERALS +#define XSHAL_HAVE_TEXT_SECTION_LITERALS (xtensa_get_config ()->xshal_have_text_section_literals) + +#undef XCHAL_HAVE_MAC16 +#define XCHAL_HAVE_MAC16 (xtensa_get_config ()->xchal_have_mac16) + +#undef XCHAL_HAVE_MUL16 +#define XCHAL_HAVE_MUL16 (xtensa_get_config ()->xchal_have_mul16) + +#undef XCHAL_HAVE_MUL32 +#define XCHAL_HAVE_MUL32 (xtensa_get_config ()->xchal_have_mul32) + +#undef XCHAL_HAVE_MUL32_HIGH +#define XCHAL_HAVE_MUL32_HIGH (xtensa_get_config ()->xchal_have_mul32_high) + +#undef XCHAL_HAVE_DIV32 +#define XCHAL_HAVE_DIV32 (xtensa_get_config ()->xchal_have_div32) + +#undef XCHAL_HAVE_NSA +#define XCHAL_HAVE_NSA (xtensa_get_config ()->xchal_have_nsa) + +#undef XCHAL_HAVE_MINMAX +#define XCHAL_HAVE_MINMAX (xtensa_get_config ()->xchal_have_minmax) + +#undef XCHAL_HAVE_SEXT +#define XCHAL_HAVE_SEXT (xtensa_get_config ()->xchal_have_sext) + +#undef XCHAL_HAVE_LOOPS +#define XCHAL_HAVE_LOOPS (xtensa_get_config ()->xchal_have_loops) + +#undef XCHAL_HAVE_THREADPTR +#define XCHAL_HAVE_THREADPTR (xtensa_get_config ()->xchal_have_threadptr) + +#undef XCHAL_HAVE_RELEASE_SYNC +#define XCHAL_HAVE_RELEASE_SYNC (xtensa_get_config ()->xchal_have_release_sync) + +#undef XCHAL_HAVE_S32C1I +#define XCHAL_HAVE_S32C1I (xtensa_get_config ()->xchal_have_s32c1i) + +#undef XCHAL_HAVE_BOOLEANS +#define XCHAL_HAVE_BOOLEANS (xtensa_get_config ()->xchal_have_booleans) + +#undef XCHAL_HAVE_FP +#define XCHAL_HAVE_FP (xtensa_get_config ()->xchal_have_fp) + +#undef XCHAL_HAVE_FP_DIV +#define XCHAL_HAVE_FP_DIV (xtensa_get_config ()->xchal_have_fp_div) + +#undef XCHAL_HAVE_FP_RECIP +#define XCHAL_HAVE_FP_RECIP (xtensa_get_config ()->xchal_have_fp_recip) + +#undef XCHAL_HAVE_FP_SQRT +#define XCHAL_HAVE_FP_SQRT (xtensa_get_config ()->xchal_have_fp_sqrt) + +#undef XCHAL_HAVE_FP_RSQRT +#define XCHAL_HAVE_FP_RSQRT (xtensa_get_config ()->xchal_have_fp_rsqrt) + +#undef XCHAL_HAVE_FP_POSTINC +#define XCHAL_HAVE_FP_POSTINC (xtensa_get_config ()->xchal_have_fp_postinc) + +#undef XCHAL_HAVE_DFP +#define XCHAL_HAVE_DFP (xtensa_get_config ()->xchal_have_dfp) + +#undef XCHAL_HAVE_DFP_DIV +#define XCHAL_HAVE_DFP_DIV (xtensa_get_config ()->xchal_have_dfp_div) + +#undef XCHAL_HAVE_DFP_RECIP +#define XCHAL_HAVE_DFP_RECIP (xtensa_get_config ()->xchal_have_dfp_recip) + +#undef XCHAL_HAVE_DFP_SQRT +#define XCHAL_HAVE_DFP_SQRT (xtensa_get_config ()->xchal_have_dfp_sqrt) + +#undef XCHAL_HAVE_DFP_RSQRT +#define XCHAL_HAVE_DFP_RSQRT (xtensa_get_config ()->xchal_have_dfp_rsqrt) + +#undef XCHAL_HAVE_WINDOWED +#define XCHAL_HAVE_WINDOWED (xtensa_get_config ()->xchal_have_windowed) + +#undef XCHAL_NUM_AREGS +#define XCHAL_NUM_AREGS (xtensa_get_config ()->xchal_num_aregs) + +#undef XCHAL_HAVE_WIDE_BRANCHES +#define XCHAL_HAVE_WIDE_BRANCHES (xtensa_get_config ()->xchal_have_wide_branches) + +#undef XCHAL_HAVE_PREDICTED_BRANCHES +#define XCHAL_HAVE_PREDICTED_BRANCHES (xtensa_get_config ()->xchal_have_predicted_branches) + + +#undef XCHAL_ICACHE_SIZE +#define XCHAL_ICACHE_SIZE (xtensa_get_config ()->xchal_icache_size) + +#undef XCHAL_DCACHE_SIZE +#define XCHAL_DCACHE_SIZE (xtensa_get_config ()->xchal_dcache_size) + +#undef XCHAL_ICACHE_LINESIZE +#define XCHAL_ICACHE_LINESIZE (xtensa_get_config ()->xchal_icache_linesize) + +#undef XCHAL_DCACHE_LINESIZE +#define XCHAL_DCACHE_LINESIZE (xtensa_get_config ()->xchal_dcache_linesize) + +#undef XCHAL_ICACHE_LINEWIDTH +#define XCHAL_ICACHE_LINEWIDTH (xtensa_get_config ()->xchal_icache_linewidth) + +#undef XCHAL_DCACHE_LINEWIDTH +#define XCHAL_DCACHE_LINEWIDTH (xtensa_get_config ()->xchal_dcache_linewidth) + +#undef XCHAL_DCACHE_IS_WRITEBACK +#define XCHAL_DCACHE_IS_WRITEBACK (xtensa_get_config ()->xchal_dcache_is_writeback) + + +#undef XCHAL_HAVE_MMU +#define XCHAL_HAVE_MMU (xtensa_get_config ()->xchal_have_mmu) + +#undef XCHAL_MMU_MIN_PTE_PAGE_SIZE +#define XCHAL_MMU_MIN_PTE_PAGE_SIZE (xtensa_get_config ()->xchal_mmu_min_pte_page_size) + + +#undef XCHAL_HAVE_DEBUG +#define XCHAL_HAVE_DEBUG (xtensa_get_config ()->xchal_have_debug) + +#undef XCHAL_NUM_IBREAK +#define XCHAL_NUM_IBREAK (xtensa_get_config ()->xchal_num_ibreak) + +#undef XCHAL_NUM_DBREAK +#define XCHAL_NUM_DBREAK (xtensa_get_config ()->xchal_num_dbreak) + +#undef XCHAL_DEBUGLEVEL +#define XCHAL_DEBUGLEVEL (xtensa_get_config ()->xchal_debuglevel) + + +#undef XCHAL_MAX_INSTRUCTION_SIZE +#define XCHAL_MAX_INSTRUCTION_SIZE (xtensa_get_config ()->xchal_max_instruction_size) + +#undef XCHAL_INST_FETCH_WIDTH +#define XCHAL_INST_FETCH_WIDTH (xtensa_get_config ()->xchal_inst_fetch_width) + + +#undef XSHAL_ABI +#undef XTHAL_ABI_WINDOWED +#undef XTHAL_ABI_CALL0 +#define XSHAL_ABI (xtensa_get_config ()->xshal_abi) +#define XTHAL_ABI_WINDOWED (xtensa_get_config ()->xthal_abi_windowed) +#define XTHAL_ABI_CALL0 (xtensa_get_config ()->xthal_abi_call0) + +#endif /* XTENSA_CONFIG_DEFINITION */ + +#ifdef __cplusplus +} +#endif +#endif /* !XTENSA_DYNAMIC_CONFIG_H */