Does Mojo have inline assembly?

Does Mojo currently have a blessed way to do inline assembly? LLVM doesn't have intrinsics for ARM MSR reads, and the two best clocks on an ARM system from a microbenchmark perspective are cntvct_el0 and pmccntr_el0, both of which are MSRs. In C I would normally read them as follows:
uint64_t tsc;

__asm__ volatile("isb" ::: "memory");
__asm__ volatile("mrs %0, cntvct_el0" : "=r" (tsc));
uint64_t tsc;

__asm__ volatile("isb" ::: "memory");
__asm__ volatile("mrs %0, cntvct_el0" : "=r" (tsc));
uint64_t tsc;
__asm__ volatile("isb" ::: "memory");
__asm__ volatile("mrs %0, pmccntr_el0" : "=r"(tsc));
uint64_t tsc;
__asm__ volatile("isb" ::: "memory");
__asm__ volatile("mrs %0, pmccntr_el0" : "=r"(tsc));
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server