aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2023-11-26 19:30:54 +0300
committerAlexander Monakov <amonakov@ispras.ru>2023-11-26 19:37:15 +0300
commit22f42cdcb091b7046f4d687342ac0913efb95838 (patch)
treed324397ad07d88cad4bef14e07034750fca54e7b
parent96c666e24f4ff47ac92327acf1c6d7563758441e (diff)
downloadgcc-22f42cdcb091b7046f4d687342ac0913efb95838.zip
gcc-22f42cdcb091b7046f4d687342ac0913efb95838.tar.gz
gcc-22f42cdcb091b7046f4d687342ac0913efb95838.tar.bz2
sort.cc: fix mentions of sorting networks in comments
Avoid using 'network sort' (a misnomer) in sort.cc, the correct term is 'sorting networks'. gcc/ChangeLog: * sort.cc: Use 'sorting networks' in comments.
-rw-r--r--gcc/sort.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/sort.cc b/gcc/sort.cc
index 9a0113f..feef345 100644
--- a/gcc/sort.cc
+++ b/gcc/sort.cc
@@ -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. */
@@ -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
@@ -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