1
Fork 0

on s390x, use PassMode::Direct for vector types

This commit is contained in:
Folkert de Vries 2025-01-20 15:46:53 +01:00
parent bcd0683e5d
commit 893d81f1e2
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 154 additions and 3 deletions

View file

@ -38,9 +38,17 @@ where
}
let size = arg.layout.size;
if size.bits() <= 128 && arg.layout.is_single_vector_element(cx, size) {
arg.cast_to(Reg { kind: RegKind::Vector, size });
return;
if size.bits() <= 128 {
if let BackendRepr::Vector { .. } = arg.layout.backend_repr {
// pass non-wrapped vector types using `PassMode::Direct`
return;
}
if arg.layout.is_single_vector_element(cx, size) {
// pass non-transparant wrappers around a vector as `PassMode::Cast`
arg.cast_to(Reg { kind: RegKind::Vector, size });
return;
}
}
if !arg.layout.is_aggregate() && size.bits() <= 64 {
arg.extend_integer_width_to(64);