From patchwork Tue Dec 27 15:44:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 36948 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1452495wrt; Tue, 27 Dec 2022 07:47:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXtld0BcIVczzK2XEoop32EGQ5FdgMHbUNrlvLh/cdocYp76DCsyvOlHwPJaVrmtL/ZXfxcr X-Received: by 2002:a17:906:9f07:b0:7ec:27d7:1838 with SMTP id fy7-20020a1709069f0700b007ec27d71838mr24343515ejc.22.1672156034010; Tue, 27 Dec 2022 07:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672156033; cv=none; d=google.com; s=arc-20160816; b=aObU6VERWaq9aAdXBaBXi+zcjSukGT3Xgj3W2nFT4NX2Cbcm6m09pGd6xO0+gYqlPI ZkwTD61kmmoRe1qN6/9mMe43NUbuelNkECUXZBh4/7GXHvIGgAFkXLt46N+1NjO2Oig3 58psJ0lORGZHIy6vYDGugCQyHpgpQmiPpNs3h9QbvGtT4v+LpdqvIe5s6cgJkfkJnbCX c5OcpS+RB2D/s5thghqSJ0zHW7Utp4T/ou6IQXmPf60qWUoyz5ZUHKAVda+2hgEfyQra cHRadkoEATdo/Gj/Ib7ZsUxadhR7cy5S3zr3qDCdxGOSwEiJ6LVR1J2B6Fem6lOtn4pi ccmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=3NyX1cYC08P5S957hCb8JyqhsMVaZjur+5g0RIbJuGk=; b=Ar4tW63GVpyM2/APhIQQufpfz9OuKIW7CF2s3ioPK1fQBqQNBYVbXVWqi5hXTyJmXJ VKafrOW432Dsj+WWAtIlIS1ky1r4A5WgM3ecT3Qj6yTrwXMdQnlbzDz87kkkscEAieSO Y88uCUIN9z+7QdF+0SqCZk1yvUmJtnhzB0r6Jr1Ag5wrZWgc0wp4jSI6icDrnRdVOWQ8 33IF8n3Qeu6RUFpV961iWujBbik72DJOnV+LVApzxDYSYO9suVnnBPhOJCw1nIx5a8cZ EHeDrsWMBMY9oJzM0aahnUJdTnjp0pEn7ZWj9r0coE2nDHistPLTMTjw5KbLk//6gW/e zCqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aE9/bIvc"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cw16-20020a170906479000b006feb76dbd51si12107132ejc.289.2022.12.27.07.47.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:47:13 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aE9/bIvc"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C29C9385B507 for ; Tue, 27 Dec 2022 15:46:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C29C9385B507 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672155992; bh=3NyX1cYC08P5S957hCb8JyqhsMVaZjur+5g0RIbJuGk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=aE9/bIvcZS7PSeRTluyX0hqYtbyNSRIgp7+xVNozmWnLsNRNk6DBHL5Gs7hVDh3Pi At5/ab2NBRcZHAtifOZBoIzSuUWfa2BpJG7NJadbtLi+g8de29ActC4dwNp/h6mqc+ C00Z9Efcn4/Jiu9UiFbcLKtOuP67Gd/WAOp+BZ4c= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 3FD973858C36 for ; Tue, 27 Dec 2022 15:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3FD973858C36 Received: by mail-pj1-x1033.google.com with SMTP id u4-20020a17090a518400b00223f7eba2c4so13522637pjh.5 for ; Tue, 27 Dec 2022 07:44:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3NyX1cYC08P5S957hCb8JyqhsMVaZjur+5g0RIbJuGk=; b=MVahtNSt35UE7ofIsuh97LLyUWtaGlNHDxnbEfmW5LTqP39PxjJ9KvVr9nHS5AxPhn oVYMMOZL4rJ5JSQJUtc8XXSjw4XHpRXS+e87rM7ZCK5AlUcipXZWQoosI46exasvGlii b6/v/SvARvm04h2oENv+hEg409NqUbLy1MDTvN/W0mawD156+LY7W7B/WAsMLDXEq/UK UMivDthfMWkVSE/R5CbwS94IbMejuEBJzSZyTvsuNSmcXykYNnYQuaEtXAkIyQjvOuxn r6AoHhpKAbgP5YTkPix6RQ9I6n3zRXQU1+MOYsXkLUjzJhj6Kp8/E55YgG/eiWfimFbA o/oQ== X-Gm-Message-State: AFqh2kogjL46OiYda16KAfwvSWtEaFnEskVuPolfVaqIFirAHI+RcX11 YYOGZ2qjmdYsmw6RWaGAN/HHG8KDyBg= X-Received: by 2002:a05:6a20:1586:b0:9d:efc0:67 with SMTP id h6-20020a056a20158600b0009defc00067mr34562662pzj.15.1672155852289; Tue, 27 Dec 2022 07:44:12 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:48c3:ad37:b390:9bd1]) by smtp.gmail.com with ESMTPSA id 5-20020a630705000000b0047911890728sm7444711pgh.79.2022.12.27.07.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:44:11 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Takayuki 'January June' Suwa Subject: [COMMITTED 1/4] xtensa: Tabify, and trim trailing spaces Date: Tue, 27 Dec 2022 07:44:01 -0800 Message-Id: <20221227154404.111654-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Max Filippov via Gcc-patches From: Max Filippov Reply-To: Max Filippov Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753382685502778057?= X-GMAIL-MSGID: =?utf-8?q?1753382685502778057?= From: Takayuki 'January June' Suwa Cosmetic and no functional changes. gcc/ChangeLog: * config/xtensa/elf.h: Tabify, and trim trailing spaces. * config/xtensa/linux.h: Likewise. * config/xtensa/uclinux.h: Likewise. * config/xtensa/xtensa-dynconfig.c: Likewise. * config/xtensa/xtensa.cc: Likewise. * config/xtensa/xtensa.h: Likewise. * config/xtensa/xtensa.md: Likewise. --- gcc/config/xtensa/elf.h | 32 +++++---- gcc/config/xtensa/linux.h | 1 - gcc/config/xtensa/uclinux.h | 1 - gcc/config/xtensa/xtensa-dynconfig.c | 6 +- gcc/config/xtensa/xtensa.cc | 85 ++++++++++++------------ gcc/config/xtensa/xtensa.h | 6 +- gcc/config/xtensa/xtensa.md | 98 ++++++++++++++-------------- 7 files changed, 113 insertions(+), 116 deletions(-) diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index fbdccc49c9b5..1edc1761d74d 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -59,7 +59,7 @@ along with GCC; see the file COPYING3. If not see "crt1-sim%O%s crt0%O%s crti%O%s crtbegin%O%s _vectors%O%s" #undef ENDFILE_SPEC -#define ENDFILE_SPEC "crtend%O%s crtn%O%s" +#define ENDFILE_SPEC "crtend%O%s crtn%O%s" #undef LINK_SPEC #define LINK_SPEC \ @@ -86,19 +86,17 @@ along with GCC; see the file COPYING3. If not see /* Search for headers in $tooldir/arch/include and for libraries and startfiles in $tooldir/arch/lib. */ #define GCC_DRIVER_HOST_INITIALIZATION \ -do \ -{ \ - char *tooldir, *archdir; \ - tooldir = concat (tooldir_base_prefix, spec_machine, \ - dir_separator_str, NULL); \ - if (!IS_ABSOLUTE_PATH (tooldir)) \ - tooldir = concat (standard_exec_prefix, spec_machine, dir_separator_str, \ - spec_version, dir_separator_str, tooldir, NULL); \ - archdir = concat (tooldir, "arch", dir_separator_str, NULL); \ - add_prefix (&startfile_prefixes, \ - concat (archdir, "lib", dir_separator_str, NULL), \ - "GCC", PREFIX_PRIORITY_LAST, 0, 1); \ - add_prefix (&include_prefixes, archdir, \ - "GCC", PREFIX_PRIORITY_LAST, 0, 0); \ - } \ -while (0) + do { \ + char *tooldir, *archdir; \ + tooldir = concat (tooldir_base_prefix, spec_machine, \ + dir_separator_str, NULL); \ + if (!IS_ABSOLUTE_PATH (tooldir)) \ + tooldir = concat (standard_exec_prefix, spec_machine, dir_separator_str, \ + spec_version, dir_separator_str, tooldir, NULL); \ + archdir = concat (tooldir, "arch", dir_separator_str, NULL); \ + add_prefix (&startfile_prefixes, \ + concat (archdir, "lib", dir_separator_str, NULL), \ + "GCC", PREFIX_PRIORITY_LAST, 0, 1); \ + add_prefix (&include_prefixes, archdir, \ + "GCC", PREFIX_PRIORITY_LAST, 0, 0); \ + } while (0) diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h index bc7bee71517d..198edfe05531 100644 --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -69,4 +69,3 @@ along with GCC; see the file COPYING3. If not see #define XTENSA_ALWAYS_PIC 1 #undef DEBUGGER_REGNO - diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h index 5fcf639ccff4..5787b2f1ab95 100644 --- a/gcc/config/xtensa/uclinux.h +++ b/gcc/config/xtensa/uclinux.h @@ -71,4 +71,3 @@ along with GCC; see the file COPYING3. If not see #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function #undef DEBUGGER_REGNO - diff --git a/gcc/config/xtensa/xtensa-dynconfig.c b/gcc/config/xtensa/xtensa-dynconfig.c index 056204ae9463..0a611fd14b03 100644 --- a/gcc/config/xtensa/xtensa-dynconfig.c +++ b/gcc/config/xtensa/xtensa-dynconfig.c @@ -35,7 +35,7 @@ #if !defined (HAVE_DLFCN_H) && defined (_WIN32) -#define RTLD_LAZY 0 /* Dummy value. */ +#define RTLD_LAZY 0 /* Dummy value. */ static void * dlopen (const char *file, int mode ATTRIBUTE_UNUSED) @@ -142,8 +142,8 @@ XTENSA_CONFIG_INSTANCE_LIST; #define XTENSA_CONFIG_ENTRY(a) "__" #a "=" STRINGIFY(a) static const char * const xtensa_config_strings[] = { - XTENSA_CONFIG_ENTRY_LIST, - NULL, + XTENSA_CONFIG_ENTRY_LIST, + NULL, }; const struct xtensa_config_v1 *xtensa_get_config_v1 (void) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index 94a98c25f8c9..178d16a78462 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -176,7 +176,7 @@ static bool constantpool_address_p (const_rtx addr); static bool xtensa_legitimate_constant_p (machine_mode, rtx); static void xtensa_reorg (void); static bool xtensa_can_use_doloop_p (const widest_int &, const widest_int &, - unsigned int, bool); + unsigned int, bool); static const char *xtensa_invalid_within_doloop (const rtx_insn *); static bool xtensa_member_type_forces_blk (const_tree, @@ -2115,7 +2115,7 @@ xtensa_emit_loop_end (rtx_insn *insn, rtx *operands) done = 1; } break; - } + } } output_asm_insn ("%1_LEND:", operands); @@ -2314,7 +2314,7 @@ xtensa_tls_module_base (void) xtensa_tls_module_base_symbol = gen_rtx_SYMBOL_REF (Pmode, "_TLS_MODULE_BASE_"); SYMBOL_REF_FLAGS (xtensa_tls_module_base_symbol) - |= TLS_MODEL_GLOBAL_DYNAMIC << SYMBOL_FLAG_TLS_SHIFT; + |= TLS_MODEL_GLOBAL_DYNAMIC << SYMBOL_FLAG_TLS_SHIFT; } return xtensa_tls_module_base_symbol; @@ -3409,7 +3409,7 @@ xtensa_expand_prologue (void) } } else - { + { insn = emit_insn (gen_movsi (hard_frame_pointer_rtx, stack_pointer_rtx)); if (!TARGET_WINDOWED_ABI) @@ -3532,11 +3532,12 @@ xtensa_set_return_address (rtx address, rtx scratch) gen_rtx_REG (SImode, A0_REG)); rtx insn; - if (total_size > 1024) { - emit_move_insn (scratch, GEN_INT (total_size - UNITS_PER_WORD)); - emit_insn (gen_addsi3 (scratch, frame, scratch)); - a0_addr = scratch; - } + if (total_size > 1024) + { + emit_move_insn (scratch, GEN_INT (total_size - UNITS_PER_WORD)); + emit_insn (gen_addsi3 (scratch, frame, scratch)); + a0_addr = scratch; + } insn = emit_move_insn (gen_frame_mem (SImode, a0_addr), address); RTX_FRAME_RELATED_P (insn) = 1; @@ -3818,8 +3819,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, /* Check if the argument is in registers: if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4 - && !must_pass_in_stack (type)) - __array = (AP).__va_reg; */ + && !must_pass_in_stack (type)) + __array = (AP).__va_reg; */ array = create_tmp_var (ptr_type_node); @@ -4515,8 +4516,8 @@ xtensa_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) /* Worker function for TARGET_FUNCTION_VALUE. */ rtx -xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, - bool outgoing) +xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, + bool outgoing) { return gen_rtx_REG ((INTEGRAL_TYPE_P (valtype) && TYPE_PRECISION (valtype) < BITS_PER_WORD) @@ -4719,7 +4720,7 @@ xtensa_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x) static bool xtensa_can_use_doloop_p (const widest_int &, const widest_int &, - unsigned int loop_depth, bool entered_at_top) + unsigned int loop_depth, bool entered_at_top) { /* Considering limitations in the hardware, only use doloop for innermost loops which must be entered from the top. */ @@ -4758,32 +4759,32 @@ hwloop_optimize (hwloop_info loop) if (loop->depth > 1) { if (dump_file) - fprintf (dump_file, ";; loop %d is not innermost\n", - loop->loop_no); + fprintf (dump_file, ";; loop %d is not innermost\n", + loop->loop_no); return false; } if (!loop->incoming_dest) { if (dump_file) - fprintf (dump_file, ";; loop %d has more than one entry\n", - loop->loop_no); + fprintf (dump_file, ";; loop %d has more than one entry\n", + loop->loop_no); return false; } if (loop->incoming_dest != loop->head) { if (dump_file) - fprintf (dump_file, ";; loop %d is not entered from head\n", - loop->loop_no); + fprintf (dump_file, ";; loop %d is not entered from head\n", + loop->loop_no); return false; } if (loop->has_call || loop->has_asm) { if (dump_file) - fprintf (dump_file, ";; loop %d has invalid insn\n", - loop->loop_no); + fprintf (dump_file, ";; loop %d has invalid insn\n", + loop->loop_no); return false; } @@ -4791,8 +4792,8 @@ hwloop_optimize (hwloop_info loop) if (loop->iter_reg_used || loop->iter_reg_used_outside) { if (dump_file) - fprintf (dump_file, ";; loop %d uses iterator\n", - loop->loop_no); + fprintf (dump_file, ";; loop %d uses iterator\n", + loop->loop_no); return false; } @@ -4804,8 +4805,8 @@ hwloop_optimize (hwloop_info loop) if (!insn) { if (dump_file) - fprintf (dump_file, ";; loop %d start_label not before loop_end\n", - loop->loop_no); + fprintf (dump_file, ";; loop %d start_label not before loop_end\n", + loop->loop_no); return false; } @@ -4829,8 +4830,8 @@ hwloop_optimize (hwloop_info loop) start_sequence (); insn = emit_insn (gen_zero_cost_loop_start (loop->iter_reg, - loop->start_label, - loop->iter_reg)); + loop->start_label, + loop->iter_reg)); seq = get_insns (); @@ -4846,21 +4847,21 @@ hwloop_optimize (hwloop_info loop) seq = emit_label_before (gen_label_rtx (), seq); new_bb = create_basic_block (seq, insn, entry_bb); FOR_EACH_EDGE (e, ei, loop->incoming) - { - if (!(e->flags & EDGE_FALLTHRU)) - redirect_edge_and_branch_force (e, new_bb); - else - redirect_edge_succ (e, new_bb); - } + { + if (!(e->flags & EDGE_FALLTHRU)) + redirect_edge_and_branch_force (e, new_bb); + else + redirect_edge_succ (e, new_bb); + } make_edge (new_bb, loop->head, 0); } else { while (DEBUG_INSN_P (entry_after) - || (NOTE_P (entry_after) + || (NOTE_P (entry_after) && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK)) - entry_after = PREV_INSN (entry_after); + entry_after = PREV_INSN (entry_after); emit_insn_after (seq, entry_after); } @@ -4881,15 +4882,15 @@ hwloop_fail (hwloop_info loop) rtx_insn *insn = loop->loop_end; emit_insn_before (gen_addsi3 (loop->iter_reg, - loop->iter_reg, - constm1_rtx), - loop->loop_end); + loop->iter_reg, + constm1_rtx), + loop->loop_end); test = gen_rtx_NE (VOIDmode, loop->iter_reg, const0_rtx); insn = emit_jump_insn_before (gen_cbranchsi4 (test, - loop->iter_reg, const0_rtx, - loop->start_label), - loop->loop_end); + loop->iter_reg, const0_rtx, + loop->start_label), + loop->loop_end); JUMP_LABEL (insn) = loop->start_label; LABEL_NUSES (loop->start_label)++; diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 7e193068431c..60d3fdfbc706 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see #define TARGET_S32C1I XCHAL_HAVE_S32C1I #define TARGET_ABSOLUTE_LITERALS XSHAL_USE_ABSOLUTE_LITERALS #define TARGET_THREADPTR XCHAL_HAVE_THREADPTR -#define TARGET_LOOPS XCHAL_HAVE_LOOPS +#define TARGET_LOOPS XCHAL_HAVE_LOOPS #define TARGET_WINDOWED_ABI_DEFAULT (XSHAL_ABI == XTHAL_ABI_WINDOWED) #define TARGET_WINDOWED_ABI xtensa_windowed_abi #define TARGET_DEBUG XCHAL_HAVE_DEBUG @@ -286,7 +286,7 @@ extern int leaf_function; /* Coprocessor registers */ #define BR_REG_FIRST 18 -#define BR_REG_LAST 18 +#define BR_REG_LAST 18 #define BR_REG_NUM (BR_REG_LAST - BR_REG_FIRST + 1) /* 16 floating-point registers */ @@ -742,7 +742,7 @@ typedef struct xtensa_args /* Define output to appear before the constant pool. */ -#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE) \ +#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE) \ do { \ if ((SIZE) > 0 || !TARGET_WINDOWED_ABI) \ { \ diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index de9bcbf24f7e..a77d3285bad1 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -70,13 +70,13 @@ ;; This code iterator is for floating-point comparisons. (define_code_iterator any_scc_sf [eq lt le uneq unlt unle unordered]) -(define_code_attr scc_sf [(eq "oeq") (lt "olt") (le "ole") +(define_code_attr scc_sf [(eq "oeq") (lt "olt") (le "ole") (uneq "ueq") (unlt "ult") (unle "ule") (unordered "un")]) ;; This iterator and attribute allow to combine most atomic operations. (define_code_iterator ATOMIC [and ior xor plus minus mult]) -(define_code_attr atomic [(and "and") (ior "ior") (xor "xor") +(define_code_attr atomic [(and "and") (ior "ior") (xor "xor") (plus "add") (minus "sub") (mult "nand")]) ;; This mode iterator allows the HI and QI patterns to be defined from @@ -195,7 +195,7 @@ (define_insn "subsi3" [(set (match_operand:SI 0 "register_operand" "=a") - (minus:SI (match_operand:SI 1 "register_operand" "r") + (minus:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "register_operand" "r")))] "" "sub\t%0, %1, %2" @@ -434,7 +434,7 @@ (define_insn "si3" [(set (match_operand:SI 0 "register_operand" "=a") - (any_minmax:SI (match_operand:SI 1 "register_operand" "%r") + (any_minmax:SI (match_operand:SI 1 "register_operand" "%r") (match_operand:SI 2 "register_operand" "r")))] "TARGET_MINMAX" "\t%0, %1, %2" @@ -507,7 +507,7 @@ (define_expand "bswapsi2" [(set (match_operand:SI 0 "register_operand" "") - (bswap:SI (match_operand:SI 1 "register_operand" "")))] + (bswap:SI (match_operand:SI 1 "register_operand" "")))] "!optimize_debug && optimize > 1" { /* GIMPLE manual byte-swapping recognition is now activated. @@ -1022,7 +1022,7 @@ %v0s32i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr") (set_attr "mode" "SI") (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")]) @@ -1170,7 +1170,7 @@ "((register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode)) && !(FP_REG_P (xt_true_regnum (operands[0])) - && (constantpool_mem_p (operands[1]) || CONSTANT_P (operands[1]))))" + && (constantpool_mem_p (operands[1]) || CONSTANT_P (operands[1]))))" "@ mov.s\t%0, %1 %v1lsi\t%0, %1 @@ -1355,7 +1355,7 @@ [(set (match_operand:SI 0 "register_operand" "=a,a") (ashift:SI (match_operand:SI 1 "register_operand" "r,r") (match_operand:SI 2 "arith_operand" "J,r")))] - "" + "" "@ slli\t%0, %1, %R2 ssl\t%2\;sll\t%0, %1" @@ -1941,13 +1941,13 @@ (define_insn "zero_cost_loop_start" [(set (pc) - (if_then_else (ne (match_operand:SI 2 "register_operand" "0") - (const_int 1)) - (label_ref (match_operand 1 "" "")) - (pc))) + (if_then_else (ne (match_operand:SI 2 "register_operand" "0") + (const_int 1)) + (label_ref (match_operand 1 "" "")) + (pc))) (set (match_operand:SI 0 "register_operand" "=a") - (plus (match_dup 0) - (const_int -1))) + (plus (match_dup 0) + (const_int -1))) (unspec [(const_int 0)] UNSPEC_LSETUP_START)] "TARGET_LOOPS && optimize" "loop\t%0, %l1_LEND" @@ -1957,13 +1957,13 @@ (define_insn "zero_cost_loop_end" [(set (pc) - (if_then_else (ne (match_operand:SI 2 "nonimmediate_operand" "0,0") - (const_int 1)) - (label_ref (match_operand 1 "" "")) - (pc))) + (if_then_else (ne (match_operand:SI 2 "nonimmediate_operand" "0,0") + (const_int 1)) + (label_ref (match_operand 1 "" "")) + (pc))) (set (match_operand:SI 0 "nonimmediate_operand" "=a,m") - (plus (match_dup 0) - (const_int -1))) + (plus (match_dup 0) + (const_int -1))) (unspec [(const_int 0)] UNSPEC_LSETUP_END) (clobber (match_scratch:SI 3 "=X,&r"))] "TARGET_LOOPS && optimize" @@ -1974,13 +1974,13 @@ (define_insn "loop_end" [(set (pc) - (if_then_else (ne (match_operand:SI 2 "register_operand" "0") - (const_int 1)) - (label_ref (match_operand 1 "" "")) - (pc))) + (if_then_else (ne (match_operand:SI 2 "register_operand" "0") + (const_int 1)) + (label_ref (match_operand 1 "" "")) + (pc))) (set (match_operand:SI 0 "register_operand" "=a") - (plus (match_dup 0) - (const_int -1))) + (plus (match_dup 0) + (const_int -1))) (unspec [(const_int 0)] UNSPEC_LSETUP_END)] "TARGET_LOOPS && optimize" { @@ -1993,13 +1993,13 @@ (define_split [(set (pc) - (if_then_else (ne (match_operand:SI 0 "nonimmediate_operand" "") - (const_int 1)) - (label_ref (match_operand 1 "" "")) - (pc))) + (if_then_else (ne (match_operand:SI 0 "nonimmediate_operand" "") + (const_int 1)) + (label_ref (match_operand 1 "" "")) + (pc))) (set (match_operand:SI 2 "nonimmediate_operand" "") - (plus:SI (match_dup 0) - (const_int -1))) + (plus:SI (match_dup 0) + (const_int -1))) (unspec [(const_int 0)] UNSPEC_LSETUP_END) (clobber (match_scratch 3))] "TARGET_LOOPS && optimize && reload_completed" @@ -2015,7 +2015,7 @@ emit_move_insn (operands[0], operands[3]); test = gen_rtx_NE (VOIDmode, operands[3], const0_rtx); emit_jump_insn (gen_cbranchsi4 (test, operands[3], - const0_rtx, operands[1])); + const0_rtx, operands[1])); } else { @@ -2029,15 +2029,15 @@ ; operand 1 is the label to jump to at the top of the loop (define_expand "doloop_end" [(parallel [(set (pc) (if_then_else - (ne (match_operand:SI 0 "" "") - (const_int 1)) - (label_ref (match_operand 1 "" "")) - (pc))) - (set (match_dup 0) - (plus:SI (match_dup 0) - (const_int -1))) - (unspec [(const_int 0)] UNSPEC_LSETUP_END) - (clobber (match_dup 2))])] ; match_scratch + (ne (match_operand:SI 0 "" "") + (const_int 1)) + (label_ref (match_operand 1 "" "")) + (pc))) + (set (match_dup 0) + (plus:SI (match_dup 0) + (const_int -1))) + (unspec [(const_int 0)] UNSPEC_LSETUP_END) + (clobber (match_dup 2))])] ; match_scratch "TARGET_LOOPS && optimize" { /* The loop optimizer doesn't check the predicates... */ @@ -2276,8 +2276,8 @@ (define_insn "call_value_internal" [(set (match_operand 0 "register_operand" "=a") - (call (mem (match_operand:SI 1 "call_insn_operand" "nir")) - (match_operand 2 "" "i")))] + (call (mem (match_operand:SI 1 "call_insn_operand" "nir")) + (match_operand 2 "" "i")))] "!SIBLING_CALL_P (insn)" { return xtensa_emit_call (1, operands); @@ -2382,9 +2382,9 @@ (define_expand "allocate_stack" [(set (match_operand 0 "nonimmed_operand") - (minus (reg A1_REG) (match_operand 1 "add_operand"))) + (minus (reg A1_REG) (match_operand 1 "add_operand"))) (set (reg A1_REG) - (minus (reg A1_REG) (match_dup 1)))] + (minus (reg A1_REG) (match_dup 1)))] "TARGET_WINDOWED_ABI" { if (CONST_INT_P (operands[1])) @@ -2509,7 +2509,7 @@ (define_expand "frame_blockage" [(set (match_dup 0) - (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))] + (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))] "" { operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); @@ -2519,7 +2519,7 @@ (define_insn "*frame_blockage" [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_operand:SI 1 "" "")] UNSPEC_FRAME_BLOCKAGE))] + (unspec:BLK [(match_operand:SI 1 "" "")] UNSPEC_FRAME_BLOCKAGE))] "" "" [(set_attr "type" "nop") @@ -2796,7 +2796,7 @@ (define_expand "sync_new_" [(set (match_operand:HQI 0 "register_operand") (ATOMIC:HQI (match_operand:HQI 1 "memory_operand") - (match_operand:HQI 2 "register_operand"))) + (match_operand:HQI 2 "register_operand"))) (set (match_dup 1) (ATOMIC:HQI (match_dup 1) (match_dup 2)))] "TARGET_S32C1I" { From patchwork Tue Dec 27 15:44:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 36946 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1452120wrt; Tue, 27 Dec 2022 07:46:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXuC71CMUoerJAOtZ+oCIMJ/8b53xQsusDuh0Ioou4yYW10peXL9f5r636gaQ94aAjSTY6K3 X-Received: by 2002:a17:906:8e96:b0:7c1:808e:7660 with SMTP id ru22-20020a1709068e9600b007c1808e7660mr19967118ejc.43.1672155983291; Tue, 27 Dec 2022 07:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672155983; cv=none; d=google.com; s=arc-20160816; b=htyOg861OukPmhoi74nIlwS9gZxhBgHc6xy7xx6U5IYdjImSoIV78rtBU/lXd5DKJ8 SnOcumR4J9rrygHlZSosfza94kSv0yzhS84REX6RJ04/1JrYngVrTsR6mjx8/FO4kVbp Q28QusfI34rn/SRbtrcgdz1SnrPuKNgsTR5qBJ2Y2XbuQC/tuBFcBs0E8kvF/l8Bi/iZ VoEM2iRLePbNLg5S0Q1k7+eYhGn7RuDFTnxDCy+LVF1fLYoaVl4jRQ+EwrUcY0ludW7N Evm1q3xYntvNmeKj9QVvUIZ8pbDMkzFz/J04nyjvrDcIiFNt+EUz1BvIO/U97liZEGIf zdvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=4ixevAcTLkip49AGE855e6E0J4mymMlkd1DGsXgW2Hg=; b=HGzXlFXfszgyz7uMnszgyZ6l+7B12rWQPQ5HjLE9WPYwVfKzdZcVFO3mrDxXKVADG8 K62zRu626yI4NBo2VG7uVwIbktBj8P6XIvxDkhx/IES+KeoQtXHzg5eSmlDF8vM9qaiz 4imyUWNnSRZCxndLHCFzLrExv6EnZTyFXMEyhFUWPGbJ6LdEEncTEch+z4KhlPVeof7B qFfHrMX8RHvigtGN7apl6MXOC2f7cfRHLq0+lIBYrFN91Z9Y/3iZS6XmqiR7frZG5LJk uJ8fDPsrmY+3X4SyvG1wrxO8YDW8wcRteoW72NIKezm1labbm7JWAU5Y6l5f/3tmOhwG ZPtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nfUHfMSX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id jg36-20020a170907972400b007c172bd367fsi11184262ejc.193.2022.12.27.07.46.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:46:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nfUHfMSX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0D3B38493C5 for ; Tue, 27 Dec 2022 15:45:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0D3B38493C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672155935; bh=4ixevAcTLkip49AGE855e6E0J4mymMlkd1DGsXgW2Hg=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=nfUHfMSXGnEydj1VS7LAmNkgmz4BmIG5lpjPV10+orsEKA3qvkzOH9vmR4qxGBaHH yn5bmhkM8P/+47CGCf8cRyPVv02rfAdiFA/QpCv5DcQX282NRAQYVgNsccwfN0AcRw mEqOMnj6E9zQPFjjlxl45mpWbWhTSo+6cyWrlIIU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id E91EB3858407 for ; Tue, 27 Dec 2022 15:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E91EB3858407 Received: by mail-pl1-x62a.google.com with SMTP id m4so13552457pls.4 for ; Tue, 27 Dec 2022 07:44:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4ixevAcTLkip49AGE855e6E0J4mymMlkd1DGsXgW2Hg=; b=sthiH/hrrImb8f1oGFkZ1H1QGGsiE3grdnwlqezciyS2UTWjDj6Dz3OgXhlgfQRQok BqIRD8EYwNFVhGcde07tZK9v1QLe6xmu1VihfxBsjBL4Psxm/hdHXcLkwfKgVO+FaO7j FFem5qx+Wwcfq4n7u33r+13y4schympGVWtQHH+HczY70fzZ0NcmPzPMj1BR9fozBphk 5QfEGWzRFwVXHEpytyoJXdAKXIkvJmcv0El3rFYOrH+di5jv9JDgT0Sx5fO+eUJpZ91N fk6/hElafVIEZ6/+p0YIIuKYvrcLCzyEBpR/WRif/TqoNcsGYd+oXfzFyAcyCd8Lf0de BFLw== X-Gm-Message-State: AFqh2kolxNhb+viEGxak4NlxSrorm0bYa0NI/xwyHLOgu8riNUQmGNma nnRzJ11iNsHcIevWQOMYGUSBWkhHtJQ= X-Received: by 2002:a05:6a20:1586:b0:ad:5a5d:3571 with SMTP id h6-20020a056a20158600b000ad5a5d3571mr34402306pzj.4.1672155853089; Tue, 27 Dec 2022 07:44:13 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:48c3:ad37:b390:9bd1]) by smtp.gmail.com with ESMTPSA id 5-20020a630705000000b0047911890728sm7444711pgh.79.2022.12.27.07.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:44:12 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Takayuki 'January June' Suwa Subject: [COMMITTED 2/4] xtensa: Clean up xtensa_expand_prologue Date: Tue, 27 Dec 2022 07:44:02 -0800 Message-Id: <20221227154404.111654-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221227154404.111654-1-jcmvbkbc@gmail.com> References: <20221227154404.111654-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Max Filippov via Gcc-patches From: Max Filippov Reply-To: Max Filippov Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753382632058114005?= X-GMAIL-MSGID: =?utf-8?q?1753382632058114005?= From: Takayuki 'January June' Suwa gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_expand_prologue): Modify to exit the inspection loops as soon as the necessity of stack pointer is found. --- gcc/config/xtensa/xtensa.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index 178d16a78462..709b0d52d069 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -3327,12 +3327,18 @@ xtensa_expand_prologue (void) ref; ref = DF_REF_NEXT_REG (ref)) if (DF_REF_CLASS (ref) == DF_REF_REGULAR && NONJUMP_INSN_P (DF_REF_INSN (ref))) - stack_pointer_needed = true; + { + stack_pointer_needed = true; + break; + } /* Check if callee-saved registers really need saving to the stack. */ if (!stack_pointer_needed) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) if (xtensa_call_save_reg (regno)) - stack_pointer_needed = true; + { + stack_pointer_needed = true; + break; + } cfun->machine->inhibit_logues_a1_adjusts = !stack_pointer_needed; From patchwork Tue Dec 27 15:44:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 36945 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1451742wrt; Tue, 27 Dec 2022 07:45:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXtKdCN7PkOoazgjxYTNsl7iF+gU0Qi5jTgz/xnCb1yGqTo/RZadmJKrM5n3hhAvx3MfzaaU X-Received: by 2002:a17:907:3888:b0:83f:757e:f182 with SMTP id sq8-20020a170907388800b0083f757ef182mr17953940ejc.65.1672155929266; Tue, 27 Dec 2022 07:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672155929; cv=none; d=google.com; s=arc-20160816; b=dg51QjdNBmjIGHaGjdiZOxdIIxm26Be0SUKNcXOrspU2ym8e4U7mVmiW1ID2HJikUP RMDQDd74AQtGV4AFPvVc5Gbe8bIRDJcyH5IJHKZEW3BmOjqbscau9gZmG4rLHrR9dek2 ILa6+T2A77iHUVjSacLL76AZdCX74w8GVk9RFEv8Shw79rniOsxcF1oqoHzRBKsRkgPS 8cP2YWO4kQqvRHO9c1ZQCJ4o9ghhPBgcdUSJBZ1ZYT6lYjYNOBE6usSZa3UDdDLxJrvX JoLQafT99Q2ve9dpjspobRnc3THal6CHxpMKPCE9QGeBFkT+4nelKE2YlsN6Qh9x92Vi J8BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=v3V0U02Cy3vT1ZUPcrGRs3LiNVA2vpE/UvyGLHu/SVE=; b=F66VD/S8qv3x8cS6hOdYzFRqpFKdD20Cmnb9DCdvKUEyuYcU2RVzXmMtsz/M3PWkSr qKKMACujFgQEy3YMQYaKty1zqTb+88ItqUrXmfzY9In5fz0FOjoXbqQyCfRl60KhkBFv G4d4vDB3Yiat1wiE6Wc9Mfd1YF+3esy2dsgE1B7TT7c+RCgWuauqpxKbhiFez8Eal+8Y HLjur+DU27mdUT8UxY14EnmY2TAybjtdMq51ptnInLm6dyjxbPLz0+mXCVUkZO6X/YkS Q+E1B4i7ogtQR1x5kc+b6NmvSrlZgx1oelMp2rr8cMFPICBP6JOr+j3GZLE0mJc0NvCp TBhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=A2iIdrwe; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t22-20020a50ab56000000b004754696ec2asi10852122edc.348.2022.12.27.07.45.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:45:29 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=A2iIdrwe; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9433384E7A8 for ; Tue, 27 Dec 2022 15:45:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9433384E7A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672155900; bh=v3V0U02Cy3vT1ZUPcrGRs3LiNVA2vpE/UvyGLHu/SVE=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=A2iIdrwe+rL31A3ht7RsZ1DNJJdso/atUaDeDHBZKC79xp5tkLhxzxP/bRSOgHdp2 jcfFPZF8U+8ZdO6LQNWaUcCKo8GBcFHA4UmjBK2OPmc0U2KWlSxYIwD2ectLRlsi4P 8jvjm25TT1rGHS3Lo8XfGLZBzJPVqwVlSHV6P0h4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id E9D993858408 for ; Tue, 27 Dec 2022 15:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9D993858408 Received: by mail-pl1-x62a.google.com with SMTP id g16so3877720plq.12 for ; Tue, 27 Dec 2022 07:44:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v3V0U02Cy3vT1ZUPcrGRs3LiNVA2vpE/UvyGLHu/SVE=; b=m19rB8OFFotPHOZiBa/B5ydxz3MMEG/vwWQd9scXf/k6trv7cAPcMqKuwM3KW+6mgJ lV/anxGUTjneZPjv/5mGS9RcVlD3ZzEzdpvrdSQJ3msVzjvuZNxz+3/4YGUf2w5gf8Pa PifQ4fry6xed1jSFM91MGTLHGc9gCcdowiYMfR7i6Z4cn52SyEMaDL3D5E7jOTzjKcnG p95wBg5SnRrX48Ck+Tpo8Qj3LEzBlekg2Z+FaE35LsMnyYpUn0nhSGDTf0EIeda4hzaG 57WUf5uvQFvDT2rZ1c/7fcwIJXsJUfh/LRtF0NDpeSl7MtPo/sBInjgSzS2czSuVTjdo LCNA== X-Gm-Message-State: AFqh2kr0cOF2gMCqupPI7iDvg5is4gaEWXyvPKAiPRex96IQu0Xp4CGG qu9yo5eQaxIw84VXd2qZeHG+u5MF7no= X-Received: by 2002:a17:90a:bb07:b0:225:a3ff:8016 with SMTP id u7-20020a17090abb0700b00225a3ff8016mr24552570pjr.17.1672155853925; Tue, 27 Dec 2022 07:44:13 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:48c3:ad37:b390:9bd1]) by smtp.gmail.com with ESMTPSA id 5-20020a630705000000b0047911890728sm7444711pgh.79.2022.12.27.07.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:44:13 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Takayuki 'January June' Suwa Subject: [COMMITTED 3/4] xtensa: Change GP_RETURN{, _REG_COUNT} to GP_RETURN_{FIRST, LAST} Date: Tue, 27 Dec 2022 07:44:03 -0800 Message-Id: <20221227154404.111654-3-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221227154404.111654-1-jcmvbkbc@gmail.com> References: <20221227154404.111654-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Max Filippov via Gcc-patches From: Max Filippov Reply-To: Max Filippov Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753382575702308401?= X-GMAIL-MSGID: =?utf-8?q?1753382575702308401?= From: Takayuki 'January June' Suwa gcc/ChangeLog: * config/xtensa/xtensa.h (GP_RETURN, GP_RETURN_REG_COUNT): Change to GP_RETURN_FIRST and GP_RETURN_LAST, respectively. * config/xtensa/xtensa.cc (xtensa_function_value, xtensa_libcall_value, xtensa_function_value_regno_p): Ditto. --- gcc/config/xtensa/xtensa.cc | 10 +++++----- gcc/config/xtensa/xtensa.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index 709b0d52d069..66e253495211 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -4526,9 +4526,9 @@ xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, bool outgoing) { return gen_rtx_REG ((INTEGRAL_TYPE_P (valtype) - && TYPE_PRECISION (valtype) < BITS_PER_WORD) - ? SImode : TYPE_MODE (valtype), - outgoing ? GP_OUTGOING_RETURN : GP_RETURN); + && TYPE_PRECISION (valtype) < BITS_PER_WORD) + ? SImode : TYPE_MODE (valtype), + outgoing ? GP_OUTGOING_RETURN : GP_RETURN_FIRST); } /* Worker function for TARGET_LIBCALL_VALUE. */ @@ -4538,7 +4538,7 @@ xtensa_libcall_value (machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED) { return gen_rtx_REG ((GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) < UNITS_PER_WORD) - ? SImode : mode, GP_RETURN); + ? SImode : mode, GP_RETURN_FIRST); } /* Worker function TARGET_FUNCTION_VALUE_REGNO_P. */ @@ -4546,7 +4546,7 @@ xtensa_libcall_value (machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED) static bool xtensa_function_value_regno_p (const unsigned int regno) { - return (regno >= GP_RETURN && regno < GP_RETURN + GP_RETURN_REG_COUNT); + return IN_RANGE (regno, GP_RETURN_FIRST, GP_RETURN_LAST); } /* The static chain is passed in memory. Provide rtx giving 'mem' diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 60d3fdfbc706..a7c112b87538 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -474,9 +474,9 @@ enum reg_class /* Symbolic macros for the registers used to return integer, floating point, and values of coprocessor and user-defined modes. */ -#define GP_RETURN (GP_REG_FIRST + 2 + WINDOW_SIZE) +#define GP_RETURN_FIRST (GP_REG_FIRST + 2 + WINDOW_SIZE) +#define GP_RETURN_LAST (GP_RETURN_FIRST + 3) #define GP_OUTGOING_RETURN (GP_REG_FIRST + 2) -#define GP_RETURN_REG_COUNT 4 /* Symbolic macros for the first/last argument registers. */ #define GP_ARG_FIRST (GP_REG_FIRST + 2) From patchwork Tue Dec 27 15:44:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 36944 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1451723wrt; Tue, 27 Dec 2022 07:45:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXtG9eDo7+i1S6JiKJVs2BWDGV31EBd1c9RMFz6D3PGl78tEI7hpjAhM6aweohpXsYAN95K7 X-Received: by 2002:a17:906:380e:b0:7c0:be5d:59a9 with SMTP id v14-20020a170906380e00b007c0be5d59a9mr22306485ejc.20.1672155926110; Tue, 27 Dec 2022 07:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672155926; cv=none; d=google.com; s=arc-20160816; b=SebossJXD8vKn0NhRD6SldPWSTPQA3i8PLLM4udi3eU1vZEdUyQ3PAc58ARil1n0+1 np5+O83Wbyn0bAZxqeMJ9D9RA0ju82OQnl6pMe7e6ZOaaT+yBg0cnXRaqZtJZcWnX88Q WBDCMtW44YBxsq8W+5bJN1AQOLJM9LcEjn2GULO2tVhBoYTmA1yY1RjQMfFamD/esRBz nCE4p8Cp686midONJ/l0R8+o8iqtZo0V2Fm9JziLILVVYkxS9b/ZmdPi8OSf+4mohXO8 YspSlEuCKTOm/xPOLTBUPgnK8BWnT2kv2ylU5L6FcX9WZNWxzMzwxp7jtxDD3UBSGG1P ovgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=xPH054aweKHdhSM+hrOHkXUKQxeUEwkbxkZbqKa6fqk=; b=Y9fchWojvWJcnnJVT0xWPWJZuaQuJb3zDSVzqF/F9pzx/3sMoiVAE/2H30FKPkxals ULJrNFFI580zDQ1T4poEJQH0FOpzyai23I4nsDRvOdOgHStj5hF8xeCCB+oZvIZe+VJx onqV2ZFXJpC3fY6nH/G22SzuWN0Kq+iVZvgnBpmAV76TuAIgCZFe4Wc9+lcxxn5p4Mn2 occwyEdqbdBCwSICh/7dz39NKZ8/V3e3MEgC1OvJbi+wLisEfkHr0Ol0/gbo5raOrmwp 22LtUj6jxxoaVloXDc1H93uOMqFQvWJHIxT5BfgXnDtI26DQbxTIqs6AHT0CGGHgIiEH /HEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SjrDI7Nn; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w16-20020a056402269000b0046bfb391d2asi12499433edd.472.2022.12.27.07.45.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:45:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SjrDI7Nn; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 965F43861027 for ; Tue, 27 Dec 2022 15:44:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965F43861027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672155898; bh=xPH054aweKHdhSM+hrOHkXUKQxeUEwkbxkZbqKa6fqk=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=SjrDI7NnaDnWXerl/uSBsILdQ5mQ/FOaSvBZIdHLkaq4MULndqomeGy+q+I//8WfB lFHdlJKuxFx4L82JArP0WSePkjG1/Fnw3u2XWN+WDZISkx7LO3p6vMn0volB3Qnpid +lQI6m9aFZnxf0vQ0KZVdcxFdCCgRQlZ6HAn35gc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id DB0B4385840D for ; Tue, 27 Dec 2022 15:44:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB0B4385840D Received: by mail-pl1-x635.google.com with SMTP id jn22so13511374plb.13 for ; Tue, 27 Dec 2022 07:44:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xPH054aweKHdhSM+hrOHkXUKQxeUEwkbxkZbqKa6fqk=; b=gcXH2oSXWiNuo1sFAp7TaA4dhjRnLbc3e6CtygPPrnFrTFuxq5J+eXUlJ6L42wgYbv IO2UF/nPx9Zns+FK3VF9WeR91IXhAhXUyL9kb5xmuOzC3huUv4ybmkCNmoZLXTpFQnay U0Uq+ogMThXon1X39vyhoTX009GeiKfZYa4nfuR8n8izpaHHGV5FgmtLPbcBhabPHw2L R3oBMkpTUUjj6FrOs9ws2wRnEkBBksQS8mvzuIN23TF/qWacFmCBAgzSfgCXnM/Al2TY NIzbE06VhIH7n2zp1UltfT+AffN+TktwThTMYGfvdzNW4dgKWB1IgjCtC0Zl/nK5p19D ZE0g== X-Gm-Message-State: AFqh2kpyIKA1v6F72bLvyRfia/Wgua1PgqIAi29a2Ul+oLPUsQDnbUlM mlOrRpeUOpBsq43EkwWc4fWLvQYLZI0= X-Received: by 2002:a05:6a20:4e04:b0:9d:efbf:786a with SMTP id gk4-20020a056a204e0400b0009defbf786amr24898880pzb.31.1672155854782; Tue, 27 Dec 2022 07:44:14 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:48c3:ad37:b390:9bd1]) by smtp.gmail.com with ESMTPSA id 5-20020a630705000000b0047911890728sm7444711pgh.79.2022.12.27.07.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 07:44:14 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Takayuki 'January June' Suwa Subject: [COMMITTED 4/4] xtensa: Generate density instructions in set_frame_ptr Date: Tue, 27 Dec 2022 07:44:04 -0800 Message-Id: <20221227154404.111654-4-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221227154404.111654-1-jcmvbkbc@gmail.com> References: <20221227154404.111654-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Max Filippov via Gcc-patches From: Max Filippov Reply-To: Max Filippov Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753382572479075493?= X-GMAIL-MSGID: =?utf-8?q?1753382572479075493?= From: Takayuki 'January June' Suwa gcc/ChangeLog: * config/xtensa/xtensa.md (set_frame_ptr): Fix to reflect TARGET_DENSITY. --- gcc/config/xtensa/xtensa.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index a77d3285bad1..e72fd9ac3f61 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -2562,12 +2562,15 @@ "" { if (frame_pointer_needed) - return "mov\ta7, sp"; + return (TARGET_DENSITY ? "mov.n\ta7, sp" : "mov\ta7, sp"); return ""; } [(set_attr "type" "move") (set_attr "mode" "SI") - (set_attr "length" "3")]) + (set (attr "length") + (if_then_else (match_test "TARGET_DENSITY") + (const_int 2) + (const_int 3)))]) ;; Post-reload splitter to remove fp assignment when it's not needed. (define_split