llvm.org GIT mirror llvm / ce89b4e
Add support for inserting inline asm to ocaml. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97412 91177308-0d34-0410-b5e6-96231b3b80d8 Erick Tryzelaar 10 years ago
4 changed file(s) with 28 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
355355 = "llvm_const_extractvalue"
356356 external const_insertvalue : llvalue -> llvalue -> int array -> llvalue
357357 = "llvm_const_insertvalue"
358 external const_inline_asm : lltype -> string -> string -> bool -> bool ->
359 llvalue
360 = "llvm_const_inline_asm"
358361 external block_address : llvalue -> llbasicblock -> llvalue = "LLVMBlockAddress"
359362
360363 (*--... Operations on global variables, functions, and aliases (globals) ...--*)
962962 of the aggregate. See the method [llvm::ConstantExpr::getInsertValue]. *)
963963 external const_insertvalue : llvalue -> llvalue -> int array -> llvalue
964964 = "llvm_const_insertvalue"
965
966 (** [const_inline_asm ty asm con side align] inserts a inline assembly string.
967 See the method [llvm::InlineAsm::get]. *)
968 external const_inline_asm : lltype -> string -> string -> bool -> bool ->
969 llvalue
970 = "llvm_const_inline_asm"
965971
966972 (** [block_address f bb] returns the address of the basic block [bb] in the
967973 function [f]. See the method [llvm::BasicBlock::get]. *)
640640 CAMLreturnT(LLVMValueRef, result);
641641 }
642642
643 /* lltype -> string -> string -> bool -> bool -> llvalue */
644 CAMLprim LLVMValueRef llvm_const_inline_asm(LLVMTypeRef Ty, value Asm,
645 value Constraints, value HasSideEffects,
646 value IsAlignStack) {
647 return LLVMConstInlineAsm(Ty, String_val(Asm), String_val(Constraints),
648 Bool_val(HasSideEffects), Bool_val(IsAlignStack));
649 }
650
643651 /*--... Operations on global variables, functions, and aliases (globals) ...--*/
644652
645653 /* llvalue -> bool */
455455 ignore (define_global "const_shufflevector" (const_shufflevector
456456 (const_vector [| zero; one |])
457457 (const_vector [| one; zero |])
458 (const_bitcast foldbomb (vector_type i32_type 2))) m)
458 (const_bitcast foldbomb (vector_type i32_type 2))) m);
459
460 group "asm"; begin
461 let ft = function_type void_type [| i32_type; i32_type; i32_type |] in
462 ignore (const_inline_asm
463 ft
464 ""
465 "{cx},{ax},{di},~{dirflag},~{fpsr},~{flags},~{edi},~{ecx}"
466 true
467 false)
468 end
459469
460470
461471 (*===-- Global Values -----------------------------------------------------===*)