3 use crate::context::CodegenCx;
5 pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function<'gcc> {
9 let gcc_name = "__builtin_trap";
10 let func = cx.context.get_builtin_function(gcc_name);
11 cx.functions.borrow_mut().insert(gcc_name.to_string(), func);
14 // NOTE: this doc specifies the equivalent GCC builtins: http://huonw.github.io/llvmint/llvmint/x86/index.html
15 "llvm.x86.sse2.cmp.pd" => "__builtin_ia32_cmppd",
16 "llvm.x86.sse2.movmsk.pd" => "__builtin_ia32_movmskpd",
17 "llvm.x86.sse2.pmovmskb.128" => "__builtin_ia32_pmovmskb128",
18 _ => unimplemented!("unsupported LLVM intrinsic {}", name)