Giter Site home page Giter Site logo

Comments (3)

zakk0610 avatar zakk0610 commented on July 18, 2024

I list some similar cases if we want to provide consistent interface for integer and floating type.
(note: in intrinsic user view is different data type)

  1. Merge Instruction
// gpr
vmerge.vvm vd, vs2, vs1, v0  # vd[i] = v0[i].LSB ? vs1[i] : vs2[i]
vmerge.vxm vd, vs2, rs1, v0  # vd[i] = v0[i].LSB ? x[rs1] : vs2[i]
vmerge.vim vd, vs2, imm, v0  # vd[i] = v0[i].LSB ? imm    : vs2[i]
// fpr
vfmerge.vfm vd, vs2, rs1, v0  # vd[i] = v0[i].LSB ? f[rs1] : vs2[i]

we can also support vvm case of intrinsic function for floating vector type

  1. Single-Width Fused Multiply-Add Instructions

floating type have below additional instructions comparing to integer fused-add instructions

# FP negate-(multiply-accumulate), overwrites subtrahend
vfnmacc.vv vd, vs1, vs2, vm   # vd[i] = -(vs1[i] * vs2[i]) - vd[i]
vfnmacc.vf vd, rs1, vs2, vm   # vd[i] = -(f[rs1] * vs2[i]) - vd[i]

# FP multiply-subtract-accumulator, overwrites subtrahend
vfmsac.vv vd, vs1, vs2, vm    # vd[i] = +(vs1[i] * vs2[i]) - vd[i]
vfmsac.vf vd, rs1, vs2, vm    # vd[i] = +(f[rs1] * vs2[i]) - vd[i]

# FP negate-(multiply-add), overwrites multiplicand
vfnmadd.vv vd, vs1, vs2, vm   # vd[i] = -(vs1[i] * vd[i]) - vs2[i]
vfnmadd.vf vd, rs1, vs2, vm   # vd[i] = -(f[rs1] * vd[i]) - vs2[i]

# FP multiply-sub, overwrites multiplicand
vfmsub.vv vd, vs1, vs2, vm    # vd[i] = +(vs1[i] * vd[i]) - vs2[i]
vfmsub.vf vd, rs1, vs2, vm    # vd[i] = +(f[rs1] * vd[i]) - vs2[i]
  1. Divide Instructions
    vfrdiv.vf vd, vs2, rs1, vm # scalar-vector, vd[i] = f[rs1]/vs2[i]

Integer doesn't support scalar-vector divide instruction

  1. Remainder Instructions (maybe this requirement is not make sense)
    Integer support Signed/Unsigned remainder, but floating does not have.

  2. Widening Multiply-Add Instructions
    https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#1213-vector-widening-integer-multiply-add-instructions
    https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#147-vector-widening-floating-point-fused-multiply-add-instructions

Integer does not have widening negate-(multiply-accumulate) and negate-(multiply-subtract-accumulator)

  1. Comparison Instructions
    https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#127-vector-integer-comparison-instructions
    https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#1411-vector-floating-point-compare-instructions

integer does not have Compare greater than or equal directly version

from rvv-intrinsic-doc.

zakk0610 avatar zakk0610 commented on July 18, 2024

https://github.com/sifive/rvv-intrinsic-internal/issues/17

from rvv-intrinsic-doc.

zakk0610 avatar zakk0610 commented on July 18, 2024

intrinsic function should support float type vslide1up/down api because spec had this instruction now.
riscv/riscv-v-spec@d0f1fab

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.