riscv-non-isa / riscv-asm-manual

RISC-V Assembly Programmer's Manual
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
1.41k stars 235 forks source link

Document floating point directive and generic way to to load a floating point immediate to floating point register #86

Closed kito-cheng closed 1 year ago

kito-cheng commented 1 year ago

Split from #85, this PR only contain non-zfa part.

Contain two things:

  1. .float and .double
  2. Generic way to to load a floating point immediate to floating point register via load from memeory.
kito-cheng commented 1 year ago

ping @asb @cmuellner :)

kito-cheng commented 1 year ago

Changes:

asb commented 1 year ago

I think we risk veering into becoming a general assembly guide which might be more of a burden than we want to take on, but documenting .float and .double seems handy. I wonder a bit about "The Assembler supports the same floating point literal formats as those defined in the C and C++ standards" - fine for gas and LLVM as and any other assembler wanting to consume the same input, but not necessarily true of any arbitrary assembler. Perhaps this document needs a "Scope" section that says something like "This document aims to provide guidance to assembly programmers targeting common open source RISC-V assemblers such as GNU as and LLVM's assembler. Other assemblers might not support the same directives or pseudoinstructions."

kito-cheng commented 1 year ago

Thanks, although one of my ultimate goal is make this document become RISC-V standard Assembly manual, but archive that apparently need much more effort than I/we can pay, so limit the scope for this document is sound good idea, let me create PR in my next workday :)

kito-cheng commented 1 year ago

Add #89, @asb did you have any further concern about this PR?

asb commented 1 year ago

With #89 in place this is looking pretty good to me, but given you only document .float and .double perhaps it doesn't make sense to list flh and flq (or to instead give guidance on using .2byte/.8byte or similar with the bit pattern of the encoded FP value.

kito-cheng commented 1 year ago

Changes:

kito-cheng commented 1 year ago

@aswaterman thanks bro :)