File tree Expand file tree Collapse file tree 4 files changed +60
-2
lines changed Expand file tree Collapse file tree 4 files changed +60
-2
lines changed Original file line number Diff line number Diff line change @@ -807,6 +807,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
807
807
Compared to v2, it is now typically 1.5x to 2x faster, uses half
808
808
as much memory, and it supports an unlimited number of
809
809
goroutines.
810
+ On Linux, the race detector now requires at least glibc version 2.17.
810
811
</ p >
811
812
812
813
< p > <!-- CL 336549 -->
Original file line number Diff line number Diff line change
1
+ // Copyright 2021 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
+ #include "textflag.h"
6
+
7
+ #define PosInf 0x7FF0000000000000
8
+ #define NaN 0x7FF8000000000001
9
+
10
+ // func archHypot(p, q float64) float64
11
+ TEXT ·archHypot(SB), NOSPLIT, $0 -24
12
+ FMOVD p+0 (FP), F0
13
+ FMOVD q+8 (FP), F1
14
+ MOVD $PosInf, R0
15
+ FMOVD R0, F30 // F30 is PosInf
16
+
17
+ FABSD F0, F0
18
+ FABSD F1, F1
19
+ FCMPD F30, F0
20
+ BGE isInf
21
+ FCMPD F30, F1
22
+ BGE isInf
23
+
24
+ FCMPED F0, F0
25
+ BNE isNaN
26
+ FCMPED F1, F1
27
+ BNE isNaN
28
+
29
+ FMAXD F0, F1, F2 // p is greater
30
+ FMIND F0, F1, F3 // q is less
31
+ FCMPD F2, 0 .0
32
+ BEQ IsZero // if p == 0, return 0
33
+
34
+ // p q
35
+ FDIVD F2, F3, F3
36
+ FMULD F3, F3, F3
37
+ FMOVD $1.0 , F4
38
+ FADDD F4, F3, F3
39
+ FSQRTD F3, F3
40
+ FMULD F3, F2, F3
41
+ FMOVD F3, ret +16 (FP)
42
+ RET
43
+
44
+ isNaN:
45
+ MOVD $NaN, R0
46
+ FMOVD R0, F29 // F29 is NaN
47
+ FMOVD F29, ret +16 (FP) // return NaN
48
+ RET
49
+ isInf:
50
+ FMOVD F30, ret +16 (FP) // return +Inf
51
+ RET
52
+ isZero:
53
+ // R0 has been set to zero
54
+ MOVD R0, ret +16 (FP) // return 0
55
+ RET
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- //go:build 386 || amd64
5
+ //go:build 386 || amd64 || arm64
6
+ // +build 386 amd64 arm64
6
7
7
8
package math
8
9
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- //go:build !386 && !amd64
5
+ //go:build !386 && !amd64 && !arm64
6
+ // +build !386,!amd64,!arm64
6
7
7
8
package math
8
9
You can’t perform that action at this time.
0 commit comments