Comments (9)
Hi Jan,
First, let me mention that there is an active proposal in the V-extension task group to add mask load and store instructions. This is motivated by reducing costs in certain OOO implementations. It looks like the latest meeting minutes haven't been uploaded, but it was also discussed last month (minutes). Reading the tea leaves, this will become part of RVV 1.0, thence we will add a new intrinsic.
However, I think I agree with you that we should extend the vreinterpret
intrinsics to convert vbool
to other types.
I hope others can chime in.
from rvv-intrinsic-doc.
Hi Nick, thanks for sharing. Both sound good to me.
from rvv-intrinsic-doc.
OpenCV folks has ask for similar feature too, I think vle1.v
/vse1.v
would be better than reinterpret, it's hard (or error prone) to set the VL
for load/store a masking via vle8
/vse8
, since actually you only need read/write VL
/8 bytes.
from rvv-intrinsic-doc.
@kito-cheng how can I reinterpret a vbool
as another type using the intrinsics API?
(I don't have an application in mind, just curious.)
from rvv-intrinsic-doc.
Hmmm, need waste some space and instruction to do that:
uint8_t preds[256] = {0, 1, 0, 1...};
vuint8m8_t v = vle8_v_u8m1(preds);
vbool1_t mask = vmsne_vx_u8m8_b1 (v, 0);
from rvv-intrinsic-doc.
I know it's not reinterpret, but we don't have reinterpret between m1
<-> vbool
yet :P
that's the solution we suggest to other guys who want pre-computed mask.
from rvv-intrinsic-doc.
:) We're also using vid_v for a similar purpose.
from rvv-intrinsic-doc.
The riscv-v-spec 1.0 mentions a trick regarding to your request in Section 11.16 : Mask values can be widened into SEW-width elements using a sequence vmv.v.i vd, 0; vmerge.vim vd, vd, 1, v0.
With the latest v-spec and explicit VL intrinsics, the following code in C works for me:
enum {AVL=20,};
vuint8m8_t v = vmv_v_x_u8m8(0, AVL);
vbool1_t mask = vmseq_vv_u8m8_b1(v, v, AVL);
uint8_t one = 1;
vuint8m8_t extended_mask = vmerge_vxm_u8m8(mask, v, one, AVL);
uint8_t bits[256];
vse8_v_u8m8(bits, extended_mask, AVL);
from rvv-intrinsic-doc.
We now have vsm_v
for saving boolean value into scalar.
Let's open a new issue if there is any issue with the existing API. Closing this one for now. Thank you :)
from rvv-intrinsic-doc.
Related Issues (20)
- Constraint of vector types in Zve32* HOT 2
- [Requirement]: The RISC-V RVV vector intrinsic must include support for vector groups in the __riscv_vfredosum function HOT 4
- Type-relative overloads for vreinterpret, vlmul_ext, vlmul_trunc, etc. HOT 1
- How to use a class to wrap or derive from a sizeless vector type HOT 1
- Encode all the effects of vsetvl in the return type, for use in subsequent type deductions HOT 1
- Does `__riscv_v_intrinsic >= 1000000` imply overloaded intrinsics are supported?
- Create bibliography from reference section HOT 3
- Simple questions about inline assembly in vmv.x.s instruction HOT 2
- Asterisks are not subscripts
- the wrong result of "vmerge_vvm_i32m1" HOT 5
- ta,ma reduction destination with vl=0 HOT 1
- Clarify the consequences of vxsat not being handled by the intrinsics HOT 3
- Add a section with examples HOT 3
- Rename uses of {implicit,explicit}-frm into {Implicit, Explicit} FP rounding mode HOT 1
- Clarify the mapping of pseudo-intrinsics
- Clarify what float and double means HOT 1
- Fix authors in the document
- How to use LMUL in rvv-intrinsic? HOT 6
- Mismatched bfloat16 autogenerated files HOT 3
- Freeze the specification HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rvv-intrinsic-doc.