aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime1.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/runtime1.go')
-rw-r--r--src/runtime/runtime1.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go
index 3ec5c44ebd..43e4c14236 100644
--- a/src/runtime/runtime1.go
+++ b/src/runtime/runtime1.go
@@ -212,10 +212,6 @@ func check() {
throw("bad unsafe.Sizeof y1")
}
- if timediv(12345*1000000000+54321, 1000000000, &e) != 12345 || e != 54321 {
- throw("bad timediv")
- }
-
var z uint32
z = 1
if !atomic.Cas(&z, 1, 2) {
@@ -593,35 +589,6 @@ func setTraceback(level string) {
atomic.Store(&traceback_cache, t)
}
-// Poor mans 64-bit division.
-// This is a very special function, do not use it if you are not sure what you are doing.
-// int64 division is lowered into _divv() call on 386, which does not fit into nosplit functions.
-// Handles overflow in a time-specific manner.
-// This keeps us within no-split stack limits on 32-bit processors.
-//
-//go:nosplit
-func timediv(v int64, div int32, rem *int32) int32 {
- res := int32(0)
- for bit := 30; bit >= 0; bit-- {
- if v >= int64(div)<<uint(bit) {
- v = v - (int64(div) << uint(bit))
- // Before this for loop, res was 0, thus all these
- // power of 2 increments are now just bitsets.
- res |= 1 << uint(bit)
- }
- }
- if v >= int64(div) {
- if rem != nil {
- *rem = 0
- }
- return 0x7fffffff
- }
- if rem != nil {
- *rem = int32(v)
- }
- return res
-}
-
// Helpers for Go. Must be NOSPLIT, must only call NOSPLIT functions, and must not block.
//go:nosplit