Skip to content

LLVM 3.0rc2: popcnt instruction fails on OSX (invalid suffix) #11663

@llvmbot

Description

@llvmbot
Bugzilla Link 11291
Resolution WONTFIX
Resolved on Nov 03, 2011 01:56
Version 2.9
OS MacOS X
Attachments testcase
Reporter LLVM Bugzilla Contributor
CC @lattner

Extended Description

I've attached a small test case that produces assembly code that the assemblers on OSX can't handle. OSX doesn't handle the length suffixes on the popcnt instruction (e.g. {w,l,q}).

Here is a related GCC bug for this issue:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34497#c14

I believe they fixed it by not adding the suffix on OSX, which works fine. Indeed changing instruction definition in lib/Target/X86/X86InstrSSE.td to drop the suffix, works fine.

The integrated assembler of llc works fine but GHC which uses LLVM can't use the integrated assembler at this stage as we do some assembly post processing.

== To Reproduce ==

  1. llc testcase.ll -o testcase.s
  2. gcc -m32 -c testcase.s -o b.o
    (or as -arch i386 testcase.s)

== Expected Output ==

Shiny object file

== Actual Output ==

testcase.s:7:suffix or operands invalid for `popcnt'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillawontfixIssue is real, but we can't or won't fix it. Not invalid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions