Text file
src/runtime/time_windows_amd64.s
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build !faketime
6
7 #include "go_asm.h"
8 #include "textflag.h"
9 #include "time_windows.h"
10
11 TEXT time·now(SB),NOSPLIT,$0-24
12 MOVQ $_INTERRUPT_TIME, DI
13 MOVQ time_lo(DI), AX
14 IMULQ $100, AX
15 MOVQ AX, mono+16(FP)
16
17 MOVQ $_SYSTEM_TIME, DI
18 MOVQ time_lo(DI), AX
19 MOVQ $116444736000000000, DI
20 SUBQ DI, AX
21 IMULQ $100, AX
22
23 // generated code for
24 // func f(x uint64) (uint64, uint64) { return x/1000000000, x%1000000000 }
25 // adapted to reduce duplication
26 MOVQ AX, CX
27 MOVQ $1360296554856532783, AX
28 MULQ CX
29 ADDQ CX, DX
30 RCRQ $1, DX
31 SHRQ $29, DX
32 MOVQ DX, sec+0(FP)
33 IMULQ $1000000000, DX
34 SUBQ DX, CX
35 MOVL CX, nsec+8(FP)
36 RET
37
View as plain text