llvm.org GIT mirror llvm / 5f3663e
Fix handling of x86 'R' constraint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83499 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 10 years ago
2 changed file(s) with 26 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
93969396 switch (Constraint[0]) {
93979397 default: break;
93989398 case 'r': // GENERAL_REGS
9399 case 'R': // LEGACY_REGS
94009399 case 'l': // INDEX_REGS
94019400 if (VT == MVT::i8)
94029401 return std::make_pair(0U, X86::GR8RegisterClass);
94059404 if (VT == MVT::i32 || !Subtarget->is64Bit())
94069405 return std::make_pair(0U, X86::GR32RegisterClass);
94079406 return std::make_pair(0U, X86::GR64RegisterClass);
9407 case 'R': // LEGACY_REGS
9408 if (VT == MVT::i8)
9409 return std::make_pair(0U, X86::GR8_NOREXRegisterClass);
9410 if (VT == MVT::i16)
9411 return std::make_pair(0U, X86::GR16_NOREXRegisterClass);
9412 if (VT == MVT::i32 || !Subtarget->is64Bit())
9413 return std::make_pair(0U, X86::GR32_NOREXRegisterClass);
9414 return std::make_pair(0U, X86::GR64_NOREXRegisterClass);
94089415 case 'f': // FP Stack registers.
94099416 // If SSE is enabled for this VT, use f80 to ensure the isel moves the
94109417 // value to the correct fpstack register class.
0 ; RUN: llc -march=x86-64 < %s | FileCheck %s
1 ; 7282062
2 ; ModuleID = ''
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
4 target triple = "x86_64-apple-darwin10.0"
5
6 define void @udiv8(i8* %quotient, i16 zeroext %a, i8 zeroext %b, i8 zeroext %c, i8* %remainder) nounwind ssp {
7 entry:
8 ; CHECK: udiv8:
9 ; CHECK-NOT: movb %ah, (%r8)
10 %a_addr = alloca i16, align 2 ; [#uses=2]
11 %b_addr = alloca i8, align 1 ; [#uses=2]
12 store i16 %a, i16* %a_addr
13 store i8 %b, i8* %b_addr
14 call void asm "\09\09movw\09$2, %ax\09\09\0A\09\09divb\09$3\09\09\09\0A\09\09movb\09%al, $0\09\0A\09\09movb %ah, ($4)", "=*m,=*m,*m,*m,R,~{dirflag},~{fpsr},~{flags},~{ax}"(i8* %quotient, i8* %remainder, i16* %a_addr, i8* %b_addr, i8* %remainder) nounwind
15 ret void
16 ; CHECK: ret
17 }