This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Add LP_SIZE, OP_LP, ASM_ADDR and RXX_LP to x86_64/sysdep.h
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 16 Mar 2012 15:37:14 -0700
- Subject: PATCH: Add LP_SIZE, OP_LP, ASM_ADDR and RXX_LP to x86_64/sysdep.h
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch adds LP_SIZE, MOVE_LP, ADD_LP, SUB_LP, CMP_LP and ASM_ADDR to
support operations on both 32bit and 64bit long/pointer sizes in assembly
codes as well as adds RXX_LP for registers used as longs and pointers in
assembly codes. OK to install?
Thanks.
H.J.
---
2012-12-16 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/x86_64/sysdep.h (LP_SIZE): New macro.
(MOVE_LP): Likewise.
(ADD_LP): Likewise.
(SUB_LP): Likewise.
(CMP_LP): Likewise.
(ASM_ADDR): Likewise.
(RAX_LP): Likewise.
(RBP_LP): Likewise.
(RBX_LP): Likewise.
(RCX_LP): Likewise.
(RDI_LP): Likewise.
(RSI_LP): Likewise.
(RSP_LP): Likewise.
(R8_LP): Likewise.
(R9_LP): Likewise.
(R10_LP): Likewise.
(R10_LP): Likewise.
(R11_LP): Likewise.
(R12_LP): Likewise.
(R13_LP): Likewise.
(R14_LP): Likewise.
(R15_LP): Likewise.
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index e455c60..466abff 100644
--- a/sysdeps/x86_64/sysdep.h
+++ b/sysdeps/x86_64/sysdep.h
@@ -95,4 +95,66 @@ lose: \
#define atom_text_section .section ".text.atom", "ax"
+/* Long and pointer size in bytes. */
+#define LP_SIZE 8
+
+/* Instruction to move long and pointer. */
+#define MOVE_LP movq
+
+/* Instruction to add long and pointer. */
+#define ADD_LP addq
+
+/* Instruction to substract long and pointer. */
+#define SUB_LP subq
+
+/* Instruction to compare against long and pointer. */
+#define CMP_LP cmpq
+
+/* Assembler address directive. */
+#define ASM_ADDR .quad
+
+/* Registers to hold long and pointer. */
+#define RAX_LP rax
+#define RBP_LP rbp
+#define RBX_LP rbx
+#define RCX_LP rcx
+#define RDI_LP rdi
+#define RDX_LP rdx
+#define RSI_LP rsi
+#define RSP_LP rsp
+#define R8_LP r8
+#define R9_LP r9
+#define R10_LP r10
+#define R11_LP r11
+#define R12_LP r12
+#define R13_LP r13
+#define R14_LP r14
+#define R15_LP r15
+
+#else /* __ASSEMBLER__ */
+
+/* Long and pointer size in bytes. */
+#define LP_SIZE "8"
+
+/* Assembler address directive. */
+#define ASM_ADDR ".quad"
+
+/* Registers to hold long and pointer. */
+#define RAX_LP "rax"
+#define RBP_LP "rbp"
+#define RBX_LP "rbx"
+#define RCX_LP "rcx"
+#define RDI_LP "rdi"
+#define RDX_LP "rdx"
+#define RSI_LP "rsi"
+#define RSP_LP "rsp"
+#define R8_LP "r8"
+#define R9_LP "r9"
+#define R10_LP "r10"
+#define R11_LP "r11"
+#define R12_LP "r12"
+#define R13_LP "r13"
+#define R14_LP "r14"
+#define R15_LP "r15"
+
#endif /* __ASSEMBLER__ */