aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengjianbo <dengjianbo@loongson.cn>2023-08-08 14:15:42 +0800
committercaiyinyu <caiyinyu@loongson.cn>2023-08-14 09:47:09 +0800
commit57b2c14272998c0ea08c005edbd90887c2d5fa6b (patch)
tree4eb5e049f40c7cf49e47b7293cb955e267ec33bb
parent084fb31bc2c5f95ae0b9e6df4d3cf0ff43471ede (diff)
downloadglibc-57b2c14272998c0ea08c005edbd90887c2d5fa6b.zip
glibc-57b2c14272998c0ea08c005edbd90887c2d5fa6b.tar.gz
glibc-57b2c14272998c0ea08c005edbd90887c2d5fa6b.tar.bz2
LoongArch: Redefine macro LEAF/ENTRY.
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
-rw-r--r--sysdeps/loongarch/sys/asm.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/sysdeps/loongarch/sys/asm.h b/sysdeps/loongarch/sys/asm.h
index d1a279b..c5eb8af 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