grow_stack_align.S 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  2. // See https://llvm.org/LICENSE.txt for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "../assembly.h"
  5. // grow_stack routine
  6. // This routine is VE specific
  7. // https://www.nec.com/en/global/prod/hpc/aurora/document/VE-ABI_v1.1.pdf
  8. // destroy %s62 and %s63 only
  9. #ifdef __ve__
  10. .text
  11. .p2align 4
  12. DEFINE_COMPILERRT_FUNCTION(__ve_grow_stack_align)
  13. subu.l %sp, %sp, %s0 # sp -= alloca size
  14. and %sp, %sp, %s1 # align sp
  15. brge.l.t %sp, %sl, 1f
  16. ld %s63, 0x18(,%tp) # load param area
  17. lea %s62, 0x13b # syscall # of grow
  18. shm.l %s62, 0x0(%s63) # stored at addr:0
  19. shm.l %sl, 0x8(%s63) # old limit at addr:8
  20. shm.l %sp, 0x10(%s63) # new limit at addr:16
  21. monc
  22. 1:
  23. b.l (,%lr)
  24. END_COMPILERRT_FUNCTION(__ve_grow_stack_align)
  25. #endif // __ve__