[LLVMbugs] [Bug 7195] New: [RFE] Support 16-bit x86 code generation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 21 20:43:45 PDT 2010


           Summary: [RFE] Support 16-bit x86 code generation
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: cdavis at mymail.mines.edu
                CC: llvmbugs at cs.uiuc.edu

While trying to compile Wine with clang, the configure script produced this:

checking whether 16-bit code can be built correctly... no
configure: error: Xcode 3.x cannot build 16-bit code correctly. Use
--disable-win16 if you don't need 16-bit support

But the linker was fixed in Xcode 3.2, and it works with GCC, so I did a little
investigation and found that the test program they use does not compile with
clang -integrated-as:

$ cat test.c
    ".globl _testfunc\n"
    "_testfunc:\tcallw good");

extern void testfunc();

int main(void)
    unsigned short *p = (unsigned short*)testfunc;
    return p[0] != 0xe866 || p[0] != 0xfffa;

$ clang test.c
<inline asm>:5:12: error: unrecognized instruction
_testfunc:      callw good
1 error generated.

Since -integrated-as is the default on Mac OS X now, I either have to pass
--disable-win16 to Wine configure or set CFLAGS="-no-integrated-as".

Now I understand that 16-bit code makes you guys shudder, but it would be
really nice if I could just drop in clang and build Wine without setting any
additional settings. Besides, imagine the other possible applications. The Wine
people, for example, have expressed general interest in a 16-bit compiler.

I'll even work on this (since I know no one else wants to). I'm just filing
this to keep track of what the rest of you probably consider a non-issue.

I know in the past that I suggested making a separate x86-16 backend (which
really made Chris recoil in horror, like I predicted he would), but that's not
what I'm suggesting here. I just want to extend the existing x86 backend to
support 16-bit codegen.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list