add floating point extension (FPE) code needed for bhyve and vmm_switch()
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/riscv/riscv/fpe.c | ||
|---|---|---|
| 106 | This doesn't capture the memory side-effects. You either need a : "memory" in there (a big hammer, though probably doesn't make much difference here) or an extra dummy operand "=m"(*(uint64_t (*)[32][2])fp_x). | |
| sys/riscv/riscv/fpe.c | ||
|---|---|---|
| 106 | Though if doing the latter, probably nicer to do: uint64_t fcsr, (*fp_x)[32][2]; fp_x = ®s->fp_x; and then you don't need to cast in the inline assembly, just "=m"(*fp_x). (Yes, the syntax for a pointer to an array is real, if extremely rarely used, and yes it should remind you of function pointers...) | |
Comment Actions
- Add dummy operand "m" to tell compiler which memory we read/write via pointers.
- Ensure all operands are output in fpe_store() and input in fpe_restore().
Comment Actions
- Ensure all operands are output in fpe_store() and input in fpe_restore().
This was wrong; the r constraint for fp_x is meant to be an input in fpe_store too, as the address is an input, not an output. D53441.