[cfe-commits] r118108 - in /cfe/trunk/test/CodeGen: mult-alt-generic.c mult-alt-x86.c
John Thompson
John.Thompson.JTSoftware at gmail.com
Tue Nov 2 16:03:52 PDT 2010
Author: jtsoftware
Date: Tue Nov 2 18:03:52 2010
New Revision: 118108
URL: http://llvm.org/viewvc/llvm-project?rev=118108&view=rev
Log:
Tests for inline asm constraints, generic and x86.
Added:
cfe/trunk/test/CodeGen/mult-alt-generic.c
cfe/trunk/test/CodeGen/mult-alt-x86.c
Added: cfe/trunk/test/CodeGen/mult-alt-generic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mult-alt-generic.c?rev=118108&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/mult-alt-generic.c (added)
+++ cfe/trunk/test/CodeGen/mult-alt-generic.c Tue Nov 2 18:03:52 2010
@@ -0,0 +1,283 @@
+// RUN: %clang_cc1 -triple i686 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple arm %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple bfin %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple cellspu %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple mblaze %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple mips %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple mipsel %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple s390x %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple sparc %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple thumb %s -emit-llvm -o - | FileCheck %s
+
+int mout0;
+int min1;
+int marray[2];
+
+// CHECK: @single_m
+void single_m()
+{
+ // CHECK: call void asm "foo $1,$0", "=*m,*m[[CLOBBERS:[a-zA-Z0-9@%{},~_ ]*\"]](i32* {{[a-zA-Z0-9@%]+}}, i32* {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=m" (mout0) : "m" (min1));
+}
+
+// CHECK: @single_o
+void single_o()
+{
+ register int out0 = 0;
+ register int index = 1;
+ // Doesn't really do an offset...
+ //asm("foo %1, %2,%0" : "=r" (out0) : "o" (min1));
+}
+
+// CHECK: @single_V
+void single_V()
+{
+// asm("foo %1,%0" : "=m" (mout0) : "V" (min1));
+}
+
+// CHECK: @single_lt
+void single_lt()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r,<r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "<r" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,r<[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "r<" (in1));
+}
+
+// CHECK: @single_gt
+void single_gt()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r,>r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : ">r" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,r>[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "r>" (in1));
+}
+
+// CHECK: @single_r
+void single_r()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r,r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "r" (in1));
+}
+
+// CHECK: @single_i
+void single_i()
+{
+ register int out0 = 0;
+ // CHECK: call i32 asm "foo $1,$0", "=r,i[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r" (out0) : "i" (1));
+}
+
+// CHECK: @single_n
+void single_n()
+{
+ register int out0 = 0;
+ // CHECK: call i32 asm "foo $1,$0", "=r,n[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r" (out0) : "n" (1));
+}
+
+// CHECK: @single_E
+void single_E()
+{
+ register double out0 = 0.0;
+ // CHECK: call double asm "foo $1,$0", "=r,E[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r" (out0) : "E" (1.0e+01));
+}
+
+// CHECK: @single_F
+void single_F()
+{
+ register double out0 = 0.0;
+ // CHECK: call double asm "foo $1,$0", "=r,F[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r" (out0) : "F" (1.0));
+}
+
+// CHECK: @single_s
+void single_s()
+{
+ register int out0 = 0;
+ //asm("foo %1,%0" : "=r" (out0) : "s" (single_s));
+}
+
+// CHECK: @single_g
+void single_g()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "g" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "g" (min1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r" (out0) : "g" (1));
+}
+
+// CHECK: @single_X
+void single_X()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "X" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r" (out0) : "X" (min1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r" (out0) : "X" (1));
+ // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
+ asm("foo %1,%0" : "=r" (out0) : "X" (marray));
+ // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r" (out0) : "X" (1.0e+01));
+ // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r" (out0) : "X" (1.0));
+}
+
+// CHECK: @single_p
+void single_p()
+{
+ register int out0 = 0;
+ // Constraint converted differently on different platforms moved to platform-specific.
+ // : call i32 asm "foo $1,$0", "=r,im[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
+ asm("foo %1,%0" : "=r" (out0) : "p" (marray));
+}
+
+// CHECK: @multi_m
+void multi_m()
+{
+ // CHECK: call void asm "foo $1,$0", "=*m|r,m|r[[CLOBBERS]](i32* {{[a-zA-Z0-9@%]+}}, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=m,r" (mout0) : "m,r" (min1));
+}
+
+// CHECK: @multi_o
+void multi_o()
+{
+ register int out0 = 0;
+ register int index = 1;
+ // Doesn't really do an offset...
+ //asm("foo %1, %2,%0" : "=r,r" (out0) : "r,o" (min1));
+}
+
+// CHECK: @multi_V
+void multi_V()
+{
+// asm("foo %1,%0" : "=m,r" (mout0) : "r,V" (min1));
+}
+
+// CHECK: @multi_lt
+void multi_lt()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|<r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,<r" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|r<[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,r<" (in1));
+}
+
+// CHECK: @multi_gt
+void multi_gt()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|>r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,>r" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|r>[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,r>" (in1));
+}
+
+// CHECK: @multi_r
+void multi_r()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|m[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,m" (in1));
+}
+
+// CHECK: @multi_i
+void multi_i()
+{
+ register int out0 = 0;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|i[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r,r" (out0) : "r,i" (1));
+}
+
+// CHECK: @multi_n
+void multi_n()
+{
+ register int out0 = 0;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|n[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r,r" (out0) : "r,n" (1));
+}
+
+// CHECK: @multi_E
+void multi_E()
+{
+ register double out0 = 0.0;
+ // CHECK: call double asm "foo $1,$0", "=r|r,r|E[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,E" (1.0e+01));
+}
+
+// CHECK: @multi_F
+void multi_F()
+{
+ register double out0 = 0.0;
+ // CHECK: call double asm "foo $1,$0", "=r|r,r|F[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,F" (1.0));
+}
+
+// CHECK: @multi_s
+void multi_s()
+{
+ register int out0 = 0;
+ //asm("foo %1,%0" : "=r,r" (out0) : "r,s" (multi_s));
+}
+
+// CHECK: @multi_g
+void multi_g()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,g" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,g" (min1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r,r" (out0) : "r,g" (1));
+}
+
+// CHECK: @multi_X
+void multi_X()
+{
+ register int out0 = 0;
+ register int in1 = 1;
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,X" (in1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,X" (min1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 1)
+ asm("foo %1,%0" : "=r,r" (out0) : "r,X" (1));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
+ asm("foo %1,%0" : "=r,r" (out0) : "r,X" (marray));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,X" (1.0e+01));
+ // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](double {{[0-9.eE+-]+}})
+ asm("foo %1,%0" : "=r,r" (out0) : "r,X" (1.0));
+}
+
+// CHECK: @multi_p
+void multi_p()
+{
+ register int out0 = 0;
+ // Constraint converted differently on different platforms moved to platform-specific.
+ // : call i32 asm "foo $1,$0", "=r|r,r|im[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
+ asm("foo %1,%0" : "=r,r" (out0) : "r,p" (marray));
+}
Added: cfe/trunk/test/CodeGen/mult-alt-x86.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mult-alt-x86.c?rev=118108&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/mult-alt-x86.c (added)
+++ cfe/trunk/test/CodeGen/mult-alt-x86.c Tue Nov 2 18:03:52 2010
@@ -0,0 +1,374 @@
+// RUN: %clang_cc1 -triple i686 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -o - | FileCheck %s
+
+int mout0;
+int min1;
+int marray[2];
+double dout0;
+double din1;
+
+// CHECK: @single_R
+void single_R()
+{
+ // CHECK: asm "foo $1,$0", "=R,R[[CLOBBERS:[a-zA-Z0-9@%{},~_ ]*\"]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=R" (mout0) : "R" (min1));
+}
+
+// CHECK: @single_q
+void single_q()
+{
+ // CHECK: asm "foo $1,$0", "=q,q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=q" (mout0) : "q" (min1));
+}
+
+// CHECK: @single_Q
+void single_Q()
+{
+ // CHECK: asm "foo $1,$0", "=Q,Q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=Q" (mout0) : "Q" (min1));
+}
+
+// CHECK: @single_a
+void single_a()
+{
+ // CHECK: asm "foo $1,$0", "={ax},{ax}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=a" (mout0) : "a" (min1));
+}
+
+// CHECK: @single_b
+void single_b()
+{
+ // CHECK: asm "foo $1,$0", "={bx},{bx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=b" (mout0) : "b" (min1));
+}
+
+// CHECK: @single_c
+void single_c()
+{
+ // CHECK: asm "foo $1,$0", "={cx},{cx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=c" (mout0) : "c" (min1));
+}
+
+// CHECK: @single_d
+void single_d()
+{
+ // CHECK: asm "foo $1,$0", "={dx},{dx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=d" (mout0) : "d" (min1));
+}
+
+// CHECK: @single_S
+void single_S()
+{
+ // CHECK: asm "foo $1,$0", "={si},{si}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=S" (mout0) : "S" (min1));
+}
+
+// CHECK: @single_D
+void single_D()
+{
+ // CHECK: asm "foo $1,$0", "={di},{di}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=D" (mout0) : "D" (min1));
+}
+
+// CHECK: @single_A
+void single_A()
+{
+ // CHECK: asm "foo $1,$0", "=A,A[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=A" (mout0) : "A" (min1));
+}
+
+// CHECK: @single_f
+void single_f()
+{
+//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
+}
+
+// CHECK: @single_t
+void single_t()
+{
+//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
+}
+
+// CHECK: @single_u
+void single_u()
+{
+//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
+}
+
+// CHECK: @single_y
+void single_y()
+{
+ // CHECK: call double asm "foo $1,$0", "=y,y[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=y" (dout0) : "y" (din1));
+}
+
+// CHECK: @single_x
+void single_x()
+{
+ // CHECK: asm "foo $1,$0", "=x,x[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=x" (dout0) : "x" (din1));
+}
+
+// CHECK: @single_Y
+void single_Y0()
+{
+ // Y constraint currently broken.
+ //asm("foo %1,%0" : "=Y0" (mout0) : "Y0" (min1));
+ //asm("foo %1,%0" : "=Yz" (mout0) : "Yz" (min1));
+ //asm("foo %1,%0" : "=Yt" (mout0) : "Yt" (min1));
+ //asm("foo %1,%0" : "=Yi" (mout0) : "Yi" (min1));
+ //asm("foo %1,%0" : "=Ym" (mout0) : "Ym" (min1));
+}
+
+// CHECK: @single_I
+void single_I()
+{
+ // CHECK: asm "foo $1,$0", "=*m,I[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "I" (1));
+}
+
+// CHECK: @single_J
+void single_J()
+{
+ // CHECK: asm "foo $1,$0", "=*m,J[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "J" (1));
+}
+
+// CHECK: @single_K
+void single_K()
+{
+ // CHECK: asm "foo $1,$0", "=*m,K[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "K" (1));
+}
+
+// CHECK: @single_L
+void single_L()
+{
+ // CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "L" (1));
+}
+
+// CHECK: @single_M
+void single_M()
+{
+ // CHECK: asm "foo $1,$0", "=*m,M[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "M" (1));
+}
+
+// CHECK: @single_N
+void single_N()
+{
+ // CHECK: asm "foo $1,$0", "=*m,N[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "N" (1));
+}
+
+// CHECK: @single_G
+void single_G()
+{
+ // CHECK: asm "foo $1,$0", "=*m,G[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
+ asm("foo %1,%0" : "=m" (mout0) : "G" (1.0));
+}
+
+// CHECK: @single_C
+void single_C()
+{
+ // CHECK: asm "foo $1,$0", "=*m,C[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
+ asm("foo %1,%0" : "=m" (mout0) : "C" (1.0));
+}
+
+// CHECK: @single_e
+void single_e()
+{
+ // CHECK: asm "foo $1,$0", "=*m,e[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "e" (1));
+}
+
+// CHECK: @single_Z
+void single_Z()
+{
+ // CHECK: asm "foo $1,$0", "=*m,Z[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=m" (mout0) : "Z" (1));
+}
+
+// CHECK: @multi_R
+void multi_R()
+{
+ // CHECK: asm "foo $1,$0", "=*r|R|m,r|R|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=R,=m" (mout0) : "r,R,m" (min1));
+}
+
+// CHECK: @multi_q
+void multi_q()
+{
+ // CHECK: asm "foo $1,$0", "=*r|q|m,r|q|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=q,=m" (mout0) : "r,q,m" (min1));
+}
+
+// CHECK: @multi_Q
+void multi_Q()
+{
+ // CHECK: asm "foo $1,$0", "=*r|Q|m,r|Q|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=Q,=m" (mout0) : "r,Q,m" (min1));
+}
+
+// CHECK: @multi_a
+void multi_a()
+{
+ // CHECK: asm "foo $1,$0", "=*r|{ax}|m,r|{ax}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=a,=m" (mout0) : "r,a,m" (min1));
+}
+
+// CHECK: @multi_b
+void multi_b()
+{
+ // CHECK: asm "foo $1,$0", "=*r|{bx}|m,r|{bx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=b,=m" (mout0) : "r,b,m" (min1));
+}
+
+// CHECK: @multi_c
+void multi_c()
+{
+ // CHECK: asm "foo $1,$0", "=*r|{cx}|m,r|{cx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=c,=m" (mout0) : "r,c,m" (min1));
+}
+
+// CHECK: @multi_d
+void multi_d()
+{
+ // CHECK: asm "foo $1,$0", "=*r|{dx}|m,r|{dx}[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=d,=m" (mout0) : "r,d" (min1));
+}
+
+// CHECK: @multi_S
+void multi_S()
+{
+ // CHECK: asm "foo $1,$0", "=*r|{si}|m,r|{si}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=S,=m" (mout0) : "r,S,m" (min1));
+}
+
+// CHECK: @multi_D
+void multi_D()
+{
+ // CHECK: asm "foo $1,$0", "=*r|{di}|m,r|{di}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=D,=m" (mout0) : "r,D,m" (min1));
+}
+
+// CHECK: @multi_A
+void multi_A()
+{
+ // CHECK: asm "foo $1,$0", "=*r|A|m,r|A|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=A,=m" (mout0) : "r,A,m" (min1));
+}
+
+// CHECK: @multi_f
+void multi_f()
+{
+//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
+}
+
+// CHECK: @multi_t
+void multi_t()
+{
+//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
+}
+
+// CHECK: @multi_u
+void multi_u()
+{
+//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
+}
+
+// CHECK: @multi_y
+void multi_y()
+{
+ // CHECK: asm "foo $1,$0", "=*r|y|m,r|y|m[[CLOBBERS]](double* @dout0, double {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=y,=m" (dout0) : "r,y,m" (din1));
+}
+
+// CHECK: @multi_x
+void multi_x()
+{
+ // CHECK: asm "foo $1,$0", "=*r|x|m,r|x|m[[CLOBBERS]](double* @dout0, double {{[a-zA-Z0-9@%]+}})
+ asm("foo %1,%0" : "=r,=x,=m" (dout0) : "r,x,m" (din1));
+}
+
+// CHECK: @multi_Y
+void multi_Y0()
+{
+ // Y constraint currently broken.
+ //asm("foo %1,%0" : "=r,=Y0,=m" (mout0) : "r,Y0,m" (min1));
+ //asm("foo %1,%0" : "=r,=Yz,=m" (mout0) : "r,Yz,m" (min1));
+ //asm("foo %1,%0" : "=r,=Yt,=m" (mout0) : "r,Yt,m" (min1));
+ //asm("foo %1,%0" : "=r,=Yi,=m" (mout0) : "r,Yi,m" (min1));
+ //asm("foo %1,%0" : "=r,=Ym,=m" (mout0) : "r,Ym,m" (min1));
+}
+
+// CHECK: @multi_I
+void multi_I()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|I|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,I,m" (1));
+}
+
+// CHECK: @multi_J
+void multi_J()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|J|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,J,m" (1));
+}
+
+// CHECK: @multi_K
+void multi_K()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|K|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,K,m" (1));
+}
+
+// CHECK: @multi_L
+void multi_L()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|L|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,L,m" (1));
+}
+
+// CHECK: @multi_M
+void multi_M()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|M|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,M,m" (1));
+}
+
+// CHECK: @multi_N
+void multi_N()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|N|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,N,m" (1));
+}
+
+// CHECK: @multi_G
+void multi_G()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|G|m[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,G,m" (1.0));
+}
+
+// CHECK: @multi_C
+void multi_C()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|C|m[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,C,m" (1.0));
+}
+
+// CHECK: @multi_e
+void multi_e()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|e|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,e,m" (1));
+}
+
+// CHECK: @multi_Z
+void multi_Z()
+{
+ // CHECK: asm "foo $1,$0", "=*r|m|m,r|Z|m[[CLOBBERS]](i32* @mout0, i32 1)
+ asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,Z,m" (1));
+}
More information about the cfe-commits
mailing list