File: geohash.s

package info (click to toggle)
golang-github-mmcloughlin-avo 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 15,024 kB
  • sloc: xml: 71,029; asm: 14,862; sh: 194; makefile: 21; ansic: 11
file content (35 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Code generated by command: go run asm.go -out geohash.s -stubs stub.go. DO NOT EDIT.

#include "textflag.h"

// func EncodeInt(lat float64, lng float64) uint64
// Requires: BMI2, SSE2
TEXT ·EncodeInt(SB), NOSPLIT, $0-24
	MOVSD lat+0(FP), X0
	MOVSD lng+8(FP), X1
	MULSD reciprocal180<>+0(SB), X0
	ADDSD onepointfive<>+0(SB), X0
	MULSD reciprocal360<>+0(SB), X1
	ADDSD onepointfive<>+0(SB), X1
	MOVQ  X0, CX
	SHRQ  $0x14, CX
	MOVQ  X1, AX
	SHRQ  $0x14, AX
	PDEPQ mask<>+0(SB), CX, CX
	PDEPQ mask<>+0(SB), AX, AX
	SHLQ  $0x01, AX
	XORQ  AX, CX
	MOVQ  CX, ret+16(FP)
	RET

DATA reciprocal180<>+0(SB)/8, $(0.005555555555555556)
GLOBL reciprocal180<>(SB), RODATA|NOPTR, $8

DATA onepointfive<>+0(SB)/8, $(1.5)
GLOBL onepointfive<>(SB), RODATA|NOPTR, $8

DATA reciprocal360<>+0(SB)/8, $(0.002777777777777778)
GLOBL reciprocal360<>(SB), RODATA|NOPTR, $8

DATA mask<>+0(SB)/8, $0x5555555555555555
GLOBL mask<>(SB), RODATA|NOPTR, $8