提交 e78754a6 编写于 作者: R roland

8007959: Use expensive node logic for more math nodes

Summary: use expensive node logic for other more math nodes.
Reviewed-by: kvn
上级 ed6d268f
......@@ -1481,10 +1481,10 @@ bool LibraryCallKit::inline_math(vmIntrinsics::ID id) {
Node* arg = round_double_node(argument(0));
Node* n;
switch (id) {
case vmIntrinsics::_dabs: n = new (C) AbsDNode( arg); break;
case vmIntrinsics::_dsqrt: n = new (C) SqrtDNode(0, arg); break;
case vmIntrinsics::_dlog: n = new (C) LogDNode( arg); break;
case vmIntrinsics::_dlog10: n = new (C) Log10DNode( arg); break;
case vmIntrinsics::_dabs: n = new (C) AbsDNode( arg); break;
case vmIntrinsics::_dsqrt: n = new (C) SqrtDNode(C, control(), arg); break;
case vmIntrinsics::_dlog: n = new (C) LogDNode(C, control(), arg); break;
case vmIntrinsics::_dlog10: n = new (C) Log10DNode(C, control(), arg); break;
default: fatal_unexpected_iid(id); break;
}
set_result(_gvn.transform(n));
......@@ -1499,9 +1499,9 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) {
Node* n = NULL;
switch (id) {
case vmIntrinsics::_dsin: n = new (C) SinDNode(arg); break;
case vmIntrinsics::_dcos: n = new (C) CosDNode(arg); break;
case vmIntrinsics::_dtan: n = new (C) TanDNode(arg); break;
case vmIntrinsics::_dsin: n = new (C) SinDNode(C, control(), arg); break;
case vmIntrinsics::_dcos: n = new (C) CosDNode(C, control(), arg); break;
case vmIntrinsics::_dtan: n = new (C) TanDNode(C, control(), arg); break;
default: fatal_unexpected_iid(id); break;
}
n = _gvn.transform(n);
......
......@@ -399,7 +399,10 @@ public:
// Cosinus of a double
class CosDNode : public Node {
public:
CosDNode( Node *in1 ) : Node(0, in1) {}
CosDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
......@@ -410,7 +413,10 @@ public:
// Sinus of a double
class SinDNode : public Node {
public:
SinDNode( Node *in1 ) : Node(0, in1) {}
SinDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
......@@ -422,7 +428,10 @@ public:
// tangens of a double
class TanDNode : public Node {
public:
TanDNode(Node *in1 ) : Node(0, in1) {}
TanDNode(Compile* C, Node *c,Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
......@@ -445,7 +454,10 @@ public:
// square root a double
class SqrtDNode : public Node {
public:
SqrtDNode(Node *c, Node *in1 ) : Node(c, in1) {}
SqrtDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
......@@ -470,7 +482,10 @@ public:
// Log_e of a double
class LogDNode : public Node {
public:
LogDNode( Node *in1 ) : Node(0, in1) {}
LogDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
......@@ -481,7 +496,10 @@ public:
// Log_10 of a double
class Log10DNode : public Node {
public:
Log10DNode( Node *in1 ) : Node(0, in1) {}
Log10DNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册