Commit cdf4d10d authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] Use the new TF operators for F64Cos, F64Sin, F64Tan, and F64Exp

R=bmeurer@chromium.org, bradnelson@chromium.org
BUG=v8:5086

Review-Url: https://codereview.chromium.org/2083473002
Cr-Commit-Position: refs/heads/master@{#37094}
parent 5448ca0b
......@@ -1308,42 +1308,6 @@ ExternalReference ExternalReference::f64_asin_wrapper_function(
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_asin_wrapper)));
}
static void f64_cos_wrapper(double* param) {
WriteDoubleValue(param, std::cos(ReadDoubleValue(param)));
}
ExternalReference ExternalReference::f64_cos_wrapper_function(
Isolate* isolate) {
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_cos_wrapper)));
}
static void f64_sin_wrapper(double* param) {
WriteDoubleValue(param, std::sin(ReadDoubleValue(param)));
}
ExternalReference ExternalReference::f64_sin_wrapper_function(
Isolate* isolate) {
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_sin_wrapper)));
}
static void f64_tan_wrapper(double* param) {
WriteDoubleValue(param, std::tan(ReadDoubleValue(param)));
}
ExternalReference ExternalReference::f64_tan_wrapper_function(
Isolate* isolate) {
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_tan_wrapper)));
}
static void f64_exp_wrapper(double* param) {
WriteDoubleValue(param, base::ieee754::exp(ReadDoubleValue(param)));
}
ExternalReference ExternalReference::f64_exp_wrapper_function(
Isolate* isolate) {
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_exp_wrapper)));
}
static void f64_pow_wrapper(double* param0, double* param1) {
WriteDoubleValue(param0, power_double_double(ReadDoubleValue(param0),
ReadDoubleValue(param1)));
......
......@@ -972,10 +972,6 @@ class ExternalReference BASE_EMBEDDED {
static ExternalReference f64_acos_wrapper_function(Isolate* isolate);
static ExternalReference f64_asin_wrapper_function(Isolate* isolate);
static ExternalReference f64_cos_wrapper_function(Isolate* isolate);
static ExternalReference f64_sin_wrapper_function(Isolate* isolate);
static ExternalReference f64_tan_wrapper_function(Isolate* isolate);
static ExternalReference f64_exp_wrapper_function(Isolate* isolate);
static ExternalReference f64_pow_wrapper_function(Isolate* isolate);
static ExternalReference f64_mod_wrapper_function(Isolate* isolate);
......
......@@ -785,16 +785,20 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
op = m->Float64Atan();
break;
case wasm::kExprF64Cos: {
return BuildF64Cos(input);
op = m->Float64Cos();
break;
}
case wasm::kExprF64Sin: {
return BuildF64Sin(input);
op = m->Float64Sin();
break;
}
case wasm::kExprF64Tan: {
return BuildF64Tan(input);
op = m->Float64Tan();
break;
}
case wasm::kExprF64Exp: {
return BuildF64Exp(input);
op = m->Float64Exp();
break;
}
case wasm::kExprF64Log:
op = m->Float64Log();
......@@ -1348,34 +1352,6 @@ Node* WasmGraphBuilder::BuildF64Asin(Node* input) {
return BuildCFuncInstruction(ref, type, input);
}
Node* WasmGraphBuilder::BuildF64Cos(Node* input) {
MachineType type = MachineType::Float64();
ExternalReference ref =
ExternalReference::f64_cos_wrapper_function(jsgraph()->isolate());
return BuildCFuncInstruction(ref, type, input);
}
Node* WasmGraphBuilder::BuildF64Sin(Node* input) {
MachineType type = MachineType::Float64();
ExternalReference ref =
ExternalReference::f64_sin_wrapper_function(jsgraph()->isolate());
return BuildCFuncInstruction(ref, type, input);
}
Node* WasmGraphBuilder::BuildF64Tan(Node* input) {
MachineType type = MachineType::Float64();
ExternalReference ref =
ExternalReference::f64_tan_wrapper_function(jsgraph()->isolate());
return BuildCFuncInstruction(ref, type, input);
}
Node* WasmGraphBuilder::BuildF64Exp(Node* input) {
MachineType type = MachineType::Float64();
ExternalReference ref =
ExternalReference::f64_exp_wrapper_function(jsgraph()->isolate());
return BuildCFuncInstruction(ref, type, input);
}
Node* WasmGraphBuilder::BuildF64Pow(Node* left, Node* right) {
MachineType type = MachineType::Float64();
ExternalReference ref =
......
......@@ -275,10 +275,6 @@ class WasmGraphBuilder {
Node* BuildF64Acos(Node* input);
Node* BuildF64Asin(Node* input);
Node* BuildF64Cos(Node* input);
Node* BuildF64Sin(Node* input);
Node* BuildF64Tan(Node* input);
Node* BuildF64Exp(Node* input);
Node* BuildF64Pow(Node* left, Node* right);
Node* BuildF64Mod(Node* left, Node* right);
......
......@@ -172,14 +172,6 @@ ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) {
"f64_acos_wrapper");
Add(ExternalReference::f64_asin_wrapper_function(isolate).address(),
"f64_asin_wrapper");
Add(ExternalReference::f64_cos_wrapper_function(isolate).address(),
"f64_cos_wrapper");
Add(ExternalReference::f64_sin_wrapper_function(isolate).address(),
"f64_sin_wrapper");
Add(ExternalReference::f64_tan_wrapper_function(isolate).address(),
"f64_tan_wrapper");
Add(ExternalReference::f64_exp_wrapper_function(isolate).address(),
"f64_exp_wrapper");
Add(ExternalReference::f64_pow_wrapper_function(isolate).address(),
"f64_pow_wrapper");
Add(ExternalReference::f64_mod_wrapper_function(isolate).address(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment