@@ -3047,6 +3047,38 @@ extern "platform-intrinsic" {
3047
3047
```
3048
3048
"## ,
3049
3049
3050
+ E0442 : r##"
3051
+ Intrinsic argument(s) and/or return value have the wrong length.
3052
+ Erroneous code example:
3053
+
3054
+ ```
3055
+ #[repr(simd)]
3056
+ struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
3057
+ i8, i8, i8, i8, i8, i8, i8, i8);
3058
+ #[repr(simd)]
3059
+ struct i32x4(i32, i32, i32, i32);
3060
+ #[repr(simd)]
3061
+ struct i64x2(i64, i64);
3062
+
3063
+ extern "platform-intrinsic" {
3064
+ fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2;
3065
+ // error: intrinsic arguments have wrong length
3066
+ }
3067
+ ```
3068
+
3069
+ To fix this error, please refer to the function declaration to give
3070
+ it the awaited types with the awaited length. Example:
3071
+
3072
+ ```
3073
+ #[repr(simd)]
3074
+ struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
3075
+
3076
+ extern "platform-intrinsic" {
3077
+ fn x86_mm_adds_epi16(x: i16x8, y: i16x8) -> i16x8; // ok!
3078
+ }
3079
+ ```
3080
+ "##
3081
+
3050
3082
}
3051
3083
3052
3084
register_diagnostics ! {
@@ -3131,7 +3163,6 @@ register_diagnostics! {
3131
3163
E0439 , // invalid `simd_shuffle`, needs length: `{}`
3132
3164
E0440 , // platform-specific intrinsic has wrong number of type parameters
3133
3165
E0441 , // unrecognized platform-specific intrinsic function
3134
- E0442 , // intrinsic {} has wrong type: found {}, expected {}
3135
3166
E0443 , // intrinsic {} has wrong type: found `{}`, expected `{}` which
3136
3167
// was used for this vector type previously in this signature
3137
3168
}
0 commit comments