about summary refs log tree commit diff
path: root/tests/codegen/simd
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-05-29 14:11:20 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-05-31 15:56:43 +1000
commit72800d3b896a5733d08213ec357f3a875f1f5b0e (patch)
treebbe11913ee6b18b5f53cdef21d53b9243f816f61 /tests/codegen/simd
parentb1b18e6031cb31b8c1a07e455e65b52eccc6305b (diff)
downloadrust-72800d3b896a5733d08213ec357f3a875f1f5b0e.tar.gz
rust-72800d3b896a5733d08213ec357f3a875f1f5b0e.zip
Run rustfmt on `tests/codegen/`.
Except for `simd-intrinsic/`, which has a lot of files containing
multiple types like `u8x64` which really are better when hand-formatted.

There is a surprising amount of two-space indenting in this directory.

Non-trivial changes:
- `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the
  test.
- `rustfmt::skip` used in a few places where hand-formatting read more
  nicely: `enum/enum-match.rs`
- Line number adjustments needed for the expected output of
  `debug-column.rs` and `coroutine-debug.rs`.
Diffstat (limited to 'tests/codegen/simd')
-rw-r--r--tests/codegen/simd/issue-120720-reduce-nan.rs5
-rw-r--r--tests/codegen/simd/swap-simd-types.rs18
2 files changed, 11 insertions, 12 deletions
diff --git a/tests/codegen/simd/issue-120720-reduce-nan.rs b/tests/codegen/simd/issue-120720-reduce-nan.rs
index 0372582bf7f..13af0bb076e 100644
--- a/tests/codegen/simd/issue-120720-reduce-nan.rs
+++ b/tests/codegen/simd/issue-120720-reduce-nan.rs
@@ -15,8 +15,7 @@ pub unsafe fn demo() -> bool {
     // CHECK: %0 = tail call reassoc double @llvm.vector.reduce.fadd.v8f64(
     // CHECK: %_0.i = fcmp uno double %0, 0.000000e+00
     // CHECK: ret i1 %_0.i
-    let res = unsafe {
-        _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN))
-    };
+    let res =
+        unsafe { _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN)) };
     res.is_nan()
 }
diff --git a/tests/codegen/simd/swap-simd-types.rs b/tests/codegen/simd/swap-simd-types.rs
index 32e75220d69..cd6e84286e1 100644
--- a/tests/codegen/simd/swap-simd-types.rs
+++ b/tests/codegen/simd/swap-simd-types.rs
@@ -13,18 +13,18 @@ use core::arch::x86_64::__m256;
 // CHECK-LABEL: @swap_single_m256
 #[no_mangle]
 pub fn swap_single_m256(x: &mut __m256, y: &mut __m256) {
-// CHECK-NOT: alloca
-// CHECK: load <8 x float>{{.+}}align 32
-// CHECK: store <8 x float>{{.+}}align 32
+    // CHECK-NOT: alloca
+    // CHECK: load <8 x float>{{.+}}align 32
+    // CHECK: store <8 x float>{{.+}}align 32
     swap(x, y)
 }
 
 // CHECK-LABEL: @swap_m256_slice
 #[no_mangle]
 pub fn swap_m256_slice(x: &mut [__m256], y: &mut [__m256]) {
-// CHECK-NOT: alloca
-// CHECK: load <8 x float>{{.+}}align 32
-// CHECK: store <8 x float>{{.+}}align 32
+    // CHECK-NOT: alloca
+    // CHECK: load <8 x float>{{.+}}align 32
+    // CHECK: store <8 x float>{{.+}}align 32
     if x.len() == y.len() {
         x.swap_with_slice(y);
     }
@@ -33,8 +33,8 @@ pub fn swap_m256_slice(x: &mut [__m256], y: &mut [__m256]) {
 // CHECK-LABEL: @swap_bytes32
 #[no_mangle]
 pub fn swap_bytes32(x: &mut [u8; 32], y: &mut [u8; 32]) {
-// CHECK-NOT: alloca
-// CHECK: load <32 x i8>{{.+}}align 1
-// CHECK: store <32 x i8>{{.+}}align 1
+    // CHECK-NOT: alloca
+    // CHECK: load <32 x i8>{{.+}}align 1
+    // CHECK: store <32 x i8>{{.+}}align 1
     swap(x, y)
 }