Skip to content

Commit 227ac33

Browse files
committed
bring macos tests to near parity with linux tests; TODO move os-agnostic code to own folder
1 parent a5358f7 commit 227ac33

11 files changed

+1049
-9
lines changed

test_macos/Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,31 @@ REL := test_text.o \
1313
test_bss.o \
1414
test_cross_0.o \
1515
test_cross_1.o \
16-
test_bounce.o
16+
test_timeval.o \
17+
stringx.o \
18+
test_bounce.o \
19+
test_bounce_neon.o \
20+
test_bounce_neon_aosoa.o \
21+
test_bounce_data_aosoa_alt_0.o \
22+
test_bounce_data_aosoa_alt_1.o \
23+
test_bounce_data_aosoa_alt_2.o \
24+
test_bounce_data_aosoa_alt_3.o
25+
26+
stringx.o: ../stringx.s
27+
$(AS) $(ASFLAGS) -o $@ $^
1728

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

32+
test_bounce_neon.o: test_bounce_neon.s
33+
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) $(call defsym,FB_DIM_Y,$(shell tput lines)) $(call defsym,FRAMES,2048) -o $@ $^
34+
35+
test_bounce_neon_aosoa.o: test_bounce_neon_aosoa.s
36+
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) $(call defsym,FB_DIM_Y,$(shell tput lines)) $(call defsym,FRAMES,1024) -o $@ $^
37+
38+
test_bounce_data_aosoa_alt_3.o: test_bounce_data_aosoa_alt_3.s
39+
$(AS) $(ASFLAGS) $(call defsym,FB_DIM_X,$(shell tput cols)) -o $@ $^
40+
2141
all: $(REL)
2242

2343
clean:

test_macos/test_bounce.s

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.equ SYS_write, 4
44
.equ SYS_exit, 1
5-
.equ SYS_nanosleep, 101
5+
.equ SYS_select, 93
66
.equ STDOUT_FILENO, 1
77

88
.if 0
@@ -95,13 +95,16 @@ _start:
9595
adrf x1, fb
9696
mov w3, 0x2020
9797
strh w3, [x1, x4]
98-
.if 0
99-
// TODO xnu equivalent to linux's
100-
mov x8, SYS_nanosleep
98+
99+
// xnu has no nanosleep
100+
mov x16, SYS_select
101+
adr x4, timeval
102+
mov x3, xzr
103+
mov x2, xzr
101104
mov x1, xzr
102-
adr x0, timespec
105+
mov x0, xzr
103106
svc 0
104-
.endif
107+
105108
subs x7, x7, 1
106109
bne .Lframe
107110

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

120-
timespec:
121-
.dword 0, 15500000
123+
timeval:
124+
.dword 0, 15500
122125

123126
.section .bss
124127
.align 6
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.global blip, blip_end, erase_end
2+
3+
.section .data
4+
.align 6
5+
blip: // AoSoA
6+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{0..3} pos_x
7+
.word 0x00000000, 0x00000000, 0x00000000, 0x00000001 // blip{0..3} pos_y
8+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_x
9+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_y
10+
11+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{4..7} pos_x
12+
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003 // blip{4..7} pos_y
13+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_x
14+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_y
15+
16+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000008
17+
.word 0x00000004, 0x00000004, 0x00000004, 0x00000000
18+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
19+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
20+
21+
.word 0x00000008, 0x00000008, 0x00000008, 0x00000008
22+
.word 0x00000001, 0x00000002, 0x00000003, 0x00000004
23+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
24+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
25+
26+
.word 0x0000000a, 0x0000000c, 0x00000010, 0x00000012
27+
.word 0x00000004, 0x00000004, 0x00000000, 0x00000000
28+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
29+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
30+
31+
.word 0x00000014, 0x00000010, 0x00000010, 0x00000012
32+
.word 0x00000000, 0x00000001, 0x00000002, 0x00000002
33+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
34+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
35+
36+
.word 0x00000014, 0x00000010, 0x00000010, 0x0000001c
37+
.word 0x00000002, 0x00000003, 0x00000004, 0x00000000
38+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
39+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
40+
41+
.word 0x0000001e, 0x00000020, 0x0000001c, 0x00000022
42+
.word 0x00000000, 0x00000000, 0x00000001, 0x00000001
43+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
44+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
45+
46+
.word 0x0000001c, 0x0000001e, 0x00000020, 0x0000001c
47+
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003
48+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
49+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
50+
51+
.word 0x00000022, 0x0000001c, 0x00000022, 0x00000026
52+
.word 0x00000003, 0x00000004, 0x00000004, 0x00000000
53+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
54+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
55+
56+
.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
57+
.word 0x00000000, 0x00000000, 0x00000001, 0x00000002
58+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
59+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
60+
61+
.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
62+
.word 0x00000002, 0x00000002, 0x00000003, 0x00000004
63+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
64+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
65+
66+
.word 0x00000028, 0x0000002a, 0x0000002e, 0x0000002e
67+
.word 0x00000004, 0x00000004, 0x00000000, 0x00000001
68+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
69+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
70+
71+
.word 0x0000002e, 0x0000002e, 0x0000002e, 0x00000030
72+
.word 0x00000002, 0x00000003, 0x00000004, 0x00000004
73+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
74+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
75+
76+
.word 0x00000032, 0x00000036, 0x00000038, 0x00000036
77+
.word 0x00000004, 0x00000001, 0x00000002, 0x00000003
78+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
79+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
80+
blip_end:
81+
.fill (blip_end - blip) / 16, 4
82+
erase_end:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
.global blip, blip_end, erase_end
2+
3+
.section .data
4+
.align 6
5+
blip: // AoSoA
6+
.word 0x00000000, 0x00000006, 0x00000000, 0x00000006 // blip{0..3} pos_x
7+
.word 0x00000000, 0x00000000, 0x00000001, 0x00000001 // blip{0..3} pos_y
8+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_x
9+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_y
10+
11+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000006 // blip{4..7} pos_x
12+
.word 0x00000002, 0x00000002, 0x00000002, 0x00000002 // blip{4..7} pos_y
13+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_x
14+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_y
15+
16+
.word 0x00000000, 0x00000006, 0x00000000, 0x00000006
17+
.word 0x00000003, 0x00000003, 0x00000004, 0x00000004
18+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
19+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
20+
21+
.word 0x0000000a, 0x0000000c, 0x0000000e, 0x0000000a
22+
.word 0x00000000, 0x00000000, 0x00000000, 0x00000001
23+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
24+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
25+
26+
.word 0x0000000a, 0x0000000c, 0x0000000e, 0x0000000a
27+
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003
28+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
29+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
30+
31+
.word 0x0000000a, 0x0000000c, 0x0000000e, 0x00000012
32+
.word 0x00000004, 0x00000004, 0x00000004, 0x00000000
33+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
34+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
35+
36+
.word 0x00000012, 0x00000012, 0x00000012, 0x00000012
37+
.word 0x00000001, 0x00000002, 0x00000003, 0x00000004
38+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
39+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
40+
41+
.word 0x00000014, 0x00000016, 0x0000001a, 0x0000001a
42+
.word 0x00000004, 0x00000004, 0x00000000, 0x00000001
43+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
44+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
45+
46+
.word 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001c
47+
.word 0x00000002, 0x00000003, 0x00000004, 0x00000004
48+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
49+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
50+
51+
.word 0x0000001e, 0x00000024, 0x00000026, 0x00000028
52+
.word 0x00000004, 0x00000000, 0x00000000, 0x00000000
53+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
54+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
55+
56+
.word 0x00000022, 0x00000028, 0x00000022, 0x00000028
57+
.word 0x00000001, 0x00000001, 0x00000002, 0x00000002
58+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
59+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
60+
61+
.word 0x00000022, 0x00000028, 0x00000022, 0x00000024
62+
.word 0x00000003, 0x00000003, 0x00000004, 0x00000004
63+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
64+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
65+
66+
.word 0x00000026, 0x0000002c, 0x0000002e, 0x0000002c
67+
.word 0x00000004, 0x00000001, 0x00000002, 0x00000003
68+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
69+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
70+
blip_end:
71+
.fill (blip_end - blip) / 16, 4
72+
erase_end:
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
.global blip, blip_end, erase_end
2+
3+
.section .data
4+
.align 6
5+
blip: // AoSoA
6+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{0..3} pos_x
7+
.word 0x00000000, 0x00000000, 0x00000000, 0x00000001 // blip{0..3} pos_y
8+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_x
9+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{0..3} step_y
10+
11+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000000 // blip{4..7} pos_x
12+
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003 // blip{4..7} pos_y
13+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_x
14+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{4..7} step_y
15+
16+
.word 0x00000000, 0x00000002, 0x00000004, 0x00000008
17+
.word 0x00000004, 0x00000004, 0x00000004, 0x00000000
18+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
19+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
20+
21+
.word 0x00000008, 0x00000008, 0x00000008, 0x00000008
22+
.word 0x00000001, 0x00000002, 0x00000003, 0x00000004
23+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
24+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
25+
26+
.word 0x0000000a, 0x0000000c, 0x00000010, 0x00000012
27+
.word 0x00000004, 0x00000004, 0x00000000, 0x00000000
28+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
29+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
30+
31+
.word 0x00000014, 0x00000010, 0x00000010, 0x00000012
32+
.word 0x00000000, 0x00000001, 0x00000002, 0x00000002
33+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
34+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
35+
36+
.word 0x00000014, 0x00000010, 0x00000010, 0x0000001c
37+
.word 0x00000002, 0x00000003, 0x00000004, 0x00000000
38+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
39+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
40+
41+
.word 0x0000001e, 0x00000020, 0x0000001c, 0x00000022
42+
.word 0x00000000, 0x00000000, 0x00000001, 0x00000001
43+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
44+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
45+
46+
.word 0x0000001c, 0x0000001e, 0x00000020, 0x0000001c
47+
.word 0x00000002, 0x00000002, 0x00000002, 0x00000003
48+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
49+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
50+
51+
.word 0x00000022, 0x0000001c, 0x00000022, 0x00000026
52+
.word 0x00000003, 0x00000004, 0x00000004, 0x00000000
53+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
54+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
55+
56+
.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
57+
.word 0x00000000, 0x00000000, 0x00000001, 0x00000002
58+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
59+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
60+
61+
.word 0x00000028, 0x0000002a, 0x00000026, 0x00000026
62+
.word 0x00000002, 0x00000002, 0x00000003, 0x00000004
63+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
64+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
65+
66+
.word 0x00000028, 0x0000002a, 0x0000002e, 0x0000002e
67+
.word 0x00000004, 0x00000004, 0x00000000, 0x00000001
68+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
69+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
70+
71+
.word 0x0000002e, 0x0000002e, 0x0000002e, 0x00000030
72+
.word 0x00000002, 0x00000003, 0x00000004, 0x00000004
73+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
74+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
75+
76+
.word 0x00000032, 0x00000036, 0x00000038, 0x00000036
77+
.word 0x00000004, 0x00000001, 0x00000002, 0x00000003
78+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
79+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
80+
81+
.word 0x00000050, 0x00000056, 0x00000050, 0x00000056 // blip{60..63} pos_x
82+
.word 0x00000020, 0x00000020, 0x00000021, 0x00000021 // blip{60..63} pos_y
83+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff // blip{60..63} step_x
84+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{60..63} step_y
85+
86+
.word 0x00000050, 0x00000052, 0x00000054, 0x00000056 // blip{64..67} pos_x
87+
.word 0x00000022, 0x00000022, 0x00000022, 0x00000022 // blip{64..67} pos_y
88+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff // blip{64..67} step_x
89+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001 // blip{64..67} step_y
90+
91+
.word 0x00000050, 0x00000056, 0x00000050, 0x00000056
92+
.word 0x00000023, 0x00000023, 0x00000024, 0x00000024
93+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
94+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
95+
96+
.word 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005a
97+
.word 0x00000020, 0x00000020, 0x00000020, 0x00000021
98+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
99+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
100+
101+
.word 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005a
102+
.word 0x00000022, 0x00000022, 0x00000022, 0x00000023
103+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
104+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
105+
106+
.word 0x0000005a, 0x0000005c, 0x0000005e, 0x00000062
107+
.word 0x00000024, 0x00000024, 0x00000024, 0x00000020
108+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
109+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
110+
111+
.word 0x00000062, 0x00000062, 0x00000062, 0x00000062
112+
.word 0x00000021, 0x00000022, 0x00000023, 0x00000024
113+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
114+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
115+
116+
.word 0x00000064, 0x00000066, 0x0000006a, 0x0000006a
117+
.word 0x00000024, 0x00000024, 0x00000020, 0x00000021
118+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
119+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
120+
121+
.word 0x0000006a, 0x0000006a, 0x0000006a, 0x0000006c
122+
.word 0x00000022, 0x00000023, 0x00000024, 0x00000024
123+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
124+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
125+
126+
.word 0x0000006e, 0x00000074, 0x00000076, 0x00000078
127+
.word 0x00000024, 0x00000020, 0x00000020, 0x00000020
128+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
129+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
130+
131+
.word 0x00000072, 0x00000078, 0x00000072, 0x00000078
132+
.word 0x00000021, 0x00000021, 0x00000022, 0x00000022
133+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
134+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
135+
136+
.word 0x00000072, 0x00000078, 0x00000072, 0x00000074
137+
.word 0x00000023, 0x00000023, 0x00000024, 0x00000024
138+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
139+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
140+
141+
.word 0x00000076, 0x0000007c, 0x0000007e, 0x0000007c
142+
.word 0x00000024, 0x00000021, 0x00000022, 0x00000023
143+
.word 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
144+
.word 0x00000001, 0x00000001, 0x00000001, 0x00000001
145+
blip_end:
146+
.fill (blip_end - blip) / 16, 4
147+
erase_end:

0 commit comments

Comments
 (0)