(root)/
glibc-2.38/
sysdeps/
loongarch/
sys/
asm.h
       1  /* Miscellaneous macros.
       2     Copyright (C) 2022-2023 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 SZVREG 16
      29  #define SZXREG 32
      30  #define REG_L ld.d
      31  #define REG_S st.d
      32  #define SRLI srli.d
      33  #define SLLI slli.d
      34  #define ADDI addi.d
      35  #define ADD  add.d
      36  #define SUB  sub.d
      37  #define BSTRINS  bstrins.d
      38  #define LI  li.d
      39  #define FREG_L fld.d
      40  #define FREG_S fst.d
      41  
      42  /* Declare leaf routine.  */
      43  #define LEAF(symbol) \
      44    .text; \
      45    .globl symbol; \
      46    .align 3; \
      47    cfi_startproc; \
      48    .type symbol, @function; \
      49    symbol:
      50  
      51  #define ENTRY(symbol) LEAF (symbol)
      52  
      53  /* Mark end of function.  */
      54  #undef END
      55  #define END(function) \
      56    cfi_endproc; \
      57    .size function, .- function;
      58  
      59  /* Stack alignment.  */
      60  #define ALMASK ~15
      61  
      62  #endif /* sys/asm.h */