From cd61fdf295b2679d7643bddca0b2644071b1575e Mon Sep 17 00:00:00 2001 From: zhangxun <1958638841@qq.com> Date: Thu, 10 Jul 2025 16:10:35 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20float32=20?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E6=8C=87=E4=BB=A4=E7=9A=84=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jcnc/snow/vm/engine/VMOpCode.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java index fcf9e49..3fa44e2 100644 --- a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java +++ b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java @@ -2218,11 +2218,34 @@ public class VMOpCode { // endregion Long64 // region Float32 (0x00D4-0xD8) - + /** + * F2B Opcode: Represents the type conversion operation from float32 to byte8 in the virtual machine. + *

This opcode is implemented by the {@link F2BCommand} class, which defines its specific execution logic.

+ * + *

Execution Steps:

+ *
    + *
  1. Pop the top float32 value from the operand stack.
  2. + *
  3. Convert the float32 value to a byte8 value (this may involve truncation).
  4. + *
  5. Push the converted byte8 value back onto the operand stack for subsequent operations.
  6. + *
+ * + *

This opcode is used to convert a float32 value to a byte8 type for further integer-based operations or comparisons.

+ */ public static final int F2B = 0x00D4; - + /** + * F2S Opcode: Represents the type conversion operation from float32 to short16 in the virtual machine. + *

This opcode is implemented by the {@link F2SCommand} class, which defines its specific execution logic.

+ * + *

Execution Steps:

+ *
    + *
  1. Pop the top float32 value from the operand stack.
  2. + *
  3. Convert the float32 value to a short16 value (this may involve truncation).
  4. + *
  5. Push the converted short16 value back onto the operand stack for subsequent operations.
  6. + *
+ * + *

This opcode is used to convert a float32 value to a short16 type for further integer-based operations or comparisons.

+ */ public static final int F2S = 0x00D5; - /** * F2I Opcode: Represents the type conversion operation from float32 to int32 in the virtual machine. *

This opcode is implemented by the {@link F2ICommand} class, which defines its specific execution logic.

@@ -2296,7 +2319,6 @@ public class VMOpCode { *

This opcode is used to narrow a double64 value to a short16 type for further integer-based processing.

*/ public static final int D2S = 0x00DA; - /** * D2I Opcode: Represents the type conversion operation from double64 to int32 in the virtual machine. *

This opcode is implemented by the {@link D2ICommand} class, which defines its specific execution logic.