<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I’m not sure, I haven’t experimented with GCC enough to know. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Finkel, Hal J. <hfinkel@anl.gov> <br>
<b>Sent:</b> Friday, May 15, 2020 8:54 AM<br>
<b>To:</b> Richard Sandiford <richard.sandiford@arm.com>; Keane, Erich via cfe-dev <cfe-dev@lists.llvm.org>; Keane, Erich <erich.keane@intel.com><br>
<b>Cc:</b> Erich Focht <Erich.Focht@EMEA.NEC.COM>; MARUKAWA KAZUSHI <marukawa@nec.com>; ISHIZAKA KAZUHISA <ishizaka@nec.com><br>
<b>Subject:</b> Re: [cfe-dev] [RFC] Opt-in vector of bool type<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<blockquote style="border:none #C8C8C8 1.0pt;border-left:solid #C8C8C8 2.25pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="color:#666666">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org">cfe-dev-bounces@lists.llvm.org</a>> on behalf of Keane, Erich via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Sent:</b> Friday, May 15, 2020 9:43 AM<br>
<b>To:</b> Richard Sandiford <<a href="mailto:richard.sandiford@arm.com">richard.sandiford@arm.com</a>>; Keane, Erich via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Cc:</b> Erich Focht <<a href="mailto:Erich.Focht@EMEA.NEC.COM">Erich.Focht@EMEA.NEC.COM</a>>; MARUKAWA KAZUSHI <<a href="mailto:marukawa@nec.com">marukawa@nec.com</a>>; ISHIZAKA KAZUHISA <<a href="mailto:ishizaka@nec.com">ishizaka@nec.com</a>><br>
<b>Subject:</b> Re: [cfe-dev] [RFC] Opt-in vector of bool type</span><span style="color:#666666">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:#666666"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#666666">Right, I mentioned that:<br>
> Note we don't allow taking a non-const ref or address of a vector element, but  GCC does, though presumably that is something we should fix.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#666666"><o:p> </o:p></span></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think that this is another thing that falls into the category of: only if we can define the semantics in a way that makes sense. For example, are the addresses of two adjacent vector elements adjacent? Can you do pointer arithmetic to
 get from one to the other?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> -Hal<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none #C8C8C8 1.0pt;border-left:solid #C8C8C8 2.25pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:#666666"><br>
<br>
-----Original Message-----<br>
From: Richard Sandiford <<a href="mailto:richard.sandiford@arm.com">richard.sandiford@arm.com</a>>
<br>
Sent: Friday, May 15, 2020 7:41 AM<br>
To: Keane, Erich via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
Cc: Simon Moll <<a href="mailto:Simon.Moll@EMEA.NEC.COM">Simon.Moll@EMEA.NEC.COM</a>>; Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>>; Keane, Erich <<a href="mailto:erich.keane@intel.com">erich.keane@intel.com</a>>; MARUKAWA
 KAZUSHI <<a href="mailto:marukawa@nec.com">marukawa@nec.com</a>>; ISHIZAKA KAZUHISA <<a href="mailto:ishizaka@nec.com">ishizaka@nec.com</a>>; Erich Focht <<a href="mailto:Erich.Focht@EMEA.NEC.COM">Erich.Focht@EMEA.NEC.COM</a>><br>
Subject: Re: [cfe-dev] [RFC] Opt-in vector of bool type<br>
<br>
"Keane, Erich via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> writes:<br>
>> The way i see it you are open to supporting this feature in Clang but there are LLVM bugs for <N x i1> types, which we may hit more often as a result, and then there is this unrelated Clang lvalue bug for attribute((vector_size)).<br>
><br>
> I don't take this as a proper summary of my position. I was warning you about the issues in LLVM, however the biggest issue is the fact that a vector of i1s isn't individually addressable.  Unless you have a way to produce an address for each individual element
 (which we don't, and is why std::vector<bool> uses a proxy return type), I don't think this fits in the type system.<br>
<br>
FWIW, I think taking the address of a vector_size element is already an error in clang.  E.g.<br>
<br>
-----------------------------------------------------------------<br>
typedef unsigned int vec __attribute__((vector_size(16))); vec v; unsigned int *foo(void) { return &v[1]; }<br>
-----------------------------------------------------------------<br>
<br>
gives:<br>
<br>
-----------------------------------------------------------------<br>
foo.c:3:34: error: address of vector element requested unsigned int *foo(void) { return &v[1]; }<br>
                                 ^~~~~<br>
1 error generated.<br>
-----------------------------------------------------------------<br>
<br>
GCC does accept this, but like others have said, I think the natural thing would be to make it an error for bools even if it isn't for other types.  The set of operations supported by a vector type is inevitably going to be influenced by the element type.<br>
<br>
Definitely agree that the semantics need to be spelled out though. :-)<br>
<br>
Thanks,<br>
Richard<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>