asm

command
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2023 License: Apache-2.0, MIT Imports: 3 Imported by: 0

README

Converting C++ to Assembly

All SIMD functions are generated from C++. Most of it is portable, auto-vectorized code. To add a new function:

  1. Compile the C++ source code to AT&T assembly with Clang, flags -Ofast -mfma -mavx2 -funroll-loops -fomit-frame-pointer -std=c++17
  2. Convert the output to avo instructions with python asm/asm2avo.py --suffix AVX2 input.s --out output.go
  3. Fix potential issues with the output. Data sections need to be added manually and moves changed to unaligned access
  4. Add the avo section to asm/gen.go and generate Go assembly and stubs with go generate asm/gen.go

The C++ code was mostly compiled and analyzed with godbolt. Other assembly output may need additional cleanup. To compile code that uses vcl run godbolt locally and add -I/path/to/vcl to the compiler flags.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL