src/share/vm/opto/vectornode.hpp

Print this page


   1 /*
   2  * Copyright (c) 2007, 2008, 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 //------------------------------VectorNode--------------------------------------
  25 // Vector Operation
  26 class VectorNode : public Node {
  27  protected:
  28   uint _length; // vector length
  29   virtual BasicType elt_basic_type() const = 0; // Vector element basic type
  30 
  31   static const Type* vect_type(BasicType elt_bt, uint len);
  32   static const Type* vect_type(const Type* elt_type, uint len) {
  33     return vect_type(elt_type->array_element_basic_type(), len);
  34   }
  35 
  36  public:
  37   friend class VectorLoadNode;  // For vect_type
  38   friend class VectorStoreNode; // ditto.
  39 
  40   VectorNode(Node* n1, uint vlen) : Node(NULL, n1), _length(vlen) {
  41     init_flags(Flag_is_Vector);
  42   }
  43   VectorNode(Node* n1, Node* n2, uint vlen) : Node(NULL, n1, n2), _length(vlen) {


1115 
1116 //------------------------------ExtractFNode---------------------------------------
1117 // Extract a float from a vector at position "pos"
1118 class ExtractFNode : public ExtractNode {
1119  public:
1120   ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
1121   virtual int Opcode() const;
1122   virtual const Type *bottom_type() const { return Type::FLOAT; }
1123   virtual uint ideal_reg() const { return Op_RegF; }
1124 };
1125 
1126 //------------------------------ExtractDNode---------------------------------------
1127 // Extract a double from a vector at position "pos"
1128 class ExtractDNode : public ExtractNode {
1129  public:
1130   ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
1131   virtual int Opcode() const;
1132   virtual const Type *bottom_type() const { return Type::DOUBLE; }
1133   virtual uint ideal_reg() const { return Op_RegD; }
1134 };


   1 /*
   2  * Copyright (c) 2007, 2010, 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 #ifndef SHARE_VM_OPTO_VECTORNODE_HPP
  25 #define SHARE_VM_OPTO_VECTORNODE_HPP
  26 
  27 #include "opto/matcher.hpp"
  28 #include "opto/memnode.hpp"
  29 #include "opto/node.hpp"
  30 #include "opto/opcodes.hpp"
  31 
  32 //------------------------------VectorNode--------------------------------------
  33 // Vector Operation
  34 class VectorNode : public Node {
  35  protected:
  36   uint _length; // vector length
  37   virtual BasicType elt_basic_type() const = 0; // Vector element basic type
  38 
  39   static const Type* vect_type(BasicType elt_bt, uint len);
  40   static const Type* vect_type(const Type* elt_type, uint len) {
  41     return vect_type(elt_type->array_element_basic_type(), len);
  42   }
  43 
  44  public:
  45   friend class VectorLoadNode;  // For vect_type
  46   friend class VectorStoreNode; // ditto.
  47 
  48   VectorNode(Node* n1, uint vlen) : Node(NULL, n1), _length(vlen) {
  49     init_flags(Flag_is_Vector);
  50   }
  51   VectorNode(Node* n1, Node* n2, uint vlen) : Node(NULL, n1, n2), _length(vlen) {


1123 
1124 //------------------------------ExtractFNode---------------------------------------
1125 // Extract a float from a vector at position "pos"
1126 class ExtractFNode : public ExtractNode {
1127  public:
1128   ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
1129   virtual int Opcode() const;
1130   virtual const Type *bottom_type() const { return Type::FLOAT; }
1131   virtual uint ideal_reg() const { return Op_RegF; }
1132 };
1133 
1134 //------------------------------ExtractDNode---------------------------------------
1135 // Extract a double from a vector at position "pos"
1136 class ExtractDNode : public ExtractNode {
1137  public:
1138   ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
1139   virtual int Opcode() const;
1140   virtual const Type *bottom_type() const { return Type::DOUBLE; }
1141   virtual uint ideal_reg() const { return Op_RegD; }
1142 };
1143 
1144 #endif // SHARE_VM_OPTO_VECTORNODE_HPP