From f6e5ad5877eba8e8996831f27fcc6841dba361c0 Mon Sep 17 00:00:00 2001 From: ishland Date: Thu, 12 Dec 2024 16:23:37 +0800 Subject: [PATCH] fix: strict math --- .../com/ishland/c2me/opts/dfc/common/ast/binary/MaxNode.java | 5 +++++ .../com/ishland/c2me/opts/dfc/common/ast/binary/MinNode.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MaxNode.java b/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MaxNode.java index b6992f36..dc63a4e9 100644 --- a/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MaxNode.java +++ b/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MaxNode.java @@ -32,6 +32,11 @@ public void evalMulti(double[] res, int[] x, int[] y, int[] z, EvalType type) { } } + @Override + public boolean canSwapOperandsSafely() { + return false; + } + @Override public void doBytecodeGenSingle(BytecodeGen.Context context, InstructionAdapter m, BytecodeGen.Context.LocalVarConsumer localVarConsumer) { super.doBytecodeGenSingle(context, m, localVarConsumer); diff --git a/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MinNode.java b/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MinNode.java index 48bf605a..6d215dba 100644 --- a/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MinNode.java +++ b/c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/binary/MinNode.java @@ -32,6 +32,11 @@ public void evalMulti(double[] res, int[] x, int[] y, int[] z, EvalType type) { } } + @Override + public boolean canSwapOperandsSafely() { + return false; + } + @Override public void doBytecodeGenSingle(BytecodeGen.Context context, InstructionAdapter m, BytecodeGen.Context.LocalVarConsumer localVarConsumer) { super.doBytecodeGenSingle(context, m, localVarConsumer);