public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Thomas Rodgers <trodgers@redhat.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
	gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Synchronize PSTL with upstream
Date: Wed, 17 May 2023 20:31:46 +0100	[thread overview]
Message-ID: <CACb0b4m608q7t=ZFAom4RY_bjYYbZfdsaEFDZK+EYJbrV15qrg@mail.gmail.com> (raw)
In-Reply-To: <CAMmuTO8hy+ofkn2D=s0EYNjrMgJ9==EmoJQZECEKPjjSJ8OBZg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2859 bytes --]

-template <class _OutputIterator, class _Size, class _Generator>
-  _OutputIterator
-__brick_generate_n(_OutputIterator __first, _Size __count, _Generator __g,
/* is_vector = */ std::true_type) noexcept
+template <class _RandomAccessIterator, class Size, class _Generator>

Missing uglification on Size.

+_RandomAccessIterator
+__brick_generate_n(_RandomAccessIterator __first, Size __count, _Generator
__g,
+                   /* is_vector = */ std::true_type) noexcept
 {
     return __unseq_backend::__simd_generate_n(__first, __count, __g);
 }

-template <class _OutputIterator, class _Size, class _Generator>
-  _OutputIterator
-__brick_generate_n(_OutputIterator __first, _Size __count, _Generator __g,
/* is_vector = */ std::false_type) noexcept
+template <class OutputIterator, class Size, class _Generator>

Missing uglification on OutputIterator and Size.

+OutputIterator
+__brick_generate_n(OutputIterator __first, Size __count, _Generator __g,
/* is_vector = */ std::false_type) noexcept


-template <class _ForwardIterator1, class _ForwardIterator2, class
_BinaryOperation>
-_ForwardIterator2
-__brick_adjacent_difference(_ForwardIterator1 __first, _ForwardIterator1
__last, _ForwardIterator2 __d_first,
-    _BinaryOperation __op, /*is_vector=*/std::true_type) noexcept
+template <class _RandomAccessIterator1, class _RandomAccessIterator2,
class BinaryOperation>

Missing uglification on BinaryOperation.

+_RandomAccessIterator2
+__brick_adjacent_difference(_RandomAccessIterator1 __first,
_RandomAccessIterator1 __last,
+                            _RandomAccessIterator2 __d_first,
BinaryOperation __op,
+                            /*is_vector=*/std::true_type) noexcept


The above problems exist on the declaration and the definitions.


--- a/libstdc++-v3/include/pstl/glue_execution_defs.h
+++ b/libstdc++-v3/include/pstl/glue_execution_defs.h
@@ -18,8 +18,8 @@ namespace std
 {
 // Type trait
 using __pstl::execution::is_execution_policy;
-#if _PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT
-#    if __INTEL_COMPILER
+#if defined(_PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT)
+#    if defined(__INTEL_COMPILER)
 template <class T>
 constexpr bool is_execution_policy_v = is_execution_policy<T>::value;
 #    else

Pre-existing, but that T should be _Tp, but it only affects the Intel
compiler branch, so meh.

Please fix these and report them upstream too.

All the actual code changes look good.

I think I'd prefer if __pattern_partial_sort_copy used
std::uninitialized_copy instead of a loop and placement-new, but that
doesn't need to hold this up. We could optimize some uses of
std::conjunction and std::conditional to use our own __and_ and
__conditional, but I'm not sure it's worth diverging from upstream to do
that.

Please fix the naming bugs noted above and push to trunk, thanks!

+Reviewed-by: Jonathan Wakely <jwakely@redhat.com>

  reply	other threads:[~2023-05-17 19:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20  3:39 Thomas Rodgers
2023-05-17 19:31 ` Jonathan Wakely [this message]
2023-06-26 18:57   ` Thomas Rodgers
2023-06-30  3:48     ` PR108672 re-fixed after " Hans-Peter Nilsson
2023-06-30  8:42       ` Jonathan Wakely
2023-06-30  9:57         ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4m608q7t=ZFAom4RY_bjYYbZfdsaEFDZK+EYJbrV15qrg@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=trodgers@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).