[php-src] jit-arm64: Add the missing parts for macros ZVAL_COPY_CONST and ZVAL_COPY_CONST_2
| From: | Hao Sun | Date: | Wed, 28 Apr 2021 02:24:18 +0000 |
| Subject: | [php-src] jit-arm64: Add the missing parts for macros ZVAL_COPY_CONST and ZVAL_COPY_CONST_2 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-115909@lists.php.net to get a copy of this message | ||
Author: Hao Sun (shqking)
Date: 2021-04-28T02:23:52Z
Commit: https://github.com/php/php-src/commit/24c6f804179a7b815de24f874975b710b2a34243
Raw diff: https://github.com/php/php-src/commit/24c6f804179a7b815de24f874975b710b2a34243.diff
Add the missing parts for macros ZVAL_COPY_CONST and ZVAL_COPY_CONST_2
This patch adds the missing parts.
Change-Id: I5ce0128a2ebf7cf73ec109d44dc4aabfd02260f2
Changed paths:
M ext/opcache/jit/zend_jit_arm64.dasc
Diff:
diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc
index 08157b030520..d85bfcccdb46 100644
--- a/ext/opcache/jit/zend_jit_arm64.dasc
+++ b/ext/opcache/jit/zend_jit_arm64.dasc
@@ -999,7 +999,9 @@ static int logical_immediate_p (uint64_t value, uint32_t reg_size)
| ldr Rd(dst_reg-ZREG_V0), [Rx(tmp_reg1)]
| SET_ZVAL_DVAL dst_addr, dst_reg, tmp_reg2
|| } else if (Z_TYPE_P(zv) == IS_LONG && dst_def_info == MAY_BE_DOUBLE) {
-| NIY // TODO:
+|| zend_reg dst_reg = (Z_MODE(dst_addr) == IS_REG) ? Z_REG(dst_addr) : fp_tmp_reg;
+| DOUBLE_GET_LONG dst_reg, Z_LVAL_P(zv), tmp_reg1
+| SET_ZVAL_DVAL dst_addr, dst_reg, tmp_reg2
|| } else {
| // In x64, if the range of this LONG value can be represented via INT type, only move the low
32 bits into dst_addr.
| // Note that imm32 is signed extended to 64 bits during mov.
@@ -1029,7 +1031,17 @@ static int logical_immediate_p (uint64_t value, uint32_t reg_size)
| SET_ZVAL_DVAL dst_addr, dst_reg, tmp_reg2
| SET_ZVAL_DVAL res_addr, dst_reg, tmp_reg2
|| } else if (Z_TYPE_P(zv) == IS_LONG && dst_def_info == MAY_BE_DOUBLE) {
-| NIY // TODO:
+|| if (Z_MODE(dst_addr) == IS_REG) {
+| DOUBLE_GET_LONG Z_REG(dst_addr), Z_LVAL_P(zv), tmp_reg1
+| SET_ZVAL_DVAL res_addr, Z_REG(dst_addr), tmp_reg2
+|| } else if (Z_MODE(res_addr) == IS_REG) {
+| DOUBLE_GET_LONG Z_REG(res_addr), Z_LVAL_P(zv), tmp_reg1
+| SET_ZVAL_DVAL dst_addr, Z_REG(res_addr), tmp_reg2
+|| } else {
+| DOUBLE_GET_LONG fp_tmp_reg, Z_LVAL_P(zv), tmp_reg1
+| SET_ZVAL_DVAL dst_addr, fp_tmp_reg, tmp_reg2
+| SET_ZVAL_DVAL res_addr, fp_tmp_reg, tmp_reg2
+|| }
|| } else {
|| if (Z_MODE(dst_addr) == IS_REG) {
| SET_ZVAL_LVAL dst_addr, Z_LVAL_P(zv), Rx(tmp_reg1), Rx(tmp_reg2)