comparisons

package
v0.0.0-...-0de04ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DCMPG

type DCMPG struct{ base.NoOperandsInstruction }

DCMPG Compare double

func (*DCMPG) Execute

func (self *DCMPG) Execute(frame *rtda.Frame)

type DCMPL

type DCMPL struct{ base.NoOperandsInstruction }

func (*DCMPL) Execute

func (self *DCMPL) Execute(frame *rtda.Frame)

type FCMPG

type FCMPG struct{ base.NoOperandsInstruction }

FCMPG Compare float * 。由于浮点数计算有可能产生NaN(Not a Number)值,所以比较两个浮点数时,除了大于、等于、小于之外, 还有第4种结果:无法比较。

当两个float变量中至少有一个是NaN时,用fcmpg指 令比较的结果是1,而用fcmpl指令比较的结果是-1。

func (*FCMPG) Execute

func (self *FCMPG) Execute(frame *rtda.Frame)

type FCMPL

type FCMPL struct{ base.NoOperandsInstruction }

func (*FCMPL) Execute

func (self *FCMPL) Execute(frame *rtda.Frame)

type IFEQ

type IFEQ struct{ base.BranchInstruction }

IFEQ Branch if int comparison with zero succeeds * if<cond>指令把操作数栈顶的int变量弹出,然后跟0进行比较, 满足条件则跳转。假设从栈顶弹出的变量是x,则指令执行跳转操 作的条件如下:

·ifeq	:		x==0
·ifne	:		x!=0
·iflt	:		x<0
·ifle	:		x<=0·ifgt:x>0
·ifge	:		x>=0

由于比较指令最终表现为跳转指令。故继承 base.BranchInstruction

func (*IFEQ) Execute

func (self *IFEQ) Execute(frame *rtda.Frame)

type IFGE

type IFGE struct{ base.BranchInstruction }

func (*IFGE) Execute

func (self *IFGE) Execute(frame *rtda.Frame)

type IFGT

type IFGT struct{ base.BranchInstruction }

func (*IFGT) Execute

func (self *IFGT) Execute(frame *rtda.Frame)

type IFLE

type IFLE struct{ base.BranchInstruction }

func (*IFLE) Execute

func (self *IFLE) Execute(frame *rtda.Frame)

type IFLT

type IFLT struct{ base.BranchInstruction }

func (*IFLT) Execute

func (self *IFLT) Execute(frame *rtda.Frame)

type IFNE

type IFNE struct{ base.BranchInstruction }

func (*IFNE) Execute

func (self *IFNE) Execute(frame *rtda.Frame)

type IF_ACMPEQ

type IF_ACMPEQ struct{ base.BranchInstruction }

IF_ACMPEQ Branch if reference comparison succeeds

func (*IF_ACMPEQ) Execute

func (self *IF_ACMPEQ) Execute(frame *rtda.Frame)

type IF_ACMPNE

type IF_ACMPNE struct{ base.BranchInstruction }

func (*IF_ACMPNE) Execute

func (self *IF_ACMPNE) Execute(frame *rtda.Frame)

type IF_ICMPEQ

type IF_ICMPEQ struct{ base.BranchInstruction }

IF_ICMPEQ Branch if int comparison succeeds

func (*IF_ICMPEQ) Execute

func (self *IF_ICMPEQ) Execute(frame *rtda.Frame)

type IF_ICMPGE

type IF_ICMPGE struct{ base.BranchInstruction }

func (*IF_ICMPGE) Execute

func (self *IF_ICMPGE) Execute(frame *rtda.Frame)

type IF_ICMPGT

type IF_ICMPGT struct{ base.BranchInstruction }

func (*IF_ICMPGT) Execute

func (self *IF_ICMPGT) Execute(frame *rtda.Frame)

type IF_ICMPLE

type IF_ICMPLE struct{ base.BranchInstruction }

func (*IF_ICMPLE) Execute

func (self *IF_ICMPLE) Execute(frame *rtda.Frame)

type IF_ICMPLT

type IF_ICMPLT struct{ base.BranchInstruction }

func (*IF_ICMPLT) Execute

func (self *IF_ICMPLT) Execute(frame *rtda.Frame)

type IF_ICMPNE

type IF_ICMPNE struct{ base.BranchInstruction }

func (*IF_ICMPNE) Execute

func (self *IF_ICMPNE) Execute(frame *rtda.Frame)

type LCMP

type LCMP struct{ base.NoOperandsInstruction }

LCMP Compare long * 比较指令可以分为两类:一类将比较结果推入操作数栈顶,一 类根据比较结果跳转。比较指令是编译器实现if-else、for、while等 语句的基石

func (*LCMP) Execute

func (self *LCMP) Execute(frame *rtda.Frame)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL