]> Cypherpunks repositories - gostls13.git/commit
runtime: implement time.now in assembly on plan9, solaris, windows
authorRuss Cox <rsc@golang.org>
Mon, 8 Sep 2014 03:40:59 +0000 (23:40 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 8 Sep 2014 03:40:59 +0000 (23:40 -0400)
commit13d0b82bc8821c41ec3782d0d5911cda2499dedc
treebc351fb5d66205a78dd77851410f82ea3daf6178
parent50fc0f1af626c57acaae2eb63781a6d76d7de9f0
runtime: implement time.now in assembly on plan9, solaris, windows

These all used a C implementation that contained 64-bit divide by 1000000000.
On 32-bit systems that ends up in the 64-bit C divide support, which makes
other calls and ends up using a fair amount of stack. We could convert them
to Go but then they'd still end up in software 64-bit divide code. That would
be okay, because Go code can split the stack, but it's still unnecessary.

Write time·now in assembly, just like on all the other systems, and use the
actual hardware support for 64/32 -> 64/32 division. This cuts the software
routines out entirely.

The actual code to do the division is copied and pasted from the sys_darwin_*.s files.

LGTM=alex.brainman
R=golang-codereviews, alex.brainman
CC=aram, golang-codereviews, iant, khr, r
https://golang.org/cl/136300043
src/pkg/runtime/os_plan9.c
src/pkg/runtime/os_solaris.c
src/pkg/runtime/os_windows.c
src/pkg/runtime/sys_darwin_amd64.s
src/pkg/runtime/sys_plan9_386.s
src/pkg/runtime/sys_plan9_amd64.s
src/pkg/runtime/sys_solaris_amd64.s
src/pkg/runtime/sys_windows_386.s
src/pkg/runtime/sys_windows_amd64.s