Artifact
9c470811da67e1c183a9517f23b9099aad9eb1d8:
0000: 23 69 66 6e 64 65 66 20 5f 61 76 63 61 6c 6c 5f #ifndef _avcall_
0010: 70 6f 77 65 72 70 63 36 34 5f 63 09 09 09 09 2f powerpc64_c..../
0020: 2a 2d 2a 2d 20 43 20 2d 2a 2d 2a 2f 0a 23 64 65 *-*- C -*-*/.#de
0030: 66 69 6e 65 20 5f 61 76 63 61 6c 6c 5f 70 6f 77 fine _avcall_pow
0040: 65 72 70 63 36 34 5f 63 0a 2f 2a 2a 0a 20 20 43 erpc64_c./**. C
0050: 6f 70 79 72 69 67 68 74 20 31 39 39 33 20 42 69 opyright 1993 Bi
0060: 6c 6c 20 54 72 69 67 67 73 2c 20 3c 42 69 6c 6c ll Triggs, <Bill
0070: 2e 54 72 69 67 67 73 40 69 6e 72 69 61 6c 70 65 .Triggs@inrialpe
0080: 73 2e 66 72 3e 0a 20 20 43 6f 70 79 72 69 67 68 s.fr>. Copyrigh
0090: 74 20 31 39 39 35 2d 32 30 30 36 20 42 72 75 6e t 1995-2006 Brun
00a0: 6f 20 48 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f o Haible, <bruno
00b0: 40 63 6c 69 73 70 2e 6f 72 67 3e 0a 20 20 43 6f @clisp.org>. Co
00c0: 70 79 72 69 67 68 74 20 32 30 30 30 20 41 64 61 pyright 2000 Ada
00d0: 6d 20 46 65 64 6f 72 2c 20 3c 66 65 64 6f 72 40 m Fedor, <fedor@
00e0: 67 6e 75 2e 6f 72 67 3e 0a 20 20 43 6f 70 79 72 gnu.org>. Copyr
00f0: 69 67 68 74 20 32 30 30 34 20 50 61 75 6c 20 47 ight 2004 Paul G
0100: 75 79 6f 74 2c 20 3c 70 67 75 79 6f 74 40 6b 61 uyot, <pguyot@ka
0110: 6c 6c 69 73 79 73 2e 6e 65 74 3e 0a 0a 20 20 54 llisys.net>.. T
0120: 68 69 73 20 69 73 20 66 72 65 65 20 73 6f 66 74 his is free soft
0130: 77 61 72 65 20 64 69 73 74 72 69 62 75 74 65 64 ware distributed
0140: 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47 under the GNU G
0150: 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 0a 20 20 eneral Public.
0160: 4c 69 63 65 6e 63 65 20 64 65 73 63 72 69 62 65 Licence describe
0170: 64 20 69 6e 20 74 68 65 20 66 69 6c 65 20 43 4f d in the file CO
0180: 50 59 49 4e 47 2e 20 43 6f 6e 74 61 63 74 20 74 PYING. Contact t
0190: 68 65 20 61 75 74 68 6f 72 20 69 66 0a 20 20 79 he author if. y
01a0: 6f 75 20 64 6f 6e 27 74 20 68 61 76 65 20 74 68 ou don't have th
01b0: 69 73 20 6f 72 20 63 61 6e 27 74 20 6c 69 76 65 is or can't live
01c0: 20 77 69 74 68 20 69 74 2e 20 54 68 65 72 65 20 with it. There
01d0: 69 73 20 41 42 53 4f 4c 55 54 45 4c 59 0a 20 20 is ABSOLUTELY.
01e0: 4e 4f 20 57 41 52 52 41 4e 54 59 2c 20 65 78 70 NO WARRANTY, exp
01f0: 6c 69 63 69 74 20 6f 72 20 69 6d 70 6c 69 65 64 licit or implied
0200: 2c 20 6f 6e 20 74 68 69 73 20 73 6f 66 74 77 61 , on this softwa
0210: 72 65 2e 0a 2a 2a 2f 0a 2f 2a 2d 2d 2d 2d 2d 2d re..**/./*------
0220: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0230: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0240: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0260: 0a 20 20 21 21 21 20 54 48 49 53 20 52 4f 55 54 . !!! THIS ROUT
0270: 49 4e 45 20 4d 55 53 54 20 42 45 20 43 4f 4d 50 INE MUST BE COMP
0280: 49 4c 45 44 20 67 63 63 20 2d 4f 20 21 21 21 0a ILED gcc -O !!!.
0290: 0a 20 20 46 6f 72 65 69 67 6e 20 66 75 6e 63 74 . Foreign funct
02a0: 69 6f 6e 20 69 6e 74 65 72 66 61 63 65 20 66 6f ion interface fo
02b0: 72 20 61 20 36 34 2d 62 69 74 20 50 6f 77 65 72 r a 64-bit Power
02c0: 50 43 20 77 69 74 68 20 67 63 63 0a 0a 20 20 54 PC with gcc.. T
02d0: 68 69 73 20 63 61 6c 6c 73 20 61 20 43 20 66 75 his calls a C fu
02e0: 6e 63 74 69 6f 6e 20 77 69 74 68 20 61 6e 20 61 nction with an a
02f0: 72 67 75 6d 65 6e 74 20 6c 69 73 74 20 62 75 69 rgument list bui
0300: 6c 74 20 75 70 20 75 73 69 6e 67 20 6d 61 63 72 lt up using macr
0310: 6f 73 0a 20 20 64 65 66 69 6e 65 64 20 69 6e 20 os. defined in
0320: 61 76 63 61 6c 6c 2e 68 2e 0a 0a 20 20 50 6f 77 avcall.h... Pow
0330: 65 72 50 43 36 34 20 41 72 67 75 6d 65 6e 74 20 erPC64 Argument
0340: 50 61 73 73 69 6e 67 20 43 6f 6e 76 65 6e 74 69 Passing Conventi
0350: 6f 6e 73 3a 0a 0a 20 20 41 6c 6c 20 61 72 67 75 ons:.. All argu
0360: 6d 65 6e 74 73 2c 20 65 78 63 65 70 74 20 74 68 ments, except th
0370: 65 20 66 69 72 73 74 20 38 20 77 6f 72 64 73 2c e first 8 words,
0380: 20 61 72 65 20 70 61 73 73 65 64 20 6f 6e 20 74 are passed on t
0390: 68 65 20 73 74 61 63 6b 20 77 69 74 68 0a 20 20 he stack with.
03a0: 77 6f 72 64 20 61 6c 69 67 6e 6d 65 6e 74 2e 20 word alignment.
03b0: 54 68 65 20 66 69 72 73 74 20 31 33 20 64 6f 75 The first 13 dou
03c0: 62 6c 65 73 20 61 6e 64 20 66 6c 6f 61 74 73 20 bles and floats
03d0: 61 72 65 20 61 6c 73 6f 20 70 61 73 73 65 64 20 are also passed
03e0: 69 6e 0a 20 20 66 6c 6f 61 74 69 6e 67 2d 70 6f in. floating-po
03f0: 69 6e 74 2d 72 65 67 69 73 74 65 72 73 2e 0a 20 int-registers..
0400: 20 54 6f 20 72 65 74 75 72 6e 20 61 20 73 74 72 To return a str
0410: 75 63 74 75 72 65 2c 20 74 68 65 20 63 61 6c 6c ucture, the call
0420: 65 64 20 66 75 6e 63 74 69 6f 6e 20 63 6f 70 69 ed function copi
0430: 65 73 20 74 68 65 20 76 61 6c 75 65 20 74 6f 20 es the value to
0440: 73 70 61 63 65 0a 20 20 70 6f 69 6e 74 65 64 20 space. pointed
0450: 74 6f 20 62 79 20 69 74 73 20 66 69 72 73 74 20 to by its first
0460: 61 72 67 75 6d 65 6e 74 2c 20 61 6e 64 20 61 6c argument, and al
0470: 6c 20 6f 74 68 65 72 20 61 72 67 75 6d 65 6e 74 l other argument
0480: 73 20 61 72 65 20 73 68 69 66 74 65 64 0a 20 20 s are shifted.
0490: 64 6f 77 6e 20 62 79 20 6f 6e 65 2e 0a 0a 20 20 down by one...
04a0: 54 68 65 20 41 49 58 20 61 72 67 75 6d 65 6e 74 The AIX argument
04b0: 20 70 61 73 73 69 6e 67 20 63 6f 6e 76 65 6e 74 passing convent
04c0: 69 6f 6e 73 20 61 72 65 20 75 73 65 64 3a 0a 20 ions are used:.
04d0: 20 2d 20 74 68 65 20 66 69 72 73 74 20 31 33 20 - the first 13
04e0: 64 6f 75 62 6c 65 73 20 61 6e 64 20 66 6c 6f 61 doubles and floa
04f0: 74 73 20 61 72 65 20 70 61 73 73 65 64 20 69 6e ts are passed in
0500: 20 46 50 20 72 65 67 69 73 74 65 72 73 2c 0a 20 FP registers,.
0510: 20 20 20 61 6e 64 20 77 68 65 6e 20 74 68 65 79 and when they
0520: 20 64 6f 2c 20 74 68 65 72 65 20 69 73 20 73 74 do, there is st
0530: 69 6c 6c 20 72 6f 6f 6d 20 61 6c 6c 6f 63 61 74 ill room allocat
0540: 65 64 20 66 6f 72 20 74 68 65 6d 20 69 6e 20 74 ed for them in t
0550: 68 65 0a 20 20 20 20 61 72 67 75 6d 65 6e 74 20 he. argument
0560: 73 65 71 75 65 6e 63 65 20 28 69 6e 74 65 67 65 sequence (intege
0570: 72 20 72 65 67 73 20 6f 72 20 73 74 61 63 6b 29 r regs or stack)
0580: 2e 0a 20 20 2d 20 53 74 72 75 63 74 75 72 65 73 .. - Structures
0590: 20 61 72 65 20 70 61 73 73 65 64 20 69 6e 20 74 are passed in t
05a0: 68 65 20 61 72 67 75 6d 65 6e 74 20 73 65 71 75 he argument sequ
05b0: 65 6e 63 65 2e 20 42 75 74 20 73 74 72 75 63 74 ence. But struct
05c0: 75 72 65 73 0a 20 20 20 20 63 6f 6e 74 61 69 6e ures. contain
05d0: 69 6e 67 20 66 6c 6f 61 74 73 20 6f 72 20 64 6f ing floats or do
05e0: 75 62 6c 65 73 20 61 72 65 20 70 61 73 73 65 64 ubles are passed
05f0: 20 69 6e 20 46 50 20 72 65 67 69 73 74 65 72 73 in FP registers
0600: 3f 21 0a 0a 20 20 43 6f 6d 70 69 6c 65 20 74 68 ?!.. Compile th
0610: 69 73 20 72 6f 75 74 69 6e 65 20 77 69 74 68 20 is routine with
0620: 67 63 63 20 2d 4f 20 28 6f 72 20 2d 4f 32 20 2d gcc -O (or -O2 -
0630: 66 6e 6f 2d 6f 6d 69 74 2d 66 72 61 6d 65 2d 70 fno-omit-frame-p
0640: 6f 69 6e 74 65 72 20 6f 72 20 2d 67 20 2d 4f 29 ointer or -g -O)
0650: 0a 20 20 74 6f 20 67 65 74 20 74 68 65 20 72 69 . to get the ri
0660: 67 68 74 20 72 65 67 69 73 74 65 72 20 76 61 72 ght register var
0670: 69 61 62 6c 65 73 2e 20 46 6f 72 20 6f 74 68 65 iables. For othe
0680: 72 20 63 6f 6d 70 69 6c 65 72 73 20 75 73 65 20 r compilers use
0690: 74 68 65 0a 20 20 70 72 65 2d 63 6f 6d 70 69 6c the. pre-compil
06a0: 65 64 20 61 73 73 65 6d 62 6c 65 72 20 76 65 72 ed assembler ver
06b0: 73 69 6f 6e 2e 0a 20 20 2d 2d 2d 2d 2d 2d 2d 2d sion.. --------
06c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
06d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
06e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
06f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2a 2f --------------*/
0700: 0a 23 69 6e 63 6c 75 64 65 20 22 61 76 63 61 6c .#include "avcal
0710: 6c 2e 68 2e 69 6e 22 0a 0a 23 64 65 66 69 6e 65 l.h.in"..#define
0720: 20 53 54 41 43 4b 5f 4f 46 46 53 45 54 20 31 34 STACK_OFFSET 14
0730: 0a 0a 23 64 65 66 69 6e 65 20 52 45 54 55 52 4e ..#define RETURN
0740: 28 54 59 50 45 2c 56 41 4c 29 09 28 2a 28 54 59 (TYPE,VAL).(*(TY
0750: 50 45 2a 29 6c 2d 3e 72 61 64 64 72 20 3d 20 28 PE*)l->raddr = (
0760: 54 59 50 45 29 28 56 41 4c 29 29 0a 0a 72 65 67 TYPE)(VAL))..reg
0770: 69 73 74 65 72 20 64 6f 75 62 6c 65 20 66 61 72 ister double far
0780: 67 31 09 5f 5f 61 73 6d 5f 5f 28 22 66 72 31 22 g1.__asm__("fr1"
0790: 29 3b 0a 72 65 67 69 73 74 65 72 20 64 6f 75 62 );.register doub
07a0: 6c 65 20 66 61 72 67 32 09 5f 5f 61 73 6d 5f 5f le farg2.__asm__
07b0: 28 22 66 72 32 22 29 3b 0a 72 65 67 69 73 74 65 ("fr2");.registe
07c0: 72 20 64 6f 75 62 6c 65 20 66 61 72 67 33 09 5f r double farg3._
07d0: 5f 61 73 6d 5f 5f 28 22 66 72 33 22 29 3b 0a 72 _asm__("fr3");.r
07e0: 65 67 69 73 74 65 72 20 64 6f 75 62 6c 65 20 66 egister double f
07f0: 61 72 67 34 09 5f 5f 61 73 6d 5f 5f 28 22 66 72 arg4.__asm__("fr
0800: 34 22 29 3b 0a 72 65 67 69 73 74 65 72 20 64 6f 4");.register do
0810: 75 62 6c 65 20 66 61 72 67 35 09 5f 5f 61 73 6d uble farg5.__asm
0820: 5f 5f 28 22 66 72 35 22 29 3b 0a 72 65 67 69 73 __("fr5");.regis
0830: 74 65 72 20 64 6f 75 62 6c 65 20 66 61 72 67 36 ter double farg6
0840: 09 5f 5f 61 73 6d 5f 5f 28 22 66 72 36 22 29 3b .__asm__("fr6");
0850: 0a 72 65 67 69 73 74 65 72 20 64 6f 75 62 6c 65 .register double
0860: 20 66 61 72 67 37 09 5f 5f 61 73 6d 5f 5f 28 22 farg7.__asm__("
0870: 66 72 37 22 29 3b 0a 72 65 67 69 73 74 65 72 20 fr7");.register
0880: 64 6f 75 62 6c 65 20 66 61 72 67 38 09 5f 5f 61 double farg8.__a
0890: 73 6d 5f 5f 28 22 66 72 38 22 29 3b 0a 72 65 67 sm__("fr8");.reg
08a0: 69 73 74 65 72 20 64 6f 75 62 6c 65 20 66 61 72 ister double far
08b0: 67 39 09 5f 5f 61 73 6d 5f 5f 28 22 66 72 39 22 g9.__asm__("fr9"
08c0: 29 3b 0a 72 65 67 69 73 74 65 72 20 64 6f 75 62 );.register doub
08d0: 6c 65 20 66 61 72 67 31 30 09 5f 5f 61 73 6d 5f le farg10.__asm_
08e0: 5f 28 22 66 72 31 30 22 29 3b 0a 72 65 67 69 73 _("fr10");.regis
08f0: 74 65 72 20 64 6f 75 62 6c 65 20 66 61 72 67 31 ter double farg1
0900: 31 09 5f 5f 61 73 6d 5f 5f 28 22 66 72 31 31 22 1.__asm__("fr11"
0910: 29 3b 0a 72 65 67 69 73 74 65 72 20 64 6f 75 62 );.register doub
0920: 6c 65 20 66 61 72 67 31 32 09 5f 5f 61 73 6d 5f le farg12.__asm_
0930: 5f 28 22 66 72 31 32 22 29 3b 0a 72 65 67 69 73 _("fr12");.regis
0940: 74 65 72 20 64 6f 75 62 6c 65 20 66 61 72 67 31 ter double farg1
0950: 33 09 5f 5f 61 73 6d 5f 5f 28 22 66 72 31 33 22 3.__asm__("fr13"
0960: 29 3b 0a 0a 69 6e 74 0a 5f 5f 62 75 69 6c 74 69 );..int.__builti
0970: 6e 5f 61 76 63 61 6c 6c 28 61 76 5f 61 6c 69 73 n_avcall(av_alis
0980: 74 2a 20 6c 29 0a 7b 0a 20 20 72 65 67 69 73 74 t* l).{. regist
0990: 65 72 20 5f 5f 61 76 77 6f 72 64 2a 09 73 70 09 er __avword*.sp.
09a0: 5f 5f 61 73 6d 5f 5f 28 22 72 31 22 29 3b 20 20 __asm__("r1");
09b0: 2f 2a 20 43 20 6e 61 6d 65 73 20 66 6f 72 20 72 /* C names for r
09c0: 65 67 69 73 74 65 72 73 20 2a 2f 0a 2f 2a 72 65 egisters */./*re
09d0: 67 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64 09 gister __avword.
09e0: 69 72 65 74 09 5f 5f 61 73 6d 5f 5f 28 22 72 33 iret.__asm__("r3
09f0: 22 29 3b 20 2a 2f 0a 20 20 72 65 67 69 73 74 65 "); */. registe
0a00: 72 20 5f 5f 61 76 77 6f 72 64 09 69 72 65 74 32 r __avword.iret2
0a10: 09 5f 5f 61 73 6d 5f 5f 28 22 72 34 22 29 3b 0a .__asm__("r4");.
0a20: 20 20 72 65 67 69 73 74 65 72 20 66 6c 6f 61 74 register float
0a30: 09 66 72 65 74 09 5f 5f 61 73 6d 5f 5f 28 22 66 .fret.__asm__("f
0a40: 72 31 22 29 3b 0a 20 20 72 65 67 69 73 74 65 72 r1");. register
0a50: 20 64 6f 75 62 6c 65 09 64 72 65 74 09 5f 5f 61 double.dret.__a
0a60: 73 6d 5f 5f 28 22 66 72 31 22 29 3b 0a 0a 20 20 sm__("fr1");..
0a70: 5f 5f 61 76 77 6f 72 64 20 73 70 61 63 65 5b 5f __avword space[_
0a80: 5f 41 56 5f 41 4c 49 53 54 5f 57 4f 52 44 53 5d _AV_ALIST_WORDS]
0a90: 3b 09 2f 2a 20 73 70 61 63 65 20 66 6f 72 20 63 ;./* space for c
0aa0: 61 6c 6c 65 65 27 73 20 73 74 61 63 6b 20 66 72 allee's stack fr
0ab0: 61 6d 65 20 2a 2f 0a 20 20 5f 5f 61 76 77 6f 72 ame */. __avwor
0ac0: 64 2a 20 61 72 67 66 72 61 6d 65 20 3d 20 73 70 d* argframe = sp
0ad0: 20 2b 20 53 54 41 43 4b 5f 4f 46 46 53 45 54 3b + STACK_OFFSET;
0ae0: 2f 2a 20 73 74 61 63 6b 20 6f 66 66 73 65 74 20 /* stack offset
0af0: 66 6f 72 20 61 72 67 75 6d 65 6e 74 20 6c 69 73 for argument lis
0b00: 74 20 2a 2f 0a 20 20 69 6e 74 20 61 72 67 6c 65 t */. int argle
0b10: 6e 20 3d 20 6c 2d 3e 61 70 74 72 20 2d 20 6c 2d n = l->aptr - l-
0b20: 3e 61 72 67 73 3b 0a 20 20 5f 5f 61 76 77 6f 72 >args;. __avwor
0b30: 64 20 69 3b 0a 0a 20 20 66 6f 72 20 28 69 20 3d d i;.. for (i =
0b40: 20 38 3b 20 69 20 3c 20 61 72 67 6c 65 6e 3b 20 8; i < arglen;
0b50: 69 2b 2b 29 20 2f 2a 20 70 75 73 68 20 66 75 6e i++) /* push fun
0b60: 63 74 69 6f 6e 20 61 72 67 73 20 6f 6e 74 6f 20 ction args onto
0b70: 73 74 61 63 6b 20 2a 2f 0a 20 20 20 20 61 72 67 stack */. arg
0b80: 66 72 61 6d 65 5b 69 2d 38 5d 20 3d 20 6c 2d 3e frame[i-8] = l->
0b90: 61 72 67 73 5b 69 5d 3b 0a 0a 20 20 2f 2a 20 70 args[i];.. /* p
0ba0: 61 73 73 20 66 69 72 73 74 20 31 33 20 66 6c 6f ass first 13 flo
0bb0: 61 74 69 6e 67 2d 70 6f 69 6e 74 20 61 72 67 73 ating-point args
0bc0: 20 69 6e 20 72 65 67 69 73 74 65 72 73 20 2a 2f in registers */
0bd0: 0a 20 20 61 72 67 6c 65 6e 20 3d 20 6c 2d 3e 66 . arglen = l->f
0be0: 61 70 74 72 20 2d 20 6c 2d 3e 66 61 72 67 73 3b aptr - l->fargs;
0bf0: 0a 20 20 69 66 20 28 61 72 67 6c 65 6e 20 3d 3d . if (arglen ==
0c00: 20 30 29 20 67 6f 74 6f 20 66 61 72 67 73 30 3b 0) goto fargs0;
0c10: 0a 20 20 65 6c 73 65 20 69 66 20 28 61 72 67 6c . else if (argl
0c20: 65 6e 20 3d 3d 20 31 29 20 67 6f 74 6f 20 66 61 en == 1) goto fa
0c30: 72 67 73 31 3b 0a 20 20 65 6c 73 65 20 69 66 20 rgs1;. else if
0c40: 28 61 72 67 6c 65 6e 20 3d 3d 20 32 29 20 67 6f (arglen == 2) go
0c50: 74 6f 20 66 61 72 67 73 32 3b 0a 20 20 65 6c 73 to fargs2;. els
0c60: 65 20 69 66 20 28 61 72 67 6c 65 6e 20 3d 3d 20 e if (arglen ==
0c70: 33 29 20 67 6f 74 6f 20 66 61 72 67 73 33 3b 0a 3) goto fargs3;.
0c80: 20 20 65 6c 73 65 20 69 66 20 28 61 72 67 6c 65 else if (argle
0c90: 6e 20 3d 3d 20 34 29 20 67 6f 74 6f 20 66 61 72 n == 4) goto far
0ca0: 67 73 34 3b 0a 20 20 65 6c 73 65 20 69 66 20 28 gs4;. else if (
0cb0: 61 72 67 6c 65 6e 20 3d 3d 20 35 29 20 67 6f 74 arglen == 5) got
0cc0: 6f 20 66 61 72 67 73 35 3b 0a 20 20 65 6c 73 65 o fargs5;. else
0cd0: 20 69 66 20 28 61 72 67 6c 65 6e 20 3d 3d 20 36 if (arglen == 6
0ce0: 29 20 67 6f 74 6f 20 66 61 72 67 73 36 3b 0a 20 ) goto fargs6;.
0cf0: 20 65 6c 73 65 20 69 66 20 28 61 72 67 6c 65 6e else if (arglen
0d00: 20 3d 3d 20 37 29 20 67 6f 74 6f 20 66 61 72 67 == 7) goto farg
0d10: 73 37 3b 0a 20 20 65 6c 73 65 20 69 66 20 28 61 s7;. else if (a
0d20: 72 67 6c 65 6e 20 3d 3d 20 38 29 20 67 6f 74 6f rglen == 8) goto
0d30: 20 66 61 72 67 73 38 3b 0a 20 20 65 6c 73 65 20 fargs8;. else
0d40: 69 66 20 28 61 72 67 6c 65 6e 20 3d 3d 20 39 29 if (arglen == 9)
0d50: 20 67 6f 74 6f 20 66 61 72 67 73 39 3b 0a 20 20 goto fargs9;.
0d60: 65 6c 73 65 20 69 66 20 28 61 72 67 6c 65 6e 20 else if (arglen
0d70: 3d 3d 20 31 30 29 20 67 6f 74 6f 20 66 61 72 67 == 10) goto farg
0d80: 73 31 30 3b 0a 20 20 65 6c 73 65 20 69 66 20 28 s10;. else if (
0d90: 61 72 67 6c 65 6e 20 3d 3d 20 31 31 29 20 67 6f arglen == 11) go
0da0: 74 6f 20 66 61 72 67 73 31 31 3b 0a 20 20 65 6c to fargs11;. el
0db0: 73 65 20 69 66 20 28 61 72 67 6c 65 6e 20 3d 3d se if (arglen ==
0dc0: 20 31 32 29 20 67 6f 74 6f 20 66 61 72 67 73 31 12) goto fargs1
0dd0: 32 3b 0a 20 20 65 6c 73 65 20 69 66 20 28 61 72 2;. else if (ar
0de0: 67 6c 65 6e 20 3d 3d 20 31 33 29 20 67 6f 74 6f glen == 13) goto
0df0: 20 66 61 72 67 73 31 33 3b 0a 20 20 66 61 72 67 fargs13;. farg
0e00: 73 31 33 3a 20 66 61 72 67 31 33 20 3d 20 6c 2d s13: farg13 = l-
0e10: 3e 66 61 72 67 73 5b 31 32 5d 3b 0a 20 20 66 61 >fargs[12];. fa
0e20: 72 67 73 31 32 3a 20 66 61 72 67 31 32 20 3d 20 rgs12: farg12 =
0e30: 6c 2d 3e 66 61 72 67 73 5b 31 31 5d 3b 0a 20 20 l->fargs[11];.
0e40: 66 61 72 67 73 31 31 3a 20 66 61 72 67 31 31 20 fargs11: farg11
0e50: 3d 20 6c 2d 3e 66 61 72 67 73 5b 31 30 5d 3b 0a = l->fargs[10];.
0e60: 20 20 66 61 72 67 73 31 30 3a 20 66 61 72 67 31 fargs10: farg1
0e70: 30 20 3d 20 6c 2d 3e 66 61 72 67 73 5b 39 5d 3b 0 = l->fargs[9];
0e80: 0a 20 20 66 61 72 67 73 39 3a 20 66 61 72 67 39 . fargs9: farg9
0e90: 20 3d 20 6c 2d 3e 66 61 72 67 73 5b 38 5d 3b 0a = l->fargs[8];.
0ea0: 20 20 66 61 72 67 73 38 3a 20 66 61 72 67 38 20 fargs8: farg8
0eb0: 3d 20 6c 2d 3e 66 61 72 67 73 5b 37 5d 3b 0a 20 = l->fargs[7];.
0ec0: 20 66 61 72 67 73 37 3a 20 66 61 72 67 37 20 3d fargs7: farg7 =
0ed0: 20 6c 2d 3e 66 61 72 67 73 5b 36 5d 3b 0a 20 20 l->fargs[6];.
0ee0: 66 61 72 67 73 36 3a 20 66 61 72 67 36 20 3d 20 fargs6: farg6 =
0ef0: 6c 2d 3e 66 61 72 67 73 5b 35 5d 3b 0a 20 20 66 l->fargs[5];. f
0f00: 61 72 67 73 35 3a 20 66 61 72 67 35 20 3d 20 6c args5: farg5 = l
0f10: 2d 3e 66 61 72 67 73 5b 34 5d 3b 0a 20 20 66 61 ->fargs[4];. fa
0f20: 72 67 73 34 3a 20 66 61 72 67 34 20 3d 20 6c 2d rgs4: farg4 = l-
0f30: 3e 66 61 72 67 73 5b 33 5d 3b 0a 20 20 66 61 72 >fargs[3];. far
0f40: 67 73 33 3a 20 66 61 72 67 33 20 3d 20 6c 2d 3e gs3: farg3 = l->
0f50: 66 61 72 67 73 5b 32 5d 3b 0a 20 20 66 61 72 67 fargs[2];. farg
0f60: 73 32 3a 20 66 61 72 67 32 20 3d 20 6c 2d 3e 66 s2: farg2 = l->f
0f70: 61 72 67 73 5b 31 5d 3b 0a 20 20 66 61 72 67 73 args[1];. fargs
0f80: 31 3a 20 66 61 72 67 31 20 3d 20 6c 2d 3e 66 61 1: farg1 = l->fa
0f90: 72 67 73 5b 30 5d 3b 0a 20 20 66 61 72 67 73 30 rgs[0];. fargs0
0fa0: 3a 20 3b 0a 09 09 09 09 2f 2a 20 63 61 6c 6c 20 : ;...../* call
0fb0: 66 75 6e 63 74 69 6f 6e 2c 20 70 61 73 73 20 38 function, pass 8
0fc0: 20 61 72 67 73 20 69 6e 20 72 65 67 69 73 74 65 args in registe
0fd0: 72 73 20 2a 2f 0a 20 20 69 20 3d 20 28 2a 6c 2d rs */. i = (*l-
0fe0: 3e 66 75 6e 63 29 28 6c 2d 3e 61 72 67 73 5b 30 >func)(l->args[0
0ff0: 5d 2c 20 6c 2d 3e 61 72 67 73 5b 31 5d 2c 20 6c ], l->args[1], l
1000: 2d 3e 61 72 67 73 5b 32 5d 2c 20 6c 2d 3e 61 72 ->args[2], l->ar
1010: 67 73 5b 33 5d 2c 0a 09 09 20 6c 2d 3e 61 72 67 gs[3],... l->arg
1020: 73 5b 34 5d 2c 20 6c 2d 3e 61 72 67 73 5b 35 5d s[4], l->args[5]
1030: 2c 20 6c 2d 3e 61 72 67 73 5b 36 5d 2c 20 6c 2d , l->args[6], l-
1040: 3e 61 72 67 73 5b 37 5d 29 3b 0a 0a 20 20 2f 2a >args[7]);.. /*
1050: 20 73 61 76 65 20 72 65 74 75 72 6e 20 76 61 6c save return val
1060: 75 65 20 2a 2f 0a 20 20 69 66 20 28 6c 2d 3e 72 ue */. if (l->r
1070: 74 79 70 65 20 3d 3d 20 5f 5f 41 56 76 6f 69 64 type == __AVvoid
1080: 29 20 7b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 ) {. } else. i
1090: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f f (l->rtype == _
10a0: 5f 41 56 77 6f 72 64 29 20 7b 0a 20 20 20 20 52 _AVword) {. R
10b0: 45 54 55 52 4e 28 5f 5f 61 76 77 6f 72 64 2c 20 ETURN(__avword,
10c0: 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 i);. } else. i
10d0: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f f (l->rtype == _
10e0: 5f 41 56 63 68 61 72 29 20 7b 0a 20 20 20 20 52 _AVchar) {. R
10f0: 45 54 55 52 4e 28 63 68 61 72 2c 20 69 29 3b 0a ETURN(char, i);.
1100: 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c } else. if (l
1110: 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 73 ->rtype == __AVs
1120: 63 68 61 72 29 20 7b 0a 20 20 20 20 52 45 54 55 char) {. RETU
1130: 52 4e 28 73 69 67 6e 65 64 20 63 68 61 72 2c 20 RN(signed char,
1140: 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 i);. } else. i
1150: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f f (l->rtype == _
1160: 5f 41 56 75 63 68 61 72 29 20 7b 0a 20 20 20 20 _AVuchar) {.
1170: 52 45 54 55 52 4e 28 75 6e 73 69 67 6e 65 64 20 RETURN(unsigned
1180: 63 68 61 72 2c 20 69 29 3b 0a 20 20 7d 20 65 6c char, i);. } el
1190: 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 se. if (l->rtyp
11a0: 65 20 3d 3d 20 5f 5f 41 56 73 68 6f 72 74 29 20 e == __AVshort)
11b0: 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 73 68 6f {. RETURN(sho
11c0: 72 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65 rt, i);. } else
11d0: 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 . if (l->rtype
11e0: 3d 3d 20 5f 5f 41 56 75 73 68 6f 72 74 29 20 7b == __AVushort) {
11f0: 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 69 . RETURN(unsi
1200: 67 6e 65 64 20 73 68 6f 72 74 2c 20 69 29 3b 0a gned short, i);.
1210: 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c } else. if (l
1220: 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 69 ->rtype == __AVi
1230: 6e 74 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e nt) {. RETURN
1240: 28 69 6e 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c (int, i);. } el
1250: 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 se. if (l->rtyp
1260: 65 20 3d 3d 20 5f 5f 41 56 75 69 6e 74 29 20 7b e == __AVuint) {
1270: 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 69 . RETURN(unsi
1280: 67 6e 65 64 20 69 6e 74 2c 20 69 29 3b 0a 20 20 gned int, i);.
1290: 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e } else. if (l->
12a0: 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 6c 6f 6e rtype == __AVlon
12b0: 67 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 g) {. RETURN(
12c0: 6c 6f 6e 67 2c 20 69 29 3b 0a 20 20 7d 20 65 6c long, i);. } el
12d0: 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 se. if (l->rtyp
12e0: 65 20 3d 3d 20 5f 5f 41 56 75 6c 6f 6e 67 29 20 e == __AVulong)
12f0: 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 {. RETURN(uns
1300: 69 67 6e 65 64 20 6c 6f 6e 67 2c 20 69 29 3b 0a igned long, i);.
1310: 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c } else. if (l
1320: 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 6c ->rtype == __AVl
1330: 6f 6e 67 6c 6f 6e 67 29 20 7b 0a 20 20 20 20 52 onglong) {. R
1340: 45 54 55 52 4e 28 6c 6f 6e 67 20 6c 6f 6e 67 2c ETURN(long long,
1350: 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 i);. } else.
1360: 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 if (l->rtype ==
1370: 5f 5f 41 56 75 6c 6f 6e 67 6c 6f 6e 67 29 20 7b __AVulonglong) {
1380: 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 69 . RETURN(unsi
1390: 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 2c 20 gned long long,
13a0: 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 i);. } else. i
13b0: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f f (l->rtype == _
13c0: 5f 41 56 66 6c 6f 61 74 29 20 7b 0a 20 20 20 20 _AVfloat) {.
13d0: 52 45 54 55 52 4e 28 66 6c 6f 61 74 2c 20 66 72 RETURN(float, fr
13e0: 65 74 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 et);. } else.
13f0: 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 if (l->rtype ==
1400: 5f 5f 41 56 64 6f 75 62 6c 65 29 20 7b 0a 20 20 __AVdouble) {.
1410: 20 20 52 45 54 55 52 4e 28 64 6f 75 62 6c 65 2c RETURN(double,
1420: 20 64 72 65 74 29 3b 0a 20 20 7d 20 65 6c 73 65 dret);. } else
1430: 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 . if (l->rtype
1440: 3d 3d 20 5f 5f 41 56 76 6f 69 64 70 29 20 7b 0a == __AVvoidp) {.
1450: 20 20 20 20 52 45 54 55 52 4e 28 76 6f 69 64 2a RETURN(void*
1460: 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 , i);. } else.
1470: 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d if (l->rtype ==
1480: 20 5f 5f 41 56 73 74 72 75 63 74 29 20 7b 0a 20 __AVstruct) {.
1490: 20 20 20 2f 2a 20 5f 5f 41 56 5f 50 43 43 5f 53 /* __AV_PCC_S
14a0: 54 52 55 43 54 5f 52 45 54 55 52 4e 20 61 6e 64 TRUCT_RETURN and
14b0: 20 5f 5f 41 56 5f 52 45 47 49 53 54 45 52 5f 53 __AV_REGISTER_S
14c0: 54 52 55 43 54 5f 52 45 54 55 52 4e 20 61 72 65 TRUCT_RETURN are
14d0: 20 69 67 6e 6f 72 65 64 20 2a 2f 0a 20 20 7d 0a ignored */. }.
14e0: 20 20 72 65 74 75 72 6e 20 30 3b 0a 7d 0a 0a 23 return 0;.}..#
14f0: 65 6e 64 69 66 20 2f 2a 5f 61 76 63 61 6c 6c 5f endif /*_avcall_
1500: 70 6f 77 65 72 70 63 36 34 5f 63 20 2a 2f 0a powerpc64_c */.