Search in sources :

Example 1 with InlineAssemblyConstraint

use of com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint in project graal by oracle.

the class LLVMGenerator method buildInlineGetRegister.

private LLVMValueRef buildInlineGetRegister(String registerName) {
    LLVMTypeRef inlineAsmType = builder.functionType(builder.rawPointerType());
    String asmSnippet = LLVMTargetSpecific.get().getRegisterInlineAsm(registerName);
    InlineAssemblyConstraint outputConstraint = new InlineAssemblyConstraint(Type.Output, Location.namedRegister(LLVMTargetSpecific.get().getLLVMRegisterName(registerName)));
    LLVMValueRef getRegister = builder.buildInlineAsm(inlineAsmType, asmSnippet, false, false, outputConstraint);
    LLVMValueRef call = builder.buildCall(getRegister);
    builder.setCallSiteAttribute(call, Attribute.GCLeafFunction);
    return call;
}
Also used : LLVMValueRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef) InlineAssemblyConstraint(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint) LLVMTypeRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMTypeRef)

Example 2 with InlineAssemblyConstraint

use of com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint in project graal by oracle.

the class LLVMGenerator method buildInlineJump.

/* Inline assembly */
private void buildInlineJump(LLVMValueRef address) {
    LLVMTypeRef inlineAsmType = builder.functionType(builder.voidType(), builder.rawPointerType());
    String asmSnippet = LLVMTargetSpecific.get().getJumpInlineAsm();
    InlineAssemblyConstraint inputConstraint = new InlineAssemblyConstraint(Type.Input, Location.register());
    LLVMValueRef jump = builder.buildInlineAsm(inlineAsmType, asmSnippet, true, false, inputConstraint);
    LLVMValueRef call = builder.buildCall(jump, address);
    builder.setCallSiteAttribute(call, Attribute.GCLeafFunction);
}
Also used : LLVMValueRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef) InlineAssemblyConstraint(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint) LLVMTypeRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMTypeRef)

Aggregations

InlineAssemblyConstraint (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint)2 LLVMTypeRef (com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMTypeRef)2 LLVMValueRef (com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef)2