--- /dev/null
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:generate go run gen_const_ppc64le.go
+
+package crc32
func main() {
w := new(bytes.Buffer)
- fmt.Fprintf(w, "// autogenerated: do not edit!\n")
- fmt.Fprintf(w, "// generated from crc32/gen_const_ppc64le.go\n")
+ // Standard: https://go.dev/s/generatedcode
+ fmt.Fprintln(w, `// Code generated by "go run gen_const_ppc64le.go"; DO NOT EDIT.`)
fmt.Fprintln(w)
- fmt.Fprintf(w, "#include \"textflag.h\"\n")
+ fmt.Fprintln(w, `#include "textflag.h"`)
// These are the polynomials supported in vector now.
// If adding others, include the polynomial and a name
err := os.WriteFile("crc32_table_ppc64le.s", b, 0666)
if err != nil {
- fmt.Printf("can't write output: %s\n", err)
+ fmt.Fprintf(os.Stderr, "can't write output: %s\n", err)
}
}