sub_f32 -> sub_f32_imm more sanely
Change-Id: Ic89359cd08298e73011952452ce909291d6f3fe9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269947
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/src/core/SkVM.cpp b/src/core/SkVM.cpp
index 9e4b6bf..2528726 100644
--- a/src/core/SkVM.cpp
+++ b/src/core/SkVM.cpp
@@ -362,7 +362,6 @@
default: break;
case Op::add_f32: imm_op = Op::add_f32_imm; goto try_imm_x_and_y;
- case Op::sub_f32: imm_op = Op::sub_f32_imm; goto try_imm_y;
case Op::mul_f32: imm_op = Op::mul_f32_imm; goto try_imm_x_and_y;
case Op::min_f32: imm_op = Op::min_f32_imm; goto try_imm_x_and_y;
case Op::max_f32: imm_op = Op::max_f32_imm; goto try_imm_x_and_y;
@@ -376,14 +375,19 @@
inst.x = inst.y;
inst.y = NA;
inst.immy = bits;
- } else
- try_imm_y:
- if (int bits; this->allImm(inst.y, &bits)) {
+ } else if (int bits; this->allImm(inst.y, &bits)) {
inst.op = imm_op;
inst.y = NA;
inst.immy = bits;
} break;
+ case Op::sub_f32:
+ if (int bits; this->allImm(inst.y, &bits)) {
+ inst.op = Op::sub_f32_imm;
+ inst.y = NA;
+ inst.immy = bits;
+ } break;
+
case Op::bit_clear:
if (int bits; this->allImm(inst.y, &bits)) {
inst.op = Op::bit_and_imm;