Package com.tonic.analysis.instruction
Enum ArithmeticInstruction.ArithmeticType
- java.lang.Object
-
- java.lang.Enum<ArithmeticInstruction.ArithmeticType>
-
- com.tonic.analysis.instruction.ArithmeticInstruction.ArithmeticType
-
- All Implemented Interfaces:
Serializable,Comparable<ArithmeticInstruction.ArithmeticType>
- Enclosing class:
- ArithmeticInstruction
public static enum ArithmeticInstruction.ArithmeticType extends Enum<ArithmeticInstruction.ArithmeticType>
The arithmetic operation kinds, each pairing a JVM opcode with its mnemonic.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DADDAdds two doubles, rounding to the nearest representable double.DDIVDivides two doubles; a zero divisor yields infinity or NaN instead of throwing.DMULMultiplies two doubles, rounding to the nearest representable double.DREMDouble remainder, taking the sign of the dividend; a zero divisor yields NaN.DSUBSubtracts the topmost double from the one beneath it.FADDAdds two floats, rounding to the nearest representable float.FDIVDivides two floats; a zero divisor yields infinity or NaN instead of throwing.FMULMultiplies two floats, rounding to the nearest representable float.FREMFloat remainder, taking the sign of the dividend; a zero divisor yields NaN.FSUBSubtracts the topmost float from the one beneath it.IADDAdds two ints, wrapping silently on overflow.IDIVDivides two ints, truncating toward zero and throwing on a zero divisor.IMULMultiplies two ints, keeping only the low 32 bits of the product.IREMInt remainder, taking the sign of the dividend and throwing on a zero divisor.ISUBSubtracts the topmost int from the one beneath it, wrapping on overflow.LADDAdds two longs, wrapping silently on overflow; each operand is two stack words.LDIVDivides two longs, truncating toward zero and throwing on a zero divisor.LMULMultiplies two longs, keeping only the low 64 bits of the product.LREMLong remainder, taking the sign of the dividend and throwing on a zero divisor.LSUBSubtracts the topmost long from the one beneath it, wrapping on overflow.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ArithmeticInstruction.ArithmeticTypefromOpcode(int opcode)Looks up the arithmetic type for a JVM opcode.StringgetMnemonic()intgetOpcode()static ArithmeticInstruction.ArithmeticTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ArithmeticInstruction.ArithmeticType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IADD
public static final ArithmeticInstruction.ArithmeticType IADD
Adds two ints, wrapping silently on overflow.
-
LADD
public static final ArithmeticInstruction.ArithmeticType LADD
Adds two longs, wrapping silently on overflow; each operand is two stack words.
-
FADD
public static final ArithmeticInstruction.ArithmeticType FADD
Adds two floats, rounding to the nearest representable float.
-
DADD
public static final ArithmeticInstruction.ArithmeticType DADD
Adds two doubles, rounding to the nearest representable double.
-
ISUB
public static final ArithmeticInstruction.ArithmeticType ISUB
Subtracts the topmost int from the one beneath it, wrapping on overflow.
-
LSUB
public static final ArithmeticInstruction.ArithmeticType LSUB
Subtracts the topmost long from the one beneath it, wrapping on overflow.
-
FSUB
public static final ArithmeticInstruction.ArithmeticType FSUB
Subtracts the topmost float from the one beneath it.
-
DSUB
public static final ArithmeticInstruction.ArithmeticType DSUB
Subtracts the topmost double from the one beneath it.
-
IMUL
public static final ArithmeticInstruction.ArithmeticType IMUL
Multiplies two ints, keeping only the low 32 bits of the product.
-
LMUL
public static final ArithmeticInstruction.ArithmeticType LMUL
Multiplies two longs, keeping only the low 64 bits of the product.
-
FMUL
public static final ArithmeticInstruction.ArithmeticType FMUL
Multiplies two floats, rounding to the nearest representable float.
-
DMUL
public static final ArithmeticInstruction.ArithmeticType DMUL
Multiplies two doubles, rounding to the nearest representable double.
-
IDIV
public static final ArithmeticInstruction.ArithmeticType IDIV
Divides two ints, truncating toward zero and throwing on a zero divisor.
-
LDIV
public static final ArithmeticInstruction.ArithmeticType LDIV
Divides two longs, truncating toward zero and throwing on a zero divisor.
-
FDIV
public static final ArithmeticInstruction.ArithmeticType FDIV
Divides two floats; a zero divisor yields infinity or NaN instead of throwing.
-
DDIV
public static final ArithmeticInstruction.ArithmeticType DDIV
Divides two doubles; a zero divisor yields infinity or NaN instead of throwing.
-
IREM
public static final ArithmeticInstruction.ArithmeticType IREM
Int remainder, taking the sign of the dividend and throwing on a zero divisor.
-
LREM
public static final ArithmeticInstruction.ArithmeticType LREM
Long remainder, taking the sign of the dividend and throwing on a zero divisor.
-
FREM
public static final ArithmeticInstruction.ArithmeticType FREM
Float remainder, taking the sign of the dividend; a zero divisor yields NaN.
-
DREM
public static final ArithmeticInstruction.ArithmeticType DREM
Double remainder, taking the sign of the dividend; a zero divisor yields NaN.
-
-
Method Detail
-
values
public static ArithmeticInstruction.ArithmeticType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ArithmeticInstruction.ArithmeticType c : ArithmeticInstruction.ArithmeticType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ArithmeticInstruction.ArithmeticType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getOpcode
public int getOpcode()
- Returns:
- the opcode
-
getMnemonic
public String getMnemonic()
- Returns:
- the mnemonic
-
fromOpcode
public static ArithmeticInstruction.ArithmeticType fromOpcode(int opcode)
Looks up the arithmetic type for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching type, or null if the opcode is not an arithmetic opcode
-
-