aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-30 11:28:11 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-30 11:28:11 -0400
commit29defd705dcaf25d4a080f7db8f76e8787fca146 (patch)
tree2524f7c0433dfb8bfcac7f2379976d67c5cac1ad /src/codegen.cpp
parentcbfe4b4bae61682e367a477283e4d64a518203a8 (diff)
downloadzig-29defd705dcaf25d4a080f7db8f76e8787fca146.tar.gz
zig-29defd705dcaf25d4a080f7db8f76e8787fca146.zip
back to AT&T syntax for assembly
this reverts 5c04730534ea7933855429c5fc5dc7b22eba7bc2. sadly the quality of the intel dialect in llvm's assembly parser has many frustrating bugs, and generally has unfortunate syntax. the plan is to use AT&T for now since it at least works, and eventually zig will have its own assembly parser for x86 and it will be as close to NASM as possible.
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index a57ff40be3..63a03fc496 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -2088,10 +2088,9 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
}
LLVMTypeRef function_type = LLVMFunctionType(ret_type, param_types, (unsigned)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 = ZigLLVMConstInlineAsm(function_type, buf_ptr(&llvm_template),
- buf_ptr(&constraint_buf), is_volatile, false, is_x86);
+ LLVMValueRef asm_fn = LLVMConstInlineAsm(function_type, buf_ptr(&llvm_template),
+ buf_ptr(&constraint_buf), is_volatile, false);
return LLVMBuildCall(g->builder, asm_fn, param_values, (unsigned)input_and_output_count, "");
}
@@ -4805,9 +4804,6 @@ static void gen_global_asm(CodeGen *g) {
if ((err = os_fetch_file_path(asm_file, &contents))) {
zig_panic("Unable to read %s: %s", buf_ptr(asm_file), err_str(err));
}
- if (g->zig_target.arch.arch == ZigLLVM_x86 || g->zig_target.arch.arch == ZigLLVM_x86_64) {
- buf_append_str(&g->global_asm, ".intel_syntax noprefix\n");
- }
buf_append_buf(&g->global_asm, &contents);
}
}