F16->F32 conversion microkernels in F16C implementation
- F16C codegen templates for F16->F32 microkernels
- Header (xnnpack/vcvt.h) and function pointers
- Test generator and scripts
- Unit tests
PiperOrigin-RevId: 399063788
diff --git a/src/xnnpack/isa-checks.h b/src/xnnpack/isa-checks.h
index 5846e9f..a0d1aeb 100644
--- a/src/xnnpack/isa-checks.h
+++ b/src/xnnpack/isa-checks.h
@@ -48,6 +48,13 @@
} \
} while (0)
+#define TEST_REQUIRES_X86_F16C \
+ do { \
+ if (!cpuinfo_initialize() || !cpuinfo_has_x86_f16c()) { \
+ GTEST_SKIP(); \
+ } \
+ } while (0)
+
#define TEST_REQUIRES_X86_XOP \
do { \
if (!cpuinfo_initialize() || !cpuinfo_has_x86_xop()) { \
diff --git a/src/xnnpack/params.h b/src/xnnpack/params.h
index 5234744..169e492 100644
--- a/src/xnnpack/params.h
+++ b/src/xnnpack/params.h
@@ -2101,6 +2101,12 @@
float* y,
const void* params);
+typedef void (*xnn_f16_f32_vcvt_ukernel_function)(
+ size_t n,
+ const void* input,
+ float* output,
+ const void* params);
+
typedef void (*xnn_vmulcaddc_ukernel_function)(
size_t m,
size_t c,
diff --git a/src/xnnpack/vcvt.h b/src/xnnpack/vcvt.h
new file mode 100644
index 0000000..b85dd59
--- /dev/null
+++ b/src/xnnpack/vcvt.h
@@ -0,0 +1,31 @@
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <xnnpack/params.h>
+#include <xnnpack/common.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define DECLARE_F16_F32_VCVT_UKERNEL_FUNCTION(fn_name) \
+ XNN_INTERNAL void fn_name( \
+ size_t n, \
+ const void* input, \
+ float* output, \
+ const void* params);
+
+DECLARE_F16_F32_VCVT_UKERNEL_FUNCTION(xnn_f16_f32_vcvt_ukernel__f16c_x8)
+DECLARE_F16_F32_VCVT_UKERNEL_FUNCTION(xnn_f16_f32_vcvt_ukernel__f16c_x16)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif