< prev index next >

src/hotspot/share/opto/convertnode.hpp

Print this page

  1 /*
  2  * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_OPTO_CONVERTNODE_HPP
 26 #define SHARE_OPTO_CONVERTNODE_HPP
 27 
 28 #include "opto/node.hpp"
 29 #include "opto/opcodes.hpp"
 30 
 31 
 32 //------------------------------Conv2BNode-------------------------------------
 33 // Convert int/pointer to a Boolean.  Map zero to zero, all else to 1.
 34 class Conv2BNode : public Node {
 35   public:
 36   Conv2BNode( Node *i ) : Node(0,i) {}
 37   virtual int Opcode() const;
 38   virtual const Type *bottom_type() const { return TypeInt::BOOL; }
 39   virtual Node* Identity(PhaseGVN* phase);
 40   virtual const Type* Value(PhaseGVN* phase) const;

 41   virtual uint  ideal_reg() const { return Op_RegI; }
 42 };
 43 
 44 // The conversions operations are all Alpha sorted.  Please keep it that way!
 45 //------------------------------ConvD2FNode------------------------------------
 46 // Convert double to float
 47 class ConvD2FNode : public Node {
 48   public:
 49   ConvD2FNode( Node *in1 ) : Node(0,in1) {}
 50   virtual int Opcode() const;
 51   virtual const Type *bottom_type() const { return Type::FLOAT; }
 52   virtual const Type* Value(PhaseGVN* phase) const;
 53   virtual Node* Identity(PhaseGVN* phase);
 54   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 55   virtual uint  ideal_reg() const { return Op_RegF; }
 56 };
 57 
 58 //------------------------------ConvD2INode------------------------------------
 59 // Convert Double to Integer
 60 class ConvD2INode : public Node {

  1 /*
  2  * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_OPTO_CONVERTNODE_HPP
 26 #define SHARE_OPTO_CONVERTNODE_HPP
 27 
 28 #include "opto/node.hpp"
 29 #include "opto/opcodes.hpp"
 30 
 31 
 32 //------------------------------Conv2BNode-------------------------------------
 33 // Convert int/pointer to a Boolean.  Map zero to zero, all else to 1.
 34 class Conv2BNode : public Node {
 35   public:
 36   Conv2BNode( Node *i ) : Node(0,i) {}
 37   virtual int Opcode() const;
 38   virtual const Type *bottom_type() const { return TypeInt::BOOL; }
 39   virtual Node* Identity(PhaseGVN* phase);
 40   virtual const Type* Value(PhaseGVN* phase) const;
 41   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
 42   virtual uint  ideal_reg() const { return Op_RegI; }
 43 };
 44 
 45 // The conversions operations are all Alpha sorted.  Please keep it that way!
 46 //------------------------------ConvD2FNode------------------------------------
 47 // Convert double to float
 48 class ConvD2FNode : public Node {
 49   public:
 50   ConvD2FNode( Node *in1 ) : Node(0,in1) {}
 51   virtual int Opcode() const;
 52   virtual const Type *bottom_type() const { return Type::FLOAT; }
 53   virtual const Type* Value(PhaseGVN* phase) const;
 54   virtual Node* Identity(PhaseGVN* phase);
 55   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 56   virtual uint  ideal_reg() const { return Op_RegF; }
 57 };
 58 
 59 //------------------------------ConvD2INode------------------------------------
 60 // Convert Double to Integer
 61 class ConvD2INode : public Node {
< prev index next >