Commit f9a841a3 authored by André Bargull's avatar André Bargull
Browse files

Bug 1673032 - Part 2: Remove ifdefs around assembler rounding functions. r=lth,jandem

`HasRoundInstruction()` and `nearbyInt{Float32,Double}()` are defined on all
platforms, so we no longer need to guard them through #ifdefs.

This change also allows to optimise round instructions on ARM64.

Differential Revision: https://phabricator.services.mozilla.com/D94815
parent 73923d06
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -6489,27 +6489,15 @@ class BaseCompiler final : public BaseCompilerInterface {
  }

  MOZ_MUST_USE bool supportsRoundInstruction(RoundingMode mode) {
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86)
    return Assembler::HasRoundInstruction(mode);
#else
    return false;
#endif
  }

  void roundF32(RoundingMode roundingMode, RegF32 f0) {
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86)
    masm.nearbyIntFloat32(roundingMode, f0, f0);
#else
    MOZ_CRASH("NYI");
#endif
  }

  void roundF64(RoundingMode roundingMode, RegF64 f0) {
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86)
    masm.nearbyIntDouble(roundingMode, f0, f0);
#else
    MOZ_CRASH("NYI");
#endif
  }

  //////////////////////////////////////////////////////////////////////