Re: [PATCH 2/4] introduce gcc_stablesort

2018-08-28 Thread Richard Biener
On Tue, Aug 28, 2018 at 11:14 AM Alexander Monakov wrote: > > This adds a stable sort to sort.cc: mergesort implementation is stable, so > we just need network sort limited to sizes 2-3 to get the complete sort > stable. > > As I don't want to duplicate code for this, I've chosen to have gcc_qsor

Re: [PATCH 2/4] introduce gcc_stablesort

2018-08-28 Thread Alexander Monakov
This adds a stable sort to sort.cc: mergesort implementation is stable, so we just need network sort limited to sizes 2-3 to get the complete sort stable. As I don't want to duplicate code for this, I've chosen to have gcc_qsort accept bit-inverted 'size' parameter to request stable sorting.