Skip to content

Commit 7777f9d

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents fdad388 + fb2c881 commit 7777f9d

File tree

35 files changed

+348
-169
lines changed

35 files changed

+348
-169
lines changed

src/cmd/asm/internal/asm/testdata/loong64enc1.s

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66

77
TEXT asmtest(SB),DUPOK|NOSPLIT,$0
88
lable1:
9-
BFPT 1(PC) // 00050048
10-
BFPT lable1 // BFPT 2 //1ffdff4b
9+
BFPT 1(PC) // 00050048
10+
BFPT lable1 // BFPT 2 // 1ffdff4b
11+
BFPT FCC0, lable1 // BFPT FCC0, 2 // 1ff9ff4b
12+
BFPT FCC7, lable1 // BFPT FCC7, 2 // fff5ff4b
1113

1214
lable2:
13-
BFPF 1(PC) // 00040048
14-
BFPF lable2 // BFPF 4 // 1ffcff4b
15+
BFPF 1(PC) // 00040048
16+
BFPF lable2 // BFPF 6 // 1ffcff4b
17+
BFPF FCC0, lable2 // BFPF FCC0, 6 // 1ff8ff4b
18+
BFPF FCC7, lable2 // BFPF FCC7, 6 // fff4ff4b
1519

1620
// relocation in play so the assembled offset should be 0
1721
JMP foo(SB) // 00000050

src/cmd/compile/internal/types2/range.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ func (check *Checker) rangeStmt(inner stmtContext, rangeStmt *syntax.ForStmt, no
3737

3838
if isTypes2 && x.mode != invalid && sValue == nil && !check.hasCallOrRecv {
3939
if t, ok := arrayPtrDeref(under(x.typ)).(*Array); ok {
40+
for {
41+
// Put constant info on the thing inside parentheses.
42+
// That's where (*../noder/writer).expr expects it.
43+
// See issue 73476.
44+
p, ok := rangeVar.(*syntax.ParenExpr)
45+
if !ok {
46+
break
47+
}
48+
rangeVar = p.X
49+
}
4050
// Override type of rangeVar to be a constant
4151
// (and thus side-effects will not be computed
4252
// by the backend).

src/cmd/compile/internal/walk/range.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ func arrayClear(wbPos src.XPos, a ir.Node, nrange *ir.RangeStmt) ir.Node {
605605

606606
// For array range clear, also set "i = len(a) - 1"
607607
if nrange != nil {
608-
idx := ir.NewAssignStmt(base.Pos, nrange.Key, ir.NewBinaryExpr(base.Pos, ir.OSUB, ir.NewUnaryExpr(base.Pos, ir.OLEN, a), ir.NewInt(base.Pos, 1)))
608+
idx := ir.NewAssignStmt(base.Pos, nrange.Key, typecheck.Conv(ir.NewBinaryExpr(base.Pos, ir.OSUB, ir.NewUnaryExpr(base.Pos, ir.OLEN, a), ir.NewInt(base.Pos, 1)), nrange.Key.Type()))
609609
n.Body.Append(idx)
610610
}
611611

src/cmd/internal/obj/loong64/asm.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ var optab = []Optab{
308308
{ABEQ, C_REG, C_REG, C_NONE, C_BRAN, C_NONE, 6, 4, 0, 0},
309309
{ABEQ, C_REG, C_NONE, C_NONE, C_BRAN, C_NONE, 6, 4, 0, 0},
310310
{ABLEZ, C_REG, C_NONE, C_NONE, C_BRAN, C_NONE, 6, 4, 0, 0},
311-
{ABFPT, C_NONE, C_NONE, C_NONE, C_BRAN, C_NONE, 6, 4, 0, NOTUSETMP},
311+
{ABFPT, C_NONE, C_NONE, C_NONE, C_BRAN, C_NONE, 6, 4, 0, 0},
312+
{ABFPT, C_FCCREG, C_NONE, C_NONE, C_BRAN, C_NONE, 6, 4, 0, 0},
312313

313314
{AJMP, C_NONE, C_NONE, C_NONE, C_BRAN, C_NONE, 11, 4, 0, 0}, // b
314315
{AJAL, C_NONE, C_NONE, C_NONE, C_BRAN, C_NONE, 11, 4, 0, 0}, // bl
@@ -1985,7 +1986,9 @@ func (c *ctxt0) asmout(p *obj.Prog, o *Optab, out []uint32) {
19851986
width = 21
19861987
// FCC0 is the implicit source operand, now that we
19871988
// don't register-allocate from the FCC bank.
1988-
rj = REG_FCC0
1989+
if rj == 0 {
1990+
rj = REG_FCC0
1991+
}
19891992
case ABEQ, ABNE:
19901993
if rd == 0 || rd == REGZERO || rj == REGZERO {
19911994
// BEQZ/BNEZ can be encoded with 21-bit offsets.

src/crypto/internal/fips140/sha256/sha256block_riscv64.s

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,47 +88,46 @@
8888
// T1 = h + BIGSIGMA1(e) + Ch(e, f, g) + Kt + Wt
8989
// BIGSIGMA1(x) = ROTR(6,x) XOR ROTR(11,x) XOR ROTR(25,x)
9090
// Ch(x, y, z) = (x AND y) XOR (NOT x AND z)
91+
// = ((y XOR z) AND x) XOR z
9192
#define SHA256T1(index, e, f, g, h) \
9293
MOVWU (index*4)(X18), X8; \
9394
ADD X5, h; \
9495
RORW $6, e, X6; \
9596
ADD X8, h; \
9697
RORW $11, e, X7; \
97-
XOR X7, X6; \
9898
RORW $25, e, X8; \
99+
XOR X7, X6; \
100+
XOR f, g, X5; \
99101
XOR X8, X6; \
102+
AND e, X5; \
100103
ADD X6, h; \
101-
AND e, f, X5; \
102-
NOT e, X7; \
103-
AND g, X7; \
104-
XOR X7, X5; \
104+
XOR g, X5; \
105105
ADD h, X5
106106

107107
// Calculate T2 in X6.
108108
// T2 = BIGSIGMA0(a) + Maj(a, b, c)
109109
// BIGSIGMA0(x) = ROTR(2,x) XOR ROTR(13,x) XOR ROTR(22,x)
110110
// Maj(x, y, z) = (x AND y) XOR (x AND z) XOR (y AND z)
111+
// = ((y XOR z) AND x) XOR (y AND z)
111112
#define SHA256T2(a, b, c) \
112113
RORW $2, a, X6; \
113114
RORW $13, a, X7; \
114-
XOR X7, X6; \
115115
RORW $22, a, X8; \
116+
XOR X7, X6; \
117+
XOR b, c, X9; \
118+
AND b, c, X7; \
119+
AND a, X9; \
116120
XOR X8, X6; \
117-
AND a, b, X7; \
118-
AND a, c, X8; \
119-
XOR X8, X7; \
120-
AND b, c, X9; \
121-
XOR X9, X7; \
122-
ADD X7, X6
121+
XOR X7, X9; \
122+
ADD X9, X6
123123

124124
// Calculate T1 and T2, then e = d + T1 and a = T1 + T2.
125125
// The values for e and a are stored in d and h, ready for rotation.
126126
#define SHA256ROUND(index, a, b, c, d, e, f, g, h) \
127127
SHA256T1(index, e, f, g, h); \
128128
SHA256T2(a, b, c); \
129-
MOV X6, h; \
130129
ADD X5, d; \
131-
ADD X5, h
130+
ADD X6, X5, h
132131

133132
#define SHA256ROUND0(index, a, b, c, d, e, f, g, h) \
134133
MSGSCHEDULE0(index); \

src/go/types/range.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/internal/poll/fd_plan9.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ type FD struct {
3636
isFile bool
3737
}
3838

39-
func (fd *FD) initIO() error {
40-
return nil
41-
}
42-
4339
// We need this to close out a file descriptor when it is unlocked,
4440
// but the real implementation has to live in the net package because
4541
// it uses os.File's.

src/internal/poll/fd_poll_runtime.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ func setDeadlineImpl(fd *FD, t time.Time, mode int) error {
156156
}
157157
defer fd.decref()
158158

159-
fd.initIO()
160159
if fd.pd.runtimeCtx == 0 {
161160
return ErrNoDeadline
162161
}

src/internal/poll/fd_unix.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ type FD struct {
4747
isFile bool
4848
}
4949

50-
func (fd *FD) initIO() error {
51-
return nil
52-
}
53-
5450
// Init initializes the FD. The Sysfd field should already be set.
5551
// This can be called multiple times on a single FD.
5652
// The net argument is a network name from the net package (e.g., "tcp"),

0 commit comments

Comments
 (0)