diff options
| author | mithe24 <mithe24@student.sdu.dk> | 2025-10-09 13:07:51 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | 36ed8ce55da6467986547c8612598f08e21f3154 (patch) | |
| tree | 24fc5c9d4addc19fc2cb7ff70080baf8d2b2857b /src/coordinateManager.s | |
| parent | 5767efb2e83d3cf0f6543d8f9c2e3966d2ddb9f8 (diff) | |
| download | sorter-36ed8ce55da6467986547c8612598f08e21f3154.tar.gz sorter-36ed8ce55da6467986547c8612598f08e21f3154.zip | |
**JANITOR** removed orphans
Diffstat (limited to 'src/coordinateManager.s')
| -rw-r--r-- | src/coordinateManager.s | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/coordinateManager.s b/src/coordinateManager.s deleted file mode 100644 index 4a46c9b..0000000 --- a/src/coordinateManager.s +++ /dev/null @@ -1,51 +0,0 @@ -# --------------------------------------------
-# FUNCTION: make_coordinate_buffer
-# PURPOSE : allocate memory for n coordinate tuples (16 bytes each)
-# INPUTS : rdi = number of coordinates
-# OUTPUTS : rax = pointer to allocated coordinate buffer
-# CLOBBERS: rax, rdi, r11
-# --------------------------------------------
-
-.globl make_coordinate_buffer
-.type make_coordinate_buffer, @function
-make_coordinate_buffer:
- imulq $16, %rdi # multiply n by 16
- call allocate # allocate total bytes
- ret
-
-
-# --------------------------------------------
-# FUNCTION: build_pointer_buffer
-# PURPOSE : build a buffer of pointers to coordinate tuples
-# INPUTS : rdi = coordinate buffer, rsi = number of tuples
-# OUTPUTS : rax = pointer buffer
-# CLOBBERS: rax, rcx, rdx, r8, r9
-# --------------------------------------------
-
-.globl build_pointer_buffer
-.type build_pointer_buffer, @function
-build_pointer_buffer:
- movq %rdi, %r8 # save coordinate buffer pointer in r8
- movq %rsi, %rax
- imulq $8, %rax # 1 pointer per coordinate / each pointer 8 bytes
- movq %rax, %rdi # argument for allocate
- call allocate # pointer buffer -> rax
- movq %rax, %r9 # save pointer buffer in r9
-
- movq $0, %rcx # index = 0
-pointer_loop:
- cmpq %rsi, %rcx # # if rcx >= n, done
- jge done
-
- movq %rcx, %rdx
- imulq $16, %rdx # 16 byte jumps / every pair of coordinates = 8 bytes + 8 bytes
- addq %r8, %rdx # rdX = coord_buffer + offset
- movq %rdx, (%r9,%rcx,8) # store pointer in pointer buffer / 8 byte jumps here, every pointer is 8 bytes
-
- incq %rcx
- jmp pointer_loop
-
-done:
- movq %r9, %rax # return pointer buffer
- ret
-
|