harpoon.IR.Tree
Class Uop

java.lang.Object
  extended by harpoon.IR.Tree.Uop

public class Uop
extends Object

Uop is an enumerated type for UNOPs. Operations are typed: pointer (P), integer (I), long (L), float (F) or double (D).

See Bop for basic rationale. We provide full set of conversion operations and both negation and bitwise-not. Some of these Uops are not in harpoon.IR.Quads.Qop and thus will require pattern-matching during translation for proper generation. This could also be done in a peephole optimization.

Version:
$Id: Uop.java,v 1.2 2002/02/25 21:05:42 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Field Summary
static int _2D
          Converts to double.
static int _2F
          Converts to float.
static int _2I
          Converts to int.
static int _2L
          Converts to long.
static int I2B
          Converts an int to a byte.
static int I2C
          Converts an int to a character.
static int I2S
          Converts an int to a short.
static int NEG
          Negation (-).
static int NOT
          Bit-wise NOT (~).
 
Constructor Summary
Uop()
           
 
Method Summary
static boolean isValid(int op)
          Determines if the given Uop value is valid.
static String toString(int op)
          Converts the enumerated Uop value to a human-readable string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEG

public static final int NEG
Negation (-).

See Also:
Constant Field Values

NOT

public static final int NOT
Bit-wise NOT (~).

See Also:
Constant Field Values

I2B

public static final int I2B
Converts an int to a byte. Result is still int type, but it is truncated to 8 bits, then sign extended.

See Also:
Constant Field Values

I2C

public static final int I2C
Converts an int to a character. Result is still int type, but is truncated to 16 bits. No sign extension.

See Also:
Constant Field Values

I2S

public static final int I2S
Converts an int to a short. Result is still int type, but is truncated to 16 bits, then sign extended.

See Also:
Constant Field Values

_2I

public static final int _2I
Converts to int.

See Also:
Constant Field Values

_2L

public static final int _2L
Converts to long.

See Also:
Constant Field Values

_2F

public static final int _2F
Converts to float.

See Also:
Constant Field Values

_2D

public static final int _2D
Converts to double.

See Also:
Constant Field Values
Constructor Detail

Uop

public Uop()
Method Detail

isValid

public static boolean isValid(int op)
Determines if the given Uop value is valid.


toString

public static String toString(int op)
Converts the enumerated Uop value to a human-readable string.