Add 'compiler/rustc_codegen_gcc/' from commit 'afae271d5d
'
git-subtree-dir: compiler/rustc_codegen_gcc git-subtree-mainline:ae90dcf020
git-subtree-split:afae271d5d
This commit is contained in:
commit
f7237f16ae
80 changed files with 15608 additions and 0 deletions
26
compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs
Normal file
26
compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
use gccjit::Function;
|
||||
|
||||
use crate::context::CodegenCx;
|
||||
|
||||
pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function<'gcc> {
|
||||
let _gcc_name =
|
||||
match name {
|
||||
"llvm.x86.xgetbv" => {
|
||||
let gcc_name = "__builtin_trap";
|
||||
let func = cx.context.get_builtin_function(gcc_name);
|
||||
cx.functions.borrow_mut().insert(gcc_name.to_string(), func);
|
||||
return func;
|
||||
},
|
||||
// TODO: this doc specifies the equivalent GCC builtins: http://huonw.github.io/llvmint/llvmint/x86/index.html
|
||||
"llvm.x86.sse2.cmp.pd" => "__builtin_ia32_cmppd",
|
||||
"llvm.x86.sse2.movmsk.pd" => "__builtin_ia32_movmskpd",
|
||||
"llvm.x86.sse2.pmovmskb.128" => "__builtin_ia32_pmovmskb128",
|
||||
_ => unimplemented!("unsupported LLVM intrinsic {}", name)
|
||||
};
|
||||
|
||||
println!("Get target builtin");
|
||||
unimplemented!();
|
||||
/*let func = cx.context.get_target_builtin_function(gcc_name);
|
||||
cx.functions.borrow_mut().insert(gcc_name.to_string(), func);
|
||||
func*/
|
||||
}
|
1286
compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
Normal file
1286
compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
Normal file
File diff suppressed because it is too large
Load diff
1001
compiler/rustc_codegen_gcc/src/intrinsic/simd.rs
Normal file
1001
compiler/rustc_codegen_gcc/src/intrinsic/simd.rs
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue