mirror of
https://github.com/open-goal/jak-project
synced 2026-09-03 02:14:07 -04:00
[goalc] fix bug in subtraction (#2399)
fixes the turrets pointing down in fortress dump mission Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
This commit is contained in:
@@ -321,15 +321,12 @@ Val* Compiler::compile_sub(const goos::Object& form, const goos::Object& rest, E
|
||||
auto result = compile_integer(0, env)->to_gpr(form, env);
|
||||
env->emit_ir<IR_IntegerMath>(
|
||||
form, IntegerMathKind::SUB_64, result,
|
||||
to_math_type(form, compile_error_guard(args.unnamed.at(0), env), math_type, env)
|
||||
->to_gpr(form, env));
|
||||
to_math_type(form, first_val, math_type, env)->to_gpr(form, env));
|
||||
return result;
|
||||
} else {
|
||||
auto result = env->make_gpr(first_type);
|
||||
env->emit_ir<IR_RegSet>(
|
||||
form, result,
|
||||
to_math_type(form, compile_error_guard(args.unnamed.at(0), env), math_type, env)
|
||||
->to_gpr(form, env));
|
||||
env->emit_ir<IR_RegSet>(form, result,
|
||||
to_math_type(form, first_val, math_type, env)->to_gpr(form, env));
|
||||
|
||||
for (size_t i = 1; i < args.unnamed.size(); i++) {
|
||||
env->emit_ir<IR_IntegerMath>(
|
||||
@@ -345,15 +342,12 @@ Val* Compiler::compile_sub(const goos::Object& form, const goos::Object& rest, E
|
||||
auto result = compile_float(0, env, env->function_env()->segment)->to_fpr(form, env);
|
||||
env->emit_ir<IR_FloatMath>(
|
||||
form, FloatMathKind::SUB_SS, result,
|
||||
to_math_type(form, compile_error_guard(args.unnamed.at(0), env), math_type, env)
|
||||
->to_fpr(form, env));
|
||||
to_math_type(form, first_val, math_type, env)->to_fpr(form, env));
|
||||
return result;
|
||||
} else {
|
||||
auto result = env->make_fpr(first_type);
|
||||
env->emit_ir<IR_RegSet>(
|
||||
form, result,
|
||||
to_math_type(form, compile_error_guard(args.unnamed.at(0), env), math_type, env)
|
||||
->to_fpr(form, env));
|
||||
env->emit_ir<IR_RegSet>(form, result,
|
||||
to_math_type(form, first_val, math_type, env)->to_fpr(form, env));
|
||||
|
||||
for (size_t i = 1; i < args.unnamed.size(); i++) {
|
||||
env->emit_ir<IR_FloatMath>(
|
||||
|
||||
Reference in New Issue
Block a user