From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7891) id DEA8A3858D39; Mon, 14 Aug 2023 03:31:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEA8A3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691983887; bh=XbTLAKXDBaYtNlauLyR9JBvyTZbMXV1AHgxrk2kflvw=; h=From:To:Subject:Date:From; b=C0Sq2QXn3l2X8kjNHQNpNBE8uQFvzOeauHENcUrNzdpB22GypDN3YAASrCsKVzgwJ W8iRORspw3w8mvyuVnqhbm6ieeYRa41KamkxZkHNQnTiDgocCcte55yhGdRzyuaM89 LE2J72kFllgJbNBVvVD3pN7YAxeTzGakB6TDdylM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Yinyu Cai To: glibc-cvs@sourceware.org Subject: [glibc] LoongArch: Redefine macro LEAF/ENTRY. X-Act-Checkin: glibc X-Git-Author: dengjianbo X-Git-Refname: refs/heads/master X-Git-Oldrev: 084fb31bc2c5f95ae0b9e6df4d3cf0ff43471ede X-Git-Newrev: 57b2c14272998c0ea08c005edbd90887c2d5fa6b Message-Id: <20230814033127.DEA8A3858D39@sourceware.org> Date: Mon, 14 Aug 2023 03:31:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=57b2c14272998c0ea08c005edbd90887c2d5fa6b commit 57b2c14272998c0ea08c005edbd90887c2d5fa6b Author: dengjianbo Date: Tue Aug 8 14:15:42 2023 +0800 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 Diff: --- 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