[llvm] r211946 - [NVPTX] Add 'b' asm constraint
Justin Holewinski
jholewinski at nvidia.com
Fri Jun 27 11:36:07 PDT 2014
Author: jholewinski
Date: Fri Jun 27 13:36:06 2014
New Revision: 211946
URL: http://llvm.org/viewvc/llvm-project?rev=211946&view=rev
Log:
[NVPTX] Add 'b' asm constraint
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
llvm/trunk/test/CodeGen/NVPTX/inline-asm.ll
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=211946&r1=211945&r2=211946&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp Fri Jun 27 13:36:06 2014
@@ -2605,6 +2605,7 @@ NVPTXTargetLowering::getConstraintType(c
switch (Constraint[0]) {
default:
break;
+ case 'b':
case 'r':
case 'h':
case 'c':
@@ -2624,6 +2625,8 @@ NVPTXTargetLowering::getRegForInlineAsmC
MVT VT) const {
if (Constraint.size() == 1) {
switch (Constraint[0]) {
+ case 'b':
+ return std::make_pair(0U, &NVPTX::Int1RegsRegClass);
case 'c':
return std::make_pair(0U, &NVPTX::Int16RegsRegClass);
case 'h':
Modified: llvm/trunk/test/CodeGen/NVPTX/inline-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/inline-asm.ll?rev=211946&r1=211945&r2=211946&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/inline-asm.ll (original)
+++ llvm/trunk/test/CodeGen/NVPTX/inline-asm.ll Fri Jun 27 13:36:06 2014
@@ -7,3 +7,10 @@ entry:
%0 = call float asm "ex2.approx.ftz.f32 $0, $1;", "=f,f"(float %x)
ret float %0
}
+
+define i32 @foo(i1 signext %cond, i32 %a, i32 %b) #0 {
+entry:
+; CHECK: selp.b32 %r{{[0-9]+}}, %r{{[0-9]+}}, %r{{[0-9]+}}, %p{{[0-9]+}}
+ %0 = tail call i32 asm "selp.b32 $0, $1, $2, $3;", "=r,r,r,b"(i32 %a, i32 %b, i1 %cond)
+ ret i32 %0
+}
More information about the llvm-commits
mailing list