From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 1147A385783D; Sat, 31 Jul 2021 03:36:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1147A385783D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work062)] Revert patch. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work062 X-Git-Oldrev: 56c4edcded930d8f67cf9129c793b9666074f593 X-Git-Newrev: 308a8bd287c6c6b33056e0d9c82bd0e0cd9e659b Message-Id: <20210731033629.1147A385783D@sourceware.org> Date: Sat, 31 Jul 2021 03:36:29 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jul 2021 03:36:29 -0000 https://gcc.gnu.org/g:308a8bd287c6c6b33056e0d9c82bd0e0cd9e659b commit 308a8bd287c6c6b33056e0d9c82bd0e0cd9e659b Author: Michael Meissner Date: Fri Jul 30 23:35:47 2021 -0400 Revert patch. 2021-07-30 Michael Meissner gcc/ Revert patch. PR target/98519 * config/rs6000/rs6000.c (rs6000_asm_operand_p): New function. (TARGET_MD_ASM_OPERAND_P): Override md_asm_operand_p hook. * doc/tm.texi (TARGET_MD_ASM_OPERAND_P): Document. * doc/tm.texi.in (TARGET_MD_ASM_OPERAND_P): Document. * target.def (md_asm_operand_p): New target hook. * targhooks.c (default_md_asm_operand_p): New default target hook. * targhooks.h (default_md_asm_operand_p): New declaration. gcc/testsuite/ Revert patch. PR target/98519 * gcc.target/powerpc/pr98519.c: New test. Diff: --- gcc/config/rs6000/rs6000.c | 26 -------------------------- gcc/doc/tm.texi | 11 ----------- gcc/doc/tm.texi.in | 2 -- gcc/recog.c | 4 ---- gcc/target.def | 15 --------------- gcc/targhooks.c | 7 ------- gcc/targhooks.h | 1 - gcc/testsuite/gcc.target/powerpc/pr98519.c | 20 -------------------- 8 files changed, 86 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a8072b59eec..2de5a96e1b6 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1196,8 +1196,6 @@ static bool rs6000_secondary_reload_move (enum rs6000_reg_type, bool); rtl_opt_pass *make_pass_analyze_swaps (gcc::context*); -static bool rs6000_asm_operand_p (rtx, const char *, const char **); - /* Hash table stuff for keeping track of TOC entries. */ struct GTY((for_user)) toc_hash_struct @@ -1641,9 +1639,6 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P rs6000_legitimate_address_p -#undef TARGET_MD_ASM_OPERAND_P -#define TARGET_MD_ASM_OPERAND_P rs6000_asm_operand_p - #undef TARGET_MODE_DEPENDENT_ADDRESS_P #define TARGET_MODE_DEPENDENT_ADDRESS_P rs6000_mode_dependent_address_p @@ -9926,27 +9921,6 @@ rs6000_offsettable_memref_p (rtx op, machine_mode reg_mode, bool strict) strict, worst_case); } -/* Add additional constraints for asm operands. We use it to prevent - prefixed loads/stores from appearing in normal asm statements. - - At the moment, we just ban all prefixed loads/stores. */ - -static bool -rs6000_asm_operand_p (rtx op, - const char *constraint ATTRIBUTE_UNUSED, - const char **constraints ATTRIBUTE_UNUSED) -{ - if (TARGET_PREFIXED && MEM_P (op)) - { - rtx addr = XEXP (op, 0); - machine_mode mode = GET_MODE (op); - if (address_is_prefixed (addr, mode, NON_PREFIXED_DEFAULT)) - return false; - } - - return true; -} - /* Determine the reassociation width to be used in reassociate_bb. This takes into account how many parallel operations we can actually do of a given type, and also the latency. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 70293a46c2a..cb015283237 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -5886,17 +5886,6 @@ Using the hook is usually simpler because it limits the number of files that are recompiled when changes are made. @end deftypefn -@deftypefn {Target Hook} bool TARGET_MD_ASM_OPERAND_P (rtx @var{op}, const char *@var{constraint}, const char **@var{constraints}) -This hook should return true if the operand is valid for being used in an -asm statement. The back end may impose additionsl constraints on what -operands are valid for an asm statement. The default behavior is to return -true always. - -For example, the PowerPC has normal memory instructions and prefixed memory -instructions. Prefixed memory instructions are not valid for the normal 'm' -constraint. -@end deftypefn - @defmac TARGET_MEM_CONSTRAINT A single character to be used instead of the default @code{'m'} character for general memory addresses. This defines the constraint diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 21e013fa274..4a522ae7e2e 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -4066,8 +4066,6 @@ accept. @hook TARGET_LEGITIMATE_ADDRESS_P -@hook TARGET_MD_ASM_OPERAND_P - @defmac TARGET_MEM_CONSTRAINT A single character to be used instead of the default @code{'m'} character for general memory addresses. This defines the constraint diff --git a/gcc/recog.c b/gcc/recog.c index 04e52a71d3f..5a42c45361d 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -2174,10 +2174,6 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints) /* Use constrain_operands after reload. */ gcc_assert (!reload_completed); - /* Allow the backend to impose additional constraints. */ - if (!targetm.md_asm_operand_p (op, constraint, constraints)) - return 0; - /* Empty constraint string is the same as "X,...,X", i.e. X for as many alternatives as required to match the other operands. */ if (*constraint == '\0') diff --git a/gcc/target.def b/gcc/target.def index 816b9e85017..68a46aaa832 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -2940,21 +2940,6 @@ files that are recompiled when changes are made.", bool, (machine_mode mode, rtx x, bool strict), default_legitimate_address_p) -/* True if the given operand is a valid machine dependent assembler - operand. */ -DEFHOOK -(md_asm_operand_p, - "This hook should return true if the operand is valid for being used in an\n\ -asm statement. The back end may impose additionsl constraints on what\n\ -operands are valid for an asm statement. The default behavior is to return\n\ -true always.\n\ -\n\ -For example, the PowerPC has normal memory instructions and prefixed memory\n\ -instructions. Prefixed memory instructions are not valid for the normal 'm'\n\ -constraint.", - bool, (rtx op, const char *constraint, const char **constraints), - default_md_asm_operand_p) - /* True if the given constant can be put into an object_block. */ DEFHOOK (use_blocks_for_constant_p, diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 7af4ef8660f..eb5190910dc 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -110,13 +110,6 @@ default_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, #endif } -bool default_md_asm_operand_p (rtx op ATTRIBUTE_UNUSED, - const char *constraint ATTRIBUTE_UNUSED, - const char **constraints ATTRIBUTE_UNUSED) -{ - return true; -} - void default_external_libcall (rtx fun ATTRIBUTE_UNUSED) { diff --git a/gcc/targhooks.h b/gcc/targhooks.h index 19f54d97df3..f92e102c450 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see #define GCC_TARGHOOKS_H extern bool default_legitimate_address_p (machine_mode, rtx, bool); -extern bool default_md_asm_operand_p (rtx, const char *, const char **); extern void default_external_libcall (rtx); extern rtx default_legitimize_address (rtx, rtx, machine_mode); diff --git a/gcc/testsuite/gcc.target/powerpc/pr98519.c b/gcc/testsuite/gcc.target/powerpc/pr98519.c deleted file mode 100644 index 25918bac3ed..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/pr98519.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target powerpc_prefixed_addr } */ -/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ - -/* Compile with -mcpu=power10. The lxsd instruction should not be replaced - with a plxsd. */ -typedef vector double vf64_t; - -static double test_f64[16]; - -vf64_t -bug (void) -{ - vf64_t j0; - __asm__("lxsd%X1 %0,%1;" : "=v" (j0) : "m" (test_f64)); - return j0; -} - -/* { dg-final { scan-assembler {\mlxsd\M} } } */ -/* { dg-final { scan-assembler-not {\mplxsd\M} } } */