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
.fpu neon
@ -44,16 +39,17 @@
teq r6, #0
beq 2f
and r6, r5, #0xff0000
ldr r4, [r4, r6, asr#14]
ldr r4, [r4, #DATA_OFFSET]
ubfx r6, r5, #16, #8 // Put byte 3 of the sel id in r6
add r6, r4, r6, lsl #2 // r6 = dtable address + dtable data offset
ldr r4, [r6, #DATA_OFFSET] // Load, adding in the data offset
1: // dtable16
and r6, r5, #0xff00
ldr r4, [r4, r6, asr#6]
ldr r4, [r4, #DATA_OFFSET]
ubfx r6, r5, #8, #8 // Put byte 2 of the sel id in r6
add r6, r4, r6, lsl #2 // r6 = dtable address + dtable data offset
ldr r4, [r6, #DATA_OFFSET] // Load, adding in the data offset
2: // dtable8
and r6, r5, #0xff
ldr ip, [r4, r6, asl#2]
uxtb r6, r5 // Low byte of sel id into r5
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
beq 5f // Go to the slow path and do the forwarding stuff

@ -3,20 +3,10 @@
#ifdef _ABI64
#define LP ld
#define SP sd
#define DTABLE_OFFSET 64
#define SMALLOBJ_MASK 7
#define SHIFT_OFFSET 4
#define DATA_OFFSET 16
#define SLOT_OFFSET 32
#else
#warning N32 is untested, O32 is unsupported.
#define LP lw
#define SP sw
#define DTABLE_OFFSET 32
#define SMALLOBJ_MASK 1
#define SHIFT_OFFSET 4
#define DATA_OFFSET 12
#define SLOT_OFFSET 16
#endif
.macro dump_and_crash reg
@ -65,7 +55,7 @@ lw $zero, ($zero)
LP $t4, DTABLE_OFFSET($t4) # Load the dtable from the class
lw $t6, SHIFT_OFFSET($t4) # Load the shift (dtable size)
# $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
@ -81,7 +71,7 @@ lw $zero, ($zero)
#endif
dadd $t6, $t6, $t7
LP $t7, ($t6)
LP $t7, DATA_OFFSET($t7)
daddi $t7, $t7, DATA_OFFSET # Compute the address of the start of the array
2: # dtable16:
andi $t6, $t5, 0xff00 # mask the selector
#ifdef _ABI64
@ -91,7 +81,7 @@ lw $zero, ($zero)
#endif
dadd $t6, $t6, $t7
LP $t7, ($t6)
LP $t7, DATA_OFFSET($t7)
daddi $t7, $t7, DATA_OFFSET # Compute the address of the start of the array
3: # dtable8:
andi $t6, $t5, 0xff # mask the selector
#ifdef _ABI64

Loading…
Cancel
Save