Bug 1827566 - Isolate SSE2 requirements to SSE-compiled file r=glandium

Only provide forward declaration to the generic code.

Differential Revision: https://phabricator.services.mozilla.com/D175742
This commit is contained in:
serge-sans-paille 2023-04-24 16:27:38 +00:00
parent f8f8179943
commit 7df7d42bf2
3 changed files with 28 additions and 2 deletions

View file

@ -159,7 +159,7 @@ static inline int32_t FirstNon8BitUnvectorized(const char16_t* str,
} }
#if defined(MOZILLA_MAY_SUPPORT_SSE2) #if defined(MOZILLA_MAY_SUPPORT_SSE2)
# include "nsTextFragmentGeneric.h" # include "nsTextFragmentGenericFwd.h"
#endif #endif
#ifdef __powerpc__ #ifdef __powerpc__

View file

@ -4,10 +4,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsTextFragmentGeneric_h__
#define nsTextFragmentGeneric_h__
#include "nsTextFragmentGenericFwd.h"
#include "nscore.h" #include "nscore.h"
#include "nsTextFragmentImpl.h" #include "nsTextFragmentImpl.h"
#include <algorithm> #include <algorithm>
#include <xsimd/xsimd.hpp>
namespace mozilla { namespace mozilla {
@ -57,3 +61,5 @@ int32_t FirstNon8Bit(const char16_t* str, const char16_t* end) {
} }
} // namespace mozilla } // namespace mozilla
#endif

View file

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsTextFragmentGenericFwd_h__
#define nsTextFragmentGenericFwd_h__
#include <cstdint>
#include <xsimd/xsimd.hpp>
namespace mozilla {
template <class Arch>
int32_t FirstNon8Bit(const char16_t* str, const char16_t* end);
} // namespace mozilla
#endif