1 /* Miscellaneous macros.
2    Copyright (C) 2022 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4 
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9 
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14 
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library.  If not, see
17    <https://www.gnu.org/licenses/>.  */
18 
19 #ifndef _SYS_ASM_H
20 #define _SYS_ASM_H
21 
22 #include <sys/regdef.h>
23 #include <sysdeps/generic/sysdep.h>
24 
25 /* Macros to handle different pointer/register sizes for 32/64-bit code.  */
26 #define SZREG 8
27 #define SZFREG 8
28 #define REG_L ld.d
29 #define REG_S st.d
30 #define SRLI srli.d
31 #define SLLI slli.d
32 #define ADDI addi.d
33 #define ADD  add.d
34 #define BSTRINS  bstrins.d
35 #define LI  li.d
36 #define FREG_L fld.d
37 #define FREG_S fst.d
38 
39 /* Declare leaf routine.  */
40 #define LEAF(symbol) \
41   .text; \
42   .globl symbol; \
43   .align 3; \
44   cfi_startproc; \
45   .type symbol, @function; \
46   symbol:
47 
48 #define ENTRY(symbol) LEAF (symbol)
49 
50 /* Mark end of function.  */
51 #undef END
52 #define END(function) \
53   cfi_endproc; \
54   .size function, .- function;
55 
56 /* Stack alignment.  */
57 #define ALMASK ~15
58 
59 #endif /* sys/asm.h */
60