Artifact 2500b5af019909556beb94d16ac98942e4cc935a:


0000: 23 69 66 6e 64 65 66 20 5f 61 76 63 61 6c 6c 5f  #ifndef _avcall_
0010: 73 70 61 72 63 5f 63 09 09 09 09 2f 2a 2d 2a 2d  sparc_c..../*-*-
0020: 20 43 20 2d 2a 2d 2a 2f 0a 23 64 65 66 69 6e 65   C -*-*/.#define
0030: 20 5f 61 76 63 61 6c 6c 5f 73 70 61 72 63 5f 63   _avcall_sparc_c
0040: 0a 2f 2a 2a 0a 20 20 43 6f 70 79 72 69 67 68 74  ./**.  Copyright
0050: 20 31 39 39 33 20 42 69 6c 6c 20 54 72 69 67 67   1993 Bill Trigg
0060: 73 2c 20 3c 42 69 6c 6c 2e 54 72 69 67 67 73 40  s, <Bill.Triggs@
0070: 69 6e 72 69 61 6c 70 65 73 2e 66 72 3e 0a 20 20  inrialpes.fr>.  
0080: 43 6f 70 79 72 69 67 68 74 20 31 39 39 35 2d 31  Copyright 1995-1
0090: 39 39 39 2c 20 32 30 30 35 20 42 72 75 6e 6f 20  999, 2005 Bruno 
00a0: 48 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f 40 63  Haible, <bruno@c
00b0: 6c 69 73 70 2e 6f 72 67 3e 0a 0a 20 20 54 68 69  lisp.org>..  Thi
00c0: 73 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61  s is free softwa
00d0: 72 65 20 64 69 73 74 72 69 62 75 74 65 64 20 75  re distributed u
00e0: 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47 65 6e  nder the GNU Gen
00f0: 65 72 61 6c 20 50 75 62 6c 69 63 0a 20 20 4c 69  eral Public.  Li
0100: 63 65 6e 63 65 20 64 65 73 63 72 69 62 65 64 20  cence described 
0110: 69 6e 20 74 68 65 20 66 69 6c 65 20 43 4f 50 59  in the file COPY
0120: 49 4e 47 2e 20 43 6f 6e 74 61 63 74 20 74 68 65  ING. Contact the
0130: 20 61 75 74 68 6f 72 20 69 66 0a 20 20 79 6f 75   author if.  you
0140: 20 64 6f 6e 27 74 20 68 61 76 65 20 74 68 69 73   don't have this
0150: 20 6f 72 20 63 61 6e 27 74 20 6c 69 76 65 20 77   or can't live w
0160: 69 74 68 20 69 74 2e 20 54 68 65 72 65 20 69 73  ith it. There is
0170: 20 41 42 53 4f 4c 55 54 45 4c 59 0a 20 20 4e 4f   ABSOLUTELY.  NO
0180: 20 57 41 52 52 41 4e 54 59 2c 20 65 78 70 6c 69   WARRANTY, expli
0190: 63 69 74 20 6f 72 20 69 6d 70 6c 69 65 64 2c 20  cit or implied, 
01a0: 6f 6e 20 74 68 69 73 20 73 6f 66 74 77 61 72 65  on this software
01b0: 2e 0a 2a 2a 2f 0a 2f 2a 2d 2d 2d 2d 2d 2d 2d 2d  ..**/./*--------
01c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
0200: 20 21 21 21 20 54 48 49 53 20 52 4f 55 54 49 4e   !!! THIS ROUTIN
0210: 45 20 4d 55 53 54 20 42 45 20 43 4f 4d 50 49 4c  E MUST BE COMPIL
0220: 45 44 20 67 63 63 20 2d 4f 20 21 21 21 0a 0a 20  ED gcc -O !!!.. 
0230: 20 46 6f 72 65 69 67 6e 20 66 75 6e 63 74 69 6f   Foreign functio
0240: 6e 20 69 6e 74 65 72 66 61 63 65 20 66 6f 72 20  n interface for 
0250: 61 20 53 75 6e 34 20 53 70 61 72 63 20 77 69 74  a Sun4 Sparc wit
0260: 68 20 67 63 63 2f 73 75 6e 2d 63 63 2e 0a 0a 20  h gcc/sun-cc... 
0270: 20 54 68 69 73 20 63 61 6c 6c 73 20 61 20 43 20   This calls a C 
0280: 66 75 6e 63 74 69 6f 6e 20 77 69 74 68 20 61 6e  function with an
0290: 20 61 72 67 75 6d 65 6e 74 20 6c 69 73 74 20 62   argument list b
02a0: 75 69 6c 74 20 75 70 20 75 73 69 6e 67 20 6d 61  uilt up using ma
02b0: 63 72 6f 73 0a 20 20 64 65 66 69 6e 65 64 20 69  cros.  defined i
02c0: 6e 20 61 76 5f 63 61 6c 6c 2e 68 2e 0a 0a 20 20  n av_call.h...  
02d0: 53 70 61 72 63 20 41 72 67 75 6d 65 6e 74 20 50  Sparc Argument P
02e0: 61 73 73 69 6e 67 20 43 6f 6e 76 65 6e 74 69 6f  assing Conventio
02f0: 6e 73 0a 0a 20 20 54 68 65 20 66 69 72 73 74 20  ns..  The first 
0300: 36 20 77 6f 72 64 73 20 6f 66 20 61 72 67 75 6d  6 words of argum
0310: 65 6e 74 73 20 61 72 65 20 70 61 73 73 65 64 20  ents are passed 
0320: 69 6e 20 69 6e 74 65 67 65 72 20 72 65 67 69 73  in integer regis
0330: 74 65 72 73 20 6f 30 2d 6f 35 0a 20 20 72 65 67  ters o0-o5.  reg
0340: 61 72 64 6c 65 73 73 20 6f 66 20 74 79 70 65 20  ardless of type 
0350: 6f 72 20 61 6c 69 67 6e 6d 65 6e 74 2e 20 20 28  or alignment.  (
0360: 52 65 67 69 73 74 65 72 73 20 61 72 65 20 77 69  Registers are wi
0370: 6e 64 6f 77 65 64 3a 20 6f 30 2d 6f 35 20 62 65  ndowed: o0-o5 be
0380: 63 6f 6d 65 0a 20 20 69 30 2d 69 35 20 69 66 20  come.  i0-i5 if 
0390: 74 68 65 20 63 61 6c 6c 65 64 20 66 75 6e 63 74  the called funct
03a0: 69 6f 6e 20 65 78 65 63 75 74 65 73 20 61 20 60  ion executes a `
03b0: 73 61 76 65 27 20 69 6e 73 74 72 75 63 74 69 6f  save' instructio
03c0: 6e 2e 29 20 20 52 65 6d 61 69 6e 69 6e 67 0a 20  n.)  Remaining. 
03d0: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 20 70   arguments are p
03e0: 75 73 68 65 64 20 6f 6e 74 6f 20 74 68 65 20 73  ushed onto the s
03f0: 74 61 63 6b 20 73 74 61 72 74 69 6e 67 20 61 74  tack starting at
0400: 20 61 20 66 69 78 65 64 20 6f 66 66 73 65 74 0a   a fixed offset.
0410: 20 20 28 22 61 72 67 66 72 61 6d 65 22 29 2e 20    ("argframe"). 
0420: 53 70 61 63 65 20 69 73 20 6c 65 66 74 20 6f 6e  Space is left on
0430: 20 74 68 65 20 73 74 61 63 6b 20 66 72 61 6d 65   the stack frame
0440: 20 66 6f 72 20 74 65 6d 70 6f 72 61 72 79 20 73   for temporary s
0450: 74 6f 72 61 67 65 20 6f 66 0a 20 20 74 68 65 20  torage of.  the 
0460: 72 65 67 69 73 74 65 72 20 61 72 67 75 6d 65 6e  register argumen
0470: 74 73 20 61 73 20 77 65 6c 6c 2e 0a 0a 20 20 44  ts as well...  D
0480: 6f 75 62 6c 65 73 20 6d 61 79 20 62 65 20 63 75  oubles may be cu
0490: 74 20 69 6e 20 68 61 6c 66 20 61 6e 64 20 6d 69  t in half and mi
04a0: 73 61 6c 69 67 6e 65 64 2e 20 20 53 68 6f 72 74  saligned.  Short
04b0: 65 72 20 69 6e 74 65 67 65 72 73 20 61 72 65 0a  er integers are.
04c0: 20 20 61 6c 77 61 79 73 20 70 72 6f 6d 6f 74 65    always promote
04d0: 64 20 74 6f 20 77 6f 72 64 2d 6c 65 6e 67 74 68  d to word-length
04e0: 2e 20 20 46 75 6e 63 74 69 6f 6e 73 20 77 69 74  .  Functions wit
04f0: 68 20 4b 26 52 2d 73 74 79 6c 65 20 64 65 63 6c  h K&R-style decl
0500: 61 72 61 74 69 6f 6e 73 0a 20 20 61 6e 64 20 66  arations.  and f
0510: 6c 6f 61 74 20 61 72 67 73 20 70 61 73 73 20 74  loat args pass t
0520: 68 65 6d 20 61 73 20 64 6f 75 62 6c 65 73 20 61  hem as doubles a
0530: 6e 64 20 74 72 75 6e 63 61 74 65 20 74 68 65 6d  nd truncate them
0540: 20 6f 6e 20 66 75 6e 63 74 69 6f 6e 20 65 6e 74   on function ent
0550: 72 79 2e 0a 20 20 53 74 72 75 63 74 75 72 65 73  ry..  Structures
0560: 20 61 72 65 20 70 61 73 73 65 64 20 61 73 20 70   are passed as p
0570: 6f 69 6e 74 65 72 73 20 74 6f 20 61 20 6c 6f 63  ointers to a loc
0580: 61 6c 20 63 6f 70 79 20 6f 66 20 74 68 65 20 73  al copy of the s
0590: 74 72 75 63 74 75 72 65 20 6d 61 64 65 0a 20 20  tructure made.  
05a0: 62 79 20 74 68 65 20 63 61 6c 6c 65 72 2e 0a 0a  by the caller...
05b0: 20 20 49 6e 74 65 67 65 72 73 20 61 6e 64 20 70    Integers and p
05c0: 6f 69 6e 74 65 72 73 20 61 72 65 20 72 65 74 75  ointers are retu
05d0: 72 6e 65 64 20 69 6e 20 6f 30 2c 20 66 6c 6f 61  rned in o0, floa
05e0: 74 73 20 69 6e 20 66 30 2c 20 64 6f 75 62 6c 65  ts in f0, double
05f0: 73 20 69 6e 0a 20 20 66 30 2f 66 31 2e 20 20 49  s in.  f0/f1.  I
0600: 66 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 72  f the function r
0610: 65 74 75 72 6e 73 20 61 20 73 74 72 75 63 74 75  eturns a structu
0620: 72 65 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20  re a pointer to 
0630: 73 70 61 63 65 0a 20 20 61 6c 6c 6f 63 61 74 65  space.  allocate
0640: 64 20 62 79 20 74 68 65 20 63 61 6c 6c 65 72 20  d by the caller 
0650: 69 73 20 70 75 73 68 65 64 20 6f 6e 74 6f 20 74  is pushed onto t
0660: 68 65 20 73 74 61 63 6b 20 69 6d 6d 65 64 69 61  he stack immedia
0670: 74 65 6c 79 0a 20 20 62 65 66 6f 72 65 20 74 68  tely.  before th
0680: 65 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75 6d  e function argum
0690: 65 6e 74 73 2e 20 47 63 63 20 77 69 74 68 6f 75  ents. Gcc withou
06a0: 74 20 2d 66 70 63 63 2d 73 74 72 75 63 74 2d 72  t -fpcc-struct-r
06b0: 65 74 75 72 6e 20 72 65 74 75 72 6e 73 0a 20 20  eturn returns.  
06c0: 3c 3d 20 34 20 62 79 74 65 20 73 74 72 75 63 74  <= 4 byte struct
06d0: 75 72 65 73 20 61 73 20 69 6e 74 65 67 65 72 73  ures as integers
06e0: 2e 0a 0a 20 20 53 75 6e 20 63 63 20 61 6c 6c 6f  ...  Sun cc allo
06f0: 63 61 74 65 73 20 74 65 6d 70 6f 72 61 72 79 20  cates temporary 
0700: 73 70 61 63 65 20 66 6f 72 20 61 20 72 65 74 75  space for a retu
0710: 72 6e 65 64 20 73 74 72 75 63 74 75 72 65 20 6a  rned structure j
0720: 75 73 74 20 62 65 6c 6f 77 0a 20 20 74 68 65 20  ust below.  the 
0730: 63 75 72 72 65 6e 74 20 66 72 61 6d 65 20 70 6f  current frame po
0740: 69 6e 74 65 72 20 24 66 70 20 28 74 68 65 20 24  inter $fp (the $
0750: 73 70 20 6f 66 20 74 68 65 20 63 61 6c 6c 65 72  sp of the caller
0760: 29 2c 20 61 6e 64 20 74 68 65 20 63 61 6c 6c 65  ), and the calle
0770: 72 0a 20 20 6d 75 73 74 20 63 6f 70 79 20 74 68  r.  must copy th
0780: 65 6d 20 66 72 6f 6d 20 74 68 65 72 65 2e 20 49  em from there. I
0790: 74 20 61 6c 73 6f 20 72 65 74 75 72 6e 73 20 74  t also returns t
07a0: 68 65 20 74 65 6d 70 20 61 64 64 72 65 73 73 20  he temp address 
07b0: 69 6e 20 24 6f 30 2c 20 62 75 74 0a 20 20 74 68  in $o0, but.  th
07c0: 61 74 20 67 65 74 73 20 6e 75 6b 65 64 20 69 6e  at gets nuked in
07d0: 20 74 68 65 20 72 65 74 75 72 6e 20 69 6e 20 74   the return in t
07e0: 68 65 20 63 6f 64 65 20 62 65 6c 6f 77 20 73 6f  he code below so
07f0: 20 77 65 20 63 61 6e 27 74 20 75 73 65 20 69 74   we can't use it
0800: 2e 0a 20 20 2a 2a 54 68 65 20 53 75 6e 20 63 63  ..  **The Sun cc
0810: 20 73 74 72 75 63 74 20 72 65 74 75 72 6e 20 73   struct return s
0820: 74 75 66 66 20 62 65 6c 6f 77 20 69 73 20 61 20  tuff below is a 
0830: 6b 6c 75 64 67 65 2a 2a 2c 20 62 75 74 20 73 65  kludge**, but se
0840: 65 6d 73 20 74 6f 20 77 6f 72 6b 0a 20 20 6f 6e  ems to work.  on
0850: 20 74 68 65 20 74 65 73 74 20 63 61 73 65 73 2e   the test cases.
0860: 2e 2e 0a 0a 20 20 43 6f 6d 70 69 6c 65 20 74 68  ....  Compile th
0870: 69 73 20 72 6f 75 74 69 6e 65 20 77 69 74 68 20  is routine with 
0880: 67 63 63 20 66 6f 72 20 74 68 65 20 5f 5f 61 73  gcc for the __as
0890: 6d 5f 5f 20 65 78 74 65 6e 73 69 6f 6e 73 20 61  m__ extensions a
08a0: 6e 64 20 77 69 74 68 0a 20 20 6f 70 74 69 6d 69  nd with.  optimi
08b0: 73 61 74 69 6f 6e 20 6f 6e 20 28 2d 4f 20 6f 72  sation on (-O or
08c0: 20 2d 4f 32 20 6f 72 20 2d 67 20 2d 4f 29 20 73   -O2 or -g -O) s
08d0: 6f 20 74 68 61 74 20 61 72 67 66 72 61 6d 65 20  o that argframe 
08e0: 69 73 20 73 65 74 20 74 6f 20 74 68 65 0a 20 20  is set to the.  
08f0: 63 6f 72 72 65 63 74 20 6f 66 66 73 65 74 2e 20  correct offset. 
0900: 28 25 73 70 20 69 73 20 75 73 65 64 20 64 69 66  (%sp is used dif
0910: 66 65 72 65 6e 74 6c 79 20 69 6e 20 6e 6f 6e 2d  ferently in non-
0920: 6f 70 74 69 6d 69 7a 65 64 20 63 6f 64 65 29 2e  optimized code).
0930: 0a 20 20 46 6f 72 20 53 75 6e 20 63 63 2c 20 75  .  For Sun cc, u
0940: 73 65 20 74 68 65 20 70 72 65 2d 63 6f 6d 70 69  se the pre-compi
0950: 6c 65 64 20 61 73 73 65 6d 62 6c 65 72 20 76 65  led assembler ve
0960: 72 73 69 6f 6e 20 6f 66 20 74 68 69 73 20 72 6f  rsion of this ro
0970: 75 74 69 6e 65 2e 0a 20 20 2d 2d 2d 2d 2d 2d 2d  utine..  -------
0980: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0990: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
09a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
09b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2a  ---------------*
09c0: 2f 0a 23 69 6e 63 6c 75 64 65 20 22 61 76 63 61  /.#include "avca
09d0: 6c 6c 2e 68 2e 69 6e 22 0a 0a 23 64 65 66 69 6e  ll.h.in"..#defin
09e0: 65 20 52 45 54 55 52 4e 28 54 59 50 45 2c 56 41  e RETURN(TYPE,VA
09f0: 4c 29 09 28 2a 28 54 59 50 45 2a 29 6c 2d 3e 72  L).(*(TYPE*)l->r
0a00: 61 64 64 72 20 3d 20 28 54 59 50 45 29 28 56 41  addr = (TYPE)(VA
0a10: 4c 29 29 0a 0a 72 65 67 69 73 74 65 72 20 76 6f  L))..register vo
0a20: 69 64 2a 20 63 61 6c 6c 65 65 09 5f 5f 61 73 6d  id* callee.__asm
0a30: 5f 5f 28 22 25 67 32 22 29 3b 20 20 2f 2a 20 61  __("%g2");  /* a
0a40: 6e 79 20 67 6c 6f 62 61 6c 20 6f 72 20 6c 6f 63  ny global or loc
0a50: 61 6c 20 72 65 67 69 73 74 65 72 20 2a 2f 0a 72  al register */.r
0a60: 65 67 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64  egister __avword
0a70: 20 6f 30 09 5f 5f 61 73 6d 5f 5f 28 22 25 6f 30   o0.__asm__("%o0
0a80: 22 29 3b 0a 72 65 67 69 73 74 65 72 20 5f 5f 61  ");.register __a
0a90: 76 77 6f 72 64 20 6f 31 09 5f 5f 61 73 6d 5f 5f  vword o1.__asm__
0aa0: 28 22 25 6f 31 22 29 3b 0a 72 65 67 69 73 74 65  ("%o1");.registe
0ab0: 72 20 5f 5f 61 76 77 6f 72 64 20 6f 32 09 5f 5f  r __avword o2.__
0ac0: 61 73 6d 5f 5f 28 22 25 6f 32 22 29 3b 0a 72 65  asm__("%o2");.re
0ad0: 67 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64 20  gister __avword 
0ae0: 6f 33 09 5f 5f 61 73 6d 5f 5f 28 22 25 6f 33 22  o3.__asm__("%o3"
0af0: 29 3b 0a 72 65 67 69 73 74 65 72 20 5f 5f 61 76  );.register __av
0b00: 77 6f 72 64 20 6f 34 09 5f 5f 61 73 6d 5f 5f 28  word o4.__asm__(
0b10: 22 25 6f 34 22 29 3b 0a 72 65 67 69 73 74 65 72  "%o4");.register
0b20: 20 5f 5f 61 76 77 6f 72 64 20 6f 35 09 5f 5f 61   __avword o5.__a
0b30: 73 6d 5f 5f 28 22 25 6f 35 22 29 3b 0a 0a 69 6e  sm__("%o5");..in
0b40: 74 0a 5f 5f 62 75 69 6c 74 69 6e 5f 61 76 63 61  t.__builtin_avca
0b50: 6c 6c 28 61 76 5f 61 6c 69 73 74 2a 20 6c 29 0a  ll(av_alist* l).
0b60: 7b 0a 20 20 2f 2a 3f 3f 20 57 65 20 70 72 6f 62  {.  /*?? We prob
0b70: 61 62 6c 79 20 6e 65 65 64 20 74 6f 20 6d 61 6b  ably need to mak
0b80: 65 20 73 70 61 63 65 20 66 6f 72 20 53 75 6e 20  e space for Sun 
0b90: 63 63 0a 20 20 20 20 73 74 72 75 63 74 20 72 65  cc.    struct re
0ba0: 74 75 72 6e 20 73 6f 6d 65 77 68 65 72 65 20 68  turn somewhere h
0bb0: 65 72 65 2e 20 2a 2f 0a 20 20 72 65 67 69 73 74  ere. */.  regist
0bc0: 65 72 20 5f 5f 61 76 77 6f 72 64 2a 20 73 70 09  er __avword* sp.
0bd0: 5f 5f 61 73 6d 5f 5f 28 22 25 73 70 22 29 3b 20  __asm__("%sp"); 
0be0: 20 2f 2a 20 43 20 6e 61 6d 65 73 20 66 6f 72 20   /* C names for 
0bf0: 72 65 67 69 73 74 65 72 73 20 2a 2f 0a 20 20 72  registers */.  r
0c00: 65 67 69 73 74 65 72 20 66 6c 6f 61 74 20 66 72  egister float fr
0c10: 65 74 09 5f 5f 61 73 6d 5f 5f 28 22 25 66 30 22  et.__asm__("%f0"
0c20: 29 3b 20 20 2f 2a 20 25 66 30 20 2a 2f 0a 20 20  );  /* %f0 */.  
0c30: 72 65 67 69 73 74 65 72 20 64 6f 75 62 6c 65 20  register double 
0c40: 64 72 65 74 09 5f 5f 61 73 6d 5f 5f 28 22 25 66  dret.__asm__("%f
0c50: 30 22 29 3b 20 20 2f 2a 20 25 66 30 2c 25 66 31  0");  /* %f0,%f1
0c60: 20 2a 2f 0a 0a 20 20 5f 5f 61 76 77 6f 72 64 20   */..  __avword 
0c70: 74 72 61 6d 70 6f 6c 69 6e 65 5b 36 5d 3b 09 09  trampoline[6];..
0c80: 2f 2a 20 72 6f 6f 6d 20 66 6f 72 20 61 20 74 72  /* room for a tr
0c90: 61 6d 70 6f 6c 69 6e 65 20 2a 2f 0a 20 20 5f 5f  ampoline */.  __
0ca0: 61 76 77 6f 72 64 20 73 70 61 63 65 5b 5f 5f 41  avword space[__A
0cb0: 56 5f 41 4c 49 53 54 5f 57 4f 52 44 53 5d 3b 09  V_ALIST_WORDS];.
0cc0: 2f 2a 20 73 70 61 63 65 20 66 6f 72 20 63 61 6c  /* space for cal
0cd0: 6c 65 65 27 73 20 73 74 61 63 6b 20 66 72 61 6d  lee's stack fram
0ce0: 65 20 2a 2f 0a 20 20 5f 5f 61 76 77 6f 72 64 20  e */.  __avword 
0cf0: 2a 61 72 67 66 72 61 6d 65 20 3d 20 73 70 20 2b  *argframe = sp +
0d00: 20 31 37 3b 09 09 2f 2a 20 73 74 61 63 6b 20 6f   17;../* stack o
0d10: 66 66 73 65 74 20 66 6f 72 20 61 72 67 75 6d 65  ffset for argume
0d20: 6e 74 20 6c 69 73 74 20 2a 2f 0a 20 20 69 6e 74  nt list */.  int
0d30: 20 61 72 67 6c 65 6e 20 3d 20 6c 2d 3e 61 70 74   arglen = l->apt
0d40: 72 20 2d 20 6c 2d 3e 61 72 67 73 3b 0a 20 20 5f  r - l->args;.  _
0d50: 5f 61 76 77 6f 72 64 20 69 3b 0a 0a 20 20 69 66  _avword i;..  if
0d60: 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f   (l->rtype == __
0d70: 41 56 73 74 72 75 63 74 29 0a 20 20 20 20 61 72  AVstruct).    ar
0d80: 67 66 72 61 6d 65 5b 2d 31 5d 20 3d 20 28 5f 5f  gframe[-1] = (__
0d90: 61 76 77 6f 72 64 29 6c 2d 3e 72 61 64 64 72 3b  avword)l->raddr;
0da0: 09 2f 2a 20 70 75 73 68 20 73 74 72 75 63 74 20  ./* push struct 
0db0: 72 65 74 75 72 6e 20 61 64 64 72 65 73 73 20 2a  return address *
0dc0: 2f 0a 0a 20 20 7b 0a 20 20 20 20 69 6e 74 20 69  /..  {.    int i
0dd0: 3b 0a 20 20 20 20 66 6f 72 20 28 69 20 3d 20 36  ;.    for (i = 6
0de0: 3b 20 69 20 3c 20 61 72 67 6c 65 6e 3b 20 69 2b  ; i < arglen; i+
0df0: 2b 29 09 2f 2a 20 70 75 73 68 20 65 78 63 65 73  +)./* push exces
0e00: 73 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 73 20  s function args 
0e10: 2a 2f 0a 20 20 20 20 20 20 61 72 67 66 72 61 6d  */.      argfram
0e20: 65 5b 69 5d 20 3d 20 6c 2d 3e 61 72 67 73 5b 69  e[i] = l->args[i
0e30: 5d 3b 0a 20 20 7d 0a 0a 20 20 69 66 20 28 28 6c  ];.  }..  if ((l
0e40: 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 73  ->rtype == __AVs
0e50: 74 72 75 63 74 29 20 26 26 20 28 6c 2d 3e 66 6c  truct) && (l->fl
0e60: 61 67 73 20 26 20 5f 5f 41 56 5f 53 55 4e 50 52  ags & __AV_SUNPR
0e70: 4f 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52  OCC_STRUCT_RETUR
0e80: 4e 29 29 0a 20 20 20 20 2f 2a 20 53 55 4e 57 73  N)).    /* SUNWs
0e90: 70 72 6f 20 63 63 20 63 6f 6d 70 69 6c 65 64 20  pro cc compiled 
0ea0: 66 75 6e 63 74 69 6f 6e 73 20 64 6f 6e 27 74 20  functions don't 
0eb0: 63 6f 70 79 20 74 68 65 20 73 74 72 75 63 74 75  copy the structu
0ec0: 72 65 20 74 6f 20 74 68 65 20 61 72 65 61 0a 20  re to the area. 
0ed0: 20 20 20 20 2a 20 70 6f 69 6e 74 65 64 20 74 6f      * pointed to
0ee0: 20 62 79 20 61 72 67 66 72 61 6d 65 5b 2d 31 5d   by argframe[-1]
0ef0: 20 75 6e 6c 65 73 73 20 74 68 65 20 63 61 6c 6c   unless the call
0f00: 65 72 20 68 61 73 20 61 20 70 72 6f 70 65 72 20  er has a proper 
0f10: 22 75 6e 69 6d 70 20 6e 22 0a 20 20 20 20 20 2a  "unimp n".     *
0f20: 20 69 6e 73 74 72 75 63 74 69 6f 6e 2e 20 57 65   instruction. We
0f30: 20 67 65 6e 65 72 61 74 65 20 74 68 65 20 63 61   generate the ca
0f40: 6c 6c 69 6e 67 20 69 6e 73 74 72 75 63 74 69 6f  lling instructio
0f50: 6e 73 20 6f 6e 20 74 68 65 20 73 74 61 63 6b 2e  ns on the stack.
0f60: 20 2a 2f 0a 20 20 20 20 7b 0a 20 20 20 20 20 20   */.    {.      
0f70: 74 72 61 6d 70 6f 6c 69 6e 65 5b 30 5d 20 3d 20  trampoline[0] = 
0f80: 30 78 39 46 43 30 38 30 30 30 3b 09 2f 2a 20 63  0x9FC08000;./* c
0f90: 61 6c 6c 20 25 67 32 09 2a 2f 0a 20 20 20 20 20  all %g2.*/.     
0fa0: 20 74 72 61 6d 70 6f 6c 69 6e 65 5b 31 5d 20 3d   trampoline[1] =
0fb0: 20 30 78 30 31 30 30 30 30 30 30 3b 09 2f 2a 20   0x01000000;./* 
0fc0: 6e 6f 70 09 09 2a 2f 0a 20 20 20 20 20 20 74 72  nop..*/.      tr
0fd0: 61 6d 70 6f 6c 69 6e 65 5b 32 5d 20 3d 20 6c 2d  ampoline[2] = l-
0fe0: 3e 72 73 69 7a 65 20 26 20 30 78 46 46 46 3b 09  >rsize & 0xFFF;.
0ff0: 2f 2a 20 75 6e 69 6d 70 20 6e 09 2a 2f 0a 20 20  /* unimp n.*/.  
1000: 20 20 20 20 74 72 61 6d 70 6f 6c 69 6e 65 5b 33      trampoline[3
1010: 5d 20 3d 20 30 78 42 30 31 30 32 30 30 30 3b 20  ] = 0xB0102000; 
1020: 20 20 20 20 20 20 2f 2a 20 6d 6f 76 20 30 2c 25        /* mov 0,%
1030: 69 30 20 20 20 20 2a 2f 0a 20 20 20 20 20 20 74  i0    */.      t
1040: 72 61 6d 70 6f 6c 69 6e 65 5b 34 5d 20 3d 20 30  rampoline[4] = 0
1050: 78 38 31 43 37 45 30 30 38 3b 20 20 20 20 20 20  x81C7E008;      
1060: 20 2f 2a 20 72 65 74 20 20 20 20 20 20 20 20 20   /* ret         
1070: 20 2a 2f 0a 20 20 20 20 20 20 74 72 61 6d 70 6f   */.      trampo
1080: 6c 69 6e 65 5b 35 5d 20 3d 20 30 78 38 31 45 38  line[5] = 0x81E8
1090: 30 30 30 30 3b 20 20 20 20 20 20 20 2f 2a 20 72  0000;       /* r
10a0: 65 73 74 6f 72 65 20 20 20 20 20 20 2a 2f 0a 20  estore      */. 
10b0: 20 20 20 20 20 5f 5f 61 73 6d 5f 5f 20 5f 5f 76       __asm__ __v
10c0: 6f 6c 61 74 69 6c 65 5f 5f 20 28 22 69 66 6c 75  olatile__ ("iflu
10d0: 73 68 20 25 30 22 20 3a 20 3a 20 22 72 22 20 28  sh %0" : : "r" (
10e0: 26 74 72 61 6d 70 6f 6c 69 6e 65 5b 30 5d 29 29  &trampoline[0]))
10f0: 3b 0a 20 20 20 20 20 20 5f 5f 61 73 6d 5f 5f 20  ;.      __asm__ 
1100: 5f 5f 76 6f 6c 61 74 69 6c 65 5f 5f 20 28 22 69  __volatile__ ("i
1110: 66 6c 75 73 68 20 25 30 22 20 3a 20 3a 20 22 72  flush %0" : : "r
1120: 22 20 28 26 74 72 61 6d 70 6f 6c 69 6e 65 5b 32  " (&trampoline[2
1130: 5d 29 29 3b 0a 20 20 20 20 20 20 5f 5f 61 73 6d  ]));.      __asm
1140: 5f 5f 20 5f 5f 76 6f 6c 61 74 69 6c 65 5f 5f 20  __ __volatile__ 
1150: 28 22 69 66 6c 75 73 68 20 25 30 22 20 3a 20 3a  ("iflush %0" : :
1160: 20 22 72 22 20 28 26 74 72 61 6d 70 6f 6c 69 6e   "r" (&trampolin
1170: 65 5b 34 5d 29 29 3b 0a 20 20 20 20 20 20 5f 5f  e[4]));.      __
1180: 61 73 6d 5f 5f 20 5f 5f 76 6f 6c 61 74 69 6c 65  asm__ __volatile
1190: 5f 5f 20 28 22 69 66 6c 75 73 68 20 25 30 22 20  __ ("iflush %0" 
11a0: 3a 20 3a 20 22 72 22 20 28 26 74 72 61 6d 70 6f  : : "r" (&trampo
11b0: 6c 69 6e 65 5b 35 5d 29 29 3b 0a 20 20 20 20 20  line[5]));.     
11c0: 20 6f 30 20 3d 20 6c 2d 3e 61 72 67 73 5b 30 5d   o0 = l->args[0]
11d0: 3b 20 6f 31 20 3d 20 6c 2d 3e 61 72 67 73 5b 31  ; o1 = l->args[1
11e0: 5d 3b 20 6f 32 20 3d 20 6c 2d 3e 61 72 67 73 5b  ]; o2 = l->args[
11f0: 32 5d 3b 0a 20 20 20 20 20 20 6f 33 20 3d 20 6c  2];.      o3 = l
1200: 2d 3e 61 72 67 73 5b 33 5d 3b 20 6f 34 20 3d 20  ->args[3]; o4 = 
1210: 6c 2d 3e 61 72 67 73 5b 34 5d 3b 20 6f 35 20 3d  l->args[4]; o5 =
1220: 20 6c 2d 3e 61 72 67 73 5b 35 5d 3b 0a 20 20 20   l->args[5];.   
1230: 20 20 20 63 61 6c 6c 65 65 20 3d 20 6c 2d 3e 66     callee = l->f
1240: 75 6e 63 3b 0a 20 20 20 20 20 20 67 6f 74 6f 20  unc;.      goto 
1250: 2a 28 76 6f 69 64 2a 29 74 72 61 6d 70 6f 6c 69  *(void*)trampoli
1260: 6e 65 3b 0a 20 20 20 20 7d 0a 0a 09 09 09 09 09  ne;.    }.......
1270: 2f 2a 20 63 61 6c 6c 20 66 75 6e 63 74 69 6f 6e  /* call function
1280: 20 77 69 74 68 20 31 73 74 20 36 20 61 72 67 73   with 1st 6 args
1290: 20 2a 2f 0a 20 20 69 20 3d 20 28 7b 20 72 65 67   */.  i = ({ reg
12a0: 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64 20 69  ister __avword i
12b0: 72 65 74 20 5f 5f 61 73 6d 5f 5f 28 22 25 6f 30  ret __asm__("%o0
12c0: 22 29 3b 0a 20 20 20 20 20 20 20 20 20 69 72 65  ");.         ire
12d0: 74 20 3d 20 28 2a 6c 2d 3e 66 75 6e 63 29 28 6c  t = (*l->func)(l
12e0: 2d 3e 61 72 67 73 5b 30 5d 2c 20 6c 2d 3e 61 72  ->args[0], l->ar
12f0: 67 73 5b 31 5d 2c 20 6c 2d 3e 61 72 67 73 5b 32  gs[1], l->args[2
1300: 5d 2c 0a 09 09 09 20 20 20 6c 2d 3e 61 72 67 73  ],....   l->args
1310: 5b 33 5d 2c 20 6c 2d 3e 61 72 67 73 5b 34 5d 2c  [3], l->args[4],
1320: 20 6c 2d 3e 61 72 67 73 5b 35 5d 29 3b 0a 20 20   l->args[5]);.  
1330: 20 20 20 20 20 20 20 61 73 6d 20 28 22 6e 6f 70         asm ("nop
1340: 22 29 3b 09 2f 2a 20 73 74 72 75 63 74 20 72 65  ");./* struct re
1350: 74 75 72 6e 69 6e 67 20 66 75 6e 63 74 69 6f 6e  turning function
1360: 73 20 73 6b 69 70 20 74 68 69 73 20 69 6e 73 74  s skip this inst
1370: 72 75 63 74 69 6f 6e 20 2a 2f 0a 20 20 20 20 20  ruction */.     
1380: 20 20 20 20 69 72 65 74 3b 0a 20 20 20 20 20 20      iret;.      
1390: 20 7d 29 3b 0a 0a 20 20 2f 2a 20 73 61 76 65 20   });..  /* save 
13a0: 72 65 74 75 72 6e 20 76 61 6c 75 65 20 2a 2f 0a  return value */.
13b0: 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d    if (l->rtype =
13c0: 3d 20 5f 5f 41 56 76 6f 69 64 29 20 7b 0a 20 20  = __AVvoid) {.  
13d0: 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e  } else.  if (l->
13e0: 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 77 6f 72  rtype == __AVwor
13f0: 64 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28  d) {.    RETURN(
1400: 5f 5f 61 76 77 6f 72 64 2c 20 69 29 3b 0a 20 20  __avword, i);.  
1410: 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e  } else.  if (l->
1420: 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 63 68 61  rtype == __AVcha
1430: 72 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28  r) {.    RETURN(
1440: 63 68 61 72 2c 20 69 29 3b 0a 20 20 7d 20 65 6c  char, i);.  } el
1450: 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70  se.  if (l->rtyp
1460: 65 20 3d 3d 20 5f 5f 41 56 73 63 68 61 72 29 20  e == __AVschar) 
1470: 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 73 69 67  {.    RETURN(sig
1480: 6e 65 64 20 63 68 61 72 2c 20 69 29 3b 0a 20 20  ned char, i);.  
1490: 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e  } else.  if (l->
14a0: 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 75 63 68  rtype == __AVuch
14b0: 61 72 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e  ar) {.    RETURN
14c0: 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 2c 20  (unsigned char, 
14d0: 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69  i);.  } else.  i
14e0: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f  f (l->rtype == _
14f0: 5f 41 56 73 68 6f 72 74 29 20 7b 0a 20 20 20 20  _AVshort) {.    
1500: 52 45 54 55 52 4e 28 73 68 6f 72 74 2c 20 69 29  RETURN(short, i)
1510: 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20  ;.  } else.  if 
1520: 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41  (l->rtype == __A
1530: 56 75 73 68 6f 72 74 29 20 7b 0a 20 20 20 20 52  Vushort) {.    R
1540: 45 54 55 52 4e 28 75 6e 73 69 67 6e 65 64 20 73  ETURN(unsigned s
1550: 68 6f 72 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c  hort, i);.  } el
1560: 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70  se.  if (l->rtyp
1570: 65 20 3d 3d 20 5f 5f 41 56 69 6e 74 29 20 7b 0a  e == __AVint) {.
1580: 20 20 20 20 52 45 54 55 52 4e 28 69 6e 74 2c 20      RETURN(int, 
1590: 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69  i);.  } else.  i
15a0: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f  f (l->rtype == _
15b0: 5f 41 56 75 69 6e 74 29 20 7b 0a 20 20 20 20 52  _AVuint) {.    R
15c0: 45 54 55 52 4e 28 75 6e 73 69 67 6e 65 64 20 69  ETURN(unsigned i
15d0: 6e 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65  nt, i);.  } else
15e0: 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20  .  if (l->rtype 
15f0: 3d 3d 20 5f 5f 41 56 6c 6f 6e 67 29 20 7b 0a 20  == __AVlong) {. 
1600: 20 20 20 52 45 54 55 52 4e 28 6c 6f 6e 67 2c 20     RETURN(long, 
1610: 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69  i);.  } else.  i
1620: 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f  f (l->rtype == _
1630: 5f 41 56 75 6c 6f 6e 67 29 20 7b 0a 20 20 20 20  _AVulong) {.    
1640: 52 45 54 55 52 4e 28 75 6e 73 69 67 6e 65 64 20  RETURN(unsigned 
1650: 6c 6f 6e 67 2c 20 69 29 3b 0a 20 20 7d 20 65 6c  long, i);.  } el
1660: 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70  se.  if (l->rtyp
1670: 65 20 3d 3d 20 5f 5f 41 56 6c 6f 6e 67 6c 6f 6e  e == __AVlonglon
1680: 67 20 7c 7c 20 6c 2d 3e 72 74 79 70 65 20 3d 3d  g || l->rtype ==
1690: 20 5f 5f 41 56 75 6c 6f 6e 67 6c 6f 6e 67 29 20   __AVulonglong) 
16a0: 7b 0a 20 20 20 20 28 28 5f 5f 61 76 77 6f 72 64  {.    ((__avword
16b0: 2a 29 6c 2d 3e 72 61 64 64 72 29 5b 30 5d 20 3d  *)l->raddr)[0] =
16c0: 20 69 3b 0a 20 20 20 20 28 28 5f 5f 61 76 77 6f   i;.    ((__avwo
16d0: 72 64 2a 29 6c 2d 3e 72 61 64 64 72 29 5b 31 5d  rd*)l->raddr)[1]
16e0: 20 3d 20 6f 31 3b 0a 20 20 7d 20 65 6c 73 65 0a   = o1;.  } else.
16f0: 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d    if (l->rtype =
1700: 3d 20 5f 5f 41 56 66 6c 6f 61 74 29 20 7b 0a 20  = __AVfloat) {. 
1710: 20 20 20 2f 2a 20 6f 6c 64 20 53 75 6e 20 63 63     /* old Sun cc
1720: 20 72 65 74 75 72 6e 73 20 66 6c 6f 61 74 73 20   returns floats 
1730: 61 73 20 64 6f 75 62 6c 65 73 20 2a 2f 0a 20 20  as doubles */.  
1740: 20 20 69 66 20 28 6c 2d 3e 66 6c 61 67 73 20 26    if (l->flags &
1750: 20 5f 5f 41 56 5f 53 55 4e 43 43 5f 46 4c 4f 41   __AV_SUNCC_FLOA
1760: 54 5f 52 45 54 55 52 4e 29 20 7b 0a 20 20 20 20  T_RETURN) {.    
1770: 20 20 52 45 54 55 52 4e 28 66 6c 6f 61 74 2c 20    RETURN(float, 
1780: 28 66 6c 6f 61 74 29 64 72 65 74 29 3b 0a 20 20  (float)dret);.  
1790: 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20    } else {.     
17a0: 20 52 45 54 55 52 4e 28 66 6c 6f 61 74 2c 20 66   RETURN(float, f
17b0: 72 65 74 29 3b 0a 20 20 20 20 7d 0a 20 20 7d 20  ret);.    }.  } 
17c0: 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74  else.  if (l->rt
17d0: 79 70 65 20 3d 3d 20 5f 5f 41 56 64 6f 75 62 6c  ype == __AVdoubl
17e0: 65 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28  e) {.    RETURN(
17f0: 64 6f 75 62 6c 65 2c 20 64 72 65 74 29 3b 0a 20  double, dret);. 
1800: 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d   } else.  if (l-
1810: 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 76 6f  >rtype == __AVvo
1820: 69 64 70 29 20 7b 0a 20 20 20 20 52 45 54 55 52  idp) {.    RETUR
1830: 4e 28 76 6f 69 64 2a 2c 20 69 29 3b 0a 20 20 7d  N(void*, i);.  }
1840: 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72   else.  if (l->r
1850: 74 79 70 65 20 3d 3d 20 5f 5f 41 56 73 74 72 75  type == __AVstru
1860: 63 74 29 20 7b 0a 20 20 20 20 69 66 20 28 6c 2d  ct) {.    if (l-
1870: 3e 66 6c 61 67 73 20 26 20 5f 5f 41 56 5f 50 43  >flags & __AV_PC
1880: 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 29  C_STRUCT_RETURN)
1890: 20 7b 0a 20 20 20 20 20 20 2f 2a 20 70 63 63 20   {.      /* pcc 
18a0: 73 74 72 75 63 74 20 72 65 74 75 72 6e 20 63 6f  struct return co
18b0: 6e 76 65 6e 74 69 6f 6e 3a 20 6e 65 65 64 20 61  nvention: need a
18c0: 20 20 2a 28 54 59 50 45 2a 29 6c 2d 3e 72 61 64    *(TYPE*)l->rad
18d0: 64 72 20 3d 20 2a 28 54 59 50 45 2a 29 69 3b 20  dr = *(TYPE*)i; 
18e0: 20 2a 2f 0a 20 20 20 20 20 20 69 66 20 28 6c 2d   */.      if (l-
18f0: 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65 6f 66  >rsize == sizeof
1900: 28 63 68 61 72 29 29 20 7b 0a 20 20 20 20 20 20  (char)) {.      
1910: 20 20 52 45 54 55 52 4e 28 63 68 61 72 2c 20 2a    RETURN(char, *
1920: 28 63 68 61 72 2a 29 69 29 3b 0a 20 20 20 20 20  (char*)i);.     
1930: 20 7d 20 65 6c 73 65 0a 20 20 20 20 20 20 69 66   } else.      if
1940: 20 28 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69   (l->rsize == si
1950: 7a 65 6f 66 28 73 68 6f 72 74 29 29 20 7b 0a 20  zeof(short)) {. 
1960: 20 20 20 20 20 20 20 52 45 54 55 52 4e 28 73 68         RETURN(sh
1970: 6f 72 74 2c 20 2a 28 73 68 6f 72 74 2a 29 69 29  ort, *(short*)i)
1980: 3b 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 0a 20  ;.      } else. 
1990: 20 20 20 20 20 69 66 20 28 6c 2d 3e 72 73 69 7a       if (l->rsiz
19a0: 65 20 3d 3d 20 73 69 7a 65 6f 66 28 69 6e 74 29  e == sizeof(int)
19b0: 29 20 7b 0a 20 20 20 20 20 20 20 20 52 45 54 55  ) {.        RETU
19c0: 52 4e 28 69 6e 74 2c 20 2a 28 69 6e 74 2a 29 69  RN(int, *(int*)i
19d0: 29 3b 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 0a  );.      } else.
19e0: 20 20 20 20 20 20 69 66 20 28 6c 2d 3e 72 73 69        if (l->rsi
19f0: 7a 65 20 3d 3d 20 73 69 7a 65 6f 66 28 64 6f 75  ze == sizeof(dou
1a00: 62 6c 65 29 29 20 7b 0a 20 20 20 20 20 20 20 20  ble)) {.        
1a10: 28 28 69 6e 74 2a 29 6c 2d 3e 72 61 64 64 72 29  ((int*)l->raddr)
1a20: 5b 30 5d 20 3d 20 28 28 69 6e 74 2a 29 69 29 5b  [0] = ((int*)i)[
1a30: 30 5d 3b 0a 20 20 20 20 20 20 20 20 28 28 69 6e  0];.        ((in
1a40: 74 2a 29 6c 2d 3e 72 61 64 64 72 29 5b 31 5d 20  t*)l->raddr)[1] 
1a50: 3d 20 28 28 69 6e 74 2a 29 69 29 5b 31 5d 3b 0a  = ((int*)i)[1];.
1a60: 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20        } else {. 
1a70: 20 20 20 20 20 20 20 69 6e 74 20 6e 20 3d 20 28         int n = (
1a80: 6c 2d 3e 72 73 69 7a 65 20 2b 20 73 69 7a 65 6f  l->rsize + sizeo
1a90: 66 28 5f 5f 61 76 77 6f 72 64 29 2d 31 29 2f 73  f(__avword)-1)/s
1aa0: 69 7a 65 6f 66 28 5f 5f 61 76 77 6f 72 64 29 3b  izeof(__avword);
1ab0: 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28  .        while (
1ac0: 2d 2d 6e 20 3e 3d 20 30 29 0a 20 20 20 20 20 20  --n >= 0).      
1ad0: 20 20 20 20 28 28 5f 5f 61 76 77 6f 72 64 2a 29      ((__avword*)
1ae0: 6c 2d 3e 72 61 64 64 72 29 5b 6e 5d 20 3d 20 28  l->raddr)[n] = (
1af0: 28 5f 5f 61 76 77 6f 72 64 2a 29 69 29 5b 6e 5d  (__avword*)i)[n]
1b00: 3b 0a 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 20  ;.      }.    } 
1b10: 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 2f 2a 20  else {.      /* 
1b20: 6e 6f 72 6d 61 6c 20 73 74 72 75 63 74 20 72 65  normal struct re
1b30: 74 75 72 6e 20 63 6f 6e 76 65 6e 74 69 6f 6e 20  turn convention 
1b40: 2a 2f 0a 20 20 20 20 20 20 69 66 20 28 6c 2d 3e  */.      if (l->
1b50: 66 6c 61 67 73 20 26 20 5f 5f 41 56 5f 53 4d 41  flags & __AV_SMA
1b60: 4c 4c 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e  LL_STRUCT_RETURN
1b70: 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28  ) {.        if (
1b80: 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65  l->rsize == size
1b90: 6f 66 28 63 68 61 72 29 29 20 7b 0a 20 20 20 20  of(char)) {.    
1ba0: 20 20 20 20 20 20 52 45 54 55 52 4e 28 63 68 61        RETURN(cha
1bb0: 72 2c 20 69 29 3b 0a 20 20 20 20 20 20 20 20 7d  r, i);.        }
1bc0: 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 69 66   else.        if
1bd0: 20 28 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69   (l->rsize == si
1be0: 7a 65 6f 66 28 73 68 6f 72 74 29 29 20 7b 0a 20  zeof(short)) {. 
1bf0: 20 20 20 20 20 20 20 20 20 52 45 54 55 52 4e 28           RETURN(
1c00: 73 68 6f 72 74 2c 20 69 29 3b 0a 20 20 20 20 20  short, i);.     
1c10: 20 20 20 7d 20 65 6c 73 65 0a 20 20 20 20 20 20     } else.      
1c20: 20 20 69 66 20 28 6c 2d 3e 72 73 69 7a 65 20 3d    if (l->rsize =
1c30: 3d 20 73 69 7a 65 6f 66 28 69 6e 74 29 29 20 7b  = sizeof(int)) {
1c40: 0a 20 20 20 20 20 20 20 20 20 20 52 45 54 55 52  .          RETUR
1c50: 4e 28 69 6e 74 2c 20 69 29 3b 0a 20 20 20 20 20  N(int, i);.     
1c60: 20 20 20 7d 0a 20 20 20 20 20 20 7d 0a 20 20 20     }.      }.   
1c70: 20 7d 0a 20 20 7d 0a 20 20 72 65 74 75 72 6e 20   }.  }.  return 
1c80: 30 3b 0a 7d 0a 0a 23 65 6e 64 69 66 20 2f 2a 5f  0;.}..#endif /*_
1c90: 61 76 63 61 6c 6c 5f 73 70 61 72 63 5f 63 20 2a  avcall_sparc_c *
1ca0: 2f 0a                                            /.