Skip to content

Commit

Permalink
sort.cc: fix mentions of sorting networks in comments
Browse files Browse the repository at this point in the history
Avoid using 'network sort' (a misnomer) in sort.cc, the correct term is
'sorting networks'.

gcc/ChangeLog:

	* sort.cc: Use 'sorting networks' in comments.
  • Loading branch information
amonakov committed Nov 26, 2023
1 parent 96c666e commit 22f42cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gcc/sort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
- deterministic (but not necessarily stable)
- fast, especially for common cases (0-5 elements of size 8 or 4)
The implementation uses a network sort for up to 5 elements and
The implementation uses sorting networks for up to 5 elements and
a merge sort on top of that. Neither stage has branches depending on
comparator result, trading extra arithmetic for branch mispredictions. */

Expand Down Expand Up @@ -53,7 +53,7 @@ struct sort_ctx
char *out; // output buffer
size_t n; // number of elements
size_t size; // element size
size_t nlim; // limit for network sort
size_t nlim; // limit for using sorting networks
};

/* Like sort_ctx, but for use with qsort_r-style comparators. Several
Expand Down Expand Up @@ -151,7 +151,7 @@ cmp1 (char *e0, char *e1, sort_ctx *c)
return x & (c->cmp (e0, e1) >> 31);
}

/* Execute network sort on 2 to 5 elements from IN, placing them into C->OUT.
/* Apply a sorting network to 2 to 5 elements from IN, placing them into C->OUT.
IN may be equal to C->OUT, in which case elements are sorted in place. */
template<typename sort_ctx>
static void
Expand Down

0 comments on commit 22f42cd

Please sign in to comment.