Skip to content

Commit

Permalink
huff0: translate asm implementation into avo program
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMula committed Mar 25, 2022
1 parent 0309165 commit 45efab9
Show file tree
Hide file tree
Showing 11 changed files with 1,605 additions and 1,317 deletions.
34 changes: 34 additions & 0 deletions huff0/_generate/cleanup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//go:build custom
// +build custom

package main

import (
"bytes"
"flag"
"io/ioutil"
"log"
"os"

"github.com/klauspost/asmfmt"
)

func main() {
flag.Parse()
args := flag.Args()
for _, file := range args {
data, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalln(err)
}
data = bytes.Replace(data, []byte("\t// #"), []byte("#"), -1)
data, err = asmfmt.Format(bytes.NewBuffer(data))
if err != nil {
log.Fatalln(err)
}
err = ioutil.WriteFile(file, data, os.ModePerm)
if err != nil {
log.Fatalln(err)
}
}
}
Loading

0 comments on commit 45efab9

Please sign in to comment.