[PATCH] D35013: [inline asm] repeating constraint matches the same output

2017-07-26 Thread Ziv Izhar via Phabricator via cfe-commits
zizhar abandoned this revision.
zizhar added a comment.

I agree,
My bad, apparently gcc doesn't support that, I see no reason to add that.
Closing the review.


Repository:
  rL LLVM

https://reviews.llvm.org/D35013



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31383: [inline asm] "=i" output constraint support - gcc compatiblity

2017-05-03 Thread Ziv Izhar via Phabricator via cfe-commits
zizhar added inline comments.



Comment at: lib/Basic/TargetInfo.cpp:506
 case '!': // Disparage severely.
 case '*': // Ignore for choosing register preferences.
+case 'i': // Ignore i as output constraint (match from the other chars)

ahatanak wrote:
> If we are going to ignore 'i', should we ignore other constraints for 
> immediate operands too (for example, 'n', 'E", and 'F')?
I agree, we should.
I will add these cases aswell :)


https://reviews.llvm.org/D31383



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31383: [inline asm] "=i" output constraint support - gcc compatiblity

2017-05-03 Thread Ziv Izhar via Phabricator via cfe-commits
zizhar updated this revision to Diff 97602.

https://reviews.llvm.org/D31383

Files:
  lib/Basic/TargetInfo.cpp
  test/Sema/asm.c


Index: test/Sema/asm.c
===
--- test/Sema/asm.c
+++ test/Sema/asm.c
@@ -160,6 +160,41 @@
   return ret;
 }
 
+void iOutputConstraint(int x){
+  __asm ("nop" : "=ir" (x) : :); // no-error
+  __asm ("nop" : "=ri" (x) : :); // no-error
+  __asm ("nop" : "=ig" (x) : :); // no-error
+  __asm ("nop" : "=im" (x) : :); // no-error
+  __asm ("nop" : "=imr" (x) : :); // no-error
+  __asm ("nop" : "=i" (x) : :); // expected-error{{invalid output constraint 
'=i' in asm}}
+  __asm ("nop" : "+i" (x) : :); // expected-error{{invalid output constraint 
'+i' in asm}}
+  __asm ("nop" : "=ii" (x) : :); // expected-error{{invalid output constraint 
'=ii' in asm}}
+  __asm ("nop" : "=nr" (x) : :); // no-error
+  __asm ("nop" : "=rn" (x) : :); // no-error
+  __asm ("nop" : "=ng" (x) : :); // no-error
+  __asm ("nop" : "=nm" (x) : :); // no-error
+  __asm ("nop" : "=nmr" (x) : :); // no-error
+  __asm ("nop" : "=n" (x) : :); // expected-error{{invalid output constraint 
'=n' in asm}}
+  __asm ("nop" : "+n" (x) : :); // expected-error{{invalid output constraint 
'+n' in asm}}
+  __asm ("nop" : "=nn" (x) : :); // expected-error{{invalid output constraint 
'=nn' in asm}}
+  __asm ("nop" : "=Fr" (x) : :); // no-error
+  __asm ("nop" : "=rF" (x) : :); // no-error
+  __asm ("nop" : "=Fg" (x) : :); // no-error
+  __asm ("nop" : "=Fm" (x) : :); // no-error
+  __asm ("nop" : "=Fmr" (x) : :); // no-error
+  __asm ("nop" : "=F" (x) : :); // expected-error{{invalid output constraint 
'=F' in asm}}
+  __asm ("nop" : "+F" (x) : :); // expected-error{{invalid output constraint 
'+F' in asm}}
+  __asm ("nop" : "=FF" (x) : :); // expected-error{{invalid output constraint 
'=FF' in asm}}
+  __asm ("nop" : "=Er" (x) : :); // no-error
+  __asm ("nop" : "=rE" (x) : :); // no-error
+  __asm ("nop" : "=Eg" (x) : :); // no-error
+  __asm ("nop" : "=Em" (x) : :); // no-error
+  __asm ("nop" : "=Emr" (x) : :); // no-error
+  __asm ("nop" : "=E" (x) : :); // expected-error{{invalid output constraint 
'=E' in asm}}
+  __asm ("nop" : "+E" (x) : :); // expected-error{{invalid output constraint 
'+E' in asm}}
+  __asm ("nop" : "=EE" (x) : :); // expected-error{{invalid output constraint 
'=EE' in asm}}
+}
+
 // PR19837
 struct foo {
   int a;
Index: lib/Basic/TargetInfo.cpp
===
--- lib/Basic/TargetInfo.cpp
+++ lib/Basic/TargetInfo.cpp
@@ -505,6 +505,11 @@
 case '?': // Disparage slightly code.
 case '!': // Disparage severely.
 case '*': // Ignore for choosing register preferences.
+case 'i': // Ignore i,n,E,F as output constraints (match from the other
+  // chars)
+case 'n':
+case 'E':
+case 'F':
   break;  // Pass them.
 }
 


Index: test/Sema/asm.c
===
--- test/Sema/asm.c
+++ test/Sema/asm.c
@@ -160,6 +160,41 @@
   return ret;
 }
 
+void iOutputConstraint(int x){
+  __asm ("nop" : "=ir" (x) : :); // no-error
+  __asm ("nop" : "=ri" (x) : :); // no-error
+  __asm ("nop" : "=ig" (x) : :); // no-error
+  __asm ("nop" : "=im" (x) : :); // no-error
+  __asm ("nop" : "=imr" (x) : :); // no-error
+  __asm ("nop" : "=i" (x) : :); // expected-error{{invalid output constraint '=i' in asm}}
+  __asm ("nop" : "+i" (x) : :); // expected-error{{invalid output constraint '+i' in asm}}
+  __asm ("nop" : "=ii" (x) : :); // expected-error{{invalid output constraint '=ii' in asm}}
+  __asm ("nop" : "=nr" (x) : :); // no-error
+  __asm ("nop" : "=rn" (x) : :); // no-error
+  __asm ("nop" : "=ng" (x) : :); // no-error
+  __asm ("nop" : "=nm" (x) : :); // no-error
+  __asm ("nop" : "=nmr" (x) : :); // no-error
+  __asm ("nop" : "=n" (x) : :); // expected-error{{invalid output constraint '=n' in asm}}
+  __asm ("nop" : "+n" (x) : :); // expected-error{{invalid output constraint '+n' in asm}}
+  __asm ("nop" : "=nn" (x) : :); // expected-error{{invalid output constraint '=nn' in asm}}
+  __asm ("nop" : "=Fr" (x) : :); // no-error
+  __asm ("nop" : "=rF" (x) : :); // no-error
+  __asm ("nop" : "=Fg" (x) : :); // no-error
+  __asm ("nop" : "=Fm" (x) : :); // no-error
+  __asm ("nop" : "=Fmr" (x) : :); // no-error
+  __asm ("nop" : "=F" (x) : :); // expected-error{{invalid output constraint '=F' in asm}}
+  __asm ("nop" : "+F" (x) : :); // expected-error{{invalid output constraint '+F' in asm}}
+  __asm ("nop" : "=FF" (x) : :); // expected-error{{invalid output constraint '=FF' in asm}}
+  __asm ("nop" : "=Er" (x) : :); // no-error
+  __asm ("nop" : "=rE" (x) : :); // no-error
+  __asm ("nop" : "=Eg" (x) : :); // no-error
+  __asm ("nop" : "=Em" (x) : :); // no-error
+  __asm ("nop" : "=Emr" (x) : :); // no-error
+  __asm ("nop" : "=E" (x) : :); // expected-error{{invalid output constraint '=E' in asm}}
+  __asm ("no

[PATCH] D31383: [inline asm] "=i" output constraint support - gcc compatiblity

2017-05-10 Thread Ziv Izhar via Phabricator via cfe-commits
zizhar added a comment.

Ping


https://reviews.llvm.org/D31383



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits