Skip to content

Commit 32d189d

Browse files
author
wangfei_chen
committed
RISC-V: refine fpu reg context offset
The index 0 and 1 are general register which should depends on _XLEN_. Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
1 parent bb47bc0 commit 32d189d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

portable/GCC/RISC-V/portContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
.macro portcontexSAVE_FPU_CONTEXT
104104
addi sp, sp, -( portFPU_CONTEXT_SIZE )
105105
/* Store the FPU registers. */
106-
store_f f0, 2 * portFPU_REG_SIZE( sp )
106+
store_f f0, 2 * portWORD_SIZE( sp )
107107
store_f f1, 3 * portFPU_REG_SIZE( sp )
108108
store_f f2, 4 * portFPU_REG_SIZE( sp )
109109
store_f f3, 5 * portFPU_REG_SIZE( sp )
@@ -142,7 +142,7 @@ store_x t0, 34 * portFPU_REG_SIZE( sp )
142142

143143
.macro portcontextRESTORE_FPU_CONTEXT
144144
/* Restore the FPU registers. */
145-
load_f f0, 2 * portFPU_REG_SIZE( sp )
145+
load_f f0, 2 * portWORD_SIZE( sp )
146146
load_f f1, 3 * portFPU_REG_SIZE( sp )
147147
load_f f2, 4 * portFPU_REG_SIZE( sp )
148148
load_f f3, 5 * portFPU_REG_SIZE( sp )

0 commit comments

Comments
 (0)