Commit 04b0c0f4 authored by John van Groningen's avatar John van Groningen
Browse files

in 32 bit Intel compacting garbage collector remove possible use of bit test,...

in 32 bit Intel compacting garbage collector remove possible use of bit test, set or reset in memory instructions
parent 4934d2a0
......@@ -282,7 +282,6 @@ update_up_list_1r:
movl d0,a1
addl neg_heap_p3,d0
#ifdef NO_BIT_INSTRUCTIONS
push a0
movl d0,a0
......@@ -296,11 +295,7 @@ update_up_list_1r:
pop a0
je copy_argument_part_1r
#else
shrl $2,d0
bt d0,(d1)
jnc copy_argument_part_1r
#endif
movl (a1),d0
movl a4,(a1)
subl $3,d0
......@@ -684,12 +679,11 @@ move_record_3_1b:
jae move_record_3_2
#endif
movl neg_heap_p3,d0
#ifdef NO_BIT_INSTRUCTIONS
pushl a2
#endif
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl heap_vector,d1
addl $4,d0
movl d0,a2
......@@ -698,49 +692,33 @@ move_record_3_1b:
movl bit_set_table(a2),a2
testl (d1,d0,4),a2
je not_linked_record_argument_part_3_b
#else
shr $2,d0
inc d0
movl heap_vector,d1
bts d0,(d1)
jnc not_linked_record_argument_part_3_b
#endif
movl neg_heap_p3,d0
addl a4,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,a2
shrl $7,d0
movl bit_set_table(a2),a2
orl a2,(d1,d0,4)
popl a2
#else
shr $2,d0
bts d0,(d1)
#endif
jmp linked_record_argument_part_3_b
not_linked_record_argument_part_3_b:
#ifdef NO_BIT_INSTRUCTIONS
orl a2,(d1,d0,4)
#endif
movl neg_heap_p3,d0
addl a4,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,a2
shrl $7,d0
movl bit_clear_table(a2),a2
andl a2,(d1,d0,4)
popl a2
#else
shr $2,d0
btr d0,(d1)
#endif
linked_record_argument_part_3_b:
movl (a1),d1
......
......@@ -28,7 +28,6 @@ mark_stack_nodes:
jnc mark_stack_nodes
#endif
#ifdef NO_BIT_INSTRUCTIONS
movl d0,d1
andl $31*4,d0
shrl $7,d1
......@@ -41,12 +40,6 @@ mark_stack_nodes:
push a2
movl a3,(a4,d1,4)
#else
shrl $2,d0
bts d0,(a4)
jc mark_stack_nodes1
push a2
#endif
movl $1,a3
......@@ -74,7 +67,6 @@ mark_hnf_3:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,d1
andl $31*4,d0
shrl $7,d1
......@@ -83,11 +75,6 @@ mark_hnf_3:
jne shared_argument_part
orl d0,(a4,d1,4)
#else
shrl $2,d0
bts d0,(a4)
jc shared_argument_part
#endif
no_shared_argument_part:
orl $2,(a0)
......@@ -134,21 +121,15 @@ mark_record_3_bb:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shrl $2,d0
bts d0,(a4)
#endif
cmpl a0,a1
ja mark_next_node
#ifdef NO_BIT_INSTRUCTIONS
add d0,d0
jne bit_in_same_word1
inc a2
......@@ -156,34 +137,23 @@ mark_record_3_bb:
bit_in_same_word1:
testl (a4,a2,4),d0
je not_yet_linked_bb
#else
inc d0
bts d0,(a4)
jnc not_yet_linked_bb
#endif
movl neg_heap_p3,d0
addl a0,d0
#ifdef NO_BIT_INSTRUCTIONS
addl $2*4,d0
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shrl $2,d0
addl $2,d0
bts d0,(a4)
not_yet_linked_bb:
#endif
movl (a1),a2
lea 8+2+1(a0),d0
movl a2,8(a0)
movl d0,(a1)
jmp mark_next_node
#ifdef NO_BIT_INSTRUCTIONS
not_yet_linked_bb:
orl d0,(a4,a2,4)
movl (a1),a2
......@@ -191,7 +161,6 @@ not_yet_linked_bb:
movl a2,8(a0)
movl d0,(a1)
jmp mark_next_node
#endif
mark_record_3_ab:
movl 4(a0),a1
......@@ -199,20 +168,15 @@ mark_record_3_ab:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shr $2,d0
bts d0,(a4)
#endif
cmpl a0,a1
ja mark_hnf_1
#ifdef NO_BIT_INSTRUCTIONS
add d0,d0
jne bit_in_same_word2
inc a2
......@@ -220,28 +184,16 @@ mark_record_3_ab:
bit_in_same_word2:
testl (a4,a2,4),d0
je not_yet_linked_ab
#else
inc d0
bts d0,(a4)
jnc not_yet_linked_ab
#endif
movl neg_heap_p3,d0
addl a0,d0
#ifdef NO_BIT_INSTRUCTIONS
addl $4,d0
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shr $2,d0
inc d0
bts d0,(a4)
not_yet_linked_ab:
#endif
movl (a1),a2
lea 4+2+1(a0),d0
......@@ -249,7 +201,6 @@ not_yet_linked_ab:
movl d0,(a1)
jmp mark_hnf_1
#ifdef NO_BIT_INSTRUCTIONS
not_yet_linked_ab:
orl d0,(a4,a2,4)
movl (a1),a2
......@@ -257,7 +208,6 @@ not_yet_linked_ab:
movl a2,4(a0)
movl d0,(a1)
jmp mark_hnf_1
#endif
mark_record_3_aab:
movl 4(a0),a1
......@@ -265,7 +215,6 @@ mark_record_3_aab:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,d0
shrl $7,a2
......@@ -273,11 +222,7 @@ mark_record_3_aab:
testl (a4,a2,4),d0
jne shared_argument_part
orl d0,(a4,a2,4)
#else
shr $2,d0
bts d0,(a4)
jc shared_argument_part
#endif
addl $2,(a0)
movl a3,4(a0)
addl $4,a0
......@@ -318,16 +263,12 @@ mark_indirection_node:
movl neg_heap_p3,d1
leal -4(a0,d1),d1
#ifdef NO_BIT_INSTRUCTIONS
movl d1,d0
andl $31*4,d0
shrl $7,d1
movl bit_clear_table(d0),d0
andl d0,(a4,d1,4)
#else
shrl $2,d1
btr d1,(a4)
#endif
movl (a0),a0
jmp mark_node
......@@ -344,7 +285,6 @@ mark_selector_node_1:
addl $1,a2
jle mark_record_selector_node_1
#ifdef NO_BIT_INSTRUCTIONS
push d0
movl d1,d0
shrl $5,d1
......@@ -354,10 +294,7 @@ mark_selector_node_1:
andl d0,d1
pop d0
jne mark_hnf_1
#else
bt d1,(a4)
jc mark_hnf_1
#endif
movl (a1),d1
testb $2,d1b
je mark_hnf_1
......@@ -370,7 +307,6 @@ large_tuple_or_record:
addl neg_heap_p3,d1
shrl $2,d1
#ifdef NO_BIT_INSTRUCTIONS
push d0
movl d1,d0
shrl $5,d1
......@@ -380,26 +316,19 @@ large_tuple_or_record:
andl d0,d1
pop d0
jne mark_hnf_1
#else
bt d1,(a4)
jc mark_hnf_1
#endif
small_tuple_or_record:
movl neg_heap_p3,d1
lea -4(a0,d1),d1
pushl a0
#ifdef NO_BIT_INSTRUCTIONS
movl d1,a0
andl $31*4,a0
shrl $7,d1
movl bit_clear_table(a0),a0
andl a0,(a4,d1,4)
#else
shrl $2,d1
btr d1,(a4)
#endif
movl -8(d0),d0
movl a1,a0
......@@ -416,7 +345,6 @@ small_tuple_or_record:
mark_record_selector_node_1:
je mark_strict_record_selector_node_1
#ifdef NO_BIT_INSTRUCTIONS
push d0
movl d1,d0
shrl $5,d1
......@@ -426,10 +354,7 @@ mark_record_selector_node_1:
andl d0,d1
pop d0
jne mark_hnf_1
#else
bt d1,(a4)
jc mark_hnf_1
#endif
movl (a1),d1
testb $2,d1b
je mark_hnf_1
......@@ -439,7 +364,6 @@ mark_record_selector_node_1:
jmp large_tuple_or_record
mark_strict_record_selector_node_1:
#ifdef NO_BIT_INSTRUCTIONS
push d0
movl d1,d0
shrl $5,d1
......@@ -449,10 +373,7 @@ mark_strict_record_selector_node_1:
andl d0,d1
pop d0
jne mark_hnf_1
#else
bt d1,(a4)
jc mark_hnf_1
#endif
movl (a1),d1
testb $2,d1b
je mark_hnf_1
......@@ -462,7 +383,7 @@ mark_strict_record_selector_node_1:
movl 8(a1),d1
addl neg_heap_p3,d1
#ifdef NO_BIT_INSTRUCTIONS
push d0
movl d1,d0
shrl $7,d1
......@@ -472,11 +393,6 @@ mark_strict_record_selector_node_1:
andl d0,d1
pop d0
jne mark_hnf_1
#else
shrl $2,d1
bt d1,(a4)
jc mark_hnf_1
#endif
select_from_small_record:
/ changed 24-1-97
......@@ -502,7 +418,6 @@ mark_node:
jnc mark_next_node_after_static
#endif
#ifdef NO_BIT_INSTRUCTIONS
movl d0,d1
andl $31*4,d0
shrl $7,d1
......@@ -514,11 +429,6 @@ mark_node:
orl d0,a2
movl a2,(a4,d1,4)
jmp mark_arguments
#else
shrl $2,d0
bts d0,(a4)
jnc mark_arguments
#endif
/ a2,d1: free
......@@ -607,16 +517,12 @@ mark_hnf_0:
movl neg_heap_p3,d1
addl a0,d1
#ifdef NO_BIT_INSTRUCTIONS
movl d1,a0
andl $31*4,a0
shrl $7,d1
movl bit_clear_table(a0),a0
andl a0,(a4,d1,4)
#else
shrl $2,d1
btr d1,(a4)
#endif
lea ZERO_ARITY_DESCRIPTOR_OFFSET-2(d0),a0
jmp mark_next_node_after_static
......@@ -628,16 +534,12 @@ mark_int_3:
movl neg_heap_p3,d1
addl a0,d1
#ifdef NO_BIT_INSTRUCTIONS
movl d1,a0
andl $31*4,a0
shrl $7,d1
movl bit_clear_table(a0),a0
andl a0,(a4,d1,4)
#else
shrl $2,d1
btr d1,(a4)
#endif
lea small_integers(,a2,8),a0
jmp mark_next_node_after_static
......@@ -647,16 +549,11 @@ mark_char_3:
movzbl 4(a0),d0
addl a0,d1
#ifdef NO_BIT_INSTRUCTIONS
movl d1,a2
andl $31*4,a2
shrl $7,d1
movl bit_clear_table(a2),a2
andl a2,(a4,d1,4)
#else
shrl $2,d1
btr d1,(a4)
#endif
lea static_characters(,d0,8),a0
jmp mark_next_node_after_static
......@@ -704,18 +601,12 @@ mark_ab_record_array:
mark_b_record_array:
movl neg_heap_p3,d0
addl a0,d0
#ifdef NO_BIT_INSTRUCTIONS
addl $4,d0
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shrl $2,d0
inc d0
bts d0,(a4)
#endif
jmp mark_next_node
mark_a_record_array:
......@@ -737,15 +628,12 @@ mark_lr_array:
shrl $2,d1
addl d0,d1
#ifdef NO_BIT_INSTRUCTIONS
movl d1,a1
andl $31,d1
shrl $5,a1
movl bit_set_table(,d1,4),d1
orl d1,(a4,a1,4)
#else
bts d1,(a4)
#endif
cmpl $1,d0
jbe mark_array_length_0_1
......
......@@ -21,7 +21,6 @@ rmark_more_stack_nodes:
jnc rmark_next_stack_node
#endif
#ifdef NO_BIT_INSTRUCTIONS
movl d0,d1
andl $31*4,d0
shrl $7,d1
......@@ -32,11 +31,6 @@ rmark_more_stack_nodes:
orl d0,a2
movl a2,(a4,d1,4)
#else
shrl $2,d0
bts d0,(a4)
jc rmark_stack_nodes1
#endif
movl (a0),d0
call rmark_stack_node
......@@ -89,7 +83,6 @@ rmark_node:
movl a3,d1
rmark_node_:
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a1
andl $31*4,d0
shrl $7,a1
......@@ -100,11 +93,6 @@ rmark_node_:
orl d0,a2
movl a2,(a4,a1,4)
#else
shrl $2,d0
bts d0,(a4)
jc rmark_reverse_and_mark_next_node
#endif
movl (a0),d0
rmark_arguments:
......@@ -140,8 +128,6 @@ rmark_hnf_3_:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,d1
andl $31*4,d0
shrl $7,d1
......@@ -150,11 +136,6 @@ rmark_hnf_3_:
jne rmark_shared_argument_part
orl d0,(a4,d1,4)
#else
shrl $2,d0
bts d0,(a4)
jc rmark_shared_argument_part
#endif
rmark_no_shared_argument_part:
subl $8,sp
......@@ -227,21 +208,15 @@ rmark_record_3_bb:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shrl $2,d0
bts d0,(a4)
#endif
cmpl a0,a1
ja rmark_next_node
#ifdef NO_BIT_INSTRUCTIONS
add d0,d0
jne rmark_bit_in_same_word1
inc a2
......@@ -249,34 +224,22 @@ rmark_record_3_bb:
rmark_bit_in_same_word1:
testl (a4,a2,4),d0
je rmark_not_yet_linked_bb
#else
inc d0
bts d0,(a4)
jnc rmark_not_yet_linked_bb
#endif
movl neg_heap_p3,d0
addl a0,d0
#ifdef NO_BIT_INSTRUCTIONS
addl $2*4,d0
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shrl $2,d0
addl $2,d0
bts d0,(a4)
rmark_not_yet_linked_bb:
#endif
movl (a1),a2
lea 8+2+1(a0),d0
movl a2,8(a0)
movl d0,(a1)
jmp rmark_next_node
#ifdef NO_BIT_INSTRUCTIONS
rmark_not_yet_linked_bb:
orl d0,(a4,a2,4)
movl (a1),a2
......@@ -284,26 +247,20 @@ rmark_not_yet_linked_bb:
movl a2,8(a0)
movl d0,(a1)
jmp rmark_next_node
#endif
rmark_record_3_ab:
movl neg_heap_p3,d0
addl a1,d0
#ifdef NO_BIT_INSTRUCTIONS
movl d0,a2
andl $31*4,d0
shrl $7,a2
movl bit_set_table(d0),d0
orl d0,(a4,a2,4)
#else
shr $2,d0
bts d0,(a4)
#endif
cmpl a0,a1
ja rmark_hnf_1
#ifdef NO_BIT_INSTRUCTIONS
add d0,d0