Commit 4f7f6aee authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [builtins] Unify most of the remaining Math builtins.

  port 0a0fe8fb (r37476)

  original commit message:
  Import fdlibm versions of acos, acosh, asin and asinh, which are more
  precise and produce the same result across platforms (we were using
  libm versions for asin and acos so far, where both speed and precision
  depended on the operating system so far). Introduce appropriate TurboFan
  operators for these functions and use them both for inlining and for the
  generic builtin.

  Also migrate the Math.imul and Math.fround builtins to TurboFan builtins
  to ensure that their behavior is always exactly the same as the inlined
  TurboFan version (i.e. C++ truncation semantics for double to float
  don't necessarily meet the JavaScript semantics).

  For completeness, also migrate Math.sign, which can even get some nice
  love in TurboFan.

  Drive-by-fix: Some alpha-sorting on the Math related functions, and
  cleanup the list of Math intrinsics that we have to export via the
  native context currently.

BUG=

Review-Url: https://codereview.chromium.org/2122643002
Cr-Commit-Position: refs/heads/master@{#37496}
parent acd674db
......@@ -748,9 +748,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ lea(i.OutputRegister(), Operand(base, offset.offset()));
break;
}
case kIeee754Float64Acos:
ASSEMBLE_IEEE754_UNOP(acos);
break;
case kIeee754Float64Acosh:
ASSEMBLE_IEEE754_UNOP(acosh);
break;
case kIeee754Float64Asin:
ASSEMBLE_IEEE754_UNOP(asin);
break;
case kIeee754Float64Asinh:
ASSEMBLE_IEEE754_UNOP(asinh);
break;
case kIeee754Float64Atan:
ASSEMBLE_IEEE754_UNOP(atan);
break;
case kIeee754Float64Atanh:
ASSEMBLE_IEEE754_UNOP(atanh);
break;
case kIeee754Float64Atan2:
ASSEMBLE_IEEE754_BINOP(atan2);
break;
......@@ -773,9 +788,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kIeee754Float64Exp:
ASSEMBLE_IEEE754_UNOP(exp);
break;
case kIeee754Float64Atanh:
ASSEMBLE_IEEE754_UNOP(atanh);
break;
case kIeee754Float64Log:
ASSEMBLE_IEEE754_UNOP(log);
break;
......
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