diff mbox series

[v1,02/27] x86/fpu: Add file for common data used across svml_s_*_avx2.S files

Message ID 20221207085236.1424424-2-goldstein.w.n@gmail.com
State New
Headers show
Series [v1,01/27] x86/fpu: Create helper file for common data macros | expand

Commit Message

Noah Goldstein Dec. 7, 2022, 8:52 a.m. UTC
All rodata that is used by more than one implementation can be defined
     here to save .rodata size.

At the moment definitions are only for the following implementations:
    atanf
    atanhf
    log
    log10f
    log2
    tanf

have been added.
---
 .../x86_64/fpu/svml_s_common_avx2_rodata.S    | 28 +++++++++++++++++++
 .../fpu/svml_s_common_avx2_rodata_offsets.h   | 26 +++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S
 create mode 100644 sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h
diff mbox series

Patch

diff --git a/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S
new file mode 100644
index 0000000000..986e8ca685
--- /dev/null
+++ b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S
@@ -0,0 +1,28 @@ 
+#include "svml_s_common_avx2_rodata_offsets.h"
+
+	.section .rodata.avx2, "a"
+	.align	32
+	.globl	COMMON_DATA_NAME
+
+COMMON_DATA_NAME:
+	/* Used By: atanf, atanhf, log, log10f, log2, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _OneF, 0x3f800000)
+	/* Used By: atanhf, log, log10f, log2.  */
+	DATA_VEC(COMMON_DATA_NAME, _NotiOffExpoMask, 0xff800000)
+	/* Used By: atanhf, log, log10f, log2.  */
+	DATA_VEC(COMMON_DATA_NAME, _IBrkValue, 0x3f2aaaab)
+	/* Used By: atanf, atanhf, tanf, tanhf.  */
+	DATA_VEC(COMMON_DATA_NAME, _AbsMask, 0x7fffffff)
+	/* Used By: log, log10f, log2.  */
+	DATA_VEC(COMMON_DATA_NAME, _ILoRange, 0x01000000)
+	/* Used By: atanhf, log.  */
+	DATA_VEC(COMMON_DATA_NAME, _Neg5F, 0xbf000000)
+	/* Used By: atanhf, log.  */
+	DATA_VEC(COMMON_DATA_NAME, _Ln2, 0x3f317218)
+	/* Used By: atanhf, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _Neg4096, 0xfffff000)
+	/* Used By: atanf, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _TanSPI1_FMA, 0x3fc90fdb)
+
+	.type	COMMON_DATA_NAME, @object
+	.size	COMMON_DATA_NAME, .-COMMON_DATA_NAME
diff --git a/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h
new file mode 100644
index 0000000000..6b18b721b1
--- /dev/null
+++ b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h
@@ -0,0 +1,26 @@ 
+#ifndef _SVML_S_COMMON_AVX2_RODATA_OFFSETS_H
+#define _SVML_S_COMMON_AVX2_RODATA_OFFSETS_H	1
+
+#include "svml_common_data_macros.h.S"
+
+#define COMMON_DATA_NAME __svml_s_common_avx2_data
+
+#define _OneF            0
+#define _NotiOffExpoMask 32
+#define _IBrkValue       64
+#define _AbsMask         96
+#define _ILoRange        128
+#define _Neg5F           160
+#define _Ln2             192
+#define _Neg4096         224
+#define _TanSPI1_FMA     256
+
+#define COMMON_DATA(offset) ((offset) + (COMMON_DATA_NAME))
+#define DATA_VEC(data_name, offset, value)                                     \
+    float_vector32(data_name, offset, value)
+
+#ifdef LOCAL_DATA_NAME
+# define LOCAL_DATA(offset) ((offset) + (LOCAL_DATA_NAME))
+#endif
+
+#endif