Skip to content

Commit b9ce1e0

Browse files
authored
Rollup merge of #152552 - androm3da:hexagon-hvx-abi-rules, r=madsmtm
Add 2048-bit HvxVectorPair support to Hexagon SIMD ABI checks Previously, rustc rejected HvxVectorPair types in function signatures because the HEXAGON_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI array only had entries for vectors up to 1024 bits. This caused the ABI checker to emit "unsupported vector type" errors for 2048-bit HvxVectorPair (used in 128-byte HVX mode). Add 2048 byte entry to allow HvxVectorPair to be passed in extern "C" funcs when the hvx-length128b is enabled.
2 parents 9e0a05b + eb1e411 commit b9ce1e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_target/src/target_features.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,11 @@ const RISCV_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI: &'static [(u64, &'stat
984984
const SPARC_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI: &'static [(u64, &'static str)] =
985985
&[/*(64, "vis")*/];
986986

987-
const HEXAGON_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI: &'static [(u64, &'static str)] =
988-
&[(512, "hvx-length64b"), (1024, "hvx-length128b")];
987+
const HEXAGON_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI: &'static [(u64, &'static str)] = &[
988+
(512, "hvx-length64b"), // HvxVector in 64-byte mode
989+
(1024, "hvx-length128b"), // HvxVector in 128-byte mode, or HvxVectorPair in 64-byte mode
990+
(2048, "hvx-length128b"), // HvxVectorPair in 128-byte mode
991+
];
989992
const MIPS_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI: &'static [(u64, &'static str)] =
990993
&[(128, "msa")];
991994
const CSKY_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI: &'static [(u64, &'static str)] =

0 commit comments

Comments
 (0)