OLD | NEW |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // func Hypot(x, y float64) float64 | 5 // func Hypot(x, y float64) float64 |
6 TEXT ·Hypot(SB),7,$0 | 6 TEXT ·Hypot(SB),7,$0 |
7 // test bits for not-finite | 7 // test bits for not-finite |
8 MOVL xh+4(FP), AX // high word x | 8 MOVL xh+4(FP), AX // high word x |
9 ANDL $0x7ff00000, AX | 9 ANDL $0x7ff00000, AX |
10 CMPL AX, $0x7ff00000 | 10 CMPL AX, $0x7ff00000 |
(...skipping 30 matching lines...) Expand all Loading... |
41 MOVL xh+4(FP), AX // high word x | 41 MOVL xh+4(FP), AX // high word x |
42 ORL xl+0(FP), AX // low word x | 42 ORL xl+0(FP), AX // low word x |
43 ANDL $0x7fffffff, AX | 43 ANDL $0x7fffffff, AX |
44 CMPL AX, $0x7ff00000 | 44 CMPL AX, $0x7ff00000 |
45 JEQ is_inf | 45 JEQ is_inf |
46 MOVL yh+12(FP), AX // high word y | 46 MOVL yh+12(FP), AX // high word y |
47 ORL yl+8(FP), AX // low word y | 47 ORL yl+8(FP), AX // low word y |
48 ANDL $0x7fffffff, AX | 48 ANDL $0x7fffffff, AX |
49 CMPL AX, $0x7ff00000 | 49 CMPL AX, $0x7ff00000 |
50 JEQ is_inf | 50 JEQ is_inf |
51 » MOVL $0x7ff00000, rh+20(FP) // return NaN = 0x7FF0000000000001 | 51 » MOVL $0x7FF80000, rh+20(FP) // return NaN = 0x7FF8000000000001 |
52 MOVL $0x00000001, rl+16(FP) | 52 MOVL $0x00000001, rl+16(FP) |
53 RET | 53 RET |
54 is_inf: | 54 is_inf: |
55 MOVL AX, rh+20(FP) // return +Inf = 0x7FF0000000000000 | 55 MOVL AX, rh+20(FP) // return +Inf = 0x7FF0000000000000 |
56 MOVL $0x00000000, rl+16(FP) | 56 MOVL $0x00000000, rl+16(FP) |
57 RET | 57 RET |
OLD | NEW |