public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Boshi Wang <wangboshi@huawei.com>
To: Szabolcs Nagy <szabolcs.nagy@arm.com>
Cc: <nd@arm.com>, GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in start.S
Date: Fri, 15 Sep 2017 01:16:00 -0000	[thread overview]
Message-ID: <2112d1ae-98b2-f555-99ed-99d1d24ac4da@huawei.com> (raw)
In-Reply-To: <59BA3F64.60504@arm.com>

On 2017/9/14 16:35, Szabolcs Nagy wrote:
> On 14/09/17 04:21, Boshi Wang wrote:
>> On 2017/9/11 17:11, Szabolcs Nagy wrote:
>>> On 07/09/17 08:33, wangboshi wrote:
>>>> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>
>>>>
>>>>       * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.
>>>>       * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.
>>>>
>>> thanks, the patch looks good to me (except for a nit below),
>>> do you have copyright assignment?
>>> do you have commit rights to the glibc repo?
>> I have read requirements of copyright assignment. I don't have that.
>>
>> I don't have commit rights, too.
>>
>> So how can I contribute the change? Could you give me some suggestions?
>>
> i think your change is just below the legally-significant limit
> https://www.gnu.org/prep/maintain/maintain.html#Legally-Significant
> so i can commit it for you.
>
> but getting your employer to sort it out with the fsf would be better,
> in case you run into further issues that need glibc fixes.
>
That's great. I have a few doubt. Could you add my name into the patch?
The new patch is here below.

diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
index df1c642..51e8e82 100644
--- a/sysdeps/aarch64/start.S
+++ b/sysdeps/aarch64/start.S
@@ -71,9 +71,9 @@ _start:
      ldr     PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]
  #else
      /* Set up the other arguments in registers */
-    ldr    PTR_REG (0), =main
-    ldr    PTR_REG (3), =__libc_csu_init
-    ldr    PTR_REG (4), =__libc_csu_fini
+    MOVL(0, main)
+    MOVL(3, __libc_csu_init)
+    MOVL(4, __libc_csu_fini)
  #endif

      /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h
index a749a70..152f5ba 100644
--- a/sysdeps/aarch64/sysdep.h
+++ b/sysdeps/aarch64/sysdep.h
@@ -137,6 +137,20 @@
      ldr    PTR_REG (T), [x##T, #:got_lo12:EXPR];    \
      OP    PTR_REG (R), [x##T];

+/* Load an immediate into R.
+   Note R is a register number and not a register name. */
+#ifdef __LP64__
+# define MOVL(R, NAME)                    \
+    movz    PTR_REG(R), #:abs_g3:NAME;        \
+    movk    PTR_REG(R), #:abs_g2_nc:NAME;        \
+    movk    PTR_REG(R), #:abs_g1_nc:NAME;        \
+    movk    PTR_REG(R), #:abs_g0_nc:NAME;
+#else
+# define MOVL(R, NAME)                    \
+    movz    PTR_REG(R), #:abs_g1:NAME;        \
+    movk    PTR_REG(R), #:abs_g0_nc:NAME;
+#endif
+
  /* Since C identifiers are not normally prefixed with an underscore
     on this system, the asm identifier `syscall_error' intrudes on the
     C name space.  Make sure we use an innocuous name.  */

Thank you, Nagy.

  reply	other threads:[~2017-09-15  1:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07  7:34 wangboshi
2017-09-07 11:43 ` Florian Weimer
2017-09-11  8:58   ` Szabolcs Nagy
2017-09-11  9:09 ` Andrew Pinski
2017-09-11  9:24   ` Szabolcs Nagy
2017-09-12  8:54   ` Boshi Wang
2017-09-11  9:11 ` Szabolcs Nagy
     [not found]   ` <336560e5-c9de-08bc-c850-28994cac2c33@huawei.com>
2017-09-14  8:35     ` Szabolcs Nagy
2017-09-15  1:16       ` Boshi Wang [this message]
2017-09-18 17:21         ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2112d1ae-98b2-f555-99ed-99d1d24ac4da@huawei.com \
    --to=wangboshi@huawei.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=szabolcs.nagy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).