target: Rename sparcv9 -> sparc64

Rename all references of sparcv9 to sparc64, to make Zig align more with
other projects. Also, added new function to convert glibc arch name to Zig
arch name, since it refers to the architecture as sparcv9.

This is based on the suggestion by @kubkon in PR 11847.
(https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
This commit is contained in:
Koakuma
2022-05-13 22:59:06 +07:00
committed by Andrew Kelley
parent aceb7e18bd
commit fb0692334e
38 changed files with 139 additions and 85 deletions

View File

@@ -21,6 +21,7 @@
#include "zigendian.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <math.h>
@@ -3596,7 +3597,7 @@ static LLVMValueRef gen_soft_float_bin_op(CodeGen *g, LLVMValueRef op1_value, LL
result = LLVMBuildLoad(g->builder, result, "");
}
// Some operations are implemented as compound ops and require us to perform some
// Some operations are implemented as compound ops and require us to perform some
// more operations before we obtain the final result
switch (op_id) {
case IrBinOpDivTrunc:
@@ -9983,6 +9984,12 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
cur_arch = arch_name;
}
}
// Workaround to LLVM/Zig naming mismatch.
// LLVM calls it sparcv9, while Zig calls it sparc64.
if (!strcmp(cur_arch, "sparcv9")) {
cur_arch = "sparc64";
}
}
assert(cur_arch != nullptr);