mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-13 15:11:32 +00:00
set m_op as well when doing a-(-b) => a+b peephole
This commit is contained in:
parent
465941f357
commit
13bcb5c5b1
1 changed files with 2 additions and 2 deletions
4
ast.cpp
4
ast.cpp
|
@ -301,11 +301,11 @@ ast_binary::ast_binary(lex_ctx_t ctx, int op,
|
|||
/* make a-(-b) => a + b */
|
||||
if (unary->m_op == VINSTR_NEG_F || unary->m_op == VINSTR_NEG_V) {
|
||||
if (op == INSTR_SUB_F) {
|
||||
op = INSTR_ADD_F;
|
||||
op = m_op = INSTR_ADD_F;
|
||||
right = normal;
|
||||
++opts_optimizationcount[OPTIM_PEEPHOLE];
|
||||
} else if (op == INSTR_SUB_V) {
|
||||
op = INSTR_ADD_V;
|
||||
op = m_op = INSTR_ADD_V;
|
||||
right = normal;
|
||||
++opts_optimizationcount[OPTIM_PEEPHOLE];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue