Skip to content

Commit

Permalink
feat: add software floating point package
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl authored and omarsy committed Nov 21, 2024
1 parent 549da06 commit 9856ec0
Show file tree
Hide file tree
Showing 4 changed files with 928 additions and 0 deletions.
32 changes: 32 additions & 0 deletions gnovm/pkg/gnolang/internal/softfloat/copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

# softfloat64.go:
# - add header
# - change package name
cat > runtime_softfloat64.go << EOF
// Code generated by copy.sh. DO NOT EDIT.
// This file is copied from \$GOROOT/src/runtime/softfloat64.go.
// It is the software floating point implementation used by the Go runtime.
EOF
cat "$GOROOT/src/runtime/softfloat64.go" >> ./runtime_softfloat64.go
sed -i 's/^package runtime$/package softfloat/' runtime_softfloat64.go

# softfloat64_test.go:
# - add header
# - change package name
# - change import to right package
# - change GOARCH to runtime.GOARCH, and import the "runtime" package
cat > runtime_softfloat64_test.go << EOF
// Code generated by copy.sh. DO NOT EDIT.
// This file is copied from \$GOROOT/src/runtime/softfloat64_test.go.
// It is the tests for the software floating point implementation
// used by the Go runtime.
EOF
cat "$GOROOT/src/runtime/softfloat64_test.go" >> ./runtime_softfloat64_test.go
sed -i 's/^package runtime_test$/package softfloat_test/
s#^\t\. "runtime"$#\t. "github.com/gnolang/gno/gnovm/pkg/gnolang/internal/softfloat"#
s/GOARCH/runtime.GOARCH/g
16a\
"runtime"' runtime_softfloat64_test.go
Loading

0 comments on commit 9856ec0

Please sign in to comment.