RISC-V: Missing overlap detection for vector widening reduction instructions
This should take an illegal exception because vs1 and vs2 overlap and have different EEWs: ```vwredsum.vs v2,v30,v30``` A simple test case: ``` .globl _start _start: la t0, exception_handler csrw mtvec, t0 # Enable FP and vector csrr t0, mstatus li x3, (0x2000 | 0x200) or t0, t0, x3 csrw mstatus, t0 // mstatus.FS = '01, mstatus.V = '01 vsetvli x5,x0,e8,m1,ta,ma vwredsum.vs v2,v30,v30 1: j 1b exception_handler: 2: j 2b ``` With a linker script: ``` OUTPUT_ARCH(riscv) ENTRY(_start) SECTIONS { . = 0x80000000; .text : { *(.entry) *(.text) . = ALIGN(8); } . = ALIGN(0x1000); .rodata : { *(.rodata .rodata.*) . = ALIGN(8); } . = ALIGN(0x1000); .rela.dyn : { *(.rela*) } .data : { *(.sdata) *(.sdata.*) *(.data) *(.data.*) *(.readmostly.data) *(*.data) . = ALIGN(8); } . = ALIGN(0x1000); .bss : { *(.sbss) *(.sbss.*) *(.bss) *(.bss.*) . = ALIGN(8); } . = ALIGN(0x1000); } ``` Built with: ``` riscv64-unknown-linux-gnu-gcc -O2 -nostdlib -march=rv64imafdv -o test test.S -T linker.ld ``` And run with: ``` qemu-system-riscv64 -M virt -cpu tt-ascalon -nographic -display none -bios test ``` The PC settles on 0x80000028, ie we don't take the exception.
issue