Skip to content

Commit 01edbe1

Browse files
author
github-actions
committed
Automatic update from GitHub Actions workflow
1 parent e2e7395 commit 01edbe1

22 files changed

+448
-41
lines changed

issue4238.html

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Issue 4238: simd_mask&lt;complex&lt;double&gt;&gt;::operator+/-/~ return a disabled simd specialization</title>
6+
<meta property="og:title" content="Issue 4238: simd_mask&lt;complex&lt;double&gt;&gt;::operator+/-/~ return a disabled simd specialization">
7+
<meta property="og:description" content="C++ library issue. Status: New">
8+
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue4238.html">
9+
<meta property="og:type" content="website">
10+
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
11+
<meta property="og:image:alt" content="C++ logo">
12+
<style>
13+
p {text-align:justify}
14+
li {text-align:justify}
15+
pre code.backtick::before { content: "`" }
16+
pre code.backtick::after { content: "`" }
17+
blockquote.note
18+
{
19+
background-color:#E0E0E0;
20+
padding-left: 15px;
21+
padding-right: 15px;
22+
padding-top: 1px;
23+
padding-bottom: 1px;
24+
}
25+
ins {background-color:#A0FFA0}
26+
del {background-color:#FFA0A0}
27+
table.issues-index { border: 1px solid; border-collapse: collapse; }
28+
table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
29+
table.issues-index td { padding: 4px; border: 1px solid; }
30+
table.issues-index td:nth-child(1) { text-align: right; }
31+
table.issues-index td:nth-child(2) { text-align: left; }
32+
table.issues-index td:nth-child(3) { text-align: left; }
33+
table.issues-index td:nth-child(4) { text-align: left; }
34+
table.issues-index td:nth-child(5) { text-align: center; }
35+
table.issues-index td:nth-child(6) { text-align: center; }
36+
table.issues-index td:nth-child(7) { text-align: left; }
37+
table.issues-index td:nth-child(5) span.no-pr { color: red; }
38+
@media (prefers-color-scheme: dark) {
39+
html {
40+
color: #ddd;
41+
background-color: black;
42+
}
43+
ins {
44+
background-color: #225522
45+
}
46+
del {
47+
background-color: #662222
48+
}
49+
a {
50+
color: #6af
51+
}
52+
a:visited {
53+
color: #6af
54+
}
55+
blockquote.note
56+
{
57+
background-color: rgba(255, 255, 255, .10)
58+
}
59+
}
60+
</style>
61+
</head>
62+
<body>
63+
<hr>
64+
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#New">New</a> status.</em></p>
65+
<h3 id="4238"><a href="lwg-active.html#4238">4238</a>. <code>simd_mask&lt;complex&lt;double&gt;&gt;::operator+/-/~</code> return a disabled <code class='backtick'>simd</code> specialization</h3>
66+
<p><b>Section:</b> 29.10.8.4 <a href="https://wg21.link/simd.mask.unary">[simd.mask.unary]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
67+
<b>Submitter:</b> Matthias Kretz <b>Opened:</b> 2025-03-27 <b>Last modified:</b> 2025-03-29</p>
68+
<p><b>Priority: </b>Not Prioritized
69+
</p>
70+
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
71+
<p><b>Discussion:</b></p>
72+
<p>
73+
Consider:
74+
</p>
75+
<blockquote><pre>
76+
simd&lt;complex&lt;double&gt;&gt; c = {};
77+
simd_mask&lt;complex&lt;double&gt;&gt; k = (c == c); // sizeof(complex&lt;double&gt;) == 16
78+
auto i = -k; // simd&lt;__int128&gt; !
79+
</pre></blockquote>
80+
<p>
81+
<code class='backtick'>basic_simd_mask</code> unary <code class='backtick'>+</code>, <code class='backtick'>-</code>, and <code class='backtick'>~</code> return <code>basic_simd&lt;<i>integer-from</i>&lt;Bytes, Abi&gt;&gt;</code>.
82+
29.10.2.1 <a href="https://wg21.link/simd.expos.defn">[simd.expos.defn]</a>/2 says:
83+
</p>
84+
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
85+
<p>
86+
<code><i>integer-from</i>&lt;Bytes&gt;</code> is an alias for a signed integer type <code class='backtick'>T</code> such that <code class='backtick'>sizeof(T)</code> equals <code class='backtick'>Bytes</code>.
87+
</p>
88+
</blockquote>
89+
<p>
90+
But <code class='backtick'>__int128</code> isn't a vectorizable type. Consequently, <code>simd&lt;__int128&gt;</code> currently
91+
is a disabled specialization. So it seems <code>simd&lt;complex&lt;double&gt;&gt;</code> wants <code class='backtick'>__int128</code>
92+
to be added to the list of vectorizable types.
93+
<p/>
94+
<b>Options:</b>
95+
</p>
96+
<ol style="list-style-type:lower-alpha">
97+
<li><p>"Specialize" <code>basic_simd_mask&lt;16, Abi&gt;</code> to return
98+
<code>rebind_t&lt;<i>integer-from</i>&lt;8&gt;, basic_simd_mask&lt;<i>integer-from</i>&lt;16&gt;, Abi&gt;&gt;</code>
99+
(reduces a 128-bit value of a vector-mask to a 64-bit value in the simd)</p></li>
100+
<li><p>"Specialize" <code>basic_simd_mask&lt;16, Abi&gt;</code> to return
101+
<code>resize_t&lt;size() * 2, rebind_t&lt;<i>integer-from</i>&lt;8&gt;,
102+
basic_simd_mask&lt;<i>integer-from</i>&lt;16&gt;, Abi&gt;&gt;&gt;</code>
103+
(duplicates a 128-bit value of a vector-mask to two 64-bit values in the simd)</p></li>
104+
<li><p>delete unary <code class='backtick'>+</code>, <code class='backtick'>-</code>, and <code class='backtick'>~</code> for <code>basic_simd_mask&lt;16, Abi&gt;</code>
105+
(closest to the status quo)</p></li>
106+
</ol>
107+
108+
109+
<p id="res-4238"><b>Proposed resolution:</b></p>
110+
<p>
111+
This wording is relative to <a href="https://wg21.link/N5008">N5008</a>.
112+
</p>
113+
114+
<ol>
115+
116+
<li><p>Modify 29.10.8.4 <a href="https://wg21.link/simd.mask.unary">[simd.mask.unary]</a> as indicated:</p>
117+
118+
<blockquote>
119+
<pre>
120+
constexpr basic_simd_mask operator!() const noexcept;
121+
constexpr basic_simd&lt;<i>integer-from</i>&lt;Bytes&gt;, Abi&gt; operator+() const noexcept;
122+
constexpr basic_simd&lt;<i>integer-from</i>&lt;Bytes&gt;, Abi&gt; operator-() const noexcept;
123+
constexpr basic_simd&lt;<i>integer-from</i>&lt;Bytes&gt;, Abi&gt; operator~() const noexcept;
124+
</pre>
125+
<blockquote>
126+
<p>
127+
-1- Let <code><i>op</i></code> be the operator.
128+
<p/>
129+
-2- <i>Returns</i>: A data-parallel object where the <code><i>i</i></code><sup>th</sup> element
130+
is initialized to the results of applying <code><i>op</i></code> to <code>operator[](<i>i</i>)</code>
131+
for all <code><i>i</i></code> in the range of <code>[0, size())</code>.
132+
<p/>
133+
<ins>-?- <i>Remarks</i>: If <code>Bytes</code> is greater than <code>8</code>, <code class='backtick'>operator+()</code>, <code class='backtick'>operator-()</code>, and
134+
<code class='backtick'>operator~()</code> are deleted.
135+
</ins>
136+
</p>
137+
</blockquote>
138+
</blockquote>
139+
140+
</li>
141+
142+
</ol>
143+
144+
145+
146+
147+
148+
</body>
149+
</html>

0 commit comments

Comments
 (0)