Proposed updates to the CORE-V builtin specifications
Created by: jeremybennett
The main changes are as follows.
-
All attempts to define builtins for 64-bit architectures are removed, since until the ISA extensions are formally defined for 64-bit CORE-V, specifying the builtins is pointless. However the introduction still describes the principle by which builtin functions for 64-bit may be provided, even with the same name as their 32-bit equivalent.
-
The first two arguments of the following builtins are changed to uint32_t, since these are vectors of values
- __builtin_riscv_cv_mac_mulsN,
- __builtin_riscv_cv_mac_mulhhsN
- __builtin_riscv_cv_mac_mulsRN
- __builtin_riscv_cv_mac_mulhhsRN
- __builtin_riscv_cv_mac_macsN,
- __builtin_riscv_cv_mac_machhsN
- __builtin_riscv_cv_mac_macsRN
- __builtin_riscv_cv_mac_machhsRN
-
The specification notes that int type is used for builtins returning a boolean value.
-
Several SIMD shift operations on byte, used max as the opcode name by mistake, which is corrected.
-
The following SIMD dot product operations have had their return type changed from uint32_t to int32_t
- __builtin_riscv_cv_simd_dotusp_h
- __builtin_riscv_cv_simd_dotusp_b
- __builtin_riscv_cv_simd_dotsp_h
- __builtin_riscv_cv_simd_dotsp_b
-
The following SIMD dot product operations have had their return type changed from uint32_t to int32_t and their scalar operand type to from uint16_t or uint8_t to int16_t or int8_t as appropriate.
- __builtin_riscv_cv_simd_dotusp_sc_h
- __builtin_riscv_cv_simd_dotusp_sc_b
- __builtin_riscv_cv_simd_dotsp_sc_h
- __builtin_riscv_cv_simd_dotsp_sc_b
-
The following SIMD dot product operations have had their return type and their final argument type changed from uint32_t to int32_t.
- __builtin_riscv_cv_simd_sdotusp_h
- __builtin_riscv_cv_simd_sdotusp_b
- __builtin_riscv_cv_simd_sdotsp_h
- __builtin_riscv_cv_simd_sdotsp_b
-
The following SIMD dot product operations have had their return type their final argument type changed from uint32_t to int32_t and their scalar operand type to from uint16_t or uint8_t to int16_t or int8_t as appropriate.
- __builtin_riscv_cv_simd_sdotusp_sc_h
- __builtin_riscv_cv_simd_sdotusp_sc_b
- __builtin_riscv_cv_simd_sdotsp_sc_h
- __builtin_riscv_cv_simd_sdotsp_sc_b
-
The constant ranges for scalar unsigned comparison immediate operations have been corrected to "0 <= j <= 63" from "-32 <= j <= 31".
-
The first argument of __builtin_riscv_cv_bitmanip_extract has been corrected to uint32_t from int32_t since it is a bit vector.
-
A superfluous "cv." has been removed from the name of several bitmanip builtins.
-
A redundant final argument has been removed, and its reference in the use of the
rD
operand has been removed from the following builtin functions.-
__builtin_riscv_cv_bitmanip_bclr
-
__builtin_riscv_cv_bitmanip_bset
- specifications/corev-builtin-spec.md: Updated as described above.
-
Signed-off-by: Jeremy Bennett jeremy.bennett@embecosm.com