imkiva wrote:

> From previous discussion, I was expecting `__riscv_ime_lambda` to have 
> arguments?

I checked current upstream LLVM. I don't see an existing RISC-V/RVV intrinsic 
that reads a field out of the current `vtype`. The closest direct CSR query is 
`__riscv_vlenb()`, which reads the read-only `vlenb` CSR. The vsetvl intrinsics 
take explicit SEW/LMUL-like configuration and return VL, but they are not 
current-vtype queries.

For rounding modes, upstream also seems to avoid a raw current-state query: 
fixed-point VXRM and floating-point FRM are passed as explicit operands on the 
operation intrinsics, and the backend inserts/optimizes CSR writes as needed.

So if you expect `__riscv_ime_lambda` to have arguments, I assume you mean a 
query parameterized by explicit vector configuration rather than reading the 
current selected `vtype.lambda`, like:
```
size_t __riscv_ime_lambda_e8(void);
size_t __riscv_ime_lambda_e16(void);
size_t __riscv_ime_lambda_e32(void);
size_t __riscv_ime_lambda_e64(void);
```
or
```
size_t __builtin_rvv_ime_lambda(size_t sew);
```
These intrinsics now query the supported/canonical lambda for the explicit SEW, 
rather than read current vtype.lambda.

And another concern is that, future matrix intrinsics will carry their required 
configuration like vlambda, etc, according to previous discussion. Do we still 
need this lambda query intrinsic?

https://github.com/llvm/llvm-project/pull/203774
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to