Skip to content

Commit 5557d15

Browse files
committed
JIT ARM64: Fixed NaN handling
1 parent 6e08668 commit 5557d15

File tree

1 file changed

+19
-26
lines changed

1 file changed

+19
-26
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8076,51 +8076,47 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
80768076
if (set_bool) {
80778077
if (exit_addr) {
80788078
if (branch_opcode == ZEND_JMPNZ || branch_opcode == ZEND_JMPNZ_EX) {
8079-
| bvs >1
80808079
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE, TMP1w, TMP2
8080+
| bvs &exit_addr
80818081
| bne &exit_addr
8082-
|1:
80838082
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE, TMP1w, TMP2
80848083
} else {
8085-
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE, TMP1w, TMP2
80868084
| bvs >1
8085+
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE, TMP1w, TMP2
80878086
| beq &exit_addr
80888087
|1:
80898088
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE, TMP1w, TMP2
80908089
}
80918090
} else if (false_label != (uint32_t)-1) { // JMPZ_EX
8092-
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE, TMP1w, TMP2
80938091
| bvs >1
8092+
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE, TMP1w, TMP2
80948093
| beq => false_label
8095-
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE, TMP1w, TMP2
80968094
|1:
8095+
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE, TMP1w, TMP2
80978096
} else if (true_label != (uint32_t)-1) { // JMPNZ_EX
8098-
| bvs >1
80998097
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE, TMP1w, TMP2
8098+
| bvs => true_label
81008099
| bne => true_label
8101-
|1:
81028100
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE, TMP1w, TMP2
81038101
} else if (set_bool_not) { // BOOL_NOT
8102+
| mov REG0w, #IS_FALSE
81048103
| bvs >1
8104+
| bne >1
81058105
| mov REG0w, #IS_TRUE
8106-
| beq >2
81078106
|1:
8108-
| mov REG0w, #IS_FALSE
8109-
|2:
81108107
| SET_ZVAL_TYPE_INFO_FROM_REG res_addr, REG0w, TMP1
81118108
} else { // BOOL
8112-
| bvs >1
81138109
| mov REG0w, #IS_TRUE
8114-
| bne >2
8115-
|1:
8110+
| bvs >1
8111+
| bne >1
81168112
| mov REG0w, #IS_FALSE
8117-
|2:
8113+
|1:
81188114
| SET_ZVAL_TYPE_INFO_FROM_REG res_addr, REG0w, TMP1
81198115
}
81208116
} else {
81218117
if (exit_addr) {
81228118
if (branch_opcode == ZEND_JMPNZ || branch_opcode == ZEND_JMPNZ_EX) {
8123-
| bvs >1
8119+
| bvs &exit_addr
81248120
| bne &exit_addr
81258121
|1:
81268122
} else {
@@ -8130,20 +8126,17 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
81308126
}
81318127
} else {
81328128
ZEND_ASSERT(true_label != (uint32_t)-1 || false_label != (uint32_t)-1);
8133-
if (false_label != (uint32_t)-1) {
8134-
| bvs =>false_label
8135-
} else {
8136-
| bvs >1
8137-
}
8138-
if (true_label != (uint32_t)-1) {
8139-
| bne =>true_label
8140-
if (false_label != (uint32_t)-1) {
8141-
| b =>false_label
8129+
if (false_label != (uint32_t)-1 ) {
8130+
| bvs >1
8131+
| beq => false_label
8132+
|1:
8133+
if (true_label != (uint32_t)-1) {
8134+
| b =>true_label
81428135
}
81438136
} else {
8144-
| beq =>false_label
8137+
| bvs => true_label
8138+
| bne => true_label
81458139
}
8146-
|1:
81478140
}
81488141
}
81498142
} else if (op1_info & (MAY_BE_ANY - (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG))) {

0 commit comments

Comments
 (0)