gitee.com/quant1x/num@v0.3.2/asm/demo/add_amd64.go (about)

     1  //go:build !noasm && !appengine
     2  // +build !noasm,!appengine
     3  
     4  package demo
     5  
     6  import "unsafe"
     7  
     8  // 自动生成add.s
     9  //go:generate clang -S -DENABLE_AVX2 -target x86_64-unknown-none -masm=intel -mno-red-zone -mstackrealign -mllvm -inline-threshold=1000 -fno-asynchronous-unwind-tables -fno-exceptions -fno-rtti -O3 -fno-builtin -ffast-math -mavx cpp/add.c -o cpp/add.s
    10  //go:generate c2goasm -a cpp/add.s add_amd64.s
    11  
    12  //go:noescape
    13  func _Add(fl, result unsafe.Pointer)
    14  
    15  func Add(fl *int) int {
    16  	var _f4 int
    17  	_Add(unsafe.Pointer(fl), unsafe.Pointer(&_f4))
    18  	return _f4
    19  }