public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: dengjianbo <dengjianbo@loongson.cn>
To: libc-alpha@sourceware.org
Cc: adhemerval.zanella@linaro.org, xry111@xry111.site,
	caiyinyu@loongson.cn, xuchenghua@loongson.cn,
	huangpei@loongson.cn, dengjianbo <dengjianbo@loongson.cn>
Subject: [PATCH 1/2] LoongArch: Redefine macro LEAF/ENTRY.
Date: Tue,  1 Aug 2023 15:09:01 +0800	[thread overview]
Message-ID: <20230801070902.1385953-2-dengjianbo@loongson.cn> (raw)
In-Reply-To: <20230801070902.1385953-1-dengjianbo@loongson.cn>

The following usage of macro LEAF/ENTRY are all feasible:
1. LEAF(fcn) -- the align value of fcn is .align 3(default value)
2. LEAF(fcn, 6) -- the align value of fcn is .align 6
---
 sysdeps/loongarch/sys/asm.h | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/sysdeps/loongarch/sys/asm.h b/sysdeps/loongarch/sys/asm.h
index d1a279b8fb..c5eb8afa09 100644
--- a/sysdeps/loongarch/sys/asm.h
+++ b/sysdeps/loongarch/sys/asm.h
@@ -39,16 +39,32 @@
 #define FREG_L fld.d
 #define FREG_S fst.d
 
-/* Declare leaf routine.  */
-#define LEAF(symbol) \
-  .text; \
-  .globl symbol; \
-  .align 3; \
-  cfi_startproc; \
-  .type symbol, @function; \
-  symbol:
-
-#define ENTRY(symbol) LEAF (symbol)
+/*  Declare leaf routine.
+    The usage of macro LEAF/ENTRY is as follows:
+    1. LEAF(fcn) -- the align value of fcn is .align 3 (default value)
+    2. LEAF(fcn, 6) -- the align value of fcn is .align 6
+*/
+#define LEAF_IMPL(symbol, aln, ...)	\
+	.text;				\
+	.globl symbol;			\
+	.align aln;			\
+	.type symbol, @function;	\
+symbol: \
+	cfi_startproc;
+
+
+#define LEAF(...) LEAF_IMPL(__VA_ARGS__, 3)
+#define ENTRY(...) LEAF(__VA_ARGS__)
+
+#define	LEAF_NO_ALIGN(symbol)		\
+	.text;				\
+	.globl	symbol;			\
+	.type	symbol, @function;	\
+symbol: \
+	cfi_startproc;
+
+#define ENTRY_NO_ALIGN(symbol) LEAF_NO_ALIGN(symbol)
+
 
 /* Mark end of function.  */
 #undef END
-- 
2.40.0


  reply	other threads:[~2023-08-01  7:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01  7:09 [PATCH 0/2] Add ifunc support and different versions of strlen dengjianbo
2023-08-01  7:09 ` dengjianbo [this message]
2023-08-01  7:09 ` [PATCH 2/2] Loongarch: Add ifunc support and add " dengjianbo
2023-08-01 14:31   ` Adhemerval Zanella Netto
2023-08-02  1:25     ` caiyinyu
2023-08-02 12:25       ` dengjianbo
2023-08-02 12:59         ` Adhemerval Zanella Netto
2023-08-03 13:27           ` dengjianbo
2023-08-03 13:48             ` Adhemerval Zanella Netto
2023-08-03 14:53               ` Xi Ruoyao
2023-08-03 14:59                 ` Xi Ruoyao
2023-08-03 16:29                   ` Adhemerval Zanella Netto
2023-08-04  1:50                 ` caiyinyu
2023-08-04 10:00               ` dengjianbo
2023-08-01 14:44   ` Xi Ruoyao
2023-08-02 12:47     ` dengjianbo

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=20230801070902.1385953-2-dengjianbo@loongson.cn \
    --to=dengjianbo@loongson.cn \
    --cc=adhemerval.zanella@linaro.org \
    --cc=caiyinyu@loongson.cn \
    --cc=huangpei@loongson.cn \
    --cc=libc-alpha@sourceware.org \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /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).