File tree 3 files changed +39
-4
lines changed
src/cmd/compile/internal/ssa 3 files changed +39
-4
lines changed Original file line number Diff line number Diff line change 103
103
(Add16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c+d))])
104
104
(Add32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c+d))])
105
105
(Add64 (Const64 [c]) (Const64 [d])) -> (Const64 [c+d])
106
- (Add32F (Const32F [c]) (Const32F [d])) -> (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
107
- (Add64F (Const64F [c]) (Const64F [d])) -> (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))])
106
+ (Add32F (Const32F [c]) (Const32F [d])) && !math.IsNaN(float64(auxTo32F(c) + auxTo32F(d))) -> (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
107
+ (Add64F (Const64F [c]) (Const64F [d])) && !math.IsNaN(auxTo64F(c) + auxTo64F(d)) -> (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))])
108
108
(AddPtr <t> x (Const64 [c])) -> (OffPtr <t> x [c])
109
109
(AddPtr <t> x (Const32 [c])) -> (OffPtr <t> x [c])
110
110
111
111
(Sub8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c-d))])
112
112
(Sub16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c-d))])
113
113
(Sub32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c-d))])
114
114
(Sub64 (Const64 [c]) (Const64 [d])) -> (Const64 [c-d])
115
- (Sub32F (Const32F [c]) (Const32F [d])) -> (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))])
116
- (Sub64F (Const64F [c]) (Const64F [d])) -> (Const64F [auxFrom64F(auxTo64F(c) - auxTo64F(d))])
115
+ (Sub32F (Const32F [c]) (Const32F [d])) && !math.IsNaN(float64(auxTo32F(c) - auxTo32F(d))) -> (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))])
116
+ (Sub64F (Const64F [c]) (Const64F [d])) && !math.IsNaN(auxTo64F(c) - auxTo64F(d)) -> (Const64F [auxFrom64F(auxTo64F(c) - auxTo64F(d))])
117
117
118
118
(Mul8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c*d))])
119
119
(Mul16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c*d))])
Original file line number Diff line number Diff line change
1
+ // compile
2
+
3
+ // Copyright 2020 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ // Make sure NaN-NaN compiles correctly.
8
+
9
+ package p
10
+
11
+ func f () {
12
+ var st struct {
13
+ f float64
14
+ _ , _ string
15
+ }
16
+
17
+ f := 1e308
18
+ st .f = 2 * f - 2 * f
19
+ }
You can’t perform that action at this time.
0 commit comments