// Movement between float and integer registers with no change in bits; accomplished with stores+loads on PPC.
// Because the 32-bit load-literal-bits instructions have impoverished addressability, always widen the
- // data instead and use FMOVDload and FMOVDstore instead (this will also dodge endianess issues).
+ // data instead and use FMOVDload and FMOVDstore instead (this will also dodge endianness issues).
// There are optimizations that should apply -- (Xi2f64 (MOVWload (not-ADD-ptr+offset) ) ) could use
// the word-load instructions. (Xi2f64 (MOVDload ptr )) can be (FMOVDload ptr)
// These variants have the same semantics as above atomic operations.
// But they are used for generating more efficient code on certain modern machines, with run-time CPU feature detection.
// On ARM64, these are used when the LSE hardware feature is available (either known at compile time or detected at runtime). If LSE is not available,
- // then the basic atomic oprations are used instead.
+ // then the basic atomic operations are used instead.
{name: "AtomicStore8Variant", argLength: 3, typ: "Mem", hasSideEffects: true}, // Store arg1 to *arg0. arg2=memory. Returns memory.
{name: "AtomicStore32Variant", argLength: 3, typ: "Mem", hasSideEffects: true}, // Store arg1 to *arg0. arg2=memory. Returns memory.
{name: "AtomicStore64Variant", argLength: 3, typ: "Mem", hasSideEffects: true}, // Store arg1 to *arg0. arg2=memory. Returns memory.
`go generate` in the go/types directory.
Generated files are clearly marked with a comment at the top and should not
be modified by hand.
-For this reason, it is usally best to make changes to the types2 sources first.
+For this reason, it is usually best to make changes to the types2 sources first.
The changes only need to be ported by hand for the go/types files that cannot
be generated yet.
```
The result of typechecking expression `e` is returned via the operand `x`
(which sometimes also serves as incoming argument).
-If an error occured the function f will report the error and try to continue
+If an error occurred the function f will report the error and try to continue
as best as it can, but it may return an invalid operand (`x.mode == invalid`).
Callers may need to explicitly check for invalid operands.
// never 0.
// Another policy presented in the paper is the Saturated Counters policy which
// freezes the counter when it reaches the value of 255. However, a range
- // of experiments showed that that decreases overall performance.
+ // of experiments showed that doing so decreases overall performance.
o.append(ir.NewIfStmt(base.Pos,
ir.NewBinaryExpr(base.Pos, ir.OEQ, counter, ir.NewInt(base.Pos, 0xff)),
[]ir.Node{ir.NewAssignStmt(base.Pos, counter, ir.NewInt(base.Pos, 1))},
}
}
- // key may need to be be addressable
+ // key may need to be addressable
n.Index = o.mapKeyTemp(n.Pos(), n.X.Type(), n.Index)
if needCopy {
return o.copyExpr(n)
}
// Command-related tests for TestGenerateCommandShortHand2
-// -- Note line numbers included to check substitutions from "build-in" variable - $GOLINE
+// -- Note line numbers included to check substitutions from "built-in" variable - $GOLINE
var splitTestsLines = []splitTestWithLine{
{"-command TEST1 $GOLINE", []string{"-command", "TEST1", "22"}, 22},
{"-command TEST2 ${DOLLAR}GOLINE", []string{"-command", "TEST2", "$GOLINE"}, 26},
}
}
- // Record that m is a dependant of r, so that if r is later disqualified
+ // Record that m is a dependent of r, so that if r is later disqualified
// m will be disqualified as well.
if t.requiring == nil {
t.requiring = make(map[module.Version][]module.Version)
// requirements of other modules.
//
// If one of those requirements pulls the version back up above the version
- // identified by reqs.Previous, then the transitive dependencies of that that
+ // identified by reqs.Previous, then the transitive dependencies of that
// initially-downgraded version should no longer matter — in particular, we
// should not add new dependencies on module paths that nothing else in the
// updated module graph even requires.
base.Exit()
}
-// cmdIsGoTelemeteryOff reports whether the command is "go telemetry off". This
+// cmdIsGoTelemetryOff reports whether the command is "go telemetry off". This
// is used to decide whether to disable the opening of counter files. See #69269.
func cmdIsGoTelemetryOff() bool {
restArgs := os.Args[1:]
func loadl16(r int, d int64) uint32 {
v := uint16(d)
if v == 0 {
- // Avoid generating "ori r,r,0", r != 0. Instead, generate the architectually preferred nop.
+ // Avoid generating "ori r,r,0", r != 0. Instead, generate the architecturally preferred nop.
// For example, "ori r31,r31,0" is a special execution serializing nop on Power10 called "exser".
return NOP
}
// emit as many as s bytes of padding to obtain alignment
s := p.To.Offset
if s < 0 || s >= a {
- ctxt.Diag("PCALIGNMAX 'amount' %d must be non-negative and smaller than the aligment %d\n", s, a)
+ ctxt.Diag("PCALIGNMAX 'amount' %d must be non-negative and smaller than the alignment %d\n", s, a)
return 0
}
if s >= a-lob {
// Print prints a disassembly of the file to w.
// If filter is non-nil, the disassembly only includes functions with names matching filter.
-// If printCode is true, the disassembly includs corresponding source lines.
+// If printCode is true, the disassembly includes corresponding source lines.
// The disassembly only includes functions that overlap the range [start, end).
func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64, printCode bool, gnuAsm bool) {
if start < d.textStart {
"testing"
)
-// AddToolChainConditions accepts a script.Cond map and adds into it a
+// AddToolChainScriptConditions accepts a [script.Cond] map and adds into it a
// set of commonly used conditions for doing toolchains testing,
// including whether the platform supports cgo, a buildmode condition,
// support for GOEXPERIMENT testing, etc. Callers must also pass in
uuid := extractUUID(exe)
if test.expect == "gobuildid" {
// Go buildid is not known in source code. Check UUID is present,
- // and satisifies UUIDv3.
+ // and satisfies UUIDv3.
if uuid == "" {
t.Fatal("expect nonempty UUID, got empty")
}
// be VersionTLS13.
//
// When EncryptedClientHelloConfigList is set, the handshake will only
- // succeed if ECH is sucessfully negotiated. If the server rejects ECH,
+ // succeed if ECH is successfully negotiated. If the server rejects ECH,
// an ECHRejectionError error will be returned, which may contain a new
// ECHConfigList that the server suggests using.
//
// Append appends the binary representation of data to buf.
// buf may be nil, in which case a new buffer will be allocated.
// See [Write] on which data are acceptable.
-// It returns the (possibily extended) buffer containing data or an error.
+// It returns the (possibly extended) buffer containing data or an error.
func Append(buf []byte, order ByteOrder, data any) ([]byte, error) {
// Fast path for basic types and slices.
if n, _ := intDataSize(data); n != 0 {
return r.rawVarint()
}
-// Int64 decodes and returns a uint64 value from the element bitstream.
+// Uint64 decodes and returns a uint64 value from the element bitstream.
func (r *Decoder) Uint64() uint64 {
r.Sync(SyncUint64)
return r.rawUvarint()
dirIdx := 0
var groupSmall groupReference
if m.dirLen <= 0 {
- // Use dirIdx == -1 as sentinal for small maps.
+ // Use dirIdx == -1 as sentinel for small maps.
dirIdx = -1
groupSmall.data = m.dirPtr
}
// - 2: *t2a
// - 3: *t2b
//
- // At some point, the directory grew to accomodate a split of
+ // At some point, the directory grew to accommodate a split of
// t2. t1 did not split, so entries 0 and 1 both point to t1.
// t2 did split, so the two halves were installed in entries 2
// and 3.
supportTCPKeepAliveCount = optSupported(TCP_KEEPCNT)
})
-// SupportTCPKeepAliveInterval indicates whether TCP_KEEPIDLE is supported.
+// SupportTCPKeepAliveIdle indicates whether TCP_KEEPIDLE is supported.
// The minimal requirement is Windows 10.0.16299.
func SupportTCPKeepAliveIdle() bool {
initTCPKeepAlive()
//
// Argument names follow a certain structure and this structure
// is relied on by the testing framework to type-check arguments.
- // The structure is is:
+ // The structure is:
//
// (?P<name>[A-Za-z]+_)?(?P<type>[A-Za-z]+)
//
type Array [8]byte
var s Slice
-var p = (Array)(s /* ok because file versions below go1.21 set the langage version to go1.21 */)
+var p = (Array)(s /* ok because file versions below go1.21 set the language version to go1.21 */)
type Array [8]byte
var s Slice
-var p = (Array)(s /* ok because file versions below go1.21 set the langage version to go1.21 */)
+var p = (Array)(s /* ok because file versions below go1.21 set the language version to go1.21 */)
return v1 == v2 || (isNaN(v1) && isNaN(v2))
}
-// equalStr compares ints and strings.
+// equalIntStr compares ints and strings.
func equalIntStr(v1 int, v2 string) bool {
return strconv.Itoa(v1) == v2
}
p.SetHTTP1(true) // default always includes HTTP/1
switch {
case t.TLSNextProto != nil:
- // Setting TLSNextProto to an empty map is is a documented way
+ // Setting TLSNextProto to an empty map is a documented way
// to disable HTTP/2 on a Transport.
if t.TLSNextProto["h2"] != nil {
p.SetHTTP2(true)
// The runtime will write to this file descriptor from
// low-level routines during a panic, possibly without
// a G, so we must call f.Fd() eagerly. This creates a
- // danger that that the file descriptor is no longer
+ // danger that the file descriptor is no longer
// valid at the time of the write, because the caller
// (incorrectly) called f.Close() and the kernel
// reissued the fd in a later call to open(2), leading
type TimeHistogram timeHistogram
-// Counts returns the counts for the given bucket, subBucket indices.
+// Count returns the counts for the given bucket, subBucket indices.
// Returns true if the bucket was valid, otherwise returns the counts
// for the overflow bucket if bucket > 0 or the underflow bucket if
// bucket < 0, and false.
memclrNoHeapPointers(ptr, typ.Size_)
}
-// reflect_typedslicecopy is meant for package reflect,
+// reflect_typedmemclr is meant for package reflect,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/ugorji/go/codec
// frames that we've already processed.
//
// There's a similar issue with nested panics, when the inner
- // panic supercedes the outer panic. Again, we end up needing to
+ // panic supersedes the outer panic. Again, we end up needing to
// walk the same stack frames.
//
// These are probably pretty rare occurrences in practice, and
}
}
-// blockFrequentShort produces 10000 block events with an average duration of
+// blockInfrequentLong produces 10000 block events with an average duration of
// rate.
func blockInfrequentLong(rate int) {
for i := 0; i < 10000; i++ {
singleton := []string{"one"}
Reverse(singleton)
if want := []string{"one"}; !Equal(singleton, want) {
- t.Errorf("Reverse(singeleton) = %v, want %v", singleton, want)
+ t.Errorf("Reverse(singleton) = %v, want %v", singleton, want)
}
Reverse[[]string](nil)
{"Mars", 0.107, 1.5},
}
-// ExampleSortKeys demonstrates a technique for sorting a struct type using programmable sort criteria.
+// Example_sortKeys demonstrates a technique for sorting a struct type using programmable sort criteria.
func Example_sortKeys() {
// Closures that order the Planet structure.
name := func(p1, p2 *Planet) bool {
{"gri", "Smalltalk", 80},
}
-// ExampleMultiKeys demonstrates a technique for sorting a struct type using different
+// Example_sortMultiKeys demonstrates a technique for sorting a struct type using different
// sets of multiple fields in the comparison. We chain together "Less" functions, each of
// which compares a single field.
func Example_sortMultiKeys() {