Sorry, forgot to gcc-patches

On 19/5/2021 下午 4:33, HAO CHEN GUI wrote:
Hi,

    This patch removes mode promotion of SSA variables on rs6000 platform.

    The attachment are the patch diff and change log file.

    Bootstrapped and tested on powerppc64le and powerppc64be (with m32) with no regressions. Is this okay for trunk? Any recommendations? Thanks a lot.

        * config/rs6000/rs6000-call.c (rs6000_promote_function_mode):
        Replace PROMOTE_MODE marco with its content.
        * config/rs6000/rs6000.h (PROMOTE_MODE): Remove.
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index f5676255387..dca139b2ecf 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -6646,7 +6646,9 @@ rs6000_promote_function_mode (const_tree type 
ATTRIBUTE_UNUSED,
                              int *punsignedp ATTRIBUTE_UNUSED,
                              const_tree, int for_return ATTRIBUTE_UNUSED)
 {
-  PROMOTE_MODE (mode, *punsignedp, type);
+  if (GET_MODE_CLASS (mode) == MODE_INT
+      && GET_MODE_SIZE (mode) < (TARGET_32BIT ? 4 : 8))
+    mode = TARGET_32BIT ? SImode : DImode;
 
   return mode;
 }
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 233a92baf3c..f6485fcacf5 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -666,17 +666,6 @@ extern unsigned char rs6000_recip_bits[];
 
 /* Target machine storage layout.  */
 
-/* Define this macro if it is advisable to hold scalars in registers
-   in a wider mode than that declared by the program.  In such cases,
-   the value is constrained to be within the bounds of the declared
-   type, but kept valid in the wider mode.  The signedness of the
-   extension may differ from that of the type.  */
-
-#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)      \
-  if (GET_MODE_CLASS (MODE) == MODE_INT                \
-      && GET_MODE_SIZE (MODE) < (TARGET_32BIT ? 4 : 8)) \
-    (MODE) = TARGET_32BIT ? SImode : DImode;
-
 /* Define this if most significant bit is lowest numbered
    in instructions that operate on numbered bit-fields.  */
 /* That is true on RS/6000.  */

Reply via email to