1 /*
2 * Copyright (c) 1997, 2009, 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 class PhaseTransform;
26 class MachNode;
27
28 //------------------------------ConNode----------------------------------------
29 // Simple constants
30 class ConNode : public TypeNode {
31 public:
32 ConNode( const Type *t ) : TypeNode(t,1) {
33 init_req(0, (Node*)Compile::current()->root());
34 init_flags(Flag_is_Con);
35 }
36 virtual int Opcode() const;
37 virtual uint hash() const;
38 virtual const RegMask &out_RegMask() const { return RegMask::Empty; }
39 virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }
40
41 // Polymorphic factory method:
42 static ConNode* make( Compile* C, const Type *t );
43 };
44
678 CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}
679 virtual int Opcode() const;
680 virtual const Type* Value(PhaseTransform* phase) const;
681 };
682
683 //---------- PopCountINode -----------------------------------------------------
684 // Population count (bit count) of an integer.
685 class PopCountINode : public CountBitsNode {
686 public:
687 PopCountINode(Node* in1) : CountBitsNode(in1) {}
688 virtual int Opcode() const;
689 };
690
691 //---------- PopCountLNode -----------------------------------------------------
692 // Population count (bit count) of a long.
693 class PopCountLNode : public CountBitsNode {
694 public:
695 PopCountLNode(Node* in1) : CountBitsNode(in1) {}
696 virtual int Opcode() const;
697 };
|
1 /*
2 * Copyright (c) 1997, 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
25 #ifndef SHARE_VM_OPTO_CONNODE_HPP
26 #define SHARE_VM_OPTO_CONNODE_HPP
27
28 #include "opto/node.hpp"
29 #include "opto/opcodes.hpp"
30 #include "opto/type.hpp"
31
32 class PhaseTransform;
33 class MachNode;
34
35 //------------------------------ConNode----------------------------------------
36 // Simple constants
37 class ConNode : public TypeNode {
38 public:
39 ConNode( const Type *t ) : TypeNode(t,1) {
40 init_req(0, (Node*)Compile::current()->root());
41 init_flags(Flag_is_Con);
42 }
43 virtual int Opcode() const;
44 virtual uint hash() const;
45 virtual const RegMask &out_RegMask() const { return RegMask::Empty; }
46 virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }
47
48 // Polymorphic factory method:
49 static ConNode* make( Compile* C, const Type *t );
50 };
51
685 CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}
686 virtual int Opcode() const;
687 virtual const Type* Value(PhaseTransform* phase) const;
688 };
689
690 //---------- PopCountINode -----------------------------------------------------
691 // Population count (bit count) of an integer.
692 class PopCountINode : public CountBitsNode {
693 public:
694 PopCountINode(Node* in1) : CountBitsNode(in1) {}
695 virtual int Opcode() const;
696 };
697
698 //---------- PopCountLNode -----------------------------------------------------
699 // Population count (bit count) of a long.
700 class PopCountLNode : public CountBitsNode {
701 public:
702 PopCountLNode(Node* in1) : CountBitsNode(in1) {}
703 virtual int Opcode() const;
704 };
705
706 #endif // SHARE_VM_OPTO_CONNODE_HPP
|