diff mbox series

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

Message ID 20221207085236.1424424-4-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_sse4_rodata.S    | 27 +++++++++++++++++++
 .../fpu/svml_s_common_sse4_rodata_offsets.h   | 25 +++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 sysdeps/x86_64/fpu/svml_s_common_sse4_rodata.S
 create mode 100644 sysdeps/x86_64/fpu/svml_s_common_sse4_rodata_offsets.h
diff mbox series

Patch

diff --git a/sysdeps/x86_64/fpu/svml_s_common_sse4_rodata.S b/sysdeps/x86_64/fpu/svml_s_common_sse4_rodata.S
new file mode 100644
index 0000000000..58337635fd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/svml_s_common_sse4_rodata.S
@@ -0,0 +1,27 @@ 
+#include "svml_s_common_sse4_rodata_offsets.h"
+
+	.section .rodata.sse4, "a"
+	.align	16
+	.globl	COMMON_DATA_NAME
+
+COMMON_DATA_NAME:
+	/* Used By: atanf, atanhf, log10f, log2f, logf, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _OneF, 0x3f800000)
+	/* Used By: atanhf, log10f, log2f, logf, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _NotiOffExpoMask, 0xff800000)
+	/* Used By: atanhf, log10f, log2f, logf.  */
+	DATA_VEC(COMMON_DATA_NAME, _IBrkValue, 0x3f2aaaab)
+	/* Used By: log10f, log2f, logf.  */
+	DATA_VEC(COMMON_DATA_NAME, _ILoRange, 0x01000000)
+	/* Used By: atanhf, logf.  */
+	DATA_VEC(COMMON_DATA_NAME, _Neg5F, 0xbf000000)
+	/* Used By: atanhf, logf.  */
+	DATA_VEC(COMMON_DATA_NAME, _Ln2, 0x3f317218)
+	/* Used By: atanhf, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _AbsMask, 0x7fffffff)
+	/* Used By: atanhf, tanf.  */
+	DATA_VEC(COMMON_DATA_NAME, _Neg4096, 0xfffff000)
+
+
+	.type	COMMON_DATA_NAME, @object
+	.size	COMMON_DATA_NAME, .-COMMON_DATA_NAME
diff --git a/sysdeps/x86_64/fpu/svml_s_common_sse4_rodata_offsets.h b/sysdeps/x86_64/fpu/svml_s_common_sse4_rodata_offsets.h
new file mode 100644
index 0000000000..8f985565d1
--- /dev/null
+++ b/sysdeps/x86_64/fpu/svml_s_common_sse4_rodata_offsets.h
@@ -0,0 +1,25 @@ 
+#ifndef _SVML_S_COMMON_SSE4_RODATA_OFFSETS_H
+#define _SVML_S_COMMON_SSE4_RODATA_OFFSETS_H	1
+
+#include "svml_common_data_macros.h.S"
+
+#define COMMON_DATA_NAME __svml_s_common_sse4_data
+
+#define _OneF	0
+#define _NotiOffExpoMask	16
+#define _IBrkValue	32
+#define _ILoRange	48
+#define _Neg5F	64
+#define _Ln2	80
+#define _AbsMask	96
+#define _Neg4096	112
+
+#define COMMON_DATA(offset) ((offset) + (COMMON_DATA_NAME))
+#define DATA_VEC(data_name, offset, value)                                     \
+    float_vector16(data_name, offset, value)
+
+#ifdef LOCAL_DATA_NAME
+# define LOCAL_DATA(offset) ((offset) + (LOCAL_DATA_NAME))
+#endif
+
+#endif