Stream: git-wasmtime

Topic: wasmtime / issue #7187 riscv64: Implement `Zvbb` - Vector...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2023 at 12:52):

afonso360 opened issue #7187:

:wave: Hey,

[Zvbb - Vector Basic Bit-manipulation][zvbb] is a extension to the vector extension that contains additional bit manipulation instructions.

These are:

| Mnemonic |
|--|
vandn.[vv,vx]
vbrev.v
vbrev8.v
vrev8.v
vclz.v
vctz.v
vcpop.v
vrol.[vv,vx]
vror.[vv,vx,vi]
vwsll.[vv,vx,vi]

These should all be fairly easy to match in cranelift since we have their native counterparts in clif.

vwsll.* suffers from the same widening described in #7186. It takes a lot of rules to match all combinations of this instruction, so it might be best to work on a better matching pattern before implementing this one.

These instructions are described in more detail in the Vector Crypto Extensions document. [Zvbb][zvbb] is only a subset of this document. The rest of the extensions described in the document are very crypto specific and I'm not sure that we can easily match them.

Additionally, some instructions in [Zvbb][zvbb] are also available in [Zvkb][zvkb] which is a subset of [Zvbb][zvbb]. It would be nice to implement these instructions when either

[zvkb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvkb.adoc
[zvbb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvbb.adoc

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2023 at 12:52):

afonso360 added the cranelift:area:riscv64 label to Issue #7187.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2023 at 12:52):

afonso360 edited issue #7187:

:wave: Hey,

[Zvbb - Vector Basic Bit-manipulation][zvbb] is a extension to the vector extension that contains additional bit manipulation instructions.

These are:

| Mnemonic |
|--|
vandn.[vv,vx]
vbrev.v
vbrev8.v
vrev8.v
vclz.v
vctz.v
vcpop.v
vrol.[vv,vx]
vror.[vv,vx,vi]
vwsll.[vv,vx,vi]

These should all be fairly easy to match in cranelift since we have their native counterparts in clif.

vwsll.* suffers from the same widening described in #7186. It takes a lot of rules to match all combinations of this instruction, so it might be best to work on a better matching pattern before implementing this one.

These instructions are described in more detail in the Vector Crypto Extensions document. [Zvbb][zvbb] is only a subset of this document. The rest of the extensions described in the document are very crypto specific and I'm not sure that we can easily match them.

Additionally, some instructions in [Zvbb][zvbb] are also available in [Zvkb][zvkb] which is a subset of [Zvbb][zvbb]. It would be nice to implement these instructions when either extension is available. As well as enabling [Zvkb][zvkb] when [Zvbb][zvbb] is available.

[zvkb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvkb.adoc
[zvbb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvbb.adoc

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2023 at 12:54):

afonso360 edited issue #7187:

:wave: Hey,

[Zvbb - Vector Basic Bit-manipulation][zvbb] is a extension to the vector extension that contains additional bit manipulation instructions.

These are:

| Mnemonic |
|--|
vandn.[vv,vx]
vbrev.v
vbrev8.v
vrev8.v
vclz.v
vctz.v
vcpop.v
vrol.[vv,vx]
vror.[vv,vx,vi]
vwsll.[vv,vx,vi]

These should all be fairly easy to match in cranelift since we have their counterparts available as cranelift instructions.

vwsll.* suffers from the same widening described in #7186. It takes a lot of rules to match all combinations of this instruction, so it might be best to work on a better matching pattern before implementing this one.

These instructions are described in more detail in the Vector Crypto Extensions document. [Zvbb][zvbb] is only a subset of this document. The rest of the extensions described in the document are very crypto specific and I'm not sure that we can easily match them.

Additionally, some instructions in [Zvbb][zvbb] are also available in [Zvkb][zvkb] which is a subset of [Zvbb][zvbb]. It would be nice to implement these instructions when either extension is available. As well as enabling [Zvkb][zvkb] when [Zvbb][zvbb] is available.

[zvkb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvkb.adoc
[zvbb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvbb.adoc

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2023 at 12:55):

afonso360 edited issue #7187:

:wave: Hey,

[Zvbb - Vector Basic Bit-manipulation][zvbb] is a extension to the vector extension that contains additional bit manipulation instructions.

These are:

| Mnemonic |
|--|
vandn.[vv,vx]
vbrev.v
vbrev8.v
vrev8.v
vclz.v
vctz.v
vcpop.v
vrol.[vv,vx]
vror.[vv,vx,vi]
vwsll.[vv,vx,vi]

These should all be fairly easy to match in cranelift since we have their counterparts available as cranelift instructions.

vwsll.* suffers from the same widening issues described in #7186. It takes a lot of rules to match all combinations of this instruction, so it might be best to work on a better matching pattern before implementing this one.

These instructions are described in more detail in the Vector Crypto Extensions document. [Zvbb][zvbb] is only a subset of this document. The rest of the extensions described in the document are very crypto specific and I'm not sure that we can easily match them.

Additionally, some instructions in [Zvbb][zvbb] are also available in [Zvkb][zvkb] which is a subset of [Zvbb][zvbb]. It would be nice to implement these instructions when either extension is available. As well as enabling [Zvkb][zvkb] when [Zvbb][zvbb] is available.

[zvkb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvkb.adoc
[zvbb]: https://github.com/riscv/riscv-crypto/blob/main/doc/vector/riscv-crypto-vector-zvbb.adoc


Last updated: Oct 23 2024 at 20:03 UTC