diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index c87e51a053b12..3c4a8019fcb46 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -354,6 +354,9 @@ if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then #elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__) # define ZEND_VM_FP_GLOBAL_REG "x27" # define ZEND_VM_IP_GLOBAL_REG "x28" +#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__riscv) && __riscv_xlen == 64 +# define ZEND_VM_FP_GLOBAL_REG "x18" +# define ZEND_VM_IP_GLOBAL_REG "x19" #else # error "global register variables are not supported" #endif diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a772e4564e083..28912f57244d6 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -64,6 +64,9 @@ # elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__) # define ZEND_VM_FP_GLOBAL_REG "x27" # define ZEND_VM_IP_GLOBAL_REG "x28" +#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__riscv) && __riscv_xlen == 64 +# define ZEND_VM_FP_GLOBAL_REG "x18" +# define ZEND_VM_IP_GLOBAL_REG "x19" # endif #endif