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