Giter Site home page Giter Site logo

Comments (9)

joy2myself avatar joy2myself commented on July 18, 2024 1

Hi @zakk0610 ,
Thanks for your proposal! But it doesn't seem like what I want in #28. I want to combine two (or more) small LMUL vectors to one big LMUL vector, or conversely, to split one big LMUL vector to two (or more) small LMUL vectors. Because my development is based on a fixed 128-bits VLEN, the vl should be changed with LMUL.

What I want may looks like

//vector combine
vint64m2_t vcombine_i64m1_i64m2 (vint64m1_t op1, vint64m1_t op2);
//vector split
vint64m1_t vget_low_i64m2_i64m1 (vint64m2_t op1);   //get the low half of big vector
vint64m1_t vget_high_i64m2_i64m1 (vint64m2_t op1);  //get the high half of big vector

In my opinion, two split functions can be implemented based on slide operation and vl modification, but I'm not sure how to implement combine operation. Moreover, even if these operations can be implemented by other intrinsics, will the interface packaged as such be more friendly to the front-end users?

from rvv-intrinsic-doc.

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

I guess it should ext before slideup, otherwise the result might truncated?

from rvv-intrinsic-doc.

zakk0610 avatar zakk0610 commented on July 18, 2024

What do you think @joy2myself @HanKuanChen?

from rvv-intrinsic-doc.

HanKuanChen avatar HanKuanChen commented on July 18, 2024

LGTM

from rvv-intrinsic-doc.

HanKuanChen avatar HanKuanChen commented on July 18, 2024

@joy2myself
How about

vint64m2_t vcombine_i64m1_i64m2 (vint64m1_t op1, vint64m1_t op2, size_t vl)
{
    return vlmul_ext_v_i64m1_i64m2(vslideup(op1, op2, vl));
}

from rvv-intrinsic-doc.

joy2myself avatar joy2myself commented on July 18, 2024

Like this?

vint64m2_t vcombine_i64m1_i64m2 (vint64m1_t op1, vint64m1_t op2, size_t vl)
{
    return vslideup_vx_i64m2(vlmul_ext_v_i64m1_i64m2(op1), vlmul_ext_v_i64m1_i64m2(op2), vl);
}

I'm not sure does it work since ext operation modified VLEN, right?

from rvv-intrinsic-doc.

zakk0610 avatar zakk0610 commented on July 18, 2024

Those two utility functions would not modified vl so you need to reset vl if need.

like this would be better.

vint64m2_t vcombine_i64m1_i64m2 (vint64m1_t op1, vint64m1_t op2, size_t vl)
{
   vint64m2_t new_op1 = vlmul_ext_v_i64m1_i64m2(op1);
   vint64m2_t new_op2 = vlmul_ext_v_i64m1_i64m2(op2);
   size_t new_vl = vsetvl_e64m2 (vl)
   return vslideup_vx_i64m2(new_op1, new_op2, new_vl);
}

from rvv-intrinsic-doc.

joy2myself avatar joy2myself commented on July 18, 2024

Thanks! If it works, it looks good to me.

from rvv-intrinsic-doc.

zakk0610 avatar zakk0610 commented on July 18, 2024

I create a PR #57
If there is no other questions, I will merge it.

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.