Skip to content

Instantly share code, notes, and snippets.

@pankkor
Created August 6, 2024 11:20
Show Gist options
  • Select an option

  • Save pankkor/876865dbb9151e7772fd42d1eae5262d to your computer and use it in GitHub Desktop.

Select an option

Save pankkor/876865dbb9151e7772fd42d1eae5262d to your computer and use it in GitHub Desktop.

Revisions

  1. pankkor created this gist Aug 6, 2024.
    9 changes: 9 additions & 0 deletions macos_aarch64_fabs.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    FORCE_INLINE static f32 absf32(f32 v) {
    f32 ret;
    __asm__ volatile (
    "fabs %s0, %s1\n"
    : "=w" (ret)
    : "w" (v)
    );
    return ret;
    }