diff options
author | Ayke van Laethem <[email protected]> | 2024-08-22 15:53:22 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2024-09-05 08:00:03 +0200 |
commit | 25abfff63204f72140ab1b29120ab9b674d5cf41 (patch) | |
tree | 576967bc8c351d7045547bc818ae0fb21cde8759 /compileopts/target.go | |
parent | e39358d0ee9d08fad1a838ecb4ea9322d4f9bbfa (diff) | |
download | tinygo-25abfff63204f72140ab1b29120ab9b674d5cf41.tar.gz tinygo-25abfff63204f72140ab1b29120ab9b674d5cf41.zip |
mips: use MIPS32 (instead of MIPS32R2) as the instruction set
This should widen compatibility a bit, so that older CPUs can also
execute programs built by TinyGo. The performance may be lower, if
that's an issue we can look into implementing the proposal here:
https://github.com/golang/go/issues/60072
This still wouldn't make programs usable on MIPS II CPUs, I suppose we
can lower compatiblity down to that CPU if needed.
I tried setting the -cpu flag in the QEMU command line to be able to
test this, but it looks like there are no QEMU CPU models that are
mips32r1 and have a FPU. So it's difficult to test this.
Diffstat (limited to 'compileopts/target.go')
-rw-r--r-- | compileopts/target.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compileopts/target.go b/compileopts/target.go index c394fa8ca..41a7babd9 100644 --- a/compileopts/target.go +++ b/compileopts/target.go @@ -336,7 +336,7 @@ func defaultTarget(options *Options) (*TargetSpec, error) { spec.Features = "+fp-armv8,+neon,-fmv,-outline-atomics" } case "mips", "mipsle": - spec.CPU = "mips32r2" + spec.CPU = "mips32" spec.CFlags = append(spec.CFlags, "-fno-pic") if options.GOARCH == "mips" { llvmarch = "mips" // big endian @@ -345,10 +345,10 @@ func defaultTarget(options *Options) (*TargetSpec, error) { } switch options.GOMIPS { case "hardfloat": - spec.Features = "+fpxx,+mips32r2,+nooddspreg,-noabicalls" + spec.Features = "+fpxx,+mips32,+nooddspreg,-noabicalls" case "softfloat": spec.SoftFloat = true - spec.Features = "+mips32r2,+soft-float,-noabicalls" + spec.Features = "+mips32,+soft-float,-noabicalls" spec.CFlags = append(spec.CFlags, "-msoft-float") default: return nil, fmt.Errorf("invalid GOMIPS=%s: must be hardfloat or softfloat", options.GOMIPS) |