src/share/vm/opto/mathexactnode.hpp

Thu, 21 Nov 2013 12:30:35 -0800

author
kvn
date
Thu, 21 Nov 2013 12:30:35 -0800
changeset 6485
da862781b584
parent 6102
b957c650babb
child 6375
085b304a1cc5
permissions
-rw-r--r--

Merge

rbackman@5791 1 /*
rbackman@5791 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
rbackman@5791 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
rbackman@5791 4 *
rbackman@5791 5 * This code is free software; you can redistribute it and/or modify it
rbackman@5791 6 * under the terms of the GNU General Public License version 2 only, as
rbackman@5791 7 * published by the Free Software Foundation.
rbackman@5791 8 *
rbackman@5791 9 * This code is distributed in the hope that it will be useful, but WITHOUT
rbackman@5791 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rbackman@5791 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
rbackman@5791 12 * version 2 for more details (a copy is included in the LICENSE file that
rbackman@5791 13 * accompanied this code).
rbackman@5791 14 *
rbackman@5791 15 * You should have received a copy of the GNU General Public License version
rbackman@5791 16 * 2 along with this work; if not, write to the Free Software Foundation,
rbackman@5791 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rbackman@5791 18 *
rbackman@5791 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
rbackman@5791 20 * or visit www.oracle.com if you need additional information or have any
rbackman@5791 21 * questions.
rbackman@5791 22 *
rbackman@5791 23 */
rbackman@5791 24
rbackman@5791 25 #ifndef SHARE_VM_OPTO_MATHEXACTNODE_HPP
rbackman@5791 26 #define SHARE_VM_OPTO_MATHEXACTNODE_HPP
rbackman@5791 27
rbackman@5791 28 #include "opto/multnode.hpp"
rbackman@5791 29 #include "opto/node.hpp"
rbackman@5927 30 #include "opto/subnode.hpp"
rbackman@5791 31 #include "opto/type.hpp"
rbackman@5791 32
rbackman@5927 33 class BoolNode;
rbackman@5927 34 class IfNode;
rbackman@5791 35 class Node;
rbackman@5791 36
rbackman@5791 37 class PhaseGVN;
rbackman@5791 38 class PhaseTransform;
rbackman@5791 39
rbackman@5791 40 class MathExactNode : public MultiNode {
rbackman@5791 41 public:
rbackman@5997 42 MathExactNode(Node* ctrl, Node* in1);
rbackman@5791 43 MathExactNode(Node* ctrl, Node* in1, Node* in2);
rbackman@5791 44 enum {
rbackman@5791 45 result_proj_node = 0,
rbackman@5791 46 flags_proj_node = 1
rbackman@5791 47 };
rbackman@5791 48 virtual int Opcode() const;
rbackman@5791 49 virtual Node* Identity(PhaseTransform* phase) { return this; }
rbackman@5791 50 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape) { return NULL; }
rbackman@5791 51 virtual const Type* Value(PhaseTransform* phase) const { return bottom_type(); }
rbackman@6102 52 virtual uint hash() const { return NO_HASH; }
rbackman@5791 53 virtual bool is_CFG() const { return false; }
rbackman@5791 54 virtual uint ideal_reg() const { return NotAMachineReg; }
rbackman@5791 55
rbackman@5927 56 ProjNode* result_node() const { return proj_out(result_proj_node); }
rbackman@5927 57 ProjNode* flags_node() const { return proj_out(flags_proj_node); }
rbackman@5927 58 Node* control_node() const;
rbackman@5927 59 Node* non_throwing_branch() const;
rbackman@5791 60 protected:
rbackman@5927 61 IfNode* if_node() const;
rbackman@5927 62 BoolNode* bool_node() const;
rbackman@5791 63 Node* no_overflow(PhaseGVN *phase, Node* new_result);
rbackman@5791 64 };
rbackman@5791 65
rbackman@5997 66 class MathExactINode : public MathExactNode {
rbackman@5997 67 public:
rbackman@5997 68 MathExactINode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {}
rbackman@5997 69 MathExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {}
rbackman@5997 70 virtual int Opcode() const;
rbackman@5997 71 virtual Node* match(const ProjNode* proj, const Matcher* m);
rbackman@5997 72 virtual const Type* bottom_type() const { return TypeTuple::INT_CC_PAIR; }
rbackman@5997 73 };
rbackman@5997 74
rbackman@5997 75 class MathExactLNode : public MathExactNode {
rbackman@5791 76 public:
rbackman@5997 77 MathExactLNode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {}
rbackman@5997 78 MathExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {}
rbackman@5791 79 virtual int Opcode() const;
rbackman@5791 80 virtual Node* match(const ProjNode* proj, const Matcher* m);
rbackman@5997 81 virtual const Type* bottom_type() const { return TypeTuple::LONG_CC_PAIR; }
rbackman@5997 82 };
rbackman@5997 83
rbackman@5997 84 class AddExactINode : public MathExactINode {
rbackman@5997 85 public:
rbackman@5997 86 AddExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {}
rbackman@5997 87 virtual int Opcode() const;
rbackman@5791 88 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
rbackman@5791 89 };
rbackman@5791 90
rbackman@5997 91 class AddExactLNode : public MathExactLNode {
rbackman@5997 92 public:
rbackman@5997 93 AddExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {}
rbackman@5997 94 virtual int Opcode() const;
rbackman@5997 95 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 96 };
rbackman@5997 97
rbackman@5997 98 class SubExactINode : public MathExactINode {
rbackman@5997 99 public:
rbackman@5997 100 SubExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {}
rbackman@5997 101 virtual int Opcode() const;
rbackman@5997 102 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 103 };
rbackman@5997 104
rbackman@5997 105 class SubExactLNode : public MathExactLNode {
rbackman@5997 106 public:
rbackman@5997 107 SubExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {}
rbackman@5997 108 virtual int Opcode() const;
rbackman@5997 109 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 110 };
rbackman@5997 111
rbackman@5997 112 class NegExactINode : public MathExactINode {
rbackman@5997 113 public:
rbackman@5997 114 NegExactINode(Node* ctrl, Node* in1) : MathExactINode(ctrl, in1) {}
rbackman@5997 115 virtual int Opcode() const;
rbackman@5997 116 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 117 };
rbackman@5997 118
rbackman@5997 119 class NegExactLNode : public MathExactLNode {
rbackman@5997 120 public:
rbackman@5997 121 NegExactLNode(Node* ctrl, Node* in1) : MathExactLNode(ctrl, in1) {}
rbackman@5997 122 virtual int Opcode() const;
rbackman@5997 123 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 124 };
rbackman@5997 125
rbackman@5997 126 class MulExactINode : public MathExactINode {
rbackman@5997 127 public:
rbackman@5997 128 MulExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {}
rbackman@5997 129 virtual int Opcode() const;
rbackman@5997 130 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 131 };
rbackman@5997 132
rbackman@5997 133 class MulExactLNode : public MathExactLNode {
rbackman@5997 134 public:
rbackman@5997 135 MulExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {}
rbackman@5997 136 virtual int Opcode() const;
rbackman@5997 137 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
rbackman@5997 138 };
rbackman@5997 139
rbackman@5791 140 class FlagsProjNode : public ProjNode {
rbackman@5791 141 public:
rbackman@5791 142 FlagsProjNode(Node* src, uint con) : ProjNode(src, con) {
rbackman@5791 143 init_class_id(Class_FlagsProj);
rbackman@5791 144 }
rbackman@5791 145
rbackman@5791 146 virtual int Opcode() const;
rbackman@5791 147 virtual bool is_CFG() const { return false; }
rbackman@5791 148 virtual const Type* bottom_type() const { return TypeInt::CC; }
rbackman@5791 149 virtual uint ideal_reg() const { return Op_RegFlags; }
rbackman@5791 150 };
rbackman@5791 151
rbackman@5791 152
rbackman@5791 153 #endif
rbackman@5791 154

mercurial