152
|
1 volatile unsigned long si = 0x89abcdef;
|
|
2 volatile unsigned long long di = 0xfedcba9876543210;
|
|
3
|
|
4 unsigned int a, b, c, d;
|
|
5
|
|
6 int
|
|
7 main (void)
|
|
8 {
|
|
9 /* Check that %A and %B extract the low and high words of a 32-bit value,
|
|
10 respectively. */
|
|
11 __asm__("mov %A1, %0\n" : "=m" (a) : "m" (si));
|
|
12 __asm__("mov %B1, %0\n" : "=m" (b) : "m" (si));
|
|
13 if (a != ((unsigned)si)
|
|
14 || b != ((unsigned)(si >> 16)))
|
|
15 return 1;
|
|
16
|
|
17 /* Check that %A, %B, %C and %D extract the 1st, 2nd, 3rd and 4th words of a
|
|
18 64-bit value, respectively. */
|
|
19 __asm__("mov %A1, %0\n" : "=m" (a) : "m" (di));
|
|
20 __asm__("mov %B1, %0\n" : "=m" (b) : "m" (di));
|
|
21 __asm__("mov %C1, %0\n" : "=m" (c) : "m" (di));
|
|
22 __asm__("mov %D1, %0\n" : "=m" (d) : "m" (di));
|
|
23 if (a != ((unsigned)di)
|
|
24 || b != ((unsigned)(di >> 16))
|
|
25 || c != ((unsigned)(di >> 32))
|
|
26 || d != ((unsigned)(di >> 48)))
|
|
27 return 1;
|
|
28
|
|
29 return 0;
|
|
30 }
|