Add (untested!) updates to the MIPS / ARM asm paths.

main
David Chisnall 10 years ago
parent f06508bfd9
commit f1c323b0a2

@ -1,8 +1,3 @@
#define DTABLE_OFFSET 32
#define SMALLOBJ_MASK 1
#define SHIFT_OFFSET 4
#define DATA_OFFSET 12
#define SLOT_OFFSET 16
.syntax unified .syntax unified
.fpu neon .fpu neon
@ -44,16 +39,17 @@
teq r6, #0 teq r6, #0
beq 2f beq 2f
and r6, r5, #0xff0000 ubfx r6, r5, #16, #8 // Put byte 3 of the sel id in r6
ldr r4, [r4, r6, asr#14] add r6, r4, r6, lsl #2 // r6 = dtable address + dtable data offset
ldr r4, [r4, #DATA_OFFSET] ldr r4, [r6, #DATA_OFFSET] // Load, adding in the data offset
1: // dtable16 1: // dtable16
and r6, r5, #0xff00 ubfx r6, r5, #8, #8 // Put byte 2 of the sel id in r6
ldr r4, [r4, r6, asr#6] add r6, r4, r6, lsl #2 // r6 = dtable address + dtable data offset
ldr r4, [r4, #DATA_OFFSET] ldr r4, [r6, #DATA_OFFSET] // Load, adding in the data offset
2: // dtable8 2: // dtable8
and r6, r5, #0xff uxtb r6, r5 // Low byte of sel id into r5
ldr ip, [r4, r6, asl#2] add r6, r4, r6, lsl #2 // r6 = dtable address + dtable data offset
ldr r4, [r6, #DATA_OFFSET] // Load, adding in the data offset
teq ip, #0 // If the slot is nil teq ip, #0 // If the slot is nil
beq 5f // Go to the slow path and do the forwarding stuff beq 5f // Go to the slow path and do the forwarding stuff

@ -3,20 +3,10 @@
#ifdef _ABI64 #ifdef _ABI64
#define LP ld #define LP ld
#define SP sd #define SP sd
#define DTABLE_OFFSET 64
#define SMALLOBJ_MASK 7
#define SHIFT_OFFSET 4
#define DATA_OFFSET 16
#define SLOT_OFFSET 32
#else #else
#warning N32 is untested, O32 is unsupported. #warning N32 is untested, O32 is unsupported.
#define LP lw #define LP lw
#define SP sw #define SP sw
#define DTABLE_OFFSET 32
#define SMALLOBJ_MASK 1
#define SHIFT_OFFSET 4
#define DATA_OFFSET 12
#define SLOT_OFFSET 16
#endif #endif
.macro dump_and_crash reg .macro dump_and_crash reg
@ -64,8 +54,8 @@ lw $zero, ($zero)
1: # class loaded, stored in $t4 1: # class loaded, stored in $t4
LP $t4, DTABLE_OFFSET($t4) # Load the dtable from the class LP $t4, DTABLE_OFFSET($t4) # Load the dtable from the class
lw $t6, SHIFT_OFFSET($t4) # Load the shift (dtable size) lw $t6, SHIFT_OFFSET($t4) # Load the shift (dtable size)
# $t4 = dtable, $t5 = sel index # $t4 = dtable, $t5 = sel index
LP $t7, DATA_OFFSET($t4) # Load the address of the start of the array daddi $t7, $t4, DATA_OFFSET # Compute the address of the start of the array
beq $0, $t6, 3f # If this is a small dtable, jump to the small dtable handlers beq $0, $t6, 3f # If this is a small dtable, jump to the small dtable handlers
@ -81,7 +71,7 @@ lw $zero, ($zero)
#endif #endif
dadd $t6, $t6, $t7 dadd $t6, $t6, $t7
LP $t7, ($t6) LP $t7, ($t6)
LP $t7, DATA_OFFSET($t7) daddi $t7, $t7, DATA_OFFSET # Compute the address of the start of the array
2: # dtable16: 2: # dtable16:
andi $t6, $t5, 0xff00 # mask the selector andi $t6, $t5, 0xff00 # mask the selector
#ifdef _ABI64 #ifdef _ABI64
@ -91,7 +81,7 @@ lw $zero, ($zero)
#endif #endif
dadd $t6, $t6, $t7 dadd $t6, $t6, $t7
LP $t7, ($t6) LP $t7, ($t6)
LP $t7, DATA_OFFSET($t7) daddi $t7, $t7, DATA_OFFSET # Compute the address of the start of the array
3: # dtable8: 3: # dtable8:
andi $t6, $t5, 0xff # mask the selector andi $t6, $t5, 0xff # mask the selector
#ifdef _ABI64 #ifdef _ABI64

Loading…
Cancel
Save