riscv / riscv-isa-manual

RISC-V Instruction Set Manual
https://riscv.org/
Creative Commons Attribution 4.0 International
3.54k stars 612 forks source link

RV32 AMOCAS.D emulated as LR/SC pair #1502

Open moscickimilosz opened 1 month ago

moscickimilosz commented 1 month ago

Hi!

The unprivileged specification version 20240411 states that:

Any AMO can be emulated by an LR/SC pair

Is this with exception of AMOCAS.D for RV32? Since:

An SC can only pair with the most recent LR in program order.

ved-rivos commented 1 month ago

That is correct. For RV32, AMOCAS.D cannot be emulated using LR/SC and AMOCAS.Q cannot be emulated using LR/SC. AMO that operate on data wider than XLEN cannot be emulated using an LR/SC pair.

moscickimilosz commented 1 month ago

Thanks for clarifying, would it make sense to note this in the spec?