24
25 #ifndef SHARE_VM_OPTO_MULNODE_HPP
26 #define SHARE_VM_OPTO_MULNODE_HPP
27
28 #include "opto/node.hpp"
29 #include "opto/opcodes.hpp"
30 #include "opto/type.hpp"
31
32 // Portions of code courtesy of Clifford Click
33
34 class PhaseTransform;
35
36 //------------------------------MulNode----------------------------------------
37 // Classic MULTIPLY functionality. This covers all the usual 'multiply'
38 // behaviors for an algebraic ring. Multiply-integer, multiply-float,
39 // multiply-double, and binary-and are all inherited from this class. The
40 // various identity values are supplied by virtual functions.
41 class MulNode : public Node {
42 virtual uint hash() const;
43 public:
44 MulNode( Node *in1, Node *in2 ): Node(0,in1,in2) {
45 init_class_id(Class_Mul);
46 }
47
48 // Handle algebraic identities here. If we have an identity, return the Node
49 // we are equivalent to. We look for "add of zero" as an identity.
50 virtual Node *Identity( PhaseTransform *phase );
51
52 // We also canonicalize the Node, moving constants to the right input,
53 // and flatten expressions (so that 1+x+2 becomes x+3).
54 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
55
56 // Compute a new Type for this node. Basically we just do the pre-check,
57 // then call the virtual add() to set the type.
58 virtual const Type *Value( PhaseTransform *phase ) const;
59
60 // Supplied function returns the product of the inputs.
61 // This also type-checks the inputs for sanity. Guaranteed never to
62 // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
63 // This call recognizes the multiplicative zero type.
64 virtual const Type *mul_ring( const Type *, const Type * ) const = 0;
65
66 // Supplied function to return the multiplicative identity type
|
24
25 #ifndef SHARE_VM_OPTO_MULNODE_HPP
26 #define SHARE_VM_OPTO_MULNODE_HPP
27
28 #include "opto/node.hpp"
29 #include "opto/opcodes.hpp"
30 #include "opto/type.hpp"
31
32 // Portions of code courtesy of Clifford Click
33
34 class PhaseTransform;
35
36 //------------------------------MulNode----------------------------------------
37 // Classic MULTIPLY functionality. This covers all the usual 'multiply'
38 // behaviors for an algebraic ring. Multiply-integer, multiply-float,
39 // multiply-double, and binary-and are all inherited from this class. The
40 // various identity values are supplied by virtual functions.
41 class MulNode : public Node {
42 virtual uint hash() const;
43 public:
44 MulNode( Node *in1, Node *in2 ): Node(0,in1,in2) {}
45
46 // Handle algebraic identities here. If we have an identity, return the Node
47 // we are equivalent to. We look for "add of zero" as an identity.
48 virtual Node *Identity( PhaseTransform *phase );
49
50 // We also canonicalize the Node, moving constants to the right input,
51 // and flatten expressions (so that 1+x+2 becomes x+3).
52 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
53
54 // Compute a new Type for this node. Basically we just do the pre-check,
55 // then call the virtual add() to set the type.
56 virtual const Type *Value( PhaseTransform *phase ) const;
57
58 // Supplied function returns the product of the inputs.
59 // This also type-checks the inputs for sanity. Guaranteed never to
60 // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
61 // This call recognizes the multiplicative zero type.
62 virtual const Type *mul_ring( const Type *, const Type * ) const = 0;
63
64 // Supplied function to return the multiplicative identity type
|