On Tue, Jul 30, 2024 at 4:29 PM Jeff Law <jeffreya...@gmail.com> wrote: >... > You define: > +#define RISCV_STACK_CLASH_VECTOR_CFA_REGNUM (GP_TEMP_FIRST + 4) > > Where: > #define GP_REG_FIRST 0 > #define GP_TEMP_FIRST (GP_REG_FIRST + 5) > > So RISCV_STACK_CLASH_VECTOR_CFA_REGNUM defined as "9" which I think is > "s1". That can't be what we want :-)
Sorry I misunderstood your initial question. Yes I am using s1 as a copy of the stack pointer and the new CFA. It's only being used in a "mov s1,sp". > What I don't understand is why we don't use RISCV_PROLOGUE_TEMP_REGNUM > or RISCV_PROLOGUE_TEMP2_REGNUM which are defined as t0 and t1 respectively. We already need both in the vector probe loop so unfortunately we can't set them as the new CFA. I'm using t0 as the probe size and t1 as the length/control of the loop. > We'd have to audit the prologue/epilogue code to ensure we can safely > use one of those two as a scratch in the context we care about. > > jeff -- Raphael Moreira Zinsly