@@ -107,24 +107,24 @@ pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>(builder: &Builder<'a, 'gcc
107
107
108
108
args = new_args. into ( ) ;
109
109
} ,
110
- "__builtin_ia32_subps512_mask" | "__builtin_ia32_subpd512_mask"
110
+ "__builtin_ia32_addps512_mask" | "__builtin_ia32_addpd512_mask"
111
+ | "__builtin_ia32_subps512_mask" | "__builtin_ia32_subpd512_mask"
111
112
| "__builtin_ia32_mulps512_mask" | "__builtin_ia32_mulpd512_mask"
112
- | "__builtin_ia32_divps512_mask" | "__builtin_ia32_divpd512_mask"
113
- | "__builtin_ia32_vfmaddsubps512_mask" | "__builtin_ia32_vfmaddsubpd512_mask" => {
113
+ | "__builtin_ia32_divps512_mask" | "__builtin_ia32_divpd512_mask" => {
114
114
let mut new_args = args. to_vec ( ) ;
115
115
let last_arg = new_args. pop ( ) . expect ( "last arg" ) ;
116
+ let arg3_type = gcc_func. get_param_type ( 2 ) ;
117
+ let undefined = builder. current_func ( ) . new_local ( None , arg3_type, "undefined_for_intrinsic" ) . to_rvalue ( ) ;
118
+ new_args. push ( undefined) ;
116
119
let arg4_type = gcc_func. get_param_type ( 3 ) ;
117
120
let minus_one = builder. context . new_rvalue_from_int ( arg4_type, -1 ) ;
118
121
new_args. push ( minus_one) ;
119
122
new_args. push ( last_arg) ;
120
123
args = new_args. into ( ) ;
121
124
} ,
122
- "__builtin_ia32_addps512_mask " | "__builtin_ia32_addpd512_mask " => {
125
+ "__builtin_ia32_vfmaddsubps512_mask " | "__builtin_ia32_vfmaddsubpd512_mask " => {
123
126
let mut new_args = args. to_vec ( ) ;
124
127
let last_arg = new_args. pop ( ) . expect ( "last arg" ) ;
125
- let arg3_type = gcc_func. get_param_type ( 2 ) ;
126
- let undefined = builder. current_func ( ) . new_local ( None , arg3_type, "undefined_for_intrinsic" ) . to_rvalue ( ) ;
127
- new_args. push ( undefined) ;
128
128
let arg4_type = gcc_func. get_param_type ( 3 ) ;
129
129
let minus_one = builder. context . new_rvalue_from_int ( arg4_type, -1 ) ;
130
130
new_args. push ( minus_one) ;
@@ -154,7 +154,10 @@ pub fn ignore_arg_cast(func_name: &str, index: usize, args_len: usize) -> bool {
154
154
return true ;
155
155
}
156
156
} ,
157
- "__builtin_ia32_vfmaddps512_mask" => {
157
+ "__builtin_ia32_vfmaddps512_mask" | "__builtin_ia32_vfmaddpd512_mask" => {
158
+ // Since there are two LLVM intrinsics that map to each of these GCC builtins and only
159
+ // one of them has a missing parameter before the last one, we check the number of
160
+ // arguments to distinguish those cases.
158
161
if args_len == 4 && index == args_len - 1 {
159
162
return true ;
160
163
}
@@ -217,6 +220,7 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function
217
220
"llvm.x86.avx512.div.ps.512" => "__builtin_ia32_divps512_mask" ,
218
221
"llvm.x86.avx512.div.pd.512" => "__builtin_ia32_divpd512_mask" ,
219
222
"llvm.x86.avx512.vfmadd.ps.512" => "__builtin_ia32_vfmaddps512_mask" ,
223
+ "llvm.x86.avx512.vfmadd.pd.512" => "__builtin_ia32_vfmaddpd512_mask" ,
220
224
221
225
// The above doc points to unknown builtins for the following, so override them:
222
226
"llvm.x86.avx2.gather.d.d" => "__builtin_ia32_gathersiv4si" ,
0 commit comments