Skip to content

[simd.math,simd.reductions] Fix undeclared identifiers in std::simd#9145

Open
abhinavagarwal07 wants to merge 2 commits into
cplusplus:mainfrom
abhinavagarwal07:fix-simd-undeclared-identifiers
Open

[simd.math,simd.reductions] Fix undeclared identifiers in std::simd#9145
abhinavagarwal07 wants to merge 2 commits into
cplusplus:mainfrom
abhinavagarwal07:fix-simd-undeclared-identifiers

Conversation

@abhinavagarwal07

@abhinavagarwal07 abhinavagarwal07 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fix undeclared identifiers in std::simd wording: use V::size() in modf-vec and T in masked reduce_max. Also name the previously unnamed x and mask parameters in the masked reduce_min/reduce_max declarations so they match their Returns descriptions.

Two adjacent std::simd specifications name an identifier introduced
nowhere in the enclosing itemdescr:

- [simd.math]: the exposition-only modf-vec helper sizes its staging
  array with Ret::size(), but the only Let-bound vector type here is V;
  Ret is a leftover from frexp-vec (where Ret is bound). Use V::size().

- [simd.reductions]: masked reduce_max returns
  numeric_limits<V::value_type>::lowest(), but its template head only
  introduces T and Abi (no V). Use numeric_limits<T>::lowest(), matching
  masked reduce_min and scalar reduce_max.
Comment thread source/numerics.tex Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs names "x" and "mask", right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get these fixes in the same PR by any chance?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

Comment thread source/numerics.tex
\returns
If \tcode{none_of(mask)} is \tcode{true}, returns
\tcode{numeric_limits<V::value_type>::lowest()}.
\tcode{numeric_limits<T>::lowest()}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct. @mattkretz , please have a look.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mattkretz mattkretz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the (pre-existing) missing x and mask.

Comment thread source/numerics.tex Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

Comment thread source/numerics.tex
\returns
If \tcode{none_of(mask)} is \tcode{true}, returns
\tcode{numeric_limits<V::value_type>::lowest()}.
\tcode{numeric_limits<T>::lowest()}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@abhinavagarwal07 abhinavagarwal07 marked this pull request as draft June 17, 2026 15:29
…uce_max

The masked reduce_min and reduce_max declarations leave both parameters
unnamed, but their Returns elements refer to x and mask. Name the
parameters x and mask so the declarations match their descriptions.
@abhinavagarwal07 abhinavagarwal07 changed the title [simd.math,simd.reductions] Fix two undeclared identifiers in std::simd [simd.math,simd.reductions] Fix undeclared identifiers in std::simd Jun 17, 2026
@abhinavagarwal07 abhinavagarwal07 marked this pull request as ready for review June 17, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants