<div dir="ltr">
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Hi,</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">In RISC-V v-extension<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> operations could operate on a group of vector registers<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">;</span> we called it LMUL. If LMUL equals 2<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> it means we could operate on 2 vector registers at the same time. So<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> we have the following combinations of types.</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Courier New";color:rgb(69,69,69)"><span class="gmail-Apple-converted-space"> </span>LMUL = 1 <span class="gmail-Apple-converted-space"> </span>LMUL = 2<span class="gmail-Apple-converted-space"> </span>LMUL = 4<span class="gmail-Apple-converted-space"> </span>LMUL = 8</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Courier New";color:rgb(69,69,69)">int64_t | vscale x 1 x i64 | vscale x<span class="gmail-Apple-converted-space"> </span>2 x i64 | vscale x<span class="gmail-Apple-converted-space"> </span>4 x i64 | vscale x<span class="gmail-Apple-converted-space"> </span>8 x i64</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Courier New";color:rgb(69,69,69)">int32_t | vscale x 2 x i32 | vscale x<span class="gmail-Apple-converted-space"> </span>4 x i32 | vscale x<span class="gmail-Apple-converted-space"> </span>8 x i32 | vscale x 16 x i32</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Courier New";color:rgb(69,69,69)">int16_t | vscale x 4 x i16 | vscale x<span class="gmail-Apple-converted-space"> </span>8 x i16 | vscale x 16 x i16 | vscale x 32 x i16</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Courier New";color:rgb(69,69,69)"><span class="gmail-Apple-converted-space"> </span>int8_t | vscale x 8 x i8<span class="gmail-Apple-converted-space"> </span>| vscale x 16 x i8<span class="gmail-Apple-converted-space"> </span>| vscale x 32 x i8<span class="gmail-Apple-converted-space"> </span>| vscale x 64 x i8</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">We have another architecture parameter<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> ELEN<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> which means the maximum size of a single vector element in bits.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;color:rgb(69,69,69)"><span style="font-family:"Helvetica Neue"">We hope the type system could be consistent under ELEN = 32 and ELEN = 64. However<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> vscale may be a fractional value under ELEN = 32 in the above type system. When ELEN = 32<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> i64 is an invalid type (we could ignore the first row for ELEN = 32) and vscale may become 1/2 on run time to fit the architecture <span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">(</span>if the vector register only has 32 bits<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">)</span>. Is there any problem to assume vscale to be fractional under some circumstances? vscale should be an unknown value when compiling. So<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> it should have no impact on code generation and optimization. The relationship between types is correct regardless vscale<span class="gmail-s1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:".PingFang TC"">’</span>s value. Is there anything I missed</span><font face=".PingFang TC">?</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;color:rgb(69,69,69)"><font face=".PingFang TC"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;color:rgb(69,69,69)"><font face=".PingFang TC">Thanks!</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;color:rgb(69,69,69)"><font face=".PingFang TC">Hsiangkai</font></p></div>