Skip to content
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

LLVM 6: Win32 inline assembly regression #2629

Closed
kinke opened this issue Mar 26, 2018 · 4 comments
Closed

LLVM 6: Win32 inline assembly regression #2629

kinke opened this issue Mar 26, 2018 · 4 comments

Comments

@kinke
Copy link
Member

kinke commented Mar 26, 2018

core.cpuid fails to build on Win32 with LLVM 6.0.0 and enabled optimizations, with symptoms of issue #2257.

I tried replacing that DMD-style inline asm with LLVM asm:

            import ldc.llvmasm;
            __asm(`mov %eax, 2
                   cpuid
                   mov $0, %eax
                   mov $1, %ebx
                   mov $2, %ecx
                   mov $3, %edx`, "=*m,=*m,=*m,=*m,~{eax},~{ebx},~{ecx},~{edx}",
                   &a[0], &a[1], &a[2], &a[3]);

That makes it work with enabled optimizations, but debug druntime fails to compile with inline assembly requires more registers than available. That error vanishes when dropping all clobbers...

What's strange is that it can apparently still be compiled fine for 32-bit Linux and OSX, the CircleCI multilib jobs with preliminary LLVM 6.0 are green.

@ZILtoid1991
Copy link

I'm getting errors like this one:

 <inline asm>:6:2: error: assembler label 'L7CPUblit9composing11blitter8bit_eightpixel' can not be   undefined
         jl L7CPUblit9composing11blitter8bit_eightpixel

This is the same on both Win32 and Win64, have not tried to build for Linux or OSX.

The project in question: https://github.com/ZILtoid1991/CPUblit

@kinke
Copy link
Member Author

kinke commented Apr 23, 2018

@ZILtoid1991: That's a separate issue as that 5k lines asm monster errors out with the same errors for LDC 1.8 and LLVM 5.0.1. Please try to come up with a nice small testcase and file a new issue.

@dnadlinger
Copy link
Member

@ZILtoid1991: See #2667 for that issue.

@kinke
Copy link
Member Author

kinke commented Jul 11, 2018

Worked around in #2770.

@kinke kinke closed this as completed Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants