/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"mozilla/Assertions.h" #ifdefined(__x86_64__) # include "mozilla/SSE.h" #endif
namespace mozilla::htmlaccel {
// MOZ_MAY_HAVE_HTMLACCEL gets defined iff `htmlaccelEnabled()` may return // `true`. The purpose is this define is to accommodate builds that don't // link `htmlaccelNotInline.cpp` and have even the most basic constant // propagation turned off so that `htmlaccelEnabled()` statically returning // false isn't enough to remove calls to functions whose definitions are // missing.
/// This function is appropriate to call when the SIMD path is compiled /// with `HTML_ACCEL_FLAGS`. /// /// Keep this in sync with `HTML_ACCEL_FLAGS` in `toolchain.configure`. inlinebool htmlaccelEnabled() { #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 12 // __GNUC__ is stuck at 4 in clang, so we need to check __clang__ above. // GCC 12 or newer is required for __builtin_shuffle. returnfalse; #elifdefined(__aarch64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ # define MOZ_MAY_HAVE_HTMLACCEL 1 return true; #elifdefined(__x86_64__) # define MOZ_MAY_HAVE_HTMLACCEL 1 bool ret = mozilla::supports_bmi(); if (ret) { // As a micro optimization for the innerHTML getter, don't bother // calling `supports_avx` in release builds, since the implementation // of SSE.h supports_bmi implies supports_avx anyway.
MOZ_ASSERT(mozilla::supports_avx(), "supports_bmi is supposed to imply supports_avx");
} return ret; #else returnfalse; #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.