[PATCH] D37448: Fix cast assertion on MS inline assembly with vector spills (PR34021)

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 13:41:16 PDT 2017


efriedma added a comment.

> According to our definition, v4si is NOT a "Vector" type, since a vector type requires it be a FP value.

Umm, what?  An integer vector is still a vector.  The backend will return it in xmm0 on x86 (both 32 and 64-bit).

The actual problem here is that X86_32TargetCodeGenInfo::addReturnRegisterOutputs is adding outputs which don't make any sense; 32-bit x86 only returns integers and pointers (and maybe a few other weird things like complex integers and tiny vectors?) in EAX:EDX.   So we shouldn't add a constraint which involves those registers if the function returns a 128-bit vector (which goes in xmm0), or a struct (which is returned in memory), or a float (which is returned in an x87 register), etc.

Adding the "right" constraint for stuff that isn't returned in EAX would be nice, but probably isn't necessary unless we actually run into code which depends on it.


Repository:
  rL LLVM

https://reviews.llvm.org/D37448





More information about the cfe-commits mailing list