mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-25 23:14:59 -07:00
Rename architecture 386 to i386
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ int_least64_t :: builtin.i64
|
||||
uint_least64_t :: builtin.u64
|
||||
|
||||
// Same on Windows, Linux, and FreeBSD
|
||||
when ODIN_ARCH == "386" || ODIN_ARCH == "amd64" {
|
||||
when ODIN_ARCH == "i386" || ODIN_ARCH == "amd64" {
|
||||
int_fast8_t :: builtin.i8
|
||||
uint_fast8_t :: builtin.u8
|
||||
int_fast16_t :: builtin.i32
|
||||
|
||||
@@ -22,7 +22,7 @@ fe_from_bytes :: #force_inline proc (out1: ^Tight_Field_Element, arg1: []byte, a
|
||||
|
||||
assert(len(arg1) == 16)
|
||||
|
||||
when ODIN_ARCH == "386" || ODIN_ARCH == "amd64" {
|
||||
when ODIN_ARCH == "i386" || ODIN_ARCH == "amd64" {
|
||||
// While it may be unwise to do deserialization here on our
|
||||
// own when fiat-crypto provides equivalent functionality,
|
||||
// doing it this way provides a little under 3x performance
|
||||
|
||||
@@ -346,7 +346,7 @@ _do_blocks :: proc (ctx: ^Context, dst, src: []byte, nr_blocks: int) {
|
||||
// Until dedicated assembly can be written leverage the fact that
|
||||
// the callers of this routine ensure that src/dst are valid.
|
||||
|
||||
when ODIN_ARCH == "386" || ODIN_ARCH == "amd64" {
|
||||
when ODIN_ARCH == "i386" || ODIN_ARCH == "amd64" {
|
||||
// util.PUT_U32_LE/util.U32_LE are not required on little-endian
|
||||
// systems that also happen to not be strict about aligned
|
||||
// memory access.
|
||||
|
||||
@@ -22,7 +22,7 @@ when ODIN_BUILD_MODE == .Dynamic {
|
||||
return true
|
||||
}
|
||||
} else when !ODIN_TEST && !ODIN_NO_ENTRY_POINT {
|
||||
when ODIN_ARCH == "386" || ODIN_NO_CRT {
|
||||
when ODIN_ARCH == "i386" || ODIN_NO_CRT {
|
||||
@(link_name="mainCRTStartup", linkage="strong", require)
|
||||
mainCRTStartup :: proc "stdcall" () -> i32 {
|
||||
context = default_context()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//+build 386, amd64
|
||||
//+build i386, amd64
|
||||
package sys_cpu
|
||||
|
||||
_cache_line_size :: 64;
|
||||
|
||||
@@ -675,7 +675,7 @@ when ODIN_ARCH == "amd64" {
|
||||
SYS_landlock_create_ruleset : uintptr : 444
|
||||
SYS_landlock_add_rule : uintptr : 445
|
||||
SYS_landlock_restrict_self : uintptr : 446
|
||||
} else when ODIN_ARCH == "386" {
|
||||
} else when ODIN_ARCH == "i386" {
|
||||
SYS_restart_syscall : uintptr : 0
|
||||
SYS_exit : uintptr : 1
|
||||
SYS_fork : uintptr : 2
|
||||
|
||||
+15
-15
@@ -29,7 +29,7 @@ enum TargetArchKind {
|
||||
TargetArch_Invalid,
|
||||
|
||||
TargetArch_amd64,
|
||||
TargetArch_386,
|
||||
TargetArch_i386,
|
||||
TargetArch_arm64,
|
||||
TargetArch_wasm32,
|
||||
TargetArch_wasm64,
|
||||
@@ -63,7 +63,7 @@ String target_os_names[TargetOs_COUNT] = {
|
||||
String target_arch_names[TargetArch_COUNT] = {
|
||||
str_lit(""),
|
||||
str_lit("amd64"),
|
||||
str_lit("386"),
|
||||
str_lit("i386"),
|
||||
str_lit("arm64"),
|
||||
str_lit("wasm32"),
|
||||
str_lit("wasm64"),
|
||||
@@ -269,9 +269,9 @@ bool global_ignore_warnings(void) {
|
||||
}
|
||||
|
||||
|
||||
gb_global TargetMetrics target_windows_386 = {
|
||||
gb_global TargetMetrics target_windows_i386 = {
|
||||
TargetOs_windows,
|
||||
TargetArch_386,
|
||||
TargetArch_i386,
|
||||
4,
|
||||
8,
|
||||
str_lit("i386-pc-windows-msvc"),
|
||||
@@ -285,9 +285,9 @@ gb_global TargetMetrics target_windows_amd64 = {
|
||||
str_lit("e-m:w-i64:64-f80:128-n8:16:32:64-S128"),
|
||||
};
|
||||
|
||||
gb_global TargetMetrics target_linux_386 = {
|
||||
gb_global TargetMetrics target_linux_i386 = {
|
||||
TargetOs_linux,
|
||||
TargetArch_386,
|
||||
TargetArch_i386,
|
||||
4,
|
||||
8,
|
||||
str_lit("i386-pc-linux-gnu"),
|
||||
@@ -328,9 +328,9 @@ gb_global TargetMetrics target_darwin_arm64 = {
|
||||
str_lit("e-m:o-i64:64-i128:128-n32:64-S128"), // TODO(bill): Is this correct?
|
||||
};
|
||||
|
||||
gb_global TargetMetrics target_freebsd_386 = {
|
||||
gb_global TargetMetrics target_freebsd_i386 = {
|
||||
TargetOs_freebsd,
|
||||
TargetArch_386,
|
||||
TargetArch_i386,
|
||||
4,
|
||||
8,
|
||||
str_lit("i386-unknown-freebsd-elf"),
|
||||
@@ -401,12 +401,12 @@ gb_global NamedTargetMetrics named_targets[] = {
|
||||
{ str_lit("darwin_amd64"), &target_darwin_amd64 },
|
||||
{ str_lit("darwin_arm64"), &target_darwin_arm64 },
|
||||
{ str_lit("essence_amd64"), &target_essence_amd64 },
|
||||
{ str_lit("linux_386"), &target_linux_386 },
|
||||
{ str_lit("linux_i386"), &target_linux_i386 },
|
||||
{ str_lit("linux_amd64"), &target_linux_amd64 },
|
||||
{ str_lit("linux_arm64"), &target_linux_arm64 },
|
||||
{ str_lit("windows_386"), &target_windows_386 },
|
||||
{ str_lit("windows_i386"), &target_windows_i386 },
|
||||
{ str_lit("windows_amd64"), &target_windows_amd64 },
|
||||
{ str_lit("freebsd_386"), &target_freebsd_386 },
|
||||
{ str_lit("freebsd_i386"), &target_freebsd_i386 },
|
||||
{ str_lit("freebsd_amd64"), &target_freebsd_amd64 },
|
||||
{ str_lit("freestanding_wasm32"), &target_freestanding_wasm32 },
|
||||
{ str_lit("wasi_wasm32"), &target_wasi_wasm32 },
|
||||
@@ -879,13 +879,13 @@ void init_build_context(TargetMetrics *cross_target) {
|
||||
#endif
|
||||
#else
|
||||
#if defined(GB_SYSTEM_WINDOWS)
|
||||
metrics = &target_windows_386;
|
||||
metrics = &target_windows_i386;
|
||||
#elif defined(GB_SYSTEM_OSX)
|
||||
#error "Build Error: Unsupported architecture"
|
||||
#elif defined(GB_SYSTEM_FREEBSD)
|
||||
metrics = &target_freebsd_386;
|
||||
metrics = &target_freebsd_i386;
|
||||
#else
|
||||
metrics = &target_linux_386;
|
||||
metrics = &target_linux_i386;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -932,7 +932,7 @@ void init_build_context(TargetMetrics *cross_target) {
|
||||
bc->link_flags = str_lit("-arch x86-64 ");
|
||||
break;
|
||||
}
|
||||
} else if (bc->metrics.arch == TargetArch_386) {
|
||||
} else if (bc->metrics.arch == TargetArch_i386) {
|
||||
switch (bc->metrics.os) {
|
||||
case TargetOs_windows:
|
||||
bc->link_flags = str_lit("/machine:x86 ");
|
||||
|
||||
@@ -3225,7 +3225,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
|
||||
case TargetOs_essence:
|
||||
case TargetOs_freebsd:
|
||||
switch (build_context.metrics.arch) {
|
||||
case TargetArch_386:
|
||||
case TargetArch_i386:
|
||||
case TargetArch_amd64:
|
||||
case TargetArch_arm64:
|
||||
max_arg_count = 7;
|
||||
|
||||
+1
-1
@@ -1193,7 +1193,7 @@ LB_ABI_INFO(lb_get_abi_info) {
|
||||
} else {
|
||||
return lbAbiAmd64SysV::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
|
||||
}
|
||||
case TargetArch_386:
|
||||
case TargetArch_i386:
|
||||
return lbAbi386::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
|
||||
case TargetArch_arm64:
|
||||
return lbAbiArm64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
|
||||
|
||||
@@ -783,7 +783,7 @@ lbProcedure *lb_create_main_procedure(lbModule *m, lbProcedure *startup_runtime)
|
||||
params->Tuple.variables[1] = alloc_entity_param(nullptr, make_token_ident("fdwReason"), t_u32, false, true);
|
||||
params->Tuple.variables[2] = alloc_entity_param(nullptr, make_token_ident("lpReserved"), t_rawptr, false, true);
|
||||
call_cleanup = false;
|
||||
} else if (build_context.metrics.os == TargetOs_windows && (build_context.metrics.arch == TargetArch_386 || build_context.no_crt)) {
|
||||
} else if (build_context.metrics.os == TargetOs_windows && (build_context.metrics.arch == TargetArch_i386 || build_context.no_crt)) {
|
||||
name = str_lit("mainCRTStartup");
|
||||
} else if (is_arch_wasm()) {
|
||||
name = str_lit("_start");
|
||||
@@ -1140,7 +1140,7 @@ void lb_generate_code(lbGenerator *gen) {
|
||||
|
||||
switch (build_context.metrics.arch) {
|
||||
case TargetArch_amd64:
|
||||
case TargetArch_386:
|
||||
case TargetArch_i386:
|
||||
LLVMInitializeX86TargetInfo();
|
||||
LLVMInitializeX86Target();
|
||||
LLVMInitializeX86TargetMC();
|
||||
|
||||
@@ -508,7 +508,7 @@ bool lb_is_matrix_simdable(Type *t) {
|
||||
case TargetArch_arm64:
|
||||
// TODO(bill): determine when this is fine
|
||||
return true;
|
||||
case TargetArch_386:
|
||||
case TargetArch_i386:
|
||||
case TargetArch_wasm32:
|
||||
case TargetArch_wasm64:
|
||||
return false;
|
||||
|
||||
@@ -1361,7 +1361,7 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
|
||||
}
|
||||
|
||||
case BuiltinProc_cpu_relax:
|
||||
if (build_context.metrics.arch == TargetArch_386 ||
|
||||
if (build_context.metrics.arch == TargetArch_i386 ||
|
||||
build_context.metrics.arch == TargetArch_amd64) {
|
||||
LLVMTypeRef func_type = LLVMFunctionType(LLVMVoidTypeInContext(p->module->ctx), nullptr, 0, false);
|
||||
LLVMValueRef the_asm = llvm_get_inline_asm(func_type, str_lit("pause"), {});
|
||||
@@ -2018,7 +2018,7 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
|
||||
inline_asm = llvm_get_inline_asm(func_type, make_string_c(asm_string), make_string_c(constraints));
|
||||
}
|
||||
break;
|
||||
case TargetArch_386:
|
||||
case TargetArch_i386:
|
||||
{
|
||||
GB_ASSERT(arg_count <= 7);
|
||||
|
||||
|
||||
@@ -1494,7 +1494,7 @@ lbValue lb_emit_mul_add(lbProcedure *p, lbValue a, lbValue b, lbValue c, Type *t
|
||||
case TargetArch_arm64:
|
||||
// possible
|
||||
break;
|
||||
case TargetArch_386:
|
||||
case TargetArch_i386:
|
||||
case TargetArch_wasm32:
|
||||
case TargetArch_wasm64:
|
||||
is_possible = false;
|
||||
|
||||
@@ -460,7 +460,7 @@ bool find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *res
|
||||
wchar_t *library_path = nullptr;
|
||||
if (build_context.metrics.arch == TargetArch_amd64) {
|
||||
library_path = concat(bstr_inst_path, L"\\VC\\Tools\\MSVC\\", version, L"\\lib\\x64\\");
|
||||
} else if (build_context.metrics.arch == TargetArch_386) {
|
||||
} else if (build_context.metrics.arch == TargetArch_i386) {
|
||||
library_path = concat(bstr_inst_path, L"\\VC\\Tools\\MSVC\\", version, L"\\lib\\x86\\");
|
||||
} else {
|
||||
continue;
|
||||
@@ -472,7 +472,7 @@ bool find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *res
|
||||
wchar_t *link_exe_path = nullptr;
|
||||
if (build_context.metrics.arch == TargetArch_amd64) {
|
||||
link_exe_path = concat(bstr_inst_path, L"\\VC\\Tools\\MSVC\\", version, L"\\bin\\Hostx64\\x64\\");
|
||||
} else if (build_context.metrics.arch == TargetArch_386) {
|
||||
} else if (build_context.metrics.arch == TargetArch_i386) {
|
||||
link_exe_path = concat(bstr_inst_path, L"\\VC\\Tools\\MSVC\\", version, L"\\bin\\Hostx86\\x86\\");
|
||||
} else {
|
||||
continue;
|
||||
@@ -529,7 +529,7 @@ bool find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *res
|
||||
|
||||
if (build_context.metrics.arch == TargetArch_amd64) {
|
||||
lib_path = concat(buffer, L"VC\\Lib\\amd64\\");
|
||||
} else if (build_context.metrics.arch == TargetArch_386) {
|
||||
} else if (build_context.metrics.arch == TargetArch_i386) {
|
||||
lib_path = concat(buffer, L"VC\\Lib\\");
|
||||
} else {
|
||||
continue;
|
||||
@@ -542,7 +542,7 @@ bool find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *res
|
||||
if (os_file_exists(vcruntime_filename)) {
|
||||
if (build_context.metrics.arch == TargetArch_amd64) {
|
||||
result->vs_exe_path = concat(buffer, L"VC\\bin\\");
|
||||
} else if (build_context.metrics.arch == TargetArch_386) {
|
||||
} else if (build_context.metrics.arch == TargetArch_i386) {
|
||||
// result->vs_exe_path = concat(buffer, L"VC\\bin\\amd64_x86\\");
|
||||
result->vs_exe_path = concat(buffer, L"VC\\bin\\x86_amd64\\");
|
||||
} else {
|
||||
@@ -573,7 +573,7 @@ Find_Result find_visual_studio_and_windows_sdk() {
|
||||
if (build_context.metrics.arch == TargetArch_amd64) {
|
||||
result.windows_sdk_um_library_path = concat(result.windows_sdk_root, L"um\\x64\\");
|
||||
result.windows_sdk_ucrt_library_path = concat(result.windows_sdk_root, L"ucrt\\x64\\");
|
||||
} else if (build_context.metrics.arch == TargetArch_386) {
|
||||
} else if (build_context.metrics.arch == TargetArch_i386) {
|
||||
result.windows_sdk_um_library_path = concat(result.windows_sdk_root, L"um\\x86\\");
|
||||
result.windows_sdk_ucrt_library_path = concat(result.windows_sdk_root, L"ucrt\\x86\\");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user