src/share/vm/opto/mathexactnode.hpp

Fri, 27 Sep 2013 08:39:19 +0200

author
rbackman
date
Fri, 27 Sep 2013 08:39:19 +0200
changeset 5791
c9ccd7b85f20
child 5927
4a2acfb16e97
permissions
-rw-r--r--

8024924: Intrinsify java.lang.Math.addExact
Reviewed-by: kvn, twisti

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@5791 30 #include "opto/type.hpp"
rbackman@5791 31
rbackman@5791 32 class Node;
rbackman@5791 33
rbackman@5791 34 class PhaseGVN;
rbackman@5791 35 class PhaseTransform;
rbackman@5791 36
rbackman@5791 37 class MathExactNode : public MultiNode {
rbackman@5791 38 public:
rbackman@5791 39 MathExactNode(Node* ctrl, Node* in1, Node* in2);
rbackman@5791 40 enum {
rbackman@5791 41 result_proj_node = 0,
rbackman@5791 42 flags_proj_node = 1
rbackman@5791 43 };
rbackman@5791 44 virtual int Opcode() const;
rbackman@5791 45 virtual Node* Identity(PhaseTransform* phase) { return this; }
rbackman@5791 46 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape) { return NULL; }
rbackman@5791 47 virtual const Type* Value(PhaseTransform* phase) const { return bottom_type(); }
rbackman@5791 48 virtual uint hash() const { return Node::hash(); }
rbackman@5791 49 virtual bool is_CFG() const { return false; }
rbackman@5791 50 virtual uint ideal_reg() const { return NotAMachineReg; }
rbackman@5791 51
rbackman@5791 52 ProjNode* result_node() { return proj_out(result_proj_node); }
rbackman@5791 53 ProjNode* flags_node() { return proj_out(flags_proj_node); }
rbackman@5791 54 protected:
rbackman@5791 55 Node* no_overflow(PhaseGVN *phase, Node* new_result);
rbackman@5791 56 };
rbackman@5791 57
rbackman@5791 58 class AddExactINode : public MathExactNode {
rbackman@5791 59 public:
rbackman@5791 60 AddExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {}
rbackman@5791 61 virtual int Opcode() const;
rbackman@5791 62 virtual const Type* bottom_type() const { return TypeTuple::INT_CC_PAIR; }
rbackman@5791 63 virtual Node* match(const ProjNode* proj, const Matcher* m);
rbackman@5791 64 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
rbackman@5791 65 };
rbackman@5791 66
rbackman@5791 67 class FlagsProjNode : public ProjNode {
rbackman@5791 68 public:
rbackman@5791 69 FlagsProjNode(Node* src, uint con) : ProjNode(src, con) {
rbackman@5791 70 init_class_id(Class_FlagsProj);
rbackman@5791 71 }
rbackman@5791 72
rbackman@5791 73 virtual int Opcode() const;
rbackman@5791 74 virtual bool is_CFG() const { return false; }
rbackman@5791 75 virtual const Type* bottom_type() const { return TypeInt::CC; }
rbackman@5791 76 virtual uint ideal_reg() const { return Op_RegFlags; }
rbackman@5791 77 };
rbackman@5791 78
rbackman@5791 79
rbackman@5791 80 #endif
rbackman@5791 81

mercurial