Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Flux
@WillFlux@mastodon.social  ·  activity timestamp last week

If you're writing assembler, I heartily recommend Compiler Explorer. I wrote about this from a RISC-V perspective a while back. #asm #riscv

https://projectf.io/posts/riscv-compiler-explorer/

Screenshot of Compiler Explorer showing C source for endian swap function being compiled into RISC-V asm with Clang 18.1.
Screenshot of Compiler Explorer showing C source for endian swap function being compiled into RISC-V asm with Clang 18.1.
Screenshot of Compiler Explorer showing C source for endian swap function being compiled into RISC-V asm with Clang 18.1.
  • Copy link
  • Flag this post
  • Block
Flux
@WillFlux@mastodon.social replied  ·  activity timestamp last week

Compiler Explorer is a great way to understand the effect of #riscv extensions or compare CPU arch. You can even compare rv32 and armv7 to a 486. 🤔

For example, an endian swap takes 11 instructions with the base RISC-V ISA, but only 1 instruction (rev8) with the Zbb extension.

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login