322
322
out->t5 = mcontext.__gregs[30];
323
323
out->t6 = mcontext.__gregs[31];
325
# if __riscv_flen == 32
326
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++)
327
out->float_save.regs[i] = mcontext.__fpregs.__f.__f[i];
328
out->float_save.fpcsr = mcontext.__fpregs.__f.__fcsr;
329
# elif __riscv_flen == 64
330
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++)
331
out->float_save.regs[i] = mcontext.__fpregs.__d.__f[i];
332
out->float_save.fpcsr = mcontext.__fpregs.__d.__fcsr;
333
# elif __riscv_flen == 128
334
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) {
335
out->float_save.regs[i].high = mcontext.__fpregs.__q.__f[2*i];
336
out->float_save.regs[i].low = mcontext.__fpregs.__q.__f[2*i+1];
338
out->float_save.fpcsr = mcontext.__fpregs.__q.__fcsr;
340
# error "Unexpected __riscv_flen"
325
// Breakpad only supports RISCV32 with 32 bit floating point.
326
// Breakpad only supports RISCV64 with 64 bit floating point.
327
#if __riscv_xlen == 32
328
for (int i = 0; i < MD_CONTEXT_RISCV_FPR_COUNT; i++)
329
out->fpregs[i] = mcontext.__fpregs.__f.__f[i];
330
out->fcsr = mcontext.__fpregs.__f.__fcsr;
331
#elif __riscv_xlen == 64
332
for (int i = 0; i < MD_CONTEXT_RISCV_FPR_COUNT; i++)
333
out->fpregs[i] = mcontext.__fpregs.__d.__f[i];
334
out->fcsr = mcontext.__fpregs.__d.__fcsr;
336
#error "Unexpected __riscv_xlen"
343
339
#endif // __riscv