8007959: Use expensive node logic for more math nodes

Use expensive node logic for other more math nodes.

Reviewed-by: kvn
This commit is contained in:
Roland Westrelin 2013-02-18 09:06:24 +01:00
parent 5159c925af
commit 260e822459
2 changed files with 31 additions and 13 deletions

View File

@ -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);

View File

@ -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; }