]> git.lizzy.rs Git - rust.git/commitdiff
Simdf64 from attempt
authormiguel raz <miguelraz@gmail.com>
Wed, 26 May 2021 01:10:55 +0000 (20:10 -0500)
committermiguel raz <miguelraz@gmail.com>
Wed, 26 May 2021 01:10:55 +0000 (20:10 -0500)
crates/core_simd/examples/nbody.rs

index 4ca371f44569c98e2bbb1ce8b77ebb9ecdb2272b..cbdcf848fee380ef224915292b83e3d5b134696f 100644 (file)
@@ -5,11 +5,16 @@
 const SOLAR_MASS: f64 = 4.0 * PI * PI;
 const DAYS_PER_YEAR: f64 = 365.24;
 
+#[derive(Debug)]
+#[repr(simd)]
 pub struct Body {
-    pub x: f64x4,
-    pub v: f64x4,
+    pub x: Simdf64([f64, 4]),
+    pub v: Simdf64([f64, 4]),
     pub mass: f64,
 }
+
+// Translation attempt is this ^^^ far
+//
 const N_BODIES: usize = 5;
 #[allow(clippy::unreadable_literal)]
 const BODIES: [Body; N_BODIES] = [