@@ -17,31 +17,27 @@ macro_rules! p {
17
17
}
18
18
}
19
19
pub fn find < ' tcx > ( _tcx : & ty:: ctxt < ' tcx > , name : & str ) -> Option < Intrinsic > {
20
- Some ( match name {
21
- "vpmax_u8" => p ! ( "vpmaxu.v8i8" , ( i8x8, i8x8) -> i8x8) ,
22
- "vpmax_s8" => p ! ( "vpmaxs.v8i8" , ( i8x8, i8x8) -> i8x8) ,
23
- "vpmax_u16" => p ! ( "vpmaxu.v4i16" , ( i16x4, i16x4) -> i16x4) ,
24
- "vpmax_s16" => p ! ( "vpmaxs.v4i16" , ( i16x4, i16x4) -> i16x4) ,
25
- "vpmax_u32" => p ! ( "vpmaxu.v2i32" , ( i32x2, i32x2) -> i32x2) ,
26
- "vpmax_s32" => p ! ( "vpmaxs.v2i32" , ( i32x2, i32x2) -> i32x2) ,
27
-
28
- "vpmin_u8" => p ! ( "vpminu.v8i8" , ( i8x8, i8x8) -> i8x8) ,
29
- "vpmin_s8" => p ! ( "vpmins.v8i8" , ( i8x8, i8x8) -> i8x8) ,
30
- "vpmin_u16" => p ! ( "vpminu.v4i16" , ( i16x4, i16x4) -> i16x4) ,
31
- "vpmin_s16" => p ! ( "vpmins.v4i16" , ( i16x4, i16x4) -> i16x4) ,
32
- "vpmin_u32" => p ! ( "vpminu.v2i32" , ( i32x2, i32x2) -> i32x2) ,
33
- "vpmin_s32" => p ! ( "vpmins.v2i32" , ( i32x2, i32x2) -> i32x2) ,
34
-
35
- "vsqrtq_f32" => plain ! ( "llvm.sqrt.v4f32" , ( f32x4) -> f32x4) ,
36
- "vsqrtq_f64" => plain ! ( "llvm.sqrt.v2f64" , ( f64x2) -> f64x2) ,
37
-
38
- "vrecpeq_f32" => p ! ( "vrecpe.v4f32" , ( f32x4) -> f32x4) ,
39
- "vrsqrteq_f32" => p ! ( "vrsqrte.v4f32" , ( f32x4) -> f32x4) ,
40
- "vrsqrteq_f64" => p ! ( "vrsqrte.v2f64" , ( f64x2) -> f64x2) ,
41
-
42
- "vmaxq_f32" => p ! ( "vmaxs.v4f32" , ( f32x4, f32x4) -> f32x4) ,
43
-
44
- "vminq_f32" => p ! ( "vmins.v4f32" , ( f32x4, f32x4) -> f32x4) ,
20
+ if !name. starts_with ( "v" ) { return None }
21
+ Some ( match & name[ "v" . len ( ) ..] {
22
+ "maxq_f32" => p ! ( "vmaxs.v4f32" , ( f32x4, f32x4) -> f32x4) ,
23
+ "minq_f32" => p ! ( "vmins.v4f32" , ( f32x4, f32x4) -> f32x4) ,
24
+ "pmax_s16" => p ! ( "vpmaxs.v4i16" , ( i16x4, i16x4) -> i16x4) ,
25
+ "pmax_s32" => p ! ( "vpmaxs.v2i32" , ( i32x2, i32x2) -> i32x2) ,
26
+ "pmax_s8" => p ! ( "vpmaxs.v8i8" , ( i8x8, i8x8) -> i8x8) ,
27
+ "pmax_u16" => p ! ( "vpmaxu.v4i16" , ( i16x4, i16x4) -> i16x4) ,
28
+ "pmax_u32" => p ! ( "vpmaxu.v2i32" , ( i32x2, i32x2) -> i32x2) ,
29
+ "pmax_u8" => p ! ( "vpmaxu.v8i8" , ( i8x8, i8x8) -> i8x8) ,
30
+ "pmin_s16" => p ! ( "vpmins.v4i16" , ( i16x4, i16x4) -> i16x4) ,
31
+ "pmin_s32" => p ! ( "vpmins.v2i32" , ( i32x2, i32x2) -> i32x2) ,
32
+ "pmin_s8" => p ! ( "vpmins.v8i8" , ( i8x8, i8x8) -> i8x8) ,
33
+ "pmin_u16" => p ! ( "vpminu.v4i16" , ( i16x4, i16x4) -> i16x4) ,
34
+ "pmin_u32" => p ! ( "vpminu.v2i32" , ( i32x2, i32x2) -> i32x2) ,
35
+ "pmin_u8" => p ! ( "vpminu.v8i8" , ( i8x8, i8x8) -> i8x8) ,
36
+ "recpeq_f32" => p ! ( "vrecpe.v4f32" , ( f32x4) -> f32x4) ,
37
+ "rsqrteq_f32" => p ! ( "vrsqrte.v4f32" , ( f32x4) -> f32x4) ,
38
+ "rsqrteq_f64" => p ! ( "vrsqrte.v2f64" , ( f64x2) -> f64x2) ,
39
+ "sqrtq_f32" => plain ! ( "llvm.sqrt.v4f32" , ( f32x4) -> f32x4) ,
40
+ "sqrtq_f64" => plain ! ( "llvm.sqrt.v2f64" , ( f64x2) -> f64x2) ,
45
41
_ => return None ,
46
42
} )
47
43
}
0 commit comments