Last active
January 19, 2025 06:12
-
-
Save define-private-public/07945570cbfe49b98bd88f0f8ea66e19 to your computer and use it in GitHub Desktop.
PSRT Rejection vs. Analytical sampling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RNG::analytical_in_unit_disk(): ; 49 instructions | |
| push rbp | |
| mov rbp, rsp | |
| sub rsp, 64 | |
| mov QWORD PTR [rbp-56], rdi | |
| movsd xmm0, QWORD PTR .LC1[rip] | |
| mov rax, QWORD PTR [rbp-56] | |
| movapd xmm1, xmm0 | |
| mov rdx, QWORD PTR .LC2[rip] | |
| movq xmm0, rdx | |
| mov rdi, rax | |
| call RNG::num(double, double) ; 19 instructions | |
| movq rax, xmm0 | |
| movq xmm0, rax | |
| call sqrt | |
| movq rax, xmm0 | |
| mov QWORD PTR [rbp-8], rax | |
| movsd xmm0, QWORD PTR .LC3[rip] | |
| mov rax, QWORD PTR [rbp-56] | |
| movapd xmm1, xmm0 | |
| mov rdx, QWORD PTR .LC2[rip] | |
| movq xmm0, rdx | |
| mov rdi, rax | |
| call RNG::num(double, double) ; 19 instructions | |
| movq rax, xmm0 | |
| mov QWORD PTR [rbp-16], rax | |
| mov rax, QWORD PTR [rbp-16] | |
| movq xmm0, rax | |
| call cos | |
| movsd xmm1, QWORD PTR [rbp-8] | |
| mulsd xmm0, xmm1 | |
| movsd QWORD PTR [rbp-24], xmm0 | |
| mov rax, QWORD PTR [rbp-16] | |
| movq xmm0, rax | |
| call sin | |
| movsd xmm1, QWORD PTR [rbp-8] | |
| mulsd xmm0, xmm1 | |
| movsd QWORD PTR [rbp-32], xmm0 | |
| movsd xmm0, QWORD PTR [rbp-32] | |
| mov rdx, QWORD PTR [rbp-24] | |
| lea rax, [rbp-48] | |
| movapd xmm1, xmm0 | |
| movq xmm0, rdx | |
| mov rdi, rax | |
| call Vec2::Vec2(double, double) [complete object constructor] ; 14 instructions | |
| mov rax, QWORD PTR [rbp-48] | |
| mov rdx, QWORD PTR [rbp-40] | |
| movq xmm0, rax | |
| movq xmm1, rdx | |
| leave | |
| ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RNG::rejection_in_unit_disk(): ; 41 instructions | |
| push rbp | |
| mov rbp, rsp | |
| push rbx | |
| sub rsp, 40 | |
| mov QWORD PTR [rbp-40], rdi | |
| .L12: | |
| movsd xmm0, QWORD PTR .LC1[rip] | |
| mov rdx, QWORD PTR .LC3[rip] | |
| mov rax, QWORD PTR [rbp-40] | |
| movapd xmm1, xmm0 | |
| movq xmm0, rdx | |
| mov rdi, rax | |
| call RNG::num(double, double) ; 19 instructions | |
| movq rbx, xmm0 | |
| movsd xmm0, QWORD PTR .LC1[rip] | |
| mov rdx, QWORD PTR .LC3[rip] | |
| mov rax, QWORD PTR [rbp-40] | |
| movapd xmm1, xmm0 | |
| movq xmm0, rdx | |
| mov rdi, rax | |
| call RNG::num(double, double) ; 19 instructions | |
| movq rax, xmm0 | |
| lea rdx, [rbp-32] | |
| movq xmm1, rbx | |
| movq xmm0, rax | |
| mov rdi, rdx | |
| call Vec2::Vec2(double, double) [complete object constructor] ; 14 instructions | |
| lea rax, [rbp-32] | |
| mov rdi, rax | |
| call Vec2::length_squared() const ; 16 instructions | |
| movsd xmm1, QWORD PTR .LC1[rip] | |
| comisd xmm1, xmm0 | |
| seta al | |
| test al, al | |
| je .L12 ; Possible jump to repeat the above (29 instructions) | |
| mov rax, QWORD PTR [rbp-32] | |
| mov rdx, QWORD PTR [rbp-24] | |
| movq xmm0, rax | |
| movq xmm1, rdx | |
| mov rbx, QWORD PTR [rbp-8] | |
| leave | |
| ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment