]> sourceware.org Git - glibc.git/commitdiff
LoongArch: Redefine macro LEAF/ENTRY.
authordengjianbo <dengjianbo@loongson.cn>
Tue, 8 Aug 2023 06:15:42 +0000 (14:15 +0800)
committercaiyinyu <caiyinyu@loongson.cn>
Mon, 14 Aug 2023 01:47:09 +0000 (09:47 +0800)
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

index d1a279b8fbbd652fcfbcb3f846bd1dcd234f4d4c..c5eb8afa098e3c1c3eb1987f5a8a9e600df19a19 100644 (file)
 #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
This page took 0.044368 seconds and 5 git commands to generate.