mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Mips specific inline assembler constraint 'R'
'R' An address that can be sued in a non-macro load or store. This patch includes a positive test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176452 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3880,6 +3880,8 @@ getConstraintType(const std::string &Constraint) const
|
|||||||
case 'l':
|
case 'l':
|
||||||
case 'x':
|
case 'x':
|
||||||
return C_RegisterClass;
|
return C_RegisterClass;
|
||||||
|
case 'R':
|
||||||
|
return C_Memory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TargetLowering::getConstraintType(Constraint);
|
return TargetLowering::getConstraintType(Constraint);
|
||||||
@@ -3928,6 +3930,9 @@ MipsTargetLowering::getSingleConstraintMatchWeight(
|
|||||||
if (isa<ConstantInt>(CallOperandVal))
|
if (isa<ConstantInt>(CallOperandVal))
|
||||||
weight = CW_Constant;
|
weight = CW_Constant;
|
||||||
break;
|
break;
|
||||||
|
case 'R':
|
||||||
|
weight = CW_Memory;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return weight;
|
return weight;
|
||||||
}
|
}
|
||||||
|
@@ -51,5 +51,14 @@ entry:
|
|||||||
; CHECK: #NO_APP
|
; CHECK: #NO_APP
|
||||||
tail call i32 asm sideeffect "addi $0,$1,$2", "=r,r,P"(i32 7, i32 65535) nounwind
|
tail call i32 asm sideeffect "addi $0,$1,$2", "=r,r,P"(i32 7, i32 65535) nounwind
|
||||||
|
|
||||||
|
; Now R Which takes the address of c
|
||||||
|
%c = alloca i32, align 4
|
||||||
|
store i32 -4469539, i32* %c, align 4
|
||||||
|
%8 = call i32 asm sideeffect "lwl $0, 1 + $1\0A\09lwr $0, 2 + $1\0A\09", "=r,*R"(i32* %c) #1
|
||||||
|
; CHECK: #APP
|
||||||
|
; CHECK: lwl ${{[0-9]+}}, 1 + 0(${{[0-9]+}})
|
||||||
|
; CHECK: lwr ${{[0-9]+}}, 2 + 0(${{[0-9]+}})
|
||||||
|
; CHECK: #NO_APP
|
||||||
|
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user