From 74227f8cdfd6c90c51406e33be8cd798365b863a Mon Sep 17 00:00:00 2001 From: Blaise Tine Date: Mon, 2 Aug 2021 16:06:54 -0700 Subject: [PATCH] optimize startup routine --- runtime/src/vx_start.S | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/runtime/src/vx_start.S b/runtime/src/vx_start.S index 754a9850..e830d752 100644 --- a/runtime/src/vx_start.S +++ b/runtime/src/vx_start.S @@ -70,14 +70,13 @@ vx_set_sp: # allocate stack region for a threads on the processor # set stack pointer - la sp, __stack_top # load stack base address - la a1, __stack_size # stack size + li sp, SMEM_BASE_ADDR # load stack base address #if SM_ENABLE - csrr a2, CSR_LTID # get lobal thread id + csrr a2, CSR_LTID # get local thread id #else csrr a2, CSR_GTID # get global thread id #endif - mul a1, a1, a2 + slli a1, a2, STACK_LOG2_SIZE sub sp, sp, a1 # sub thread block # disable active warps except warp0