Brandon Wu
c804e86f55
[RISCV][VLS] Support RISCV VLS calling convention ( #100346 )
...
This patch adds a function attribute `riscv_vls_cc` for RISCV VLS
calling
convention which takes 0 or 1 argument, the argument is the `ABI_VLEN`
which is the `VLEN` for passing the fixed-vector arguments, it wraps the
argument as a scalable vector(VLA) using the `ABI_VLEN` and uses the
corresponding mechanism to handle it. The range of `ABI_VLEN` is [32,
65536],
if not specified, the default value is 128.
Here is an example of VLS argument passing:
Non-VLS call:
```
void original_call(__attribute__((vector_size(16))) int arg) {}
=>
define void @original_call(i128 noundef %arg) {
entry:
...
ret void
}
```
VLS call:
```
void __attribute__((riscv_vls_cc(256))) vls_call(__attribute__((vector_size(16))) int arg) {}
=>
define riscv_vls_cc void @vls_call(<vscale x 1 x i32> %arg) {
entry:
...
ret void
}
}
```
The first Non-VLS call passes generic vector argument of 16 bytes by
flattened integer.
On the contrary, the VLS call uses `ABI_VLEN=256` which wraps the
vector to <vscale x 1 x i32> where the number of scalable vector
elements
is calaulated by: `ORIG_ELTS * RVV_BITS_PER_BLOCK / ABI_VLEN`.
Note: ORIG_ELTS = Vector Size / Type Size = 128 / 32 = 4.
PsABI PR: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/418
C-API PR: https://github.com/riscv-non-isa/riscv-c-api-doc/pull/68
2025-03-03 12:39:35 +08:00
..
2025-02-13 12:13:39 +01:00
2023-06-20 16:43:14 +02:00
2022-12-14 13:38:20 +01:00
2024-10-09 09:27:28 +04:00
2023-09-13 08:38:48 +03:00
2024-08-12 14:56:53 +04:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2022-12-19 15:22:39 +08:00
2024-07-25 09:19:22 -04:00
2022-12-13 12:24:05 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2023-06-20 16:43:14 +02:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2025-01-29 16:56:47 +01:00
2025-03-03 12:39:35 +08:00
2024-02-22 14:07:16 +00:00
2024-11-06 11:53:33 +00:00
2023-03-14 16:48:33 +00:00
2023-03-06 18:34:32 +00:00
2025-02-19 10:13:37 +01:00
2025-02-19 10:13:37 +01:00
2022-09-07 12:47:21 +02:00
2022-09-07 12:47:21 +02:00
2024-11-07 08:11:15 +00:00
2023-07-12 12:31:42 +05:30
2022-12-14 13:38:20 +01:00
2024-06-14 15:07:27 +01:00
2024-04-05 14:18:59 +01:00
2024-06-14 15:07:27 +01:00
2023-06-16 00:49:59 +02:00
2023-06-16 00:49:59 +02:00
2022-12-02 17:12:03 -05:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-09 01:04:45 +03:00
2024-10-15 17:11:25 +08:00
2025-01-29 16:56:47 +01:00
2024-08-20 11:25:49 +03:00
2023-06-20 16:43:14 +02:00
2022-12-19 11:23:17 +01:00
2022-12-19 11:23:17 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2025-01-29 16:56:47 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-09 01:04:45 +03:00
2024-09-02 12:42:52 +02:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2024-08-20 11:25:49 +03:00
2024-08-20 11:25:49 +03:00
2024-11-28 11:21:38 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2025-02-13 12:13:39 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2023-07-12 12:31:42 +05:30
2024-10-11 12:09:10 +07:00
2022-11-04 10:21:38 +01:00
2022-11-04 10:21:38 +01:00
2023-07-12 14:35:55 +02:00
2022-12-14 13:38:20 +01:00
2025-02-24 10:11:53 -08:00
2024-11-18 15:16:48 -08:00
2022-12-14 13:38:20 +01:00
2023-12-06 08:41:44 -08:00
2024-08-27 13:53:25 -04:00
2023-12-06 08:41:44 -08:00
2024-08-27 13:53:25 -04:00
2023-12-06 08:41:44 -08:00
2024-08-27 13:53:25 -04:00
2024-08-27 13:53:25 -04:00
2024-08-27 13:53:25 -04:00
2024-04-10 19:46:01 -07:00
2024-08-27 13:53:25 -04:00
2024-08-27 13:53:25 -04:00
2023-12-06 08:41:44 -08:00
2024-08-27 13:53:25 -04:00
2024-08-27 13:53:25 -04:00
2024-04-10 19:46:01 -07:00
2024-03-27 11:41:34 +00:00
2024-04-10 19:46:01 -07:00
2023-12-06 08:41:44 -08:00
2022-12-14 13:38:20 +01:00
2023-12-06 08:41:44 -08:00
2024-04-10 19:46:01 -07:00
2024-04-10 19:46:01 -07:00
2022-12-14 13:38:20 +01:00
2024-10-18 15:58:33 +01:00
2022-12-14 13:38:20 +01:00
2022-12-07 18:29:18 +00:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2024-02-23 10:24:15 +01:00
2024-01-16 17:01:01 -08:00
2024-01-16 17:01:01 -08:00
2023-10-11 10:23:38 +01:00
2023-10-11 10:23:38 +01:00
2023-10-11 10:23:38 +01:00
2023-10-11 10:23:38 +01:00
2023-10-11 10:23:38 +01:00
2024-06-14 15:07:27 +01:00
2023-03-02 09:29:42 +00:00
2024-06-14 15:07:27 +01:00
2022-12-14 13:38:20 +01:00
2022-11-04 10:21:38 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2024-04-11 12:29:29 -07:00
2022-12-14 13:38:20 +01:00
2022-12-19 11:23:17 +01:00
2022-12-19 11:23:17 +01:00
2025-01-29 16:56:47 +01:00
2024-03-06 09:51:48 -05:00
2022-12-14 13:38:20 +01:00
2024-08-28 12:48:20 +01:00
2022-12-14 13:38:20 +01:00
2022-12-14 13:38:20 +01:00
2024-04-29 10:16:45 +01:00
2024-04-29 10:16:45 +01:00
2024-04-29 10:16:45 +01:00
2024-05-28 16:09:53 +02:00
2024-05-28 16:09:53 +02:00
2024-03-27 11:41:34 +00:00
2024-06-04 08:31:03 +02:00
2024-11-21 11:21:12 +00:00
2022-12-14 13:38:20 +01:00
2023-06-20 16:43:14 +02:00