ARM first & default LDC
Iain Buclaw
ibuclaw at gdcproject.org
Wed Dec 16 10:26:46 UTC 2020
On Wednesday, 16 December 2020 at 05:20:21 UTC, Max Haughton
wrote:
>
> Ultimately in this discussion of arm and RISC-V making the
> frontend asm {} blocks understand them would probably do more
> than changing compilers. It's a relatively simple thing to have
> but I don't think any other language can do it.
asm {} blocks are cross platform without needing special support.
uint result = void;
version (ARM)
{
asm nothrow @nogc
{
"vmrs %0, FPSCR;
and %0, %0, #0x1F;" : "=r" (result);
}
}
else version (RISCV32)
{
asm nothrow @nogc
{
"frflags %0" : "=r" (result);
}
}
return result;
More information about the Digitalmars-d
mailing list