hotspot/src/share/vm/opto/countbitsnode.hpp
author iveresov
Thu, 22 Jan 2015 11:25:23 -0800
changeset 28723 0a36120cb225
parent 23528 8f1a7f5e8066
child 35551 36ef3841fb34
permissions -rw-r--r--
8071302: assert(!_reg_node[reg_lo] || edge_from_to(_reg_node[reg_lo], def)) failed: after block local Summary: Add merge nodes to node to block mapping Reviewed-by: kvn, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23528
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     1
/*
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     4
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     8
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    13
 * accompanied this code).
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    14
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    18
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    21
 * questions.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    22
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    23
 */
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    24
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    25
#ifndef SHARE_VM_OPTO_COUNTBITSNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    26
#define SHARE_VM_OPTO_COUNTBITSNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    27
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    28
#include "opto/node.hpp"
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    29
#include "opto/opcodes.hpp"
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    30
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    31
class PhaseTransform;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    32
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    33
//---------- CountBitsNode -----------------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    34
class CountBitsNode : public Node {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    35
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    36
  CountBitsNode(Node* in1) : Node(0, in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    37
  const Type* bottom_type() const { return TypeInt::INT; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    38
  virtual uint ideal_reg() const { return Op_RegI; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    39
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    40
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    41
//---------- CountLeadingZerosINode --------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    42
// Count leading zeros (0-bit count starting from MSB) of an integer.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    43
class CountLeadingZerosINode : public CountBitsNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    44
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    45
  CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    46
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    47
  virtual const Type* Value(PhaseTransform* phase) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    48
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    49
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    50
//---------- CountLeadingZerosLNode --------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    51
// Count leading zeros (0-bit count starting from MSB) of a long.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    52
class CountLeadingZerosLNode : public CountBitsNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    53
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    54
  CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    55
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    56
  virtual const Type* Value(PhaseTransform* phase) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    57
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    58
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    59
//---------- CountTrailingZerosINode -------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    60
// Count trailing zeros (0-bit count starting from LSB) of an integer.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    61
class CountTrailingZerosINode : public CountBitsNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    62
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    63
  CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    64
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    65
  virtual const Type* Value(PhaseTransform* phase) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    66
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    67
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    68
//---------- CountTrailingZerosLNode -------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    69
// Count trailing zeros (0-bit count starting from LSB) of a long.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    70
class CountTrailingZerosLNode : public CountBitsNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    71
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    72
  CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    73
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    74
  virtual const Type* Value(PhaseTransform* phase) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    75
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    76
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    77
//---------- PopCountINode -----------------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    78
// Population count (bit count) of an integer.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    79
class PopCountINode : public CountBitsNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    80
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    81
  PopCountINode(Node* in1) : CountBitsNode(in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    82
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    83
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    84
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    85
//---------- PopCountLNode -----------------------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    86
// Population count (bit count) of a long.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    87
class PopCountLNode : public CountBitsNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    88
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    89
  PopCountLNode(Node* in1) : CountBitsNode(in1) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    90
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    91
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    92
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    93
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    94
#endif // SHARE_VM_OPTO_COUNTBITSNODE_HPP