From 5c04730534ea7933855429c5fc5dc7b22eba7bc2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 23 Mar 2017 18:59:43 -0400 Subject: use intel dialect for inline assembly closes #242 --- src/codegen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index a336beb11f..66d3e35246 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1772,9 +1772,10 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru } LLVMTypeRef function_type = LLVMFunctionType(ret_type, param_types, input_and_output_count, false); + bool is_x86 = (g->zig_target.arch.arch == ZigLLVM_x86 || g->zig_target.arch.arch == ZigLLVM_x86_64); bool is_volatile = asm_expr->is_volatile || (asm_expr->output_list.length == 0); - LLVMValueRef asm_fn = LLVMConstInlineAsm(function_type, buf_ptr(&llvm_template), - buf_ptr(&constraint_buf), is_volatile, false); + LLVMValueRef asm_fn = ZigLLVMConstInlineAsm(function_type, buf_ptr(&llvm_template), + buf_ptr(&constraint_buf), is_volatile, false, is_x86); return LLVMBuildCall(g->builder, asm_fn, param_values, input_and_output_count, ""); } -- cgit v1.2.3