Skip to content

Instantly share code, notes, and snippets.

@MattBlack85
Last active July 28, 2022 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattBlack85/eadd16deddad6319cd990572d3334fe5 to your computer and use it in GitHub Desktop.
Save MattBlack85/eadd16deddad6319cd990572d3334fe5 to your computer and use it in GitHub Desktop.
2005..=2049 => {
lea ecx, [rax, -, 2005]
cmp cx, 45
jae .LBB39_13
let t = decimal_year - 2000_f64;
vaddsd xmm1, xmm0, qword, ptr, [rip, +, .LCPI39_10]
0.005_589f64.mul_add(t * t, 0.32217f64.mul_add(t, 62.92))
vmulsd xmm2, xmm1, xmm1
vmovsd xmm0, qword, ptr, [rip, +, .LCPI39_11]
vfmadd213sd xmm0, xmm1, qword, ptr, [rip, +, .LCPI39_12]
vfmadd231sd xmm0, xmm2, qword, ptr, [rip, +, .LCPI39_13]
}
add rsp, 56
ret
2005..=2049 => {
lea ecx, [rax, -, 2005]
cmp cx, 45
jae .LBB39_13
let t = decimal_year - 2000_f64;
addsd xmm0, qword, ptr, [rip, +, .LCPI39_10]
0.005_589f64.mul_add(t * t, 0.32217f64.mul_add(t, 62.92))
movapd xmm1, xmm0
mulsd xmm1, xmm0
movsd qword, ptr, [rsp, +, 8], xmm1
movsd xmm1, qword, ptr, [rip, +, .LCPI39_11]
movsd xmm2, qword, ptr, [rip, +, .LCPI39_12]
mov rbx, qword, ptr, [rip, +, fma@GOTPCREL]
call rbx
movapd xmm2, xmm0
movsd xmm1, qword, ptr, [rip, +, .LCPI39_13]
movsd xmm0, qword, ptr, [rsp, +, 8]
mov rax, rbx
add rsp, 64
pop rbx
jmp rax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment