about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs b/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs
index c54574d801d..ad46e18c11c 100644
--- a/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs
+++ b/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs
@@ -9,13 +9,13 @@
 
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
-struct f32x4(pub f32, pub f32, pub f32, pub f32);
+struct f32x4(pub [f32; 4]);
 
 use std::intrinsics::simd::*;
 
 fn main() {
-    let x = f32x4(1.0, 2.0, 3.0, 4.0);
-    let y = f32x4(2.0, 1.0, 4.0, 3.0);
+    let x = f32x4([1.0, 2.0, 3.0, 4.0]);
+    let y = f32x4([2.0, 1.0, 4.0, 3.0]);
 
     #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
     let nan = f32::NAN;
@@ -24,13 +24,13 @@ fn main() {
     #[cfg(any(target_arch = "mips", target_arch = "mips64"))]
     let nan = f32::from_bits(f32::NAN.to_bits() - 1);
 
-    let n = f32x4(nan, nan, nan, nan);
+    let n = f32x4([nan, nan, nan, nan]);
 
     unsafe {
         let min0 = simd_fmin(x, y);
         let min1 = simd_fmin(y, x);
         assert_eq!(min0, min1);
-        let e = f32x4(1.0, 1.0, 3.0, 3.0);
+        let e = f32x4([1.0, 1.0, 3.0, 3.0]);
         assert_eq!(min0, e);
         let minn = simd_fmin(x, n);
         assert_eq!(minn, x);
@@ -40,7 +40,7 @@ fn main() {
         let max0 = simd_fmax(x, y);
         let max1 = simd_fmax(y, x);
         assert_eq!(max0, max1);
-        let e = f32x4(2.0, 2.0, 4.0, 4.0);
+        let e = f32x4([2.0, 2.0, 4.0, 4.0]);
         assert_eq!(max0, e);
         let maxn = simd_fmax(x, n);
         assert_eq!(maxn, x);