Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/asm-manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,10 @@ as seen by `objdump`:
1c: R_RISCV_PCREL_LO12_S .L0
----

On RV32, `ld <rd>, <symbol>` and `sd <rd>, <symbol>, <rt>` can be used to
Copy link

@MaskRay MaskRay Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is <symbol>+<offset> allowed?

(Allowed in gas and llvm but the llvm AsmParser is a bit of a hack.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM looks like it is passing the offset through to the relocation correctly, so I'm happy to allow this. I can clarify the wording to ensure it is, because there are other places that allow <symbol>{+<offset>} when they only say <symbol> right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this to be <symbol expression> which can be symbol, offset, or symbol with offset.

generate a sequence including the `ld` and `sd` instructions in Zilsd -- in
these cases, `<rd>` denotes the even GPR in an even-odd GPR pair.

== Constants

The following example shows loading a constant using the `%hi` and
Expand Down
Loading