<code>GOMIPS_hardfloat</code> or <code>GOMIPS_softfloat</code>.
</p>
+<p>
+The value of <code>GOMIPS64</code> environment variable (<code>hardfloat</code> or
+<code>softfloat</code>) is made available to assembly code by predefining either
+<code>GOMIPS64_hardfloat</code> or <code>GOMIPS64_softfloat</code>.
+</p>
+
<h3 id="unsupported_opcodes">Unsupported opcodes</h3>
<p>
}
arch.REGSP = mips.REGSP
arch.MAXWIDTH = 1 << 50
-
+ arch.SoftFloat = objabi.GOMIPS64 == "softfloat"
arch.ZeroRange = zerorange
arch.ZeroAuto = zeroAuto
arch.Ginsnop = ginsnop
goarm string
go386 string
gomips string
+ gomips64 string
goroot string
goroot_final string
goextlinkenabled string
}
gomips = b
+ b = os.Getenv("GOMIPS64")
+ if b == "" {
+ b = "hardfloat"
+ }
+ gomips64 = b
+
if p := pathf("%s/src/all.bash", goroot); !isfile(p) {
fatalf("$GOROOT is not set correctly or not exported\n"+
"\tGOROOT=%s\n"+
os.Setenv("GOHOSTOS", gohostos)
os.Setenv("GOOS", goos)
os.Setenv("GOMIPS", gomips)
+ os.Setenv("GOMIPS64", gomips64)
os.Setenv("GOROOT", goroot)
os.Setenv("GOROOT_FINAL", goroot_final)
compile = append(compile, "-D", "GOMIPS_"+gomips)
}
+ if goarch == "mips64" || goarch == "mipsle64" {
+ // Define GOMIPS64_value from gomips64.
+ compile = append(compile, "-D", "GOMIPS64_"+gomips64)
+ }
+
doclean := true
b := pathf("%s/%s", workdir, filepath.Base(p))
if goarch == "mips" || goarch == "mipsle" {
xprintf(format, "GOMIPS", gomips)
}
+ if goarch == "mips64" || goarch == "mips64le" {
+ xprintf(format, "GOMIPS64", gomips64)
+ }
if *path {
sep := ":"
// const defaultGO386 = <go386>
// const defaultGOARM = <goarm>
// const defaultGOMIPS = <gomips>
+// const defaultGOMIPS64 = <gomips64>
// const defaultGOOS = runtime.GOOS
// const defaultGOARCH = runtime.GOARCH
// const defaultGO_EXTLINK_ENABLED = <goextlinkenabled>
fmt.Fprintf(&buf, "const defaultGO386 = `%s`\n", go386)
fmt.Fprintf(&buf, "const defaultGOARM = `%s`\n", goarm)
fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips)
+ fmt.Fprintf(&buf, "const defaultGOMIPS64 = `%s`\n", gomips64)
fmt.Fprintf(&buf, "const defaultGOOS = runtime.GOOS\n")
fmt.Fprintf(&buf, "const defaultGOARCH = runtime.GOARCH\n")
fmt.Fprintf(&buf, "const defaultGO_EXTLINK_ENABLED = `%s`\n", goextlinkenabled)
// GOMIPS
// For GOARCH=mips{,le}, whether to use floating point instructions.
// Valid values are hardfloat (default), softfloat.
+// GOMIPS64
+// For GOARCH=mips64{,le}, whether to use floating point instructions.
+// Valid values are hardfloat (default), softfloat.
//
// Special-purpose environment variables:
//
GOROOT_FINAL = findGOROOT_FINAL()
// Used in envcmd.MkEnv and build ID computations.
- GOARM = fmt.Sprint(objabi.GOARM)
- GO386 = objabi.GO386
- GOMIPS = objabi.GOMIPS
+ GOARM = fmt.Sprint(objabi.GOARM)
+ GO386 = objabi.GO386
+ GOMIPS = objabi.GOMIPS
+ GOMIPS64 = objabi.GOMIPS64
)
// Update build context to use our computed GOROOT.
env = append(env, cfg.EnvVar{Name: "GO386", Value: cfg.GO386})
case "mips", "mipsle":
env = append(env, cfg.EnvVar{Name: "GOMIPS", Value: cfg.GOMIPS})
+ case "mips64", "mips64le":
+ env = append(env, cfg.EnvVar{Name: "GOMIPS64", Value: cfg.GOMIPS64})
}
cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
GOMIPS
For GOARCH=mips{,le}, whether to use floating point instructions.
Valid values are hardfloat (default), softfloat.
+ GOMIPS64
+ For GOARCH=mips64{,le}, whether to use floating point instructions.
+ Valid values are hardfloat (default), softfloat.
Special-purpose environment variables:
args = append(args, "-D", "GOMIPS_"+cfg.GOMIPS)
}
+ if cfg.Goarch == "mips64" || cfg.Goarch == "mips64le" {
+ // Define GOMIPS64_value from cfg.GOMIPS64.
+ args = append(args, "-D", "GOMIPS64_"+cfg.GOMIPS64)
+ }
+
var ofiles []string
for _, sfile := range sfiles {
ofile := a.Objdir + sfile[:len(sfile)-len(".s")] + ".o"
var (
defaultGOROOT string // set by linker
- GOROOT = envOr("GOROOT", defaultGOROOT)
- GOARCH = envOr("GOARCH", defaultGOARCH)
- GOOS = envOr("GOOS", defaultGOOS)
- GO386 = envOr("GO386", defaultGO386)
- GOARM = goarm()
- GOMIPS = gomips()
- Version = version
+ GOROOT = envOr("GOROOT", defaultGOROOT)
+ GOARCH = envOr("GOARCH", defaultGOARCH)
+ GOOS = envOr("GOOS", defaultGOOS)
+ GO386 = envOr("GO386", defaultGO386)
+ GOARM = goarm()
+ GOMIPS = gomips()
+ GOMIPS64 = gomips64()
+ Version = version
)
func goarm() int {
panic("unreachable")
}
+func gomips64() string {
+ switch v := envOr("GOMIPS64", defaultGOMIPS64); v {
+ case "hardfloat", "softfloat":
+ return v
+ }
+ log.Fatalf("Invalid GOMIPS64 value. Must be hardfloat or softfloat.")
+ panic("unreachable")
+}
+
func Getgoextlinkenabled() string {
return envOr("GO_EXTLINK_ENABLED", defaultGO_EXTLINK_ENABLED)
}
* Also note that at procedure entry in gc world, 8(R29) will be the
* first arg.
*/
+#ifndef GOMIPS64_softfloat
ADDV $(-8*23), R29
+#else
+ ADDV $(-8*15), R29
+#endif
MOVV R5, (8*1)(R29) // void*
MOVW R6, (8*2)(R29) // int32
MOVV R7, (8*3)(R29) // uintptr
MOVV RSB, (8*12)(R29)
MOVV g, (8*13)(R29)
MOVV R31, (8*14)(R29)
+#ifndef GOMIPS64_softfloat
MOVD F24, (8*15)(R29)
MOVD F25, (8*16)(R29)
MOVD F26, (8*17)(R29)
MOVD F29, (8*20)(R29)
MOVD F30, (8*21)(R29)
MOVD F31, (8*22)(R29)
-
+#endif
// Initialize Go ABI environment
// prepare SB register = PC & 0xffffffff00000000
BGEZAL R0, 1(PC)
MOVV (8*12)(R29), RSB
MOVV (8*13)(R29), g
MOVV (8*14)(R29), R31
+#ifndef GOMIPS64_softfloat
MOVD (8*15)(R29), F24
MOVD (8*16)(R29), F25
MOVD (8*17)(R29), F26
MOVD (8*21)(R29), F30
MOVD (8*22)(R29), F31
ADDV $(8*23), R29
+#else
+ ADDV $(8*15), R29
+#endif
RET
.globl crosscall1
.set noat
crosscall1:
+#ifndef __mips_soft_float
daddiu $29, $29, -160
+#else
+ daddiu $29, $29, -96 // For soft-float, no need to make room for FP registers
+#endif
sd $31, 0($29)
sd $16, 8($29)
sd $17, 16($29)
sd $23, 64($29)
sd $28, 72($29)
sd $30, 80($29)
+#ifndef __mips_soft_float
sdc1 $f24, 88($29)
sdc1 $f25, 96($29)
sdc1 $f26, 104($29)
sdc1 $f29, 128($29)
sdc1 $f30, 136($29)
sdc1 $f31, 144($29)
+#endif
// prepare SB register = pc & 0xffffffff00000000
bal 1f
ld $23, 64($29)
ld $28, 72($29)
ld $30, 80($29)
+#ifndef __mips_soft_float
ldc1 $f24, 88($29)
ldc1 $f25, 96($29)
ldc1 $f26, 104($29)
ldc1 $f29, 128($29)
ldc1 $f30, 136($29)
ldc1 $f31, 144($29)
+#endif
ld $31, 0($29)
-
+#ifndef __mips_soft_float
daddiu $29, $29, 160
+#else
+ daddiu $29, $29, 96
+#endif
jr $31
.set at
// 386/387:"FSQRT" 386/sse2:"SQRTSD"
// arm64:"FSQRTD"
// arm/7:"SQRTD"
- // mips/hardfloat:"SQRTD" mips64:"SQRTD"
+ // mips/hardfloat:"SQRTD" mips/softfloat:-"SQRTD"
+ // mips64/hardfloat:"SQRTD" mips64/softfloat:-"SQRTD"
return math.Sqrt(x)
}
"arm": {"GOARM", "5", "6", "7"},
"arm64": {},
"mips": {"GOMIPS", "hardfloat", "softfloat"},
- "mips64": {},
+ "mips64": {"GOMIPS64", "hardfloat", "softfloat"},
"ppc64": {},
"ppc64le": {},
"s390x": {},