Skip to content

Commit 36afd54

Browse files
committed
Matthias Kretz improves discussion and wording
1 parent 8ef506b commit 36afd54

File tree

1 file changed

+137
-7
lines changed

1 file changed

+137
-7
lines changed

xml/issue4414.xml

Lines changed: 137 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,92 @@
22
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
33

44
<issue num="4414" status="New">
5-
<title>&sect;[simd.traits] `rebind` and `resize` reference a `type` member that doesn't exist</title>
6-
<section><sref ref="[simd.traits]"/></section>
5+
<title>&sect;[simd.expos.abi] <tt><i>deduce-abi-t</i></tt> is underspecified and incorrectly referenced
6+
from `rebind` and `resize`</title>
7+
<section><sref ref="[simd.expos.abi]"/><sref ref="[simd.traits]"/></section>
78
<submitter>Matthias Kretz</submitter>
89
<date>15 Oct 2025</date>
910
<priority>99</priority>
1011

1112
<discussion>
1213
<p>
13-
In <sref ref="[simd.traits]"/> `rebind` and `resize` say "<tt><i>deduce-abi-t</i>&lt;T, V::size()&gt;</tt>
14-
has a member type `type`". But <tt><i>deduce-abi-t</i></tt> is specified in
15-
<sref ref="[simd.expos.abi]"/> p4-5 as an alias that is either defined or not.
14+
In <sref ref="[simd.expos.abi]"/>, <tt><i>deduce-abi-t</i></tt> is specified to be defined for some
15+
arguments. For all remaining arguments, nothing is specified. This could be interpreted to make
16+
such specializations ill-formed. But that does not match the intent of making
1617
</p>
18+
<blockquote><pre>
19+
simd::vec&lt;std::string&gt;
20+
</pre></blockquote>
21+
<p>
22+
and
23+
</p>
24+
<blockquote><pre>
25+
simd::vec&lt;int, INT_MAX&gt;
26+
</pre></blockquote>
27+
<p>
28+
disabled specializations of `basic_vec`. (If `INT_MAX` is not supported by the
29+
implementation.)
30+
<p/>
31+
The wording needs to clarify what happens in those cases.
32+
<p/>
33+
In <sref ref="[simd.traits]"/>, `rebind` and `resize` say "<tt><i>deduce-abi-t</i>&lt;T, V::size()&gt;</tt>
34+
has a member type `type`". But that's not how <tt><i>deduce-abi-t</i></tt> is specified.
35+
</p>
36+
<superseded>
37+
<p>
38+
This wording is relative to <paper num="N5014"/>.
39+
</p>
40+
41+
<ol>
42+
<li><p>Modify <sref ref="[simd.traits]"/> as indicated:</p>
43+
44+
<blockquote>
45+
<pre>
46+
template&lt;class T, class V&gt; struct rebind { using type = <i>see below</i>; };
47+
</pre>
48+
<blockquote>
49+
<p>
50+
-4- The member `type` is present if and only if
51+
</p>
52+
<ol style="list-style-type: none">
53+
<li><p>
54+
(4.1) &mdash; `V` is a data-parallel type,
55+
</p></li>
56+
<li><p>
57+
(4.2) &mdash; `T` is a vectorizable type, and
58+
</p></li>
59+
<li><p>
60+
(4.3) &mdash; <tt><i>deduce-abi-t</i>&lt;T, V::size()&gt;</tt> <del>has a member type `type`</del>
61+
<ins>is defined</ins>.
62+
</p></li>
63+
</ol>
64+
[&hellip;]
65+
</blockquote>
66+
<pre>
67+
template&lt;<i>simd-size-type</i> N, class V&gt; struct resize { using type = <i>see below</i>; };
68+
</pre>
69+
<blockquote>
70+
<p>
71+
-7- Let `T` denote [&hellip;]
72+
<p/>
73+
-8- The member `type` is present if and only if
74+
</p>
75+
<ol style="list-style-type: none">
76+
<li><p>
77+
(8.1) &mdash; `V` is a data-parallel type, and
78+
</p></li>
79+
<li><p>
80+
(8.2) &mdash; <tt><i>deduce-abi-t</i>&lt;T, N&gt;</tt> <del>has a member type `type`</del>
81+
<ins>is defined</ins>.
82+
</p></li>
83+
</ol>
84+
</blockquote>
85+
</blockquote>
86+
</li>
87+
</ol>
88+
</superseded>
89+
90+
<note>2025-10-21; Matthias Kretz improves discussion and proposed wording</note>
1791
</discussion>
1892

1993
<resolution>
@@ -22,6 +96,62 @@ This wording is relative to <paper num="N5014"/>.
2296
</p>
2397

2498
<ol>
99+
<li><p>Modify <sref ref="[simd.expos.abi]"/> as indicated:</p>
100+
101+
<blockquote>
102+
<pre>
103+
template&lt;class T&gt; using <i>native-abi</i> = <i>see below</i>;
104+
template&lt;class T, <i>simd-size-type</i> N&gt; using <i>deduce-abi-t</i> = <i>see below</i>;
105+
</pre>
106+
<blockquote>
107+
<p>
108+
-1- An <i>ABI tag</i> is a type that indicates a choice of size and binary representation for objects of data-parallel
109+
type.
110+
<p/>
111+
[&hellip;]
112+
<p/>
113+
-3- An implementation defines ABI tag types as necessary for the following aliases.
114+
<p/>
115+
-4- <tt><i>deduce-abi-t</i>&lt;T, N&gt;</tt> <del>is defined</del><ins>names an ABI tag type if and
116+
only</ins> if
117+
</p>
118+
<ol style="list-style-type: none">
119+
<li><p>
120+
(4.1) &mdash; `T` is a vectorizable type,
121+
</p></li>
122+
<li><p>
123+
(4.2) &mdash; `N` is greater than zero, and
124+
</p></li>
125+
<li><p>
126+
(4.3) &mdash; `N` is not larger than an implementation-defined maximum.
127+
</p></li>
128+
</ol>
129+
<p>
130+
<ins>Otherwise, <tt><i>deduce-abi-t</i>&lt;T, N&gt;</tt> names an unspecified type.</ins>
131+
<p/>
132+
The implementation-defined maximum for `N` is not smaller than 64 and can differ depending on `T`.
133+
[&hellip;]
134+
<p/>
135+
-5- <del>Where present,</del><ins>If</ins> <tt><i>deduce-abi-t</i>&lt;T, N&gt;</tt> names an ABI
136+
tag type <del>such that</del><ins>, the following is `true`:</ins>
137+
</p>
138+
<ol style="list-style-type: none">
139+
<li><p>
140+
(5.1) &mdash; <tt><i>simd-size-v</i>&lt;T, <i>deduce-abi-t</i>&lt;T, N&gt;&gt;</tt> equals `N`,
141+
</p></li>
142+
<li><p>
143+
(5.2) &mdash; <tt>basic_vec&lt;T, <i>deduce-abi-t</i>&lt;T, N&gt;&gt;</tt> is enabled
144+
(<sref ref="[simd.overview]"/>), and
145+
</p></li>
146+
<li><p>
147+
(5.3) &mdash; <tt>basic_mask&lt;sizeof(T), <i>deduce-abi-t</i>&lt;<i>integer-from</i>&lt;sizeof(T)&gt;, N&gt;&gt;</tt>
148+
is enabled.
149+
</p></li>
150+
</ol>
151+
</blockquote>
152+
</blockquote>
153+
</li>
154+
25155
<li><p>Modify <sref ref="[simd.traits]"/> as indicated:</p>
26156

27157
<blockquote>
@@ -41,7 +171,7 @@ template&lt;class T, class V&gt; struct rebind { using type = <i>see below</i>;
41171
</p></li>
42172
<li><p>
43173
(4.3) &mdash; <tt><i>deduce-abi-t</i>&lt;T, V::size()&gt;</tt> <del>has a member type `type`</del>
44-
<ins>is defined</ins>.
174+
<ins>names an ABI tag type</ins>.
45175
</p></li>
46176
</ol>
47177
[&hellip;]
@@ -61,7 +191,7 @@ template&lt;<i>simd-size-type</i> N, class V&gt; struct resize { using type = <i
61191
</p></li>
62192
<li><p>
63193
(8.2) &mdash; <tt><i>deduce-abi-t</i>&lt;T, N&gt;</tt> <del>has a member type `type`</del>
64-
<ins>is defined</ins>.
194+
<ins>names an ABI tag type</ins>.
65195
</p></li>
66196
</ol>
67197
</blockquote>

0 commit comments

Comments
 (0)