Path: blob/master/src/hotspot/share/opto/countbitsnode.hpp
40930 views
/*1* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_OPTO_COUNTBITSNODE_HPP25#define SHARE_OPTO_COUNTBITSNODE_HPP2627#include "opto/node.hpp"28#include "opto/opcodes.hpp"2930class PhaseTransform;3132//---------- CountBitsNode -----------------------------------------------------33class CountBitsNode : public Node {34public:35CountBitsNode(Node* in1) : Node(0, in1) {}36const Type* bottom_type() const { return TypeInt::INT; }37virtual uint ideal_reg() const { return Op_RegI; }38};3940//---------- CountLeadingZerosINode --------------------------------------------41// Count leading zeros (0-bit count starting from MSB) of an integer.42class CountLeadingZerosINode : public CountBitsNode {43public:44CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {}45virtual int Opcode() const;46virtual const Type* Value(PhaseGVN* phase) const;47};4849//---------- CountLeadingZerosLNode --------------------------------------------50// Count leading zeros (0-bit count starting from MSB) of a long.51class CountLeadingZerosLNode : public CountBitsNode {52public:53CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {}54virtual int Opcode() const;55virtual const Type* Value(PhaseGVN* phase) const;56};5758//---------- CountTrailingZerosINode -------------------------------------------59// Count trailing zeros (0-bit count starting from LSB) of an integer.60class CountTrailingZerosINode : public CountBitsNode {61public:62CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {}63virtual int Opcode() const;64virtual const Type* Value(PhaseGVN* phase) const;65};6667//---------- CountTrailingZerosLNode -------------------------------------------68// Count trailing zeros (0-bit count starting from LSB) of a long.69class CountTrailingZerosLNode : public CountBitsNode {70public:71CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}72virtual int Opcode() const;73virtual const Type* Value(PhaseGVN* phase) const;74};7576//---------- PopCountINode -----------------------------------------------------77// Population count (bit count) of an integer.78class PopCountINode : public CountBitsNode {79public:80PopCountINode(Node* in1) : CountBitsNode(in1) {}81virtual int Opcode() const;82};8384//---------- PopCountLNode -----------------------------------------------------85// Population count (bit count) of a long.86class PopCountLNode : public CountBitsNode {87public:88PopCountLNode(Node* in1) : CountBitsNode(in1) {}89virtual int Opcode() const;90};919293#endif // SHARE_OPTO_COUNTBITSNODE_HPP949596