Move implementation of floating point assembler intrinsics to separate file.
Bug: 278812060
Test: m berberis_all
Change-Id: I53dae9b00b16e4678481465376e9e74984ebdbcd
diff --git a/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler.h b/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler.h
index bfb4a37..77309dc 100644
--- a/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler.h
+++ b/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler.h
@@ -282,6 +282,7 @@
} // namespace berberis
// Macro specializations.
-#include "berberis/intrinsics/macro_assembler-impl.h"
+#include "berberis/intrinsics/macro_assembler_constants_pool.h"
+#include "berberis/intrinsics/macro_assembler_floating_point_impl.h"
#endif // RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_H_
diff --git a/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler_constants_pool.h b/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler_constants_pool.h
new file mode 100644
index 0000000..9c1ce82
--- /dev/null
+++ b/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler_constants_pool.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_CONSTANTS_POOL_H_
+#define RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_CONSTANTS_POOL_H_
+
+#include "berberis/base/bit_util.h"
+#include "berberis/intrinsics/macro_assembler.h"
+
+namespace berberis::constants_pool {
+
+// Constant suitable for NaN boxing of RISC-V 32bit float with PXor.
+// Note: technically we only need to Nan-box Float32 since we don't support Float16 yet.
+template <typename FloatType>
+extern const int32_t kNanBox;
+template <>
+extern const int32_t kNanBox<intrinsics::Float32>;
+
+// Canonically Nan boxed canonical NaN.
+// Note: technically we only need to Nan-box Float32 since we don't support Float16 yet.
+template <typename FloatType>
+extern const int32_t kNanBoxedNans;
+template <>
+extern const int32_t kNanBoxedNans<intrinsics::Float32>;
+
+// Canonical NaNs. Float32 and Float64 are supported.
+template <typename FloatType>
+extern const int32_t kCanonicalNans;
+template <>
+extern const int32_t kCanonicalNans<intrinsics::Float32>;
+template <>
+extern const int32_t kCanonicalNans<intrinsics::Float64>;
+
+} // namespace berberis::constants_pool
+
+#endif // RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_CONSTANTS_POOL_H_
diff --git a/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler-impl.h b/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler_floating_point_impl.h
similarity index 84%
rename from intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler-impl.h
rename to intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler_floating_point_impl.h
index 520e5e3..2c1dbf8 100644
--- a/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler-impl.h
+++ b/intrinsics/riscv64_to_x86_64/include/berberis/intrinsics/macro_assembler_floating_point_impl.h
@@ -14,37 +14,15 @@
* limitations under the License.
*/
-#ifndef RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_IMPL_H_
-#define RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_IMPL_H_
+#ifndef RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_FLOATING_POINT_IMPL_H_
+#define RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_FLOATING_POINT_IMPL_H_
#include "berberis/base/bit_util.h"
#include "berberis/intrinsics/macro_assembler.h"
+#include "berberis/intrinsics/macro_assembler_constants_pool.h"
namespace berberis {
-namespace constants_pool {
-
-// Constant suitable for NaN boxing of RISC-V 32bit float with PXor.
-// Note: technically we only need to Nan-box Float32 since we don't support Float16 yet.
-template <typename FloatType>
-extern const int32_t kNanBox;
-template <>
-extern const int32_t kNanBox<intrinsics::Float32>;
-template <typename FloatType>
-extern const int32_t kNanBoxedNans;
-template <>
-extern const int32_t kNanBoxedNans<intrinsics::Float32>;
-template <typename FloatType>
-extern const int32_t kCanonicalNans;
-
-// Canonical NaNs. Float32 and Float64 are supported.
-template <>
-extern const int32_t kCanonicalNans<intrinsics::Float32>;
-template <>
-extern const int32_t kCanonicalNans<intrinsics::Float64>;
-
-} // namespace constants_pool
-
template <typename Assembler>
template <typename FloatType>
void MacroAssembler<Assembler>::CanonicalizeNan(XMMRegister result, XMMRegister src) {
@@ -165,4 +143,4 @@
} // namespace berberis
-#endif // RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_IMPL_H_
+#endif // RISCV64_TO_X86_64_BERBERIS_INTRINSICS_MACRO_ASSEMBLER_FLOATING_POINT_IMPL_H_