|
From: <sv...@va...> - 2005-11-04 14:39:09
|
Author: sewardj
Date: 2005-11-04 14:38:48 +0000 (Fri, 04 Nov 2005)
New Revision: 5001
Log:
Also test jecxz.
Modified:
trunk/none/tests/amd64/jrcxz.c
trunk/none/tests/amd64/jrcxz.stdout.exp
Modified: trunk/none/tests/amd64/jrcxz.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/jrcxz.c 2005-11-04 14:25:09 UTC (rev 5000)
+++ trunk/none/tests/amd64/jrcxz.c 2005-11-04 14:38:48 UTC (rev 5001)
@@ -2,35 +2,68 @@
#include <stdio.h>
=20
typedef unsigned long long int ULong;
+typedef unsigned int UInt;
=20
-ULong arg, res;
+ULong arg64, res64;
=20
-extern void foo ( void );
+extern void foo64 ( void );
asm("\n"
-"foo:\n"
+"foo64:\n"
"\tpushq %rcx\n"
=20
"\tmovq $0, %rax\n"
-"\tmovq arg, %rcx\n"
+"\tmovq arg64, %rcx\n"
=20
-"Lagain:\n"
+"Lagain64:\n"
"\taddq $177, %rax\n"
"\tdecq %rcx\n"
-"\tjrcxz Lout\n"
-"\tjmp Lagain\n"
+"\tjrcxz Lout64\n"
+"\tjmp Lagain64\n"
=20
-"Lout:\n"
-"\tmovq %rax, res\n"
+"Lout64:\n"
+"\tmovq %rax, res64\n"
=20
"\tpopq %rcx\n"
"\tret\n"
);
=20
+
+UInt arg32, res32;
+
+extern void foo32 ( void );
+asm("\n"
+"foo32:\n"
+"\tpushq %rcx\n"
+
+"\tmovq $0, %rax\n"
+"\tmovl arg32, %ecx\n"
+
+"Lagain32:\n"
+"\taddq $177, %rax\n"
+"\tdecl %ecx\n"
+"\tjecxz Lout32\n"
+"\tjmp Lagain32\n"
+
+"Lout32:\n"
+"\tmovl %eax, res32\n"
+
+"\tpopq %rcx\n"
+"\tret\n"
+);
+
+
+
int main ( void )
{
- arg =3D 100;
- res =3D 0;
- foo();
- printf("%lld\n", res);
+ arg64 =3D 100;
+ res64 =3D 0;
+ foo64();
+ printf("%lld\n", res64);
+
+ arg32 =3D 1234;
+ res32 =3D 0;
+ foo32();
+ printf("%d\n", res32);
+
return 0;
}
Modified: trunk/none/tests/amd64/jrcxz.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/jrcxz.stdout.exp 2005-11-04 14:25:09 UTC (rev =
5000)
+++ trunk/none/tests/amd64/jrcxz.stdout.exp 2005-11-04 14:38:48 UTC (rev =
5001)
@@ -1 +1,2 @@
17700
+218418
|