|
1 | 1 | use std::borrow::Cow; |
2 | 2 |
|
3 | | -use gccjit::{CType, Context, Function, FunctionPtrType, RValue, ToRValue, UnaryOp}; |
| 3 | +use gccjit::{CType, Context, Function, FunctionPtrType, RValue, ToRValue}; |
4 | 4 | use rustc_codegen_ssa::traits::BuilderMethods; |
5 | 5 |
|
6 | 6 | use crate::builder::Builder; |
@@ -43,7 +43,6 @@ pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>( |
43 | 43 | gcc_func: FunctionPtrType<'gcc>, |
44 | 44 | mut args: Cow<'b, [RValue<'gcc>]>, |
45 | 45 | func_name: &str, |
46 | | - original_function_name: Option<&String>, |
47 | 46 | ) -> Cow<'b, [RValue<'gcc>]> { |
48 | 47 | // TODO: this might not be a good way to workaround the missing tile builtins. |
49 | 48 | if func_name == "__builtin_trap" { |
@@ -541,33 +540,6 @@ pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>( |
541 | 540 | let c = builder.context.new_rvalue_from_vector(None, arg3_type, &[new_args[2]; 2]); |
542 | 541 | args = vec![a, b, c, new_args[3]].into(); |
543 | 542 | } |
544 | | - "__builtin_ia32_vfmaddsubpd256" |
545 | | - | "__builtin_ia32_vfmaddsubps" |
546 | | - | "__builtin_ia32_vfmaddsubps256" |
547 | | - | "__builtin_ia32_vfmaddsubpd" => { |
548 | | - if let Some(original_function_name) = original_function_name { |
549 | | - match &**original_function_name { |
550 | | - "llvm.x86.fma.vfmsubadd.pd.256" |
551 | | - | "llvm.x86.fma.vfmsubadd.ps" |
552 | | - | "llvm.x86.fma.vfmsubadd.ps.256" |
553 | | - | "llvm.x86.fma.vfmsubadd.pd" => { |
554 | | - // NOTE: since both llvm.x86.fma.vfmsubadd.ps and llvm.x86.fma.vfmaddsub.ps maps to |
555 | | - // __builtin_ia32_vfmaddsubps, only add minus if this comes from a |
556 | | - // subadd LLVM intrinsic, e.g. _mm256_fmsubadd_pd. |
557 | | - let mut new_args = args.to_vec(); |
558 | | - let arg3 = &mut new_args[2]; |
559 | | - *arg3 = builder.context.new_unary_op( |
560 | | - None, |
561 | | - UnaryOp::Minus, |
562 | | - arg3.get_type(), |
563 | | - *arg3, |
564 | | - ); |
565 | | - args = new_args.into(); |
566 | | - } |
567 | | - _ => (), |
568 | | - } |
569 | | - } |
570 | | - } |
571 | 543 | "__builtin_ia32_ldmxcsr" => { |
572 | 544 | // The builtin __builtin_ia32_ldmxcsr takes an integer value while llvm.x86.sse.ldmxcsr takes a pointer, |
573 | 545 | // so dereference the pointer. |
@@ -913,16 +885,6 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function |
913 | 885 | "llvm.ctlz.v4i64" => "__builtin_ia32_vplzcntq_256_mask", |
914 | 886 | "llvm.ctlz.v2i64" => "__builtin_ia32_vplzcntq_128_mask", |
915 | 887 | "llvm.ctpop.v32i16" => "__builtin_ia32_vpopcountw_v32hi", |
916 | | - "llvm.x86.fma.vfmsub.sd" => "__builtin_ia32_vfmsubsd3", |
917 | | - "llvm.x86.fma.vfmsub.ss" => "__builtin_ia32_vfmsubss3", |
918 | | - "llvm.x86.fma.vfmsubadd.pd" => "__builtin_ia32_vfmaddsubpd", |
919 | | - "llvm.x86.fma.vfmsubadd.pd.256" => "__builtin_ia32_vfmaddsubpd256", |
920 | | - "llvm.x86.fma.vfmsubadd.ps" => "__builtin_ia32_vfmaddsubps", |
921 | | - "llvm.x86.fma.vfmsubadd.ps.256" => "__builtin_ia32_vfmaddsubps256", |
922 | | - "llvm.x86.fma.vfnmadd.sd" => "__builtin_ia32_vfnmaddsd3", |
923 | | - "llvm.x86.fma.vfnmadd.ss" => "__builtin_ia32_vfnmaddss3", |
924 | | - "llvm.x86.fma.vfnmsub.sd" => "__builtin_ia32_vfnmsubsd3", |
925 | | - "llvm.x86.fma.vfnmsub.ss" => "__builtin_ia32_vfnmsubss3", |
926 | 888 | "llvm.x86.avx512.conflict.d.512" => "__builtin_ia32_vpconflictsi_512_mask", |
927 | 889 | "llvm.x86.avx512.conflict.d.256" => "__builtin_ia32_vpconflictsi_256_mask", |
928 | 890 | "llvm.x86.avx512.conflict.d.128" => "__builtin_ia32_vpconflictsi_128_mask", |
@@ -1000,8 +962,6 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function |
1000 | 962 | "llvm.fshr.v32i16" => "__builtin_ia32_vpshrdv_v32hi", |
1001 | 963 | "llvm.fshr.v16i16" => "__builtin_ia32_vpshrdv_v16hi", |
1002 | 964 | "llvm.fshr.v8i16" => "__builtin_ia32_vpshrdv_v8hi", |
1003 | | - "llvm.x86.fma.vfmadd.sd" => "__builtin_ia32_vfmaddsd3", |
1004 | | - "llvm.x86.fma.vfmadd.ss" => "__builtin_ia32_vfmaddss3", |
1005 | 965 | "llvm.x86.rdrand.64" => "__builtin_ia32_rdrand64_step", |
1006 | 966 |
|
1007 | 967 | // The above doc points to unknown builtins for the following, so override them: |
|
0 commit comments