Author: kparzysz Date: Fri Jul 21 11:07:15 2017 New Revision: 308763 URL: http://llvm.org/viewvc/llvm-project?rev=308763&view=rev Log: [Hexagon] Add inline-asm constraint 'a' for modifier register class
For example asm ("memw(%0++%1) = %2" : : "r"(addr),"a"(mod),"r"(val) : "memory") Modified: cfe/trunk/lib/Basic/Targets.cpp cfe/trunk/test/CodeGen/hexagon-inline-asm.c Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=308763&r1=308762&r2=308763&view=diff ============================================================================== --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Fri Jul 21 11:07:15 2017 @@ -6887,6 +6887,9 @@ public: return true; } break; + case 'a': // Modifier register m0-m1. + Info.setAllowsRegister(); + return true; case 's': // Relocatable constant. return true; Modified: cfe/trunk/test/CodeGen/hexagon-inline-asm.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/hexagon-inline-asm.c?rev=308763&r1=308762&r2=308763&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/hexagon-inline-asm.c (original) +++ cfe/trunk/test/CodeGen/hexagon-inline-asm.c Fri Jul 21 11:07:15 2017 @@ -15,3 +15,9 @@ void foo(v64 v0, v64 v1, v64 *p) { asm ("%0 = memw(##%1)" : "=r"(r) : "s"(&g)); // CHECK: call i32 asm "$0 = memw(##$1)", "=r,s"(i32* @g) } + +void fred(unsigned *p, unsigned m, unsigned v) { + asm ("memw(%0++%1) = %2" : : "r"(p),"a"(m),"r"(v) : "memory"); +// CHECK: call void asm sideeffect "memw($0++$1) = $2", "r,a,r,~{memory}"(i32* %0, i32 %1, i32 %2) +} + _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits