mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-31 20:10:35 +00:00
fix 0-x being turned into x
This commit is contained in:
parent
99de3cf4f5
commit
de14d514f3
1 changed files with 6 additions and 2 deletions
8
fold.c
8
fold.c
|
@ -799,8 +799,10 @@ static ast_expression *fold_superfluous(ast_expression *left, ast_expression *ri
|
|||
break;
|
||||
|
||||
|
||||
case INSTR_ADD_F:
|
||||
case INSTR_SUB_F:
|
||||
if (swapped)
|
||||
return NULL;
|
||||
case INSTR_ADD_F:
|
||||
if (fold_immvalue_float(load) == 0.0f) {
|
||||
++opts_optimizationcount[OPTIM_PEEPHOLE];
|
||||
ast_unref(right);
|
||||
|
@ -816,8 +818,10 @@ static ast_expression *fold_superfluous(ast_expression *left, ast_expression *ri
|
|||
}
|
||||
break;
|
||||
|
||||
case INSTR_ADD_V:
|
||||
case INSTR_SUB_V:
|
||||
if (swapped)
|
||||
return NULL;
|
||||
case INSTR_ADD_V:
|
||||
if (vec3_cmp(fold_immvalue_vector(load), vec3_create(0, 0, 0))) {
|
||||
++opts_optimizationcount[OPTIM_PEEPHOLE];
|
||||
ast_unref(right);
|
||||
|
|
Loading…
Reference in a new issue