-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add attributes to inline ASM blocks #50
Comments
|
So this hasn't been pushed to Dscanner yet right? |
|
I don't really want to copy/paste entire ASM blocks just for this. I have the change pushed to a branch. I'll merge that branch as soon as LDC and GDC support 2.067. |
|
For LDC/GDC this could take a while. No need to copy/paste anything, how about this (I tried, it works): // TODO:remove this when LDC/GDC supports 2.067
static if(__VERSION__<2067) enum asm_att=``;
else enum asm_att=`pure nothrow @nogc`;
ushort newlineMask(const ubyte*) pure nothrow @trusted @nogc
{
mixin(`asm `~asm_att~`
{
naked;
movdqu XMM1, [RDI];
mov RAX, 3;
mov RDX, 16;
mov R8, 0x0d0d0d0d0d0d0d0dL;
movq XMM2, R8;
shufpd XMM2, XMM2, 0;
pcmpeqb XMM2, XMM1;
mov R9, 0x0a0a0a0a0a0a0a0aL;
movq XMM3, R9;
shufpd XMM3, XMM3, 0;
pcmpeqb XMM3, XMM1;
mov R10, 0xe280a8L;
movq XMM4, R10;
pcmpestrm XMM4, XMM1, 0b01001100;
movdqa XMM4, XMM0;
mov R11, 0xe280a9L;
movq XMM5, R11;
pcmpestrm XMM5, XMM1, 0b01001100;
movdqa XMM5, XMM0;
mov RCX, 0x0a0d;
dec RAX;
movq XMM6, RCX;
pcmpestrm XMM6, XMM1, 0b01001100;
movdqa XMM6, XMM0;
movdqa XMM7, XMM6;
pslldq XMM7, 1;
movdqa XMM0, XMM4;
por XMM0, XMM5;
por XMM7, XMM6;
movdqa XMM1, XMM2;
por XMM1, XMM3;
pxor XMM7, XMM1;
por XMM7, XMM0;
por XMM7, XMM6;
pmovmskb RAX, XMM7;
and RAX, 0b0011_1111_1111_1111;
ret;
}
`);
} |
DMD 2.067 deprecates the assumption that inline ASM blocks are pure, @nogc, etc. There are 3 blocks that spew several deprecation messages each. Unfortunately, I'm not sure enough with my assembly to manually verify them
The blocks are at lines 2296, 2324, 2240 in lexer.d as of 617b7c6 .
The text was updated successfully, but these errors were encountered: