зеркало из https://github.com/microsoft/clang-1.git
Add some missing X86-specific asm constraint letters, and fix
some bugs in setting allowsRegister on the ones there. 8348447. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
23637beead
Коммит
545be51fdf
|
@ -1202,6 +1202,15 @@ X86TargetInfo::validateAsmConstraint(const char *&Name,
|
|||
TargetInfo::ConstraintInfo &Info) const {
|
||||
switch (*Name) {
|
||||
default: return false;
|
||||
case 'Y': // first letter of a pair:
|
||||
switch (*(Name+1)) {
|
||||
default: return false;
|
||||
case '0': // First SSE register.
|
||||
case 't': // Any SSE register, when SSE2 is enabled.
|
||||
case 'i': // Any SSE register, when SSE2 and inter-unit moves enabled.
|
||||
case 'm': // any MMX register, when inter-unit moves enabled.
|
||||
break; // falls through to setAllowsRegister.
|
||||
}
|
||||
case 'a': // eax.
|
||||
case 'b': // ebx.
|
||||
case 'c': // ecx.
|
||||
|
@ -1209,22 +1218,27 @@ X86TargetInfo::validateAsmConstraint(const char *&Name,
|
|||
case 'S': // esi.
|
||||
case 'D': // edi.
|
||||
case 'A': // edx:eax.
|
||||
case 'f': // any x87 floating point stack register.
|
||||
case 't': // top of floating point stack.
|
||||
case 'u': // second from top of floating point stack.
|
||||
case 'q': // Any register accessible as [r]l: a, b, c, and d.
|
||||
case 'y': // Any MMX register.
|
||||
case 'x': // Any SSE register.
|
||||
case 'Q': // Any register accessible as [r]h: a, b, c, and d.
|
||||
case 'R': // "Legacy" registers: ax, bx, cx, dx, di, si, sp, bp.
|
||||
case 'l': // "Index" registers: any general register that can be used as an
|
||||
// index in a base+index memory access.
|
||||
Info.setAllowsRegister();
|
||||
return true;
|
||||
case 'C': // SSE floating point constant.
|
||||
case 'G': // x87 floating point constant.
|
||||
case 'e': // 32-bit signed integer constant for use with zero-extending
|
||||
// x86_64 instructions.
|
||||
case 'Z': // 32-bit unsigned integer constant for use with zero-extending
|
||||
// x86_64 instructions.
|
||||
case 'N': // unsigned 8-bit integer constant for use with in and out
|
||||
// instructions.
|
||||
case 'R': // "legacy" registers: ax, bx, cx, dx, di, si, sp, bp.
|
||||
Info.setAllowsRegister();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string
|
||||
|
|
|
@ -168,3 +168,25 @@ float t21(long double x) {
|
|||
// CHECK: call x86_fp80 asm sideeffect "frndint"
|
||||
// CHECK-NEXT: fptrunc x86_fp80 {{.*}} to float
|
||||
}
|
||||
|
||||
// <rdar://problem/8348447> - accept 'l' constraint
|
||||
unsigned char t22(unsigned char a, unsigned char b) {
|
||||
unsigned int la = a;
|
||||
unsigned int lb = b;
|
||||
unsigned int bigres;
|
||||
unsigned char res;
|
||||
__asm__ ("0:\n1:\n" : [bigres] "=la"(bigres) : [la] "0"(la), [lb] "c"(lb) :
|
||||
"edx", "cc");
|
||||
res = bigres;
|
||||
return res;
|
||||
}
|
||||
|
||||
// <rdar://problem/8348447> - accept 'l' constraint
|
||||
unsigned char t23(unsigned char a, unsigned char b) {
|
||||
unsigned int la = a;
|
||||
unsigned int lb = b;
|
||||
unsigned char res;
|
||||
__asm__ ("0:\n1:\n" : [res] "=la"(res) : [la] "0"(la), [lb] "c"(lb) :
|
||||
"edx", "cc");
|
||||
return res;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче