aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorLayne Gustafson <lgustaf1@binghamton.edu>2020-01-08 22:29:12 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-19 20:53:20 -0500
commitfd17a9962b07147a5b20487ab8e4d9bc0aa946cd (patch)
tree8d7bfb464f4db3669bc246970cb233f414d57643 /src/codegen.cpp
parent03dd376b55a57cbc10269f771f72ced1eaa7aabb (diff)
downloadzig-fd17a9962b07147a5b20487ab8e4d9bc0aa946cd.tar.gz
zig-fd17a9962b07147a5b20487ab8e4d9bc0aa946cd.zip
Add defaut feature support
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 4aa71f32c7..d0749c9432 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -8781,8 +8781,9 @@ static void init(CodeGen *g) {
reloc_mode = LLVMRelocStatic;
}
- const char *target_specific_cpu_args;
- const char *target_specific_features;
+ const char *target_specific_cpu_args = "";
+ const char *target_specific_features = "";
+
if (g->zig_target->is_native) {
// LLVM creates invalid binaries on Windows sometimes.
// See https://github.com/ziglang/zig/issues/508
@@ -8794,22 +8795,6 @@ static void init(CodeGen *g) {
target_specific_cpu_args = ZigLLVMGetHostCPUName();
target_specific_features = ZigLLVMGetNativeFeatures();
}
- } else if (target_is_riscv(g->zig_target)) {
- // TODO https://github.com/ziglang/zig/issues/2883
- // Be aware of https://github.com/ziglang/zig/issues/3275
- target_specific_cpu_args = "";
- target_specific_features = riscv_default_features;
- } else if (g->zig_target->arch == ZigLLVM_x86) {
- // This is because we're really targeting i686 rather than i386.
- // It's pretty much impossible to use many of the language features
- // such as fp16 if you stick use the x87 only. This is also what clang
- // uses as base cpu.
- // TODO https://github.com/ziglang/zig/issues/2883
- target_specific_cpu_args = "pentium4";
- target_specific_features = (g->zig_target->os == OsFreestanding) ? "-sse": "";
- } else {
- target_specific_cpu_args = "";
- target_specific_features = "";
}
// Override CPU and features if defined by user.