Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/core_arch/src/s390x/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7477,6 +7477,19 @@ mod tests {
[0, !0, !0, !0]
}

// f32 is the tricky case for max/min as that needs a fallback on z13
test_vec_2! { test_vec_max, vec_max, f32x4, f32x4 -> f32x4,
[1.0, f32::NAN, f32::INFINITY, 2.0],
[-10.0, -10.0, 5.0, f32::NAN],
[1.0, -10.0, f32::INFINITY, 2.0]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I expect this to fail as the fallback does not handle NaNs correctly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, strange. Tests pass with and without the enhancement target feature. Is the fallback actually more accurate than the docs say?

Copy link
Copy Markdown
Member Author

@RalfJung RalfJung Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no, the test probably gets optimized away. (EDIT: Or maybe not, LLVM might just do a proper fallback that matches what it documents rather than the IBM docs.)

Still useful to have the test as it would have shown the issue with #2058.

}

test_vec_2! { test_vec_min, vec_min, f32x4, f32x4 -> f32x4,
[1.0, f32::NAN, f32::INFINITY, 2.0],
[-10.0, -10.0, 5.0, f32::NAN],
[-10.0, -10.0, 5.0, 2.0]
}

#[simd_test(enable = "vector")]
fn test_vec_meadd() {
let a = vector_unsigned_short([1, 0, 2, 0, 3, 0, 4, 0]);
Expand Down
Loading