Some code relating to x86 and x86-64 differs only in regards to register width. This change makes it possible to specify registers by word-size independent names, thus allowing for generic code while keeping the compatibilities visible.
Signed-off-by: Eduard - Gabriel Munteanu <[email protected]> --- arch/x86/include/arch/registers_32.h | 11 +++++++++++ arch/x86/include/arch/registers_64.h | 11 +++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/arch/registers_32.h b/arch/x86/include/arch/registers_32.h index d4a4975..568fd90 100644 --- a/arch/x86/include/arch/registers_32.h +++ b/arch/x86/include/arch/registers_32.h @@ -17,6 +17,17 @@ enum machine_reg { REG_EBP = NR_REGISTERS, REG_ESP, + + /* Either-R**-or-E** variants (for word-size independent code). */ + REG_XAX = REG_EAX, + REG_XCX, + REG_XDX, + REG_XBX, + REG_XSI, + REG_XDI, + REG_XBP = REG_EBP, + REG_XSP, + REG_UNASSIGNED = ~0UL, }; diff --git a/arch/x86/include/arch/registers_64.h b/arch/x86/include/arch/registers_64.h index 0e7933e..b3bd8db 100644 --- a/arch/x86/include/arch/registers_64.h +++ b/arch/x86/include/arch/registers_64.h @@ -24,6 +24,17 @@ enum machine_reg { REG_RSP = NR_REGISTERS, /* R4 */ REG_RBP, /* R5 */ + + /* Either-R**-or-E** variants (for word-size independent code). */ + REG_XAX = REG_RAX, + REG_XCX, + REG_XDX, + REG_XBX, + REG_XSI, + REG_XDI, + REG_XSP = REG_RSP, + REG_XBP, + REG_UNASSIGNED = ~0UL, }; -- 1.6.0.6 ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Jatovm-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jatovm-devel
