public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] LoongArch: Change to put magic number to .rodata section
@ 2023-09-15  1:12 Yinyu Cai
  0 siblings, 0 replies; only message in thread
From: Yinyu Cai @ 2023-09-15  1:12 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=780adf7aeab9308c02d89260df6ffa84dc2289a5

commit 780adf7aeab9308c02d89260df6ffa84dc2289a5
Author: dengjianbo <dengjianbo@loongson.cn>
Date:   Wed Sep 13 15:35:01 2023 +0800

    LoongArch: Change to put magic number to .rodata section
    
    Change to put magic number to .rodata section in memmove-lsx, and use
    pcalau12i and %pc_lo12 with vld to get the data.

Diff:
---
 sysdeps/loongarch/lp64/multiarch/memmove-lsx.S | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/sysdeps/loongarch/lp64/multiarch/memmove-lsx.S b/sysdeps/loongarch/lp64/multiarch/memmove-lsx.S
index 8a9367708d..5eb819ef74 100644
--- a/sysdeps/loongarch/lp64/multiarch/memmove-lsx.S
+++ b/sysdeps/loongarch/lp64/multiarch/memmove-lsx.S
@@ -209,13 +209,10 @@ L(al_less_16):
     nop
 
 
-L(magic_num):
-    .dword          0x0706050403020100
-    .dword          0x0f0e0d0c0b0a0908
 L(unaligned):
-    pcaddi          t2, -4
+    pcalau12i       t2, %pc_hi20(L(INDEX))
     bstrins.d       a1, zero, 3, 0
-    vld             vr8, t2, 0
+    vld             vr8, t2, %pc_lo12(L(INDEX))
     vld             vr0, a1, 0
 
     vld             vr1, a1, 16
@@ -413,13 +410,10 @@ L(back_al_less_16):
     vst             vr1, a0, 0
     jr              ra
 
-L(magic_num_2):
-    .dword          0x0706050403020100
-    .dword          0x0f0e0d0c0b0a0908
 L(back_unaligned):
-    pcaddi          t2, -4
+    pcalau12i       t2, %pc_hi20(L(INDEX))
     bstrins.d       a4, zero, 3, 0
-    vld             vr8, t2, 0
+    vld             vr8, t2, %pc_lo12(L(INDEX))
     vld             vr0, a4, 0
 
     vld             vr1, a4, -16
@@ -529,6 +523,12 @@ L(back_un_less_16):
     jr              ra
 END(MEMMOVE_NAME)
 
+    .section        .rodata.cst16,"M",@progbits,16
+    .align          4
+L(INDEX):
+    .dword          0x0706050403020100
+    .dword          0x0f0e0d0c0b0a0908
+
 libc_hidden_builtin_def (MEMCPY_NAME)
 libc_hidden_builtin_def (MEMMOVE_NAME)
 #endif

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-15  1:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-15  1:12 [glibc] LoongArch: Change to put magic number to .rodata section Yinyu Cai

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).