Skip to content

Commit

Permalink
bring macos tests to near parity with linux tests; TODO move os-agnos…
Browse files Browse the repository at this point in the history
…tic code to own folder
  • Loading branch information
blu committed Oct 15, 2021
1 parent a5358f7 commit 227ac33
Show file tree
Hide file tree
Showing 11 changed files with 1,049 additions and 9 deletions.
22 changes: 21 additions & 1 deletion test_macos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,31 @@ REL := test_text.o \
test_bss.o \
test_cross_0.o \
test_cross_1.o \
test_bounce.o
test_timeval.o \
stringx.o \
test_bounce.o \
test_bounce_neon.o \
test_bounce_neon_aosoa.o \
test_bounce_data_aosoa_alt_0.o \
test_bounce_data_aosoa_alt_1.o \
test_bounce_data_aosoa_alt_2.o \
test_bounce_data_aosoa_alt_3.o

stringx.o: ../stringx.s
$(AS) $(ASFLAGS) -o $@ $^

test_bounce.o: test_bounce.s
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) $(call defsym,FB_DIM_Y,$(shell tput lines)) $(call defsym,FRAMES,1024) -o $@ $^

test_bounce_neon.o: test_bounce_neon.s
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) $(call defsym,FB_DIM_Y,$(shell tput lines)) $(call defsym,FRAMES,2048) -o $@ $^

test_bounce_neon_aosoa.o: test_bounce_neon_aosoa.s
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) $(call defsym,FB_DIM_Y,$(shell tput lines)) $(call defsym,FRAMES,1024) -o $@ $^

test_bounce_data_aosoa_alt_3.o: test_bounce_data_aosoa_alt_3.s
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) -o $@ $^

all: $(REL)

clean:
Expand Down
19 changes: 11 additions & 8 deletions test_macos/test_bounce.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.equ SYS_write, 4
.equ SYS_exit, 1
.equ SYS_nanosleep, 101
.equ SYS_select, 93
.equ STDOUT_FILENO, 1

.if 0
Expand Down Expand Up @@ -95,13 +95,16 @@ _start:
adrf x1, fb
mov w3, 0x2020
strh w3, [x1, x4]
.if 0
// TODO xnu equivalent to linux's
mov x8, SYS_nanosleep

// xnu has no nanosleep
mov x16, SYS_select
adr x4, timeval
mov x3, xzr
mov x2, xzr
mov x1, xzr
adr x0, timespec
mov x0, xzr
svc 0
.endif

subs x7, x7, 1
bne .Lframe

Expand All @@ -117,8 +120,8 @@ fb_cursor_cmd:
.ascii "\033[1;1H"
fb_cursor_len = . - fb_cursor_cmd

timespec:
.dword 0, 15500000
timeval:
.dword 0, 15500

.section .bss
.align 6
Expand Down
82 changes: 82 additions & 0 deletions test_macos/test_bounce_data_aosoa_alt_0.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.global blip, blip_end, erase_end

.section .data
.align 6
blip: // AoSoA
.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{0..3} pos_x
.word 0x00000000, 0x00000000, 0x00000000, 0x00000001 // blip{0..3} pos_y
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_y

.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{4..7} pos_x
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003 // blip{4..7} pos_y
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_y

.word 0x00000000, 0x00000002, 0x00000004, 0x00000008
.word 0x00000004, 0x00000004, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000008, 0x00000008, 0x00000008, 0x00000008
.word 0x00000001, 0x00000002, 0x00000003, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000000a, 0x0000000c, 0x00000010, 0x00000012
.word 0x00000004, 0x00000004, 0x00000000, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000014, 0x00000010, 0x00000010, 0x00000012
.word 0x00000000, 0x00000001, 0x00000002, 0x00000002
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000014, 0x00000010, 0x00000010, 0x0000001c
.word 0x00000002, 0x00000003, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000001e, 0x00000020, 0x0000001c, 0x00000022
.word 0x00000000, 0x00000000, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000001c, 0x0000001e, 0x00000020, 0x0000001c
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000022, 0x0000001c, 0x00000022, 0x00000026
.word 0x00000003, 0x00000004, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
.word 0x00000000, 0x00000000, 0x00000001, 0x00000002
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
.word 0x00000002, 0x00000002, 0x00000003, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000028, 0x0000002a, 0x0000002e, 0x0000002e
.word 0x00000004, 0x00000004, 0x00000000, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000002e, 0x0000002e, 0x0000002e, 0x00000030
.word 0x00000002, 0x00000003, 0x00000004, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000032, 0x00000036, 0x00000038, 0x00000036
.word 0x00000004, 0x00000001, 0x00000002, 0x00000003
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
blip_end:
.fill (blip_end - blip) / 16, 4
erase_end:
72 changes: 72 additions & 0 deletions test_macos/test_bounce_data_aosoa_alt_1.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.global blip, blip_end, erase_end

.section .data
.align 6
blip: // AoSoA
.word 0x00000000, 0x00000006, 0x00000000, 0x00000006 // blip{0..3} pos_x
.word 0x00000000, 0x00000000, 0x00000001, 0x00000001 // blip{0..3} pos_y
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_y

.word 0x00000000, 0x00000002, 0x00000004, 0x00000006 // blip{4..7} pos_x
.word 0x00000002, 0x00000002, 0x00000002, 0x00000002 // blip{4..7} pos_y
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_y

.word 0x00000000, 0x00000006, 0x00000000, 0x00000006
.word 0x00000003, 0x00000003, 0x00000004, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000000a, 0x0000000c, 0x0000000e, 0x0000000a
.word 0x00000000, 0x00000000, 0x00000000, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000000a, 0x0000000c, 0x0000000e, 0x0000000a
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000000a, 0x0000000c, 0x0000000e, 0x00000012
.word 0x00000004, 0x00000004, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000012, 0x00000012, 0x00000012, 0x00000012
.word 0x00000001, 0x00000002, 0x00000003, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000014, 0x00000016, 0x0000001a, 0x0000001a
.word 0x00000004, 0x00000004, 0x00000000, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001c
.word 0x00000002, 0x00000003, 0x00000004, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000001e, 0x00000024, 0x00000026, 0x00000028
.word 0x00000004, 0x00000000, 0x00000000, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000022, 0x00000028, 0x00000022, 0x00000028
.word 0x00000001, 0x00000001, 0x00000002, 0x00000002
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000022, 0x00000028, 0x00000022, 0x00000024
.word 0x00000003, 0x00000003, 0x00000004, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000026, 0x0000002c, 0x0000002e, 0x0000002c
.word 0x00000004, 0x00000001, 0x00000002, 0x00000003
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
blip_end:
.fill (blip_end - blip) / 16, 4
erase_end:
147 changes: 147 additions & 0 deletions test_macos/test_bounce_data_aosoa_alt_2.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.global blip, blip_end, erase_end

.section .data
.align 6
blip: // AoSoA
.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{0..3} pos_x
.word 0x00000000, 0x00000000, 0x00000000, 0x00000001 // blip{0..3} pos_y
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_y

.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{4..7} pos_x
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003 // blip{4..7} pos_y
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_y

.word 0x00000000, 0x00000002, 0x00000004, 0x00000008
.word 0x00000004, 0x00000004, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000008, 0x00000008, 0x00000008, 0x00000008
.word 0x00000001, 0x00000002, 0x00000003, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000000a, 0x0000000c, 0x00000010, 0x00000012
.word 0x00000004, 0x00000004, 0x00000000, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000014, 0x00000010, 0x00000010, 0x00000012
.word 0x00000000, 0x00000001, 0x00000002, 0x00000002
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000014, 0x00000010, 0x00000010, 0x0000001c
.word 0x00000002, 0x00000003, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000001e, 0x00000020, 0x0000001c, 0x00000022
.word 0x00000000, 0x00000000, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000001c, 0x0000001e, 0x00000020, 0x0000001c
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000022, 0x0000001c, 0x00000022, 0x00000026
.word 0x00000003, 0x00000004, 0x00000004, 0x00000000
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
.word 0x00000000, 0x00000000, 0x00000001, 0x00000002
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
.word 0x00000002, 0x00000002, 0x00000003, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000028, 0x0000002a, 0x0000002e, 0x0000002e
.word 0x00000004, 0x00000004, 0x00000000, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000002e, 0x0000002e, 0x0000002e, 0x00000030
.word 0x00000002, 0x00000003, 0x00000004, 0x00000004
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000032, 0x00000036, 0x00000038, 0x00000036
.word 0x00000004, 0x00000001, 0x00000002, 0x00000003
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000050, 0x00000056, 0x00000050, 0x00000056 // blip{60..63} pos_x
.word 0x00000020, 0x00000020, 0x00000021, 0x00000021 // blip{60..63} pos_y
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff // blip{60..63} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{60..63} step_y

.word 0x00000050, 0x00000052, 0x00000054, 0x00000056 // blip{64..67} pos_x
.word 0x00000022, 0x00000022, 0x00000022, 0x00000022 // blip{64..67} pos_y
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff // blip{64..67} step_x
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{64..67} step_y

.word 0x00000050, 0x00000056, 0x00000050, 0x00000056
.word 0x00000023, 0x00000023, 0x00000024, 0x00000024
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005a
.word 0x00000020, 0x00000020, 0x00000020, 0x00000021
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005a
.word 0x00000022, 0x00000022, 0x00000022, 0x00000023
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000005a, 0x0000005c, 0x0000005e, 0x00000062
.word 0x00000024, 0x00000024, 0x00000024, 0x00000020
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000062, 0x00000062, 0x00000062, 0x00000062
.word 0x00000021, 0x00000022, 0x00000023, 0x00000024
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000064, 0x00000066, 0x0000006a, 0x0000006a
.word 0x00000024, 0x00000024, 0x00000020, 0x00000021
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000006a, 0x0000006a, 0x0000006a, 0x0000006c
.word 0x00000022, 0x00000023, 0x00000024, 0x00000024
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x0000006e, 0x00000074, 0x00000076, 0x00000078
.word 0x00000024, 0x00000020, 0x00000020, 0x00000020
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000072, 0x00000078, 0x00000072, 0x00000078
.word 0x00000021, 0x00000021, 0x00000022, 0x00000022
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000072, 0x00000078, 0x00000072, 0x00000074
.word 0x00000023, 0x00000023, 0x00000024, 0x00000024
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001

.word 0x00000076, 0x0000007c, 0x0000007e, 0x0000007c
.word 0x00000024, 0x00000021, 0x00000022, 0x00000023
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
blip_end:
.fill (blip_end - blip) / 16, 4
erase_end:
Loading

0 comments on commit 227ac33

Please sign in to comment.