From b899b54354642c97a0c80f11c5c9a60c39db919d Mon Sep 17 00:00:00 2001 From: Brendan Hansknecht Date: Fri, 2 Jun 2023 15:54:08 -0700 Subject: [PATCH] change assembly comment style to hopefully fix windows --- .../builtins/bitcode/src/libc/cpuid.zig | 28 +++++++++---------- .../bitcode/src/libc/folly/memcpy-x86_64.S | 16 +++++------ .../bitcode/src/libc/musl/memcpy-i386.S | 4 +-- .../bitcode/src/libc/musl/memcpy-x86_64.S | 4 +-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/crates/compiler/builtins/bitcode/src/libc/cpuid.zig b/crates/compiler/builtins/bitcode/src/libc/cpuid.zig index 5d44b80b5e..0b6a08d3c5 100644 --- a/crates/compiler/builtins/bitcode/src/libc/cpuid.zig +++ b/crates/compiler/builtins/bitcode/src/libc/cpuid.zig @@ -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 diff --git a/crates/compiler/builtins/bitcode/src/libc/folly/memcpy-x86_64.S b/crates/compiler/builtins/bitcode/src/libc/folly/memcpy-x86_64.S index 45b321088b..266e56b0a2 100644 --- a/crates/compiler/builtins/bitcode/src/libc/folly/memcpy-x86_64.S +++ b/crates/compiler/builtins/bitcode/src/libc/folly/memcpy-x86_64.S @@ -71,7 +71,7 @@ */ - # .type {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}, @function not supported by windows + // .type {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}, @function not supported by windows {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}: .cfi_startproc @@ -106,7 +106,7 @@ ret .cfi_endproc - # .size {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}, .-{[function_prefix]s}__folly_memcpy_short_{[prefetch]s} not supported by windows + // .size {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}, .-{[function_prefix]s}__folly_memcpy_short_{[prefetch]s} not supported by windows // memcpy is an alternative entrypoint into the function named __folly_memcpy. // The compiler is able to call memcpy since the name is global while @@ -115,12 +115,12 @@ // memcpy is being used. .balign 64 .globl {[function_prefix]s}__folly_memcpy_{[prefetch]s} - # .type {[function_prefix]s}__folly_memcpy_{[prefetch]s}, @function not supported by windows + // .type {[function_prefix]s}__folly_memcpy_{[prefetch]s}, @function not supported by windows {[function_prefix]s}__folly_memcpy_{[prefetch]s}: .cfi_startproc - mov %rdi, %rax # return: $rdi + mov %rdi, %rax // return: $rdi test %rdx, %rdx je .L_EQ0_{[prefetch]s} @@ -261,8 +261,8 @@ // This threshold is half of L1 cache on a Skylake machine, which means that // potentially all of L1 will be populated by this copy once it is executed // (dst and src are cached for temporal copies). - # NON_TEMPORAL_STORE_THRESHOLD = $32768 - # cmp NON_TEMPORAL_STORE_THRESHOLD, %rdx + // NON_TEMPORAL_STORE_THRESHOLD = $32768 + // cmp NON_TEMPORAL_STORE_THRESHOLD, %rdx cmp $32768, %rdx jae .L_NON_TEMPORAL_LOOP_{[prefetch]s} @@ -387,7 +387,7 @@ ret .L_OVERLAP_BWD_{[prefetch]s}: - # Save last 32 bytes. + // Save last 32 bytes. vmovdqu -32(%rsi, %rdx), %ymm8 lea -32(%rdi, %rdx), %r9 @@ -434,4 +434,4 @@ ret .cfi_endproc - # .size {[function_prefix]s}__folly_memcpy_{[prefetch]s}, .-{[function_prefix]s}__folly_memcpy_{[prefetch]s} not supported by windows + // .size {[function_prefix]s}__folly_memcpy_{[prefetch]s}, .-{[function_prefix]s}__folly_memcpy_{[prefetch]s} not supported by windows diff --git a/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-i386.S b/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-i386.S index 66e6ea1d2e..83a2d4261d 100644 --- a/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-i386.S +++ b/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-i386.S @@ -1,6 +1,6 @@ .global {[function_prefix]s}musl_memcpy -# Windows does not support the type directive. -# .type {[function_prefix]s}musl_memcpy,@function +// Windows does not support the type directive. +// .type {[function_prefix]s}musl_memcpy,@function {[function_prefix]s}musl_memcpy: push %esi push %edi diff --git a/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-x86_64.S b/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-x86_64.S index 904386e19b..21391b4553 100644 --- a/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-x86_64.S +++ b/crates/compiler/builtins/bitcode/src/libc/musl/memcpy-x86_64.S @@ -1,6 +1,6 @@ .global {[function_prefix]s}musl_memcpy -# Windows does not support the type directive. -# .type {[function_prefix]s}musl_memcpy,@function +// Windows does not support the type directive. +// .type {[function_prefix]s}musl_memcpy,@function {[function_prefix]s}musl_memcpy: mov %rdi,%rax cmp $8,%rdx