diff options
-rw-r--r-- | acompact.asm | 11 | ||||
-rw-r--r-- | acopy.asm | 16 | ||||
-rw-r--r-- | amark.asm | 18 | ||||
-rw-r--r-- | amark_prefetch.asm | 20 | ||||
-rw-r--r-- | astartup.asm | 87 |
5 files changed, 132 insertions, 20 deletions
diff --git a/acompact.asm b/acompact.asm index 7659fed..49b8174 100644 --- a/acompact.asm +++ b/acompact.asm @@ -877,9 +877,16 @@ move_b_array: jmp cp_s_arg_lp3 move_strict_basic_array: - mov rax,rdx + mov rax,rdx + cmp rbx,offset dINT+2 + jle cp_s_arg_lp3 cmp rbx,offset BOOL+2 - jne cp_s_arg_lp3 + je move_bool_array + +move_int32_or_real32_array: + add rax,1 + shr rax,1 + jmp cp_s_arg_lp3 move_bool_array: add rax,7 @@ -1243,10 +1243,18 @@ copy_array_a3: copy_strict_basic_array_2: mov rbx,qword ptr 8[rcx] + + cmp rax,offset dINT+2 + jle copy_int_or_real_array_2 + cmp rax,offset BOOL+2 je copy_bool_array_2 -copy_int_array_2: +copy_int32_or_real32_array_2: + add rbx,1 + shr rbx,1 + +copy_int_or_real_array_2: shl rbx,3 lea rdx,(-24)[rsi] @@ -1270,9 +1278,9 @@ copy_int_array_2: jmp cp_s_arg_lp2 copy_bool_array_2: - lea rax,7[rbx] - shr rax,3 - jmp copy_int_array_2 + add rbx,7 + shr rbx,3 + jmp copy_int_or_real_array_2 end_copy1: mov heap_end_after_gc,rsi @@ -1061,10 +1061,15 @@ _mark_array_using_reversal: _mark_strict_basic_array: mov rax,qword ptr 8[rcx] + cmp rbp,offset dINT+2 + jle _mark_strict_int_or_real_array cmp rbp,offset BOOL+2 je _mark_strict_bool_array -_mark_strict_real_array: -_mark_strict_int_array: +_mark_strict_int32_or_real32_array: + add rax,6+1 + shr rax,1 + jmp _mark_basic_array_ +_mark_strict_int_or_real_array: add rax,3 jmp _mark_basic_array_ _mark_strict_bool_array: @@ -1881,10 +1886,15 @@ __mark_b_record_array: __mark_strict_basic_array: mov rax,qword ptr 8[rcx] + cmp rbp,offset dINT+2 + jle __mark__strict__int__or__real__array cmp rbp,offset BOOL+2 je __mark__strict__bool__array -__mark__strict__real__array: -__mark__strict__int__array: +__mark__strict__int32__or__real32__array: + add rax,6+1 + shr rax,1 + jmp __mark_basic_array +__mark__strict__int__or__real__array: add rax,3 jmp __mark_basic_array __mark__strict__bool__array: diff --git a/amark_prefetch.asm b/amark_prefetch.asm index f3bb0bc..f2f632c 100644 --- a/amark_prefetch.asm +++ b/amark_prefetch.asm @@ -880,10 +880,14 @@ pmark_array_using_reversal: pmark_strict_basic_array: mov rax,qword ptr 8[rcx] + cmp rbp,offset dINT+2 + jle pmark_strict_int_or_real_array cmp rbp,offset BOOL+2 je pmark_strict_bool_array -pmark_strict_real_array: -pmark_strict_int_array: + add rax,6+1 + shr rax,1 + jmp pmark_basic_array_ +pmark_strict_int_or_real_array: add rax,3 jmp pmark_basic_array_ pmark_strict_bool_array: @@ -999,8 +1003,8 @@ pmarkr_no_shared_argument_part: shl rbp,3 or qword ptr [rdx],1 - add rax,rbp - add rdx,rbp + add rax,rbp + add rdx,rbp cmp rax,32*8 jbe pmarkr_fits_in_word_2 @@ -1704,10 +1708,14 @@ pmarkr_b_record_array: pmarkr_strict_basic_array: mov rax,qword ptr 8[rcx] + cmp rbp,offset dINT+2 + jle pmarkr_strict_int_or_real_array cmp rbp,offset BOOL+2 je pmarkr_strict_bool_array -pmarkr_strict_real_array: -pmarkr_strict_int_array: + add rax,6+1 + shr rax,1 + jmp pmarkr_basic_array +pmarkr_strict_int_or_real_array: add rax,3 jmp pmarkr_basic_array pmarkr_strict_bool_array: diff --git a/astartup.asm b/astartup.asm index 834dca6..7f1ccb8 100644 --- a/astartup.asm +++ b/astartup.asm @@ -388,13 +388,17 @@ _DATA ends public _create_arrayB public _create_arrayC public _create_arrayI + public _create_arrayI32 public _create_arrayR + public _create_arrayR32 public _create_r_array public create_array public create_arrayB public create_arrayC public create_arrayI + public create_arrayI32 public create_arrayR + public create_arrayR32 public create_R_array public BtoAC @@ -482,11 +486,13 @@ _DATA ends public __driver -; from system.abc: +; from system.abc: extrn dINT:near + extrn INT32:near extrn CHAR:near extrn BOOL:near extrn REAL:near + extrn REAL32:near extrn FILE:near extrn __STRING__:near extrn __ARRAY__:near @@ -3944,14 +3950,28 @@ _create_arrayI: call collect_0 no_collect_4572: mov rcx,rdi - lea rbp,__ARRAY__+2 - mov qword ptr [rdi],rbp + mov qword ptr [rdi],offset __ARRAY__+2 mov qword ptr 8[rdi],rax lea rbp,dINT+2 mov qword ptr 16[rdi],rbp lea rdi,24[rdi+rax*8] ret +_create_arrayI32: + mov rbx,rax + add rax,6+1 + shr rax,1 + sub r15,rax + jge no_collect_3572 + call collect_0 +no_collect_3572: + mov rcx,rdi + mov qword ptr [rdi],offset __ARRAY__+2 + mov qword ptr 8[rdi],rbx + mov qword ptr 16[rdi],offset INT32+2 + lea rdi,[rdi+rax*8] + ret + _create_arrayR: lea rbp,3[rax] sub r15,rbp @@ -3960,11 +3980,26 @@ _create_arrayR: no_collect_4580: mov rcx,rdi mov qword ptr [rdi],offset __ARRAY__+2 - mov qword ptr 8[rdi],rax + mov qword ptr 8[rdi],rax mov qword ptr 16[rdi],offset REAL+2 lea rdi,24[rdi+rax*8] ret +_create_arrayR32: + mov rbx,rax + add rax,6+1 + shr rax,1 + sub r15,rax + jge no_collect_3580 + call collect_0 +no_collect_3580: + mov rcx,rdi + mov qword ptr [rdi],offset __ARRAY__+2 + mov qword ptr 8[rdi],rax + mov qword ptr 16[rdi],offset REAL32+2 + lea rdi,[rdi+rax*8] + ret + ; rax : number of elements, rbx: element descriptor ; r10 : element size, r11 : element a size, rcx :a_element-> rcx : array @@ -4125,6 +4160,27 @@ no_collect_4578: add rdi,16 jmp create_arrayBCI +create_arrayI32: + mov r10,rbx + add rbx,6+1 + shr rbx,1 + sub r15,rbx + jge no_collect_3577 + call collect_0 +no_collect_3577: + mov rcx,rdi + mov qword ptr [rdi],offset __ARRAY__+2 + mov qword ptr 8[rdi],r10 + mov qword ptr 16[rdi],offset INT32+2 + add rdi,24 + + sub rbx,3 + + mov ebp,eax + shl rax,32 + or rax,rbp + jmp create_arrayBCI + create_arrayI: lea rbp,3[rbx] sub r15,rbp @@ -4158,6 +4214,29 @@ st_filli_array: ret +create_arrayR32: + cvtsd2ss qword ptr (-8)[rsp],xmm0 + mov r10,rax + add rax,6+1 + shr rax,1 + mov ebx,qword ptr (-8)[rsp] + sub r15,rax + jge no_collect_3579 + call collect_0 +no_collect_3579: + mov rcx,rdi + mov qword ptr [rdi],offset __ARRAY__+2 + mov qword ptr 8[rdi],r10 + mov qword ptr 16[rdi],offset REAL32+2 + add rdi,24 + + sub rax,3 + + mov edx,ebx + shl rbx,32 + or rbx,rdx + jmp st_fillr_array + create_arrayR: movsd qword ptr (-8)[rsp],xmm0 lea rbp,3[rax] |