Segher,

   The const_anchor should work on both 64 and 32 bit. I think the constant loading is cheap on 32 bit platform,  so I only enabled it on 64 bit. I will add a test case and verify the patch on Darwin and AIX. Thanks.

On 17/3/2021 上午 12:35, Segher Boessenkool wrote:
Hi!

On Mon, Mar 15, 2021 at 11:11:32AM +0800, HAO CHEN GUI via Gcc-patches wrote:
     This patch adds const_anchor for rs6000. The const_anchor is used
in cse pass.
1) This isn't suitable for stage 4.
2) Please add a test case, which shows what it does, that it is useful.
3) Does this work on other OSes than Linux?  What about Darwin and AIX?

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ec068c58aa5..2b2350c53ae 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4911,6 +4911,13 @@ rs6000_option_override_internal (bool global_init_p)
      warning (0, "%qs is deprecated and not recommended in any circumstances",
             "-mno-speculate-indirect-jumps");
+ if (TARGET_64BIT)
+    {
+      targetm.min_anchor_offset = -32768;
+      targetm.max_anchor_offset = 32767;
+      targetm.const_anchor = 0x8000;
+    }
Why only on 64 bit?  Why these choices?


Segher

Reply via email to