Vector Extension Workgroup Meeting
I was going to restart meetings probably in two weeks. I hope to have
almost updated draft before then, Krste | I don’t see Vector Extension meetings on the calendar. Is the group meeting?On Fri, 8 Jan 2021 16:21:31 +0000, "Bill Huffman" <huffman@cadence.com> said: | Bill | Bill Huffman | CadenceLogoRed185Regcopy1583174817new51584636989.png Distinguished Engineer UIcorrectsize1583179003.png FortuneLogonew1584637099.png | T: 408.944.7613 |
|
|
Vector Extension Workgroup Meeting
Bill Huffman
|
|
Re: Vector TG minutes for 2020/12/18 meeting
Zalman Stern
Does it get easier if the specification is just the immediate value plus one? I really don't understand how this encoding is particularly great for immediates as many of the values are likely very rarely or even never used and it seems like one can't get long enough values even for existing SIMD hardware in some data types. Compare to e.g.: (first_bit ? 3 : 1) << rest_of_the_bits or: map[] = { 1, 3, 5, 8 }; // Or maybe something else for 5 and 8 map[first_two_bits] << rest_of_the_bits; I.e. get a lot of powers of two, multiples of three-vecs for graphics, maybe something else. -Z-
On Mon, Dec 21, 2020 at 10:47 AM Guy Lemieux <guy.lemieux@...> wrote:
|
|
Re: Vector TG minutes for 2020/12/18 meeting
Guy Lemieux
for vsetivli, with the uimm=00000 encoding, rather than setting vl to 32, how setting it to some other meaning? one option is to set vl=VLMAX. i have some concerns about software using this safely (eg, if VLMAX turns out to be much larger than software anticipated, then it would fail; correcting this requires more instructions than just using the regular vsetvl/vsetvli would have used). another option is to allow an implementation-defined vl to be chosen by hardware; this could be anywhere between 1 and VLMAX. for example, implementations may just choose vl=32, or they may choose something else. it allows the CPU architect to devise a scheme that best fits the implementation. this may consider factors like the effective width of the execution engine, the pipeline depth (to reduce likelihood of stalls from dependent instructions), or that the vector register file is actually a multi-level memory hierarchy where some smaller values may operate with greater efficiency (lower power), or matching VL to the optimal memory system burst length. perhaps some guidance by the spec could be given here for the default scheme, eg whether the implementation optimizes for best performance or power (while still allowing implementations to modify this default via an implementation-defined CSR). software using a few extra cycles to check the returned vl against AVL should not a big problem (the simplest solution being vsetvli followed by vsetivli) g
On Fri, Dec 18, 2020 at 6:13 PM Krste Asanovic <krste@...> wrote:
|
|
Vector TG minutes for 2020/12/18 meeting
Date: 2020/12/18
Task Group: Vector Extension Chair: Krste Asanovic Co-Chair: Roger Espasa Number of Attendees: ~10 Current issues on github: https://github.com/riscv/riscv-v-spec Note: No more meetings schedule until next year. Time slot may have to change. Issues discussed: # Freeze process We are close to freezing the spec. There is a waiver from chairs for SAIL model and compatibility tests, but we will need to complete these before ratification. # auto pdf generation There was a request to have the repo automatically generate a pdf version on commits to avoid users having to install formatting tools. # Mask handling Continuing discussion, the concrete proposal is to add new unit-stride loads and stores that would use the lumop/sumop field to encode byte load/stores used for masks, and also use effective vl = ceil(vl/8) (implying effectively EMUL<=1). Proposed instructions would be: vle1.v vd, (rs1) # Byte load with effective vl = ceil(vl/8) vse1.v vs2, (rs1) # Byte store with effective vl = ceil(vl/8) Encoded with lumop/sumop = 00011. We discussed adding whole vector register load version with lumop=01011, which would only be a mask hint, but for now, this seems less necessary so is not on PoR. vl1re1.v vd, (rs1) # Whole register load # vsetivli A new variant of vsetvl was proposed providing an immediate as the AVL in rs1[4:0]. The immediate encoding is the same as for CSR immediate instructions. The instruction would have bit 31:30 = 11 and bits 29:20 would be encoded same as vsetvli. This would be used when AVL was statically known, and known to fit inside vector register group. Compared with existing PoR, it removes need to load immediate into a spare scalar register before executing vsetvli, and is useful for handling scalar values in vector register (vl=1) and other cases where short fixed-sized vectors are the datatype (e.g., graphics). There was discussion on whether uimm=00000 should represent 32 or be reserved. 32 is more useful, but adds a little complexity to hardware. There was also discussion on whether instruction should set vill if selected AVL is not supported, or whether should clip vl to VLMAX as with other instructions, or if behavior should be reserved. Group generally favored writing vill to expose software errors.
|
|
Last vector TG meeting of 2020, usual time, Friday Dec 17
Agenda is hopefully clearing up any remaining major issues before 1.0 draft can go out,
Krste
|
|
Re: Vector Task Group minutes 2020/12/04
Thang Tran
I am totally in agreement with Krste. Adding the mask load/store is an improvement but adding the new mask registers is too disruptive and increasing in area.
toggle quoted messageShow quoted text
Thanks, Thang
-----Original Message-----
From: tech-vector-ext@lists.riscv.org [mailto:tech-vector-ext@lists.riscv.org] On Behalf Of Krste Asanovic Sent: Thursday, December 17, 2020 1:43 AM To: Grant Martin <gmartin15@pacbell.net> Cc: Steven Wallach <steven.wallach@bsc.es>; Roger Espasa <roger.espasa@semidynamics.com>; Alex Solomatnikov <sols@sifive.com>; Bill Huffman <huffman@cadence.com>; Krste Asanovic <krste@berkeley.edu>; tech-vector-ext@lists.riscv.org Subject: Re: [RISC-V] [tech-vector-ext] Vector Task Group minutes 2020/12/04 I'm not contemplating changing mask design (yet again) at this point in process. I don't see any great advantage to any of these last round of proposals, as they all have significant downsides for some part of implementation space. The current design, like any real design, is not perfect, but does balance a lot of competing concerns coming from different design points. @sols: The mask load instructions are being added to allow a microarchitecture to see all common mask writes, enabling complex microarchitectures to perform mask optimizations. In particular, for wide datapaths and for renamed registers. Without renaming, and without deep temporal registers, having v0 be only mask source reduces cost of mask read port. @swallach: The mask logical operations can be fused with masked operations in more complex machines to reduce software cost of only allowing v0 be mask. @sols,lidawei: Adding more dedicated mask register state increase cost/complexity for all machines. Long LMUL needs a lot of bits to hold mask. Dropping longer LMUL would reduce efficiency of simple machines. @roger: Using x registers for masks breaks vector-length agnostic goal and would limit LMUL. @lidawei: Fractional LMUL helps with case where you want widening operations and lots of mask registers. If uarch utlization is low with lower LMUL, then one solution is to increase VLEN for same physical datapath width. @swallach: ARM SVE uses predicates to implement vector length, so unsurprisingly ends up needing more mask resources. RVV vl can be considered additional mask that is AND-ed in with each mask. Krste | Having been a silent observer of this group for what seems like aOn Wed, 16 Dec 2020 14:08:22 -0800, Grant Martin <gmartin15@pacbell.net> said: | very long time, but now recently liberated from previous constraints, | I will observe that I have seen the use in DSPs of both dedicated mask register files and use of general vector type registers to serve this purpose. | Along with operations for manipulating them. | While there are pros and cons for both, I lean to the side of not | having a special mask register file and special operations, but instead use existing resources and operations. | However I have a process observation as well - it has taken RV Vector | proposal a long time to converge to a near 1.0 specification. Would | going down a different route cause enough delay and debate that it would derange the process and significantly delay the standardization that is desired? As opposed to more modest suggestions. | Thanks and best regards | Grant Martin | gmartin@ieee.org | (gmartin15@pacbell.net) | Mobile +1.510.703.7470 | Home +1.925.846.8683 | Sent from my iPad | On Dec 16, 2020, at 12:54 PM, swallach <steven.wallach@bsc.es> wrote: | i guess i am looking at the wrong set of apps. | in any case VM registers NOT in the vector registers permits a robust and performance optimized operations under mask. | wrt extra instructions. i am neutral. | On Dec 16, 2020, at 3:49 PM, Roger Espasa <roger.espasa@semidynamics.com> wrote: | 8 Maks registers are quite needed in modern outer-vectorized loops. Also in graphic shaders. I would say 16 is | overkill. | Now, and I am not defending this, if we had to go this route, I would seriously fight for masks-in-x-registers. I.e | :no new state , no new instructions. Only a few arch tricks to try to avoid loss of decoupling between vector unit and | scalar unit. That’s better than a new set of registers and | instructions | Roger. | On Wed, 16 Dec 2020 at 21:34, swallach <steven.wallach@bsc.es> wrote: | in my experience only only one maybe two vm registers are | needed | nested loops under if statements is rare. || On Dec 16, 2020, at 3:29 PM, Bill Huffman <huffman@cadence.com> wrote: || || I don’t think a separate mask register will do at all. It would take || a mask register file with at least 8 and | maybe 16 registers. Lots of compare results need to be kept and operations need to be done on mask registers. I | don't think we should have a separate mask register file. || || Bill || || -----Original Message----- || From: tech-vector-ext@lists.riscv.org || <tech-vector-ext@lists.riscv.org> On Behalf Of swallach || Sent: Wednesday, December 16, 2020 12:26 PM || To: Alex Solomatnikov <sols@sifive.com> || Cc: Krste Asanovic <krste@berkeley.edu>; || tech-vector-ext@lists.riscv.org || Subject: Re: [RISC-V] [tech-vector-ext] Vector Task Group minutes || 2020/12/04 || || EXTERNAL MAIL || || || i totally agree. if this is done, then instructions like: count || bits, etc can directly apply to the mask | register. || || also, from a hardware implementation, the VM register can be implemented with LATÇHES. this facilitates a | better implementation (imho) for operations under mask || || and yes load and store VM are required || || —— || || || If separate loads and stores are introduced for mask, then separate || vmask register can be introduced to avoid | dual use of v0 (as a regular vector register and as a mask register) and its complications. || || Alex || | | https://urldefense.com/v3/__http://bsc.es/disclaimer__;!!EHscmS1ygiU1l | A!RJHAWw-769bPQyIHjTxb9o5uKdCXTVYJl2Bab73oZY-l_MvY1RgkMuZPnlTs5wU$ || || || || || | http://bsc.es/disclaimer | WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and | may contain information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. If | you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are | strictly prohibited from disclosing, distributing, copying, or in any way using this message. If you have received this | communication in error, please notify the sender and destroy and delete any copies you may have received. | http://www.bsc.es/disclaimer |
|
|
Re: Vector Task Group minutes 2020/12/04
I'm not contemplating changing mask design (yet again) at this point
in process. I don't see any great advantage to any of these last round of proposals, as they all have significant downsides for some part of implementation space. The current design, like any real design, is not perfect, but does balance a lot of competing concerns coming from different design points. @sols: The mask load instructions are being added to allow a microarchitecture to see all common mask writes, enabling complex microarchitectures to perform mask optimizations. In particular, for wide datapaths and for renamed registers. Without renaming, and without deep temporal registers, having v0 be only mask source reduces cost of mask read port. @swallach: The mask logical operations can be fused with masked operations in more complex machines to reduce software cost of only allowing v0 be mask. @sols,lidawei: Adding more dedicated mask register state increase cost/complexity for all machines. Long LMUL needs a lot of bits to hold mask. Dropping longer LMUL would reduce efficiency of simple machines. @roger: Using x registers for masks breaks vector-length agnostic goal and would limit LMUL. @lidawei: Fractional LMUL helps with case where you want widening operations and lots of mask registers. If uarch utlization is low with lower LMUL, then one solution is to increase VLEN for same physical datapath width. @swallach: ARM SVE uses predicates to implement vector length, so unsurprisingly ends up needing more mask resources. RVV vl can be considered additional mask that is AND-ed in with each mask. Krste | Having been a silent observer of this group for what seems like a very long time, but now recently liberated from previousOn Wed, 16 Dec 2020 14:08:22 -0800, Grant Martin <gmartin15@pacbell.net> said: | constraints, I will observe that I have seen the use in DSPs of both dedicated mask register files and use of general vector | type registers to serve this purpose. | Along with operations for manipulating them. | While there are pros and cons for both, I lean to the side of not having a special mask register file and special operations, | but instead use existing resources and operations. | However I have a process observation as well - it has taken RV Vector proposal a long time to converge to a near 1.0 | specification. Would going down a different route cause enough delay and debate that it would derange the process and | significantly delay the standardization that is desired? As opposed to more modest suggestions. | Thanks and best regards | Grant Martin | gmartin@ieee.org | (gmartin15@pacbell.net) | Mobile +1.510.703.7470 | Home +1.925.846.8683 | Sent from my iPad | On Dec 16, 2020, at 12:54 PM, swallach <steven.wallach@bsc.es> wrote: | i guess i am looking at the wrong set of apps. | in any case VM registers NOT in the vector registers permits a robust and performance optimized operations under mask. | wrt extra instructions. i am neutral. | On Dec 16, 2020, at 3:49 PM, Roger Espasa <roger.espasa@semidynamics.com> wrote: | 8 Maks registers are quite needed in modern outer-vectorized loops. Also in graphic shaders. I would say 16 is | overkill. | Now, and I am not defending this, if we had to go this route, I would seriously fight for masks-in-x-registers. I.e | :no new state , no new instructions. Only a few arch tricks to try to avoid loss of decoupling between vector unit and | scalar unit. That’s better than a new set of registers and instructions | Roger. | On Wed, 16 Dec 2020 at 21:34, swallach <steven.wallach@bsc.es> wrote: | in my experience only only one maybe two vm registers are needed | nested loops under if statements is rare. || On Dec 16, 2020, at 3:29 PM, Bill Huffman <huffman@cadence.com> wrote: || || I don’t think a separate mask register will do at all. It would take a mask register file with at least 8 and | maybe 16 registers. Lots of compare results need to be kept and operations need to be done on mask registers. I | don't think we should have a separate mask register file. || || Bill || || -----Original Message----- || From: tech-vector-ext@lists.riscv.org <tech-vector-ext@lists.riscv.org> On Behalf Of swallach || Sent: Wednesday, December 16, 2020 12:26 PM || To: Alex Solomatnikov <sols@sifive.com> || Cc: Krste Asanovic <krste@berkeley.edu>; tech-vector-ext@lists.riscv.org || Subject: Re: [RISC-V] [tech-vector-ext] Vector Task Group minutes 2020/12/04 || || EXTERNAL MAIL || || || i totally agree. if this is done, then instructions like: count bits, etc can directly apply to the mask | register. || || also, from a hardware implementation, the VM register can be implemented with LATÇHES. this facilitates a | better implementation (imho) for operations under mask || || and yes load and store VM are required || || —— || || || If separate loads and stores are introduced for mask, then separate vmask register can be introduced to avoid | dual use of v0 (as a regular vector register and as a mask register) and its complications. || || Alex || | https://urldefense.com/v3/__http://bsc.es/disclaimer__;!!EHscmS1ygiU1lA!RJHAWw-769bPQyIHjTxb9o5uKdCXTVYJl2Bab73oZY-l_MvY1RgkMuZPnlTs5wU$ || || || || || | http://bsc.es/disclaimer | WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and | may contain information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. If | you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are | strictly prohibited from disclosing, distributing, copying, or in any way using this message. If you have received this | communication in error, please notify the sender and destroy and delete any copies you may have received. | http://www.bsc.es/disclaimer |
|
|
Re: Vector Task Group minutes 2020/12/04
imho, since are trying to both address the embedded market and the hpc market, we have conflicts wrt logic, power, and cost
addressing the hpc market, 8 extra registers for VM, appropriately defined, that increases the performance of loops with conditionals, is not an issue. on the other hand, for embedded these registers may be un necessary overhead. attached is a paper on what ARM and fujitsu have implemented. just for a reference. worth a read http://bsc.es/disclaimer
|
|
Re: Vector Task Group minutes 2020/12/04
lidawei14@...
In some cases we have widening computations with large LMUL settings, we will quickly run out of v0-v31 if we also have to keep masks in these registers.
|
|
Re: Vector Task Group minutes 2020/12/04
Having been a silent observer of this group for what seems like a very long time, but now recently liberated from previous constraints, I will observe that I have seen the use in DSPs of both dedicated mask register files and use of general vector type registers to serve this purpose. Along with operations for manipulating them. While there are pros and cons for both, I lean to the side of not having a special mask register file and special operations, but instead use existing resources and operations. However I have a process observation as well - it has taken RV Vector proposal a long time to converge to a near 1.0 specification. Would going down a different route cause enough delay and debate that it would derange the process and significantly delay the standardization that is desired? As opposed to more modest suggestions. Thanks and best regards Grant Martin gmartin@... (gmartin15@...) Mobile +1.510.703.7470 Home +1.925.846.8683
On Dec 16, 2020, at 12:54 PM, swallach <steven.wallach@...> wrote:
|
|
Re: Vector Task Group minutes 2020/12/04
Alex Solomatnikov
One option is to allow mask generating instructions (compares) to write either to regular vector regs or to vmask and to provide move instructions between vector regs and vmask. But mask consuming instructions can use only vmask as a mask. Mask load and store are also only for vmask. This is no worse than current design. Alex
On Wed, Dec 16, 2020 at 12:29 PM Bill Huffman <huffman@...> wrote: I don’t think a separate mask register will do at all. It would take a mask register file with at least 8 and maybe 16 registers. Lots of compare results need to be kept and operations need to be done on mask registers. I don't think we should have a separate mask register file.
|
|
Re: Vector Task Group minutes 2020/12/04
i guess i am looking at the wrong set of apps. in any case VM registers NOT in the vector registers permits a robust and performance optimized operations under mask. wrt extra instructions. i am neutral. On Dec 16, 2020, at 3:49 PM, Roger Espasa <roger.espasa@...> wrote:
WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message. If you have received this communication in error, please notify the sender and destroy and delete any copies you may have received. http://www.bsc.es/disclaimer
|
|
Re: Vector Task Group minutes 2020/12/04
8 Maks registers are quite needed in modern outer-vectorized loops. Also in graphic shaders. I would say 16 is overkill. Now, and I am not defending this, if we had to go this route, I would seriously fight for masks-in-x-registers. I.e :no new state , no new instructions. Only a few arch tricks to try to avoid loss of decoupling between vector unit and scalar unit. That’s better than a new set of registers and instructions Roger.
On Wed, 16 Dec 2020 at 21:34, swallach <steven.wallach@...> wrote: in my experience only only one maybe two vm registers are needed
|
|
Re: Vector Task Group minutes 2020/12/04
i would also add, that if 8 or 16 registers are needed, why do we only have one register, , V0. if this were true we would need to multi-plex between varius vector registers and V0 i believe i have interpreted your commengt of 8 or 16 registers, correctly ------------------------------------ Bill WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message. If you have received this communication in error, please notify the sender and destroy and delete any copies you may have received. http://www.bsc.es/disclaimer
|
|
Re: Vector Task Group minutes 2020/12/04
in my experience only only one maybe two vm registers are needed
nested loops under if statements is rare. On Dec 16, 2020, at 3:29 PM, Bill Huffman <huffman@cadence.com> wrote: http://bsc.es/disclaimer
|
|
Re: Vector Task Group minutes 2020/12/04
Bill Huffman
I don’t think a separate mask register will do at all. It would take a mask register file with at least 8 and maybe 16 registers. Lots of compare results need to be kept and operations need to be done on mask registers. I don't think we should have a separate mask register file.
toggle quoted messageShow quoted text
Bill
-----Original Message-----
From: tech-vector-ext@lists.riscv.org <tech-vector-ext@lists.riscv.org> On Behalf Of swallach Sent: Wednesday, December 16, 2020 12:26 PM To: Alex Solomatnikov <sols@sifive.com> Cc: Krste Asanovic <krste@berkeley.edu>; tech-vector-ext@lists.riscv.org Subject: Re: [RISC-V] [tech-vector-ext] Vector Task Group minutes 2020/12/04 EXTERNAL MAIL i totally agree. if this is done, then instructions like: count bits, etc can directly apply to the mask register. also, from a hardware implementation, the VM register can be implemented with LATÇHES. this facilitates a better implementation (imho) for operations under mask and yes load and store VM are required —— If separate loads and stores are introduced for mask, then separate vmask register can be introduced to avoid dual use of v0 (as a regular vector register and as a mask register) and its complications. Alex https://urldefense.com/v3/__http://bsc.es/disclaimer__;!!EHscmS1ygiU1lA!RJHAWw-769bPQyIHjTxb9o5uKdCXTVYJl2Bab73oZY-l_MvY1RgkMuZPnlTs5wU$
|
|
Re: Vector Task Group minutes 2020/12/04
i totally agree. if this is done, then instructions like: count bits, etc can directly apply to the mask register.
also, from a hardware implementation, the VM register can be implemented with LATÇHES. this facilitates a better implementation (imho) for operations under mask and yes load and store VM are required —— If separate loads and stores are introduced for mask, then separate vmask register can be introduced to avoid dual use of v0 (as a regular vector register and as a mask register) and its complications. Alex http://bsc.es/disclaimer
|
|
Re: Vector Task Group minutes 2020/12/04
Alex Solomatnikov
If separate loads and stores are introduced for mask, then separate vmask register can be introduced to avoid dual use of v0 (as a regular vector register and as a mask register) and its complications. Alex
On Fri, Dec 4, 2020 at 7:01 PM Krste Asanovic <krste@...> wrote:
|
|
Re: 答复: [RISC-V] [tech-vector-ext] The scenarios of GEMM for u/int8 data
Linjie Yu
Hi,David
Can we see the git of your work? My code has not been upload to git, and I will show it in the mail. Does this mean the 32 vector registers are not enough, or that the number of elements for the given input vector length are not enough? Yes, for the width should be widen 4 times.
With a "temporary working vector" this new instruction is a combination of the old with any "insert scalar into element" instruction [such as vrgather.vv splatt with mask ].
To use vrgather.vv, the 128 bits const is complex to init.
Next, I will show my code:
Firstly, the C code:
int sum[8]; for (int j = 0; j < 8; j++) { sum[j] = bias_ptr[j]; } for (int j = 0; j < inch_16; j++) { for (int k = 0; k < 16; k++) { for (int x = 0; x < 8; x++) { sum[x] += in_ptr[k] * f0[k + 16 * x]; } } in_ptr += 16; f0 += 16 * 8; } for (int j = 0; j < 8; j++) { int lshift = -shift_value[j + i]; if (lshift > 0) { sum[j] = (sum[j] + (1 << (lshift - 1))) >> lshift; } else { sum[j] = sum[j] << (-lshift); } out_ptr[j] = (char)sum[j]; }
1. vdot.vv+vredsum.vs (the tail process is so complex) "vsetvli zero, zero, e64, m8\n\t" "vxor.vv v0, v0, v0\n\t" "beqz %4, 1f\n\t"
"0: \n\t" "vsetvli zero, zero, e8, m1\n\t" "vle.v v8, (%0)\n\t" "addi %0, %0, 16\n\t" "vle.v v9, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v10, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v11, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v12, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v13, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v14, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v15, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v16, (%1)\n\t" "addi %1, %1, 16\n\t"
"vsetvli zero, zero, e32, m1, d4\n\t" "vdot.vv v0, v8, v9\n\t" "vdot.vv v1, v8, v10\n\t" "vdot.vv v2, v8, v11\n\t" "vdot.vv v3, v8, v12\n\t" "vdot.vv v4, v8, v13\n\t" "addi %4, %4, -1\n\t" "vdot.vv v5, v8, v14\n\t" "vdot.vv v6, v8, v15\n\t" "vdot.vv v7, v8, v16\n\t" "bnez %4, 0b\n\t"
"1: \n\t" "vsetvli zero, zero, e64, m8\n\t" "vxor.vv v8, v8, v8\n\t" "vsetvli zero, zero, e32, m1\n\t" "vwredsum.vs v8, v0, v8\n\t" "vwredsum.vs v9, v1, v9\n\t" "vwredsum.vs v10, v2, v10\n\t" "vwredsum.vs v11, v3, v11\n\t" "vwredsum.vs v12, v4, v12\n\t" "vwredsum.vs v13, v5, v13\n\t" "vwredsum.vs v14, v6, v14\n\t" "vwredsum.vs v15, v7, v15\n\t"
2. vwmul + vwredsum.vs (vwredsum.vs used in the for loop) "vsetvli zero, zero, e64, m8\n\t" "vxor.vv v0, v0, v0\n\t" "beqz %4, 1f\n\t"
"0: \n\t" "vsetvli zero, zero, e8, m1\n\t" "vle.v v8, (%0)\n\t" "addi %0, %0, 16\n\t" "vle.v v9, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v10, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v11, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v12, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v13, (%1)\n\t" "addi %1, %1, 16\n\t"
"vwmul.vv v14, v8, v9\n\t" "vwmul.vv v16, v8, v10\n\t" "vle.v v9, (%1)\n\t" "addi %1, %1, 16\n\t" "vwmul.vv v18, v8, v11\n\t" "vle.v v10, (%1)\n\t" "addi %1, %1, 16\n\t" "vwmul.vv v20, v8, v12\n\t" "vle.v v11, (%1)\n\t" "addi %1, %1, 16\n\t"
"vwmul.vv v22, v8, v13\n\t" "vwmul.vv v24, v8, v9\n\t" "vwmul.vv v26, v8, v10\n\t" "vwmul.vv v28, v8, v11\n\t"
"vsetvli zero, zero, e16, m2\n\t" "vwredsum.vs v0, v14, v0\n\t" "vwredsum.vs v1, v16, v1\n\t" "vwredsum.vs v2, v18, v2\n\t" "addi %4, %4, -1\n\t" "vwredsum.vs v3, v20, v3\n\t" "vwredsum.vs v4, v22, v4\n\t" "vwredsum.vs v5, v24, v5\n\t" "vwredsum.vs v6, v26, v6\n\t" "vwredsum.vs v7, v28, v7\n\t" "bnez %4, 0b\n\t"
3. vwmul + vwredsum.vs(new) "vsetvli zero, zero, e16, m2\n\t" "vxor.vv v2, v2, v2\n\t" "beqz %4, 1f\n\t"
"0: \n\t" "vsetvli zero, zero, e8, m1\n\t" "vle.v v8, (%0)\n\t" "addi %0, %0, 16\n\t" "vle.v v9, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v10, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v11, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v12, (%1)\n\t" "addi %1, %1, 16\n\t" "vle.v v13, (%1)\n\t" "addi %1, %1, 16\n\t"
"vwmul.vv v14, v8, v9\n\t" "vwmul.vv v16, v8, v10\n\t" "vle.v v9, (%1)\n\t" "addi %1, %1, 16\n\t" "vwmul.vv v18, v8, v11\n\t" "vle.v v10, (%1)\n\t" "addi %1, %1, 16\n\t" "vwmul.vv v20, v8, v12\n\t" "vle.v v11, (%1)\n\t" "addi %1, %1, 16\n\t"
"vwmul.vv v22, v8, v13\n\t" "vwmul.vv v24, v8, v9\n\t" "vwmul.vv v26, v8, v10\n\t" "vwmul.vv v28, v8, v11\n\t"
"vsetvli zero, zero, e16, m2\n\t" "vwredsum.vs v2, v14, v2, 0\n\t" "vwredsum.vs v2, v16, v2, 1\n\t" "vwredsum.vs v2, v18, v2, 2\n\t" "addi %4, %4, -1\n\t" "vwredsum.vs v2, v20, v2, 3\n\t" "vwredsum.vs v3, v22, v3, 0\n\t" "vwredsum.vs v3, v24, v3, 1\n\t" "vwredsum.vs v3, v26, v3, 2\n\t" "vwredsum.vs v3, v28, v3, 3\n\t"
"bnez %4, 0b\n\t"
All of them are shown above. Any suggestions are welcomed.
Yours Damon
发件人: tech-vector-ext@... <tech-vector-ext@...> 代表 David Horner
On 2020-12-11 3:34 a.m., Linjie Yu wrote:
Can we see the git of your work?
Does this mean the 32 vector registers are not enough, or that the number of elements for the given input vector length are not enough?
Note vdot.vv is experimental. It is not planned for the v1.0 ratification proposal.
With a "temporary working vector" this new instruction is a combination of the old with any "insert scalar into element" instruction [such as vrgather.vv splatt with mask ].
I would be happy to look at your current work to make suggestions if you could direct me to the code.
|
|