File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ score:
16
16
mulsd xmm1 , xmm1 ; y^2
17
17
addsd xmm0 , xmm1 ; x^2 + y^2
18
18
sqrtsd xmm0 , xmm0 ; square root of x^2 + y^2, or distance to the center
19
-
19
+
20
20
xor rax , rax ; base value is 0
21
21
22
22
movsd xmm1 , qword [ outer_radius ]
23
- ucomisd xmm0 , xmm1
23
+ ucomisd xmm0 , xmm1
24
24
ja outside_target ; if distance is greater than outer circle, missed the target
25
-
25
+
26
26
movsd xmm1 , qword [ mid_radius ]
27
27
ucomisd xmm0 , xmm1
28
28
ja inside_outer_circle ; if distance is greater than mid circle, it's between mid and outer
31
31
ucomisd xmm0 , xmm1
32
32
ja inside_middle_circle ; if distance is greater than inner circle, it's between inner and mid
33
33
; otherwise, it's inside inner circle
34
-
34
+
35
35
; instructions fall through, accumulating values to give the total for each case
36
36
add al , 5
37
37
inside_middle_circle:
@@ -44,4 +44,3 @@ outside_target:
44
44
%ifidn __OUTPUT_FORMAT__ , elf64
45
45
section .note.GNU - stack noalloc noexec nowrite progbits
46
46
%endif
47
-
Original file line number Diff line number Diff line change 1
1
AS = nasm
2
2
3
- CFLAGS = -g -Wall -Wextra -pedantic -Werror
3
+ CFLAGS = -g -Wall -Wextra -pedantic -Werror -std=c2x -Wno-gnu-binary-literal
4
4
LDFLAGS =
5
5
ASFLAGS = -g -F dwarf -Werror
6
6
Original file line number Diff line number Diff line change 4
4
extern uint8_t score(double x, double y);
5
5
"""
6
6
7
+
7
8
def gen_func_body (prop , inp , expected ):
8
9
str_list = []
9
10
x = inp ["x" ]
You can’t perform that action at this time.
0 commit comments