change assembly comment style to hopefully fix windows

This commit is contained in:
Brendan Hansknecht 2023-06-02 15:54:08 -07:00
parent 341ef9bb7b
commit b899b54354
No known key found for this signature in database
GPG key ID: A199D0660F95F948
4 changed files with 26 additions and 26 deletions

View file

@ -9,24 +9,24 @@ comptime {
switch (arch) {
.x86_64 => {
asm (std.fmt.comptimePrint(
\\ # Check if AVX2 is supported.
\\ # Returns 1 if AVX2 is supported, 0 otherwise.
\\ // Check if AVX2 is supported.
\\ // Returns 1 if AVX2 is supported, 0 otherwise.
\\ .global {[function_prefix]s}supports_avx2;
\\ {[function_prefix]s}supports_avx2:
\\ # Save the EBX register.
\\ // Save the EBX register.
\\ push %rbx
\\
\\ # Call the CPUID instruction with the EAX register set to 7 and ECX set to 0.
\\ # This will get the CPUID information for the current CPU.
\\ // Call the CPUID instruction with the EAX register set to 7 and ECX set to 0.
\\ // This will get the CPUID information for the current CPU.
\\ mov $7, %eax
\\ mov $0, %ecx
\\ cpuid
\\
\\ # The AVX2 feature flag is located in the EBX register at bit 5.
\\ // The AVX2 feature flag is located in the EBX register at bit 5.
\\ bt $5, %ebx
\\ jc .avx2_supported
\\
\\ # AVX2 is not supported.
\\ // AVX2 is not supported.
\\ pop %rbx
\\ mov $0, %eax
\\ ret
@ -37,24 +37,24 @@ comptime {
\\ ret
, .{ .function_prefix = function_prefix }));
asm (std.fmt.comptimePrint(
\\ # Check if prefetchw is supported.
\\ # Returns 1 if the prefetchw instruction is supported, 0 otherwise.
\\ // Check if prefetchw is supported.
\\ // Returns 1 if the prefetchw instruction is supported, 0 otherwise.
\\ .global {[function_prefix]s}supports_prefetchw;
\\ {[function_prefix]s}supports_prefetchw:
\\ # Save the EBX register.
\\ // Save the EBX register.
\\ push %rbx
\\
\\ # Call the CPUID instruction with the EAX register set to 0x80000001 and ECX set to 0.
\\ # This will get the CPUID information for the current CPU.
\\ // Call the CPUID instruction with the EAX register set to 0x80000001 and ECX set to 0.
\\ // This will get the CPUID information for the current CPU.
\\ mov $0x80000001, %eax
\\ mov $0, %ecx
\\ cpuid
\\
\\ # The prefetchw feature flag is located in the ECX register at bit 8.
\\ // The prefetchw feature flag is located in the ECX register at bit 8.
\\ bt $8, %ecx
\\ jc .prefetchw_supported
\\
\\ # AVX2 is not supported.
\\ // AVX2 is not supported.
\\ pop %rbx
\\ mov $0, %eax
\\ ret