RISC-V: Correctly gate memcpy threshold in vector block move
Fixes RISC-V vector block move to use the correct memcpy threshold, resolving incorrect activation of memcpy path.
A bug in the RISC-V vector block move implementation has been fixed, ensuring that the memcpy path is correctly gated by the riscv_memcpy_size_threshold. Previously, this threshold was incorrectly gated by riscv_memmove_size_threshold, leading to the memcpy path only being honored under specific, unrelated conditions related to memmove settings.
In Details
The riscv_vector_expand_block_move function incorrectly used riscv_memmove_size_threshold to gate the !movmem_p (memcpy) path. The condition riscv_memmove_size_threshold >= 0 was intended for memmove, not memcpy. This commit corrects the gating to use riscv_memcpy_size_threshold, aligning the behavior with the intended optimization for block moves based on size thresholds.
- RISC-V
- An open-standard instruction set architecture (ISA) based on RISC principles, increasingly used for embedded systems and high-performance computing.
- vector block move
- An operation that moves a block of data using vector instructions, which can be more efficient for large data transfers.
- memcpy
- A standard C library function that copies a block of memory from a source to a destination.
- memmove
- A standard C library function similar to memcpy, but it correctly handles overlapping memory regions.