Document floating point directive and generic way to to load a floating point im...
source link: https://github.com/riscv-non-isa/riscv-asm-manual/pull/86
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Document floating point directive and generic way to to load a floating point immediate to floating point register #86
Merged
Conversation
Collaborator
Split from #85, this PR only contain non-zfa part.
Contain two things:
.float
and.double
- Generic way to to load a floating point immediate to floating point register via load from memeory.
Collaborator
Author
Collaborator
Author
Changes:
|
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." |
Collaborator
Author
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 :) |
Contributor
With #89 in place this is looking pretty good to me, but given you only document |
Outdated
point immediate value. Instead, a programmer can use the `.float`/`.double` |
||
directive to declare a floating point immediate value in the source code, and |
||
then load it into a floating point register using the load global |
||
pseudoinstruction (`fl{h|s|d|q}`). |
Same comment as @asb : you only mention the .float
and .double
directives; what should I use in the FP16 and FP128 cases? Note that .quad
is already used by GAS. Maybe .float{16,32,64,128}
would be a more scalable approach?
Collaborator
Author
Oh, the reason I document .float
and .double
here is because .float16
is not supported by clang, and .float128
are not supported for both clang and binutils...
.quad
is supported by both, I think I should add that to doc.
Collaborator
Author
My thought is we should add .float{16,32,64,128}
and .bfloat16
in future, but anyway it out of scope of this PR, let me finish fli stuff first.
Collaborator
Author
Changes:
|
Collaborator
Author
@aswaterman thanks bro :) |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK