63 lines
1.9 KiB
Diff
63 lines
1.9 KiB
Diff
From 71597faac0fde4f608a60dd610d0cefac4972cc3 Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Wakely <jwakely@redhat.com>
|
|
Date: Tue, 17 Nov 2020 12:56:17 +0000
|
|
Subject: [PATCH] Fix GCC build failure in WasmBaselineCompile.cpp
|
|
|
|
GCC does not yet implement C++ Core DR 727, so explicit specializations
|
|
at class scope aren't allowed. This replaces it with a different C++17
|
|
feature: using if-constexpr inside the function body and checking the
|
|
template argument there.
|
|
|
|
See https://bugzilla.mozilla.org/show_bug.cgi?id=1677690
|
|
and https://bugzilla.redhat.com/show_bug.cgi?id=1897675
|
|
---
|
|
js/src/wasm/WasmBaselineCompile.cpp | 24 ++++++++++--------------
|
|
1 file changed, 10 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp
|
|
index 676dbfa73d33a..b82aa242d3c6b 100644
|
|
--- js/src/wasm/WasmBaselineCompile.cpp
|
|
+++ js/src/wasm/WasmBaselineCompile.cpp
|
|
@@ -655,15 +655,13 @@ class BaseRegAlloc {
|
|
|
|
template <MIRType t>
|
|
bool hasFPU() {
|
|
- return availFPU.hasAny<RegTypeOf<t>::value>();
|
|
- }
|
|
-
|
|
#ifdef RABALDR_SIDEALLOC_V128
|
|
- template <>
|
|
- bool hasFPU<MIRType::Simd128>() {
|
|
- MOZ_CRASH("Should not happen");
|
|
- }
|
|
+ if constexpr (t == MIRType::Simd128)
|
|
+ MOZ_CRASH("Should not happen");
|
|
+ else
|
|
#endif
|
|
+ return availFPU.hasAny<RegTypeOf<t>::value>();
|
|
+ }
|
|
|
|
bool isAvailableGPR(Register r) { return availGPR.has(r); }
|
|
|
|
@@ -746,15 +744,13 @@ class BaseRegAlloc {
|
|
|
|
template <MIRType t>
|
|
FloatRegister allocFPU() {
|
|
- return availFPU.takeAny<RegTypeOf<t>::value>();
|
|
- }
|
|
-
|
|
#ifdef RABALDR_SIDEALLOC_V128
|
|
- template <>
|
|
- FloatRegister allocFPU<MIRType::Simd128>() {
|
|
- MOZ_CRASH("Should not happen");
|
|
- }
|
|
+ if constexpr (t == MIRType::Simd128)
|
|
+ MOZ_CRASH("Should not happen");
|
|
+ else
|
|
#endif
|
|
+ return availFPU.takeAny<RegTypeOf<t>::value>();
|
|
+ }
|
|
|
|
void freeGPR(Register r) { availGPR.add(r); }
|
|
|