Giter Site home page Giter Site logo

Comments (9)

nick-knight avatar nick-knight commented on July 18, 2024 1

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.

jan-wassenberg avatar jan-wassenberg commented on July 18, 2024

Hi Nick, thanks for sharing. Both sound good to me.

from rvv-intrinsic-doc.

kito-cheng avatar kito-cheng commented on July 18, 2024

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.

nick-knight avatar nick-knight commented on July 18, 2024

@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.

kito-cheng avatar kito-cheng commented on July 18, 2024

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.

kito-cheng avatar kito-cheng commented on July 18, 2024

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.

jan-wassenberg avatar jan-wassenberg commented on July 18, 2024

:) We're also using vid_v for a similar purpose.

from rvv-intrinsic-doc.

zhaochenyuangit avatar zhaochenyuangit commented on July 18, 2024

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.

eopXD avatar eopXD commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.