Skip to content

Commit 2778b5d

Browse files
authored
zend vm savee registers support for riscv 64. (#11773)
x8 being already reserved, we can only pull x18 to x27.
1 parent 6602dde commit 2778b5d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Zend/Zend.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
354354
#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__)
355355
# define ZEND_VM_FP_GLOBAL_REG "x27"
356356
# define ZEND_VM_IP_GLOBAL_REG "x28"
357+
#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__riscv) && __riscv_xlen == 64
358+
# define ZEND_VM_FP_GLOBAL_REG "x18"
359+
# define ZEND_VM_IP_GLOBAL_REG "x19"
357360
#else
358361
# error "global register variables are not supported"
359362
#endif

Zend/zend_execute.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
# elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__)
6565
# define ZEND_VM_FP_GLOBAL_REG "x27"
6666
# define ZEND_VM_IP_GLOBAL_REG "x28"
67+
#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__riscv) && __riscv_xlen == 64
68+
# define ZEND_VM_FP_GLOBAL_REG "x18"
69+
# define ZEND_VM_IP_GLOBAL_REG "x19"
6770
# endif
6871
#endif
6972

0 commit comments

Comments
 (0)