From 21ab98823985127d97bdda25c377880ee1e0a051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Thu, 6 May 2021 10:10:59 +0200 Subject: [PATCH] atan2: tweak for speed --- dsp/src/atan2.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dsp/src/atan2.rs b/dsp/src/atan2.rs index 6d6e476..bfe33db 100644 --- a/dsp/src/atan2.rs +++ b/dsp/src/atan2.rs @@ -77,6 +77,8 @@ pub fn atan2(y: i32, x: i32) -> i32 { if sign.1 { angle = angle.wrapping_neg(); + // Negation ends up in slightly faster assembly + // angle = !angle; } angle