Disable AVX and SSE instruction generation for HULK

This commit is contained in:
Josh Holtrop 2022-11-05 22:02:52 -04:00
parent 1b69810e8f
commit 354555d7f1
2 changed files with 28 additions and 3 deletions

View File

@ -105,7 +105,34 @@ hulk_env = env "hulk", use: %w[ldc2 x86_64-elf-gcc] do |env|
"fontgen" => fontgen_env.expand("^/fontgen"))
env["sources"] = glob("src/hulk/**/*.d")
env["sources"] << "^/src/hulk/kfont.d"
env["DFLAGS"] += %w[-mtriple=x86_64-unknown-elf --betterC -release -O3 --wi --enable-cross-module-inlining -code-model=large]
cpu_attrs = %w[
-avx
-avx2
-avx512bf16
-avx512bitalg
-avx512bw
-avx512cd
-avx512dq
-avx512er
-avx512f
-avx512ifma
-avx512pf
-avx512vbmi
-avx512vbmi2
-avx512vl
-avx512vnni
-avx512vp2intersect
-avx512vpopcntdq
-sse
-sse-unaligned-mem
-sse2
-sse3
-sse4.1
-sse4.2
-sse4a
-ssse3
]
env["DFLAGS"] += %W[-mtriple=x86_64-unknown-elf -mattr=#{cpu_attrs.join(",")} --betterC -release -O3 --wi --enable-cross-module-inlining -code-model=large]
env["D_IMPORT_PATH"] += %w[src]
env["D_IMPORT_PATH"] << env.expand("^/src")
env["LD"] = "x86_64-elf-gcc"

View File

@ -42,8 +42,6 @@ private void initialize_cpu()
write_cr4(read_cr4() | CR4_OSFXSR | CR4_OSXMMEXCPT);
/* 2. Enable OSXSAVE. */
write_cr4(read_cr4() | CR4_OSXSAVE);
/* 3. Enable AVX. */
// xsetbv(0u, xgetbv(0u) | XCR0_X87 | XCR0_SSE | XCR0_AVX);
}
/**