0000: 43 61 6c 6c 2d 75 73 65 64 20 67 65 6e 65 72 61 Call-used genera
0010: 6c 2d 70 75 72 70 6f 73 65 2f 69 6e 74 65 67 65 l-purpose/intege
0020: 72 20 72 65 67 69 73 74 65 72 73 2c 20 6e 6f 74 r registers, not
0030: 20 69 6e 74 65 72 66 65 72 69 6e 67 20 77 69 74 interfering wit
0040: 68 20 61 72 67 20 72 65 67 69 73 74 65 72 73 3a h arg registers:
0050: 0a 0a 67 72 65 70 20 43 41 4c 4c 5f 55 53 45 44 ..grep CALL_USED
0060: 20 69 6e 20 74 68 65 20 6d 61 63 68 69 6e 65 20 in the machine
0070: 64 65 73 63 72 69 70 74 69 6f 6e 2e 0a 0a 43 6f description...Co
0080: 6d 70 69 6c 65 20 74 68 65 20 73 6d 61 6c 6c 20 mpile the small
0090: 70 72 6f 67 72 61 6d 3a 0a 65 78 74 65 72 6e 20 program:.extern
00a0: 76 6f 69 64 2a 20 76 6f 6c 61 74 69 6c 65 20 78 void* volatile x
00b0: 3b 0a 65 78 74 65 72 6e 20 76 6f 69 64 2a 20 76 ;.extern void* v
00c0: 6f 6c 61 74 69 6c 65 20 79 3b 0a 69 6e 74 20 66 olatile y;.int f
00d0: 6f 6f 20 28 69 6e 74 20 61 30 2c 20 69 6e 74 20 oo (int a0, int
00e0: 61 31 2c 20 69 6e 74 20 61 32 2c 20 69 6e 74 20 a1, int a2, int
00f0: 61 33 2c 20 69 6e 74 20 61 34 2c 20 69 6e 74 20 a3, int a4, int
0100: 61 35 2c 20 69 6e 74 20 61 36 2c 20 69 6e 74 20 a5, int a6, int
0110: 61 37 29 0a 7b 20 76 6f 69 64 2a 20 61 20 3d 20 a7).{ void* a =
0120: 78 3b 20 76 6f 69 64 2a 20 62 20 3d 20 79 3b 20 x; void* b = y;
0130: 79 20 3d 20 61 3b 20 78 20 3d 20 62 3b 0a 20 20 y = a; x = b;.
0140: 72 65 74 75 72 6e 20 61 30 2b 61 31 2b 61 32 2b return a0+a1+a2+
0150: 61 33 2b 61 34 2b 61 35 2b 61 36 2b 61 37 3b 0a a3+a4+a5+a6+a7;.
0160: 7d 0a 0a 41 6d 6f 6e 67 20 74 68 65 73 65 2c 20 }..Among these,
0170: 77 65 20 63 61 6e 20 75 73 65 20 74 68 65 20 6c we can use the l
0180: 65 78 69 63 61 6c 20 63 6c 6f 73 75 72 65 20 72 exical closure r
0190: 65 67 2c 20 62 65 63 61 75 73 65 20 5f 5f 76 61 eg, because __va
01a0: 63 61 6c 6c 5f 72 20 68 61 73 20 6e 6f 0a 6c 65 call_r has no.le
01b0: 78 69 63 61 6c 20 63 6c 6f 73 75 72 65 20 28 6d xical closure (m
01c0: 6f 72 65 20 70 72 65 63 69 73 65 6c 79 2c 20 77 ore precisely, w
01d0: 65 20 61 72 65 20 62 75 69 6c 64 69 6e 67 20 61 e are building a
01e0: 20 6c 65 78 69 63 61 6c 20 63 6c 6f 73 75 72 65 lexical closure
01f0: 20 66 6f 72 20 69 74 29 2e 0a 0a 67 72 65 70 20 for it)...grep
0200: 53 54 41 54 49 43 5f 43 48 41 49 4e 5f 52 45 47 STATIC_CHAIN_REG
0210: 4e 55 4d 20 61 6e 64 20 54 52 41 4d 50 4f 4c 49 NUM and TRAMPOLI
0220: 4e 45 5f 54 45 4d 50 4c 41 54 45 20 69 6e 20 74 NE_TEMPLATE in t
0230: 68 65 20 6d 61 63 68 69 6e 65 20 64 65 73 63 72 he machine descr
0240: 69 70 74 69 6f 6e 2e 0a 0a 20 20 20 20 20 20 20 iption...
0250: 20 20 20 20 20 4d 61 63 68 69 6e 65 20 64 65 73 Machine des
0260: 63 72 69 70 74 69 6f 6e 20 20 20 20 20 20 20 20 cription
0270: 20 66 69 72 73 74 20 74 77 6f 20 28 61 2c 62 29 first two (a,b)
0280: 20 20 20 20 20 4c 65 78 69 63 61 6c 20 63 6c 6f Lexical clo
0290: 73 75 72 65 20 72 65 67 0a 69 33 38 36 20 20 20 sure reg.i386
02a0: 20 20 20 20 20 65 61 78 2c 65 64 78 2c 65 63 78 eax,edx,ecx
02b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
02c0: 20 65 61 78 2c 65 64 78 20 20 20 20 20 20 20 20 eax,edx
02d0: 20 20 20 20 20 20 20 20 20 65 63 78 0a 6d 36 38 ecx.m68
02e0: 6b 20 20 20 20 20 20 20 20 64 30 2c 64 31 2c 61 k d0,d1,a
02f0: 30 2c 61 31 20 20 20 20 20 20 20 20 20 20 20 20 0,a1
0300: 20 20 20 20 20 64 30 2c 64 31 20 20 20 20 20 20 d0,d1
0310: 20 20 20 20 20 20 20 20 20 20 20 20 20 61 30 20 a0
0320: 28 61 31 20 69 6e 20 4e 65 74 42 53 44 29 0a 6d (a1 in NetBSD).m
0330: 69 70 73 20 20 20 20 20 20 20 20 72 32 2d 72 31 ips r2-r1
0340: 35 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5
0350: 20 20 20 20 20 20 20 24 32 3d 76 30 2c 24 33 3d $2=v0,$3=
0360: 76 31 2c 24 38 3d 74 30 20 20 20 20 20 20 20 24 v1,$8=t0 $
0370: 32 0a 73 70 61 72 63 20 20 20 20 20 20 20 67 31 2.sparc g1
0380: 2d 67 34 20 20 20 20 20 20 20 20 20 20 20 20 20 -g4
0390: 20 20 20 20 20 20 20 20 20 20 67 31 2d 67 33 20 g1-g3
03a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
03b0: 20 20 67 32 0a 73 70 61 72 63 36 34 20 20 20 20 g2.sparc64
03c0: 20 67 31 2d 67 35 20 20 20 20 20 20 20 20 20 20 g1-g5
03d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 67 31 2d g1-
03e0: 67 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 g3
03f0: 20 20 20 20 20 67 35 0a 61 6c 70 68 61 20 20 20 g5.alpha
0400: 20 20 20 20 24 30 2d 24 38 2c 24 32 32 2d 24 32 $0-$8,$22-$2
0410: 35 2c 24 32 38 20 20 20 20 20 20 20 20 20 20 20 5,$28
0420: 24 32 2c 24 31 20 20 20 20 20 20 20 20 20 20 20 $2,$1
0430: 20 20 20 20 20 20 20 20 24 31 0a 68 70 70 61 20 $1.hppa
0440: 20 20 20 20 20 20 20 32 30 2d 32 32 2c 32 38 2d 20-22,28-
0450: 32 39 20 20 20 20 20 20 20 20 20 20 20 20 20 20 29
0460: 20 20 20 72 31 39 2c 72 32 30 2c 72 32 31 2c 72 r19,r20,r21,r
0470: 32 32 20 20 20 20 20 20 20 20 20 72 32 39 0a 61 22 r29.a
0480: 72 6d 20 20 20 20 20 20 20 20 20 72 31 32 3d 69 rm r12=i
0490: 70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 p
04a0: 20 20 20 20 20 20 20 72 30 2c 72 31 2c 72 33 2c r0,r1,r3,
04b0: 72 32 20 20 20 20 20 20 20 20 20 20 20 20 20 72 r2 r
04c0: 31 32 20 28 21 29 0a 70 6f 77 65 72 70 63 20 20 12 (!).powerpc
04d0: 20 20 20 30 2c 33 2d 31 32 20 20 20 20 20 20 20 0,3-12
04e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 0
04f0: 2c 31 31 2c 31 32 20 20 20 20 20 20 20 20 20 20 ,11,12
0500: 20 20 20 20 20 20 20 31 31 0a 70 6f 77 65 72 70 11.powerp
0510: 63 36 34 20 20 20 30 2c 33 2d 31 32 20 20 20 20 c64 0,3-12
0520: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0530: 20 20 30 2c 31 31 20 20 20 20 20 20 20 20 20 20 0,11
0540: 20 20 20 20 20 20 20 20 20 20 31 31 0a 6d 38 38 11.m88
0550: 6b 20 20 20 20 20 20 20 20 31 30 2c 31 33 2c 31 k 10,13,1
0560: 31 28 3f 29 20 20 20 20 20 20 20 20 20 20 20 20 1(?)
0570: 20 20 20 20 20 72 31 30 2c 72 31 33 2c 72 31 31 r10,r13,r11
0580: 2c 72 31 32 20 20 20 20 20 20 20 20 20 72 31 31 ,r12 r11
0590: 0a 63 6f 6e 76 65 78 20 20 20 20 20 20 73 30 2d .convex s0-
05a0: 73 37 2c 61 31 2d 61 35 20 20 20 20 20 20 20 20 s7,a1-a5
05b0: 20 20 20 20 20 20 20 20 20 73 31 2c 73 32 20 20 s1,s2
05c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
05d0: 20 73 30 0a 69 61 36 34 20 20 20 20 20 20 20 20 s0.ia64
05e0: 72 31 34 2d 72 33 31 2c 72 38 2d 72 31 31 20 20 r14-r31,r8-r11
05f0: 20 20 20 20 20 20 20 20 20 20 20 20 72 38 2c 72 r8,r
0600: 31 34 2c 72 31 35 2e 2e 2e 72 31 39 20 20 20 20 14,r15...r19
0610: 20 20 20 20 72 31 35 0a 78 38 36 5f 36 34 20 20 r15.x86_64
0620: 20 20 20 20 72 61 78 2c 72 64 78 2c 72 63 78 2c rax,rdx,rcx,
0630: 72 73 69 2c 72 64 69 2c 72 38 2d 72 31 35 20 20 rsi,rdi,r8-r15
0640: 72 61 78 2c 72 31 30 20 20 20 20 20 20 20 20 20 rax,r10
0650: 20 20 20 20 20 20 20 20 72 31 30 0a 73 33 39 30 r10.s390
0660: 20 20 20 20 20 20 20 20 72 30 2d 72 35 20 20 20 r0-r5
0670: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0680: 20 20 20 20 72 31 32 2c 72 30 20 20 20 20 20 20 r12,r0
0690: 20 20 20 20 20 20 20 20 20 20 20 20 72 30 0a r0.