Artifact a5777379eef4cec8f4120b093df498bf326f660e:


0000: 23 69 66 6e 64 65 66 20 5f 61 76 63 61 6c 6c 5f  #ifndef _avcall_
0010: 73 33 39 30 5f 63 09 09 09 09 2f 2a 2d 2a 2d 20  s390_c..../*-*- 
0020: 43 20 2d 2a 2d 2a 2f 0a 23 64 65 66 69 6e 65 20  C -*-*/.#define 
0030: 5f 61 76 63 61 6c 6c 5f 73 33 39 30 5f 63 0a 2f  _avcall_s390_c./
0040: 2a 2a 0a 20 20 43 6f 70 79 72 69 67 68 74 20 31  **.  Copyright 1
0050: 39 39 33 20 42 69 6c 6c 20 54 72 69 67 67 73 2c  993 Bill Triggs,
0060: 20 3c 42 69 6c 6c 2e 54 72 69 67 67 73 40 69 6e   <Bill.Triggs@in
0070: 72 69 61 6c 70 65 73 2e 66 72 3e 0a 20 20 43 6f  rialpes.fr>.  Co
0080: 70 79 72 69 67 68 74 20 31 39 39 35 2d 31 39 39  pyright 1995-199
0090: 39 20 42 72 75 6e 6f 20 48 61 69 62 6c 65 2c 20  9 Bruno Haible, 
00a0: 3c 62 72 75 6e 6f 40 63 6c 69 73 70 2e 6f 72 67  <bruno@clisp.org
00b0: 3e 0a 20 20 43 6f 70 79 72 69 67 68 74 20 32 30  >.  Copyright 20
00c0: 30 31 20 47 65 72 68 61 72 64 20 54 6f 6e 6e 2c  01 Gerhard Tonn,
00d0: 20 3c 67 74 40 64 65 62 69 61 6e 2e 6f 72 67 3e   <gt@debian.org>
00e0: 0a 0a 20 20 54 68 69 73 20 69 73 20 66 72 65 65  ..  This is free
00f0: 20 73 6f 66 74 77 61 72 65 20 64 69 73 74 72 69   software distri
0100: 62 75 74 65 64 20 75 6e 64 65 72 20 74 68 65 20  buted under the 
0110: 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c  GNU General Publ
0120: 69 63 0a 20 20 4c 69 63 65 6e 63 65 20 64 65 73  ic.  Licence des
0130: 63 72 69 62 65 64 20 69 6e 20 74 68 65 20 66 69  cribed in the fi
0140: 6c 65 20 43 4f 50 59 49 4e 47 2e 20 43 6f 6e 74  le COPYING. Cont
0150: 61 63 74 20 74 68 65 20 61 75 74 68 6f 72 20 69  act the author i
0160: 66 0a 20 20 79 6f 75 20 64 6f 6e 27 74 20 68 61  f.  you don't ha
0170: 76 65 20 74 68 69 73 20 6f 72 20 63 61 6e 27 74  ve this or can't
0180: 20 6c 69 76 65 20 77 69 74 68 20 69 74 2e 20 54   live with it. T
0190: 68 65 72 65 20 69 73 20 41 42 53 4f 4c 55 54 45  here is ABSOLUTE
01a0: 4c 59 0a 20 20 4e 4f 20 57 41 52 52 41 4e 54 59  LY.  NO WARRANTY
01b0: 2c 20 65 78 70 6c 69 63 69 74 20 6f 72 20 69 6d  , explicit or im
01c0: 70 6c 69 65 64 2c 20 6f 6e 20 74 68 69 73 20 73  plied, on this s
01d0: 6f 66 74 77 61 72 65 2e 0a 2a 2a 2f 0a 2f 2a 2d  oftware..**/./*-
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 2d 2d  ----------------
0200: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0210: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0220: 2d 2d 2d 2d 2d 0a 0a 20 20 46 6f 72 65 69 67 6e  -----..  Foreign
0230: 20 66 75 6e 63 74 69 6f 6e 20 69 6e 74 65 72 66   function interf
0240: 61 63 65 20 66 6f 72 20 61 6e 20 49 42 4d 20 53  ace for an IBM S
0250: 2f 33 39 30 20 77 69 74 68 20 67 63 63 0a 0a 20  /390 with gcc.. 
0260: 20 54 68 69 73 20 63 61 6c 6c 73 20 61 20 43 20   This calls a C 
0270: 66 75 6e 63 74 69 6f 6e 20 77 69 74 68 20 61 6e  function with an
0280: 20 61 72 67 75 6d 65 6e 74 20 6c 69 73 74 20 62   argument list b
0290: 75 69 6c 74 20 75 70 20 75 73 69 6e 67 20 6d 61  uilt up using ma
02a0: 63 72 6f 73 0a 20 20 64 65 66 69 6e 65 64 20 69  cros.  defined i
02b0: 6e 20 61 76 5f 63 61 6c 6c 2e 68 2e 0a 0a 20 20  n av_call.h...  
02c0: 53 33 39 30 20 41 72 67 75 6d 65 6e 74 20 50 61  S390 Argument Pa
02d0: 73 73 69 6e 67 20 43 6f 6e 76 65 6e 74 69 6f 6e  ssing Convention
02e0: 73 3a 0a 0a 20 20 41 6c 6c 20 61 72 67 75 6d 65  s:..  All argume
02f0: 6e 74 73 2c 20 65 78 63 65 70 74 20 74 68 65 20  nts, except the 
0300: 66 69 72 73 74 20 35 20 77 6f 72 64 73 2c 20 61  first 5 words, a
0310: 72 65 20 70 61 73 73 65 64 20 6f 6e 20 74 68 65  re passed on the
0320: 20 73 74 61 63 6b 20 77 69 74 68 0a 20 20 77 6f   stack with.  wo
0330: 72 64 20 61 6c 69 67 6e 6d 65 6e 74 2e 20 44 6f  rd alignment. Do
0340: 75 62 6c 65 73 20 74 61 6b 65 20 74 77 6f 20 77  ubles take two w
0350: 6f 72 64 73 2e 20 54 68 65 20 66 69 72 73 74 20  ords. The first 
0360: 32 20 64 6f 75 62 6c 65 73 20 61 6e 64 20 66 6c  2 doubles and fl
0370: 6f 61 74 73 0a 20 20 61 72 65 20 61 6c 73 6f 20  oats.  are also 
0380: 70 61 73 73 65 64 20 69 6e 20 66 6c 6f 61 74 69  passed in floati
0390: 6e 67 2d 70 6f 69 6e 74 2d 72 65 67 69 73 74 65  ng-point-registe
03a0: 72 73 2e 0a 20 20 54 6f 20 72 65 74 75 72 6e 20  rs..  To return 
03b0: 61 20 73 74 72 75 63 74 75 72 65 2c 20 74 68 65  a structure, the
03c0: 20 63 61 6c 6c 65 64 20 66 75 6e 63 74 69 6f 6e   called function
03d0: 20 63 6f 70 69 65 73 20 74 68 65 20 76 61 6c 75   copies the valu
03e0: 65 20 74 6f 20 73 70 61 63 65 0a 20 20 70 6f 69  e to space.  poi
03f0: 6e 74 65 64 20 74 6f 20 62 79 20 69 74 73 20 66  nted to by its f
0400: 69 72 73 74 20 61 72 67 75 6d 65 6e 74 2c 20 61  irst argument, a
0410: 6e 64 20 61 6c 6c 20 6f 74 68 65 72 20 61 72 67  nd all other arg
0420: 75 6d 65 6e 74 73 20 61 72 65 20 73 68 69 66 74  uments are shift
0430: 65 64 0a 20 20 64 6f 77 6e 20 62 79 20 6f 6e 65  ed.  down by one
0440: 2e 0a 0a 20 20 43 6f 6d 70 69 6c 65 20 74 68 69  ...  Compile thi
0450: 73 20 72 6f 75 74 69 6e 65 20 77 69 74 68 20 67  s routine with g
0460: 63 63 20 2d 4f 32 20 74 6f 20 67 65 74 20 74 68  cc -O2 to get th
0470: 65 20 72 69 67 68 74 20 72 65 67 69 73 74 65 72  e right register
0480: 20 76 61 72 69 61 62 6c 65 73 2e 0a 20 20 46 6f   variables..  Fo
0490: 72 20 6f 74 68 65 72 20 63 6f 6d 70 69 6c 65 72  r other compiler
04a0: 73 20 75 73 65 20 74 68 65 20 70 72 65 2d 63 6f  s use the pre-co
04b0: 6d 70 69 6c 65 64 20 61 73 73 65 6d 62 6c 65 72  mpiled assembler
04c0: 20 76 65 72 73 69 6f 6e 2e 0a 20 20 2d 2d 2d 2d   version..  ----
04d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
04e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
04f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0500: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0510: 2d 2d 2a 2f 0a 23 69 6e 63 6c 75 64 65 20 22 61  --*/.#include "a
0520: 76 63 61 6c 6c 2e 68 22 0a 0a 23 64 65 66 69 6e  vcall.h"..#defin
0530: 65 20 53 54 41 43 4b 5f 4f 46 46 53 45 54 20 32  e STACK_OFFSET 2
0540: 34 0a 0a 23 64 65 66 69 6e 65 20 52 45 54 55 52  4..#define RETUR
0550: 4e 28 54 59 50 45 2c 56 41 4c 29 09 28 2a 28 54  N(TYPE,VAL).(*(T
0560: 59 50 45 2a 29 6c 2d 3e 72 61 64 64 72 20 3d 20  YPE*)l->raddr = 
0570: 28 54 59 50 45 29 28 56 41 4c 29 29 0a 0a 72 65  (TYPE)(VAL))..re
0580: 67 69 73 74 65 72 20 66 6c 6f 61 74 20 20 66 61  gister float  fa
0590: 72 67 31 09 5f 5f 61 73 6d 5f 5f 28 22 66 30 22  rg1.__asm__("f0"
05a0: 29 3b 0a 72 65 67 69 73 74 65 72 20 66 6c 6f 61  );.register floa
05b0: 74 20 20 66 61 72 67 32 09 5f 5f 61 73 6d 5f 5f  t  farg2.__asm__
05c0: 28 22 66 32 22 29 3b 0a 72 65 67 69 73 74 65 72  ("f2");.register
05d0: 20 64 6f 75 62 6c 65 20 64 61 72 67 31 09 5f 5f   double darg1.__
05e0: 61 73 6d 5f 5f 28 22 66 30 22 29 3b 0a 72 65 67  asm__("f0");.reg
05f0: 69 73 74 65 72 20 64 6f 75 62 6c 65 20 64 61 72  ister double dar
0600: 67 32 09 5f 5f 61 73 6d 5f 5f 28 22 66 32 22 29  g2.__asm__("f2")
0610: 3b 0a 0a 69 6e 74 0a 5f 5f 62 75 69 6c 74 69 6e  ;..int.__builtin
0620: 5f 61 76 63 61 6c 6c 28 61 76 5f 61 6c 69 73 74  _avcall(av_alist
0630: 2a 20 6c 29 0a 7b 0a 20 20 72 65 67 69 73 74 65  * l).{.  registe
0640: 72 20 5f 5f 61 76 77 6f 72 64 2a 09 73 70 09 5f  r __avword*.sp._
0650: 5f 61 73 6d 5f 5f 28 22 72 31 35 22 29 3b 20 20  _asm__("r15");  
0660: 2f 2a 20 43 20 6e 61 6d 65 73 20 66 6f 72 20 72  /* C names for r
0670: 65 67 69 73 74 65 72 73 20 2a 2f 0a 2f 2a 72 65  egisters */./*re
0680: 67 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64 09  gister __avword.
0690: 69 72 65 74 09 5f 5f 61 73 6d 5f 5f 28 22 72 32  iret.__asm__("r2
06a0: 22 29 3b 20 2a 2f 0a 20 20 72 65 67 69 73 74 65  "); */.  registe
06b0: 72 20 5f 5f 61 76 77 6f 72 64 09 69 72 65 74 32  r __avword.iret2
06c0: 09 5f 5f 61 73 6d 5f 5f 28 22 72 33 22 29 3b 0a  .__asm__("r3");.
06d0: 20 20 72 65 67 69 73 74 65 72 20 66 6c 6f 61 74    register float
06e0: 09 66 72 65 74 09 5f 5f 61 73 6d 5f 5f 28 22 66  .fret.__asm__("f
06f0: 30 22 29 3b 0a 20 20 72 65 67 69 73 74 65 72 20  0");.  register 
0700: 64 6f 75 62 6c 65 09 64 72 65 74 09 5f 5f 61 73  double.dret.__as
0710: 6d 5f 5f 28 22 66 30 22 29 3b 0a 0a 20 20 5f 5f  m__("f0");..  __
0720: 61 76 77 6f 72 64 20 73 70 61 63 65 5b 5f 5f 41  avword space[__A
0730: 56 5f 41 4c 49 53 54 5f 57 4f 52 44 53 5d 3b 09  V_ALIST_WORDS];.
0740: 2f 2a 20 73 70 61 63 65 20 66 6f 72 20 63 61 6c  /* space for cal
0750: 6c 65 65 27 73 20 73 74 61 63 6b 20 66 72 61 6d  lee's stack fram
0760: 65 20 2a 2f 0a 20 20 5f 5f 61 76 77 6f 72 64 2a  e */.  __avword*
0770: 20 61 72 67 66 72 61 6d 65 20 3d 20 73 70 20 2b   argframe = sp +
0780: 20 53 54 41 43 4b 5f 4f 46 46 53 45 54 3b 2f 2a   STACK_OFFSET;/*
0790: 20 73 74 61 63 6b 20 6f 66 66 73 65 74 20 66 6f   stack offset fo
07a0: 72 20 61 72 67 75 6d 65 6e 74 20 6c 69 73 74 20  r argument list 
07b0: 2a 2f 0a 20 20 69 6e 74 20 61 72 67 6c 65 6e 20  */.  int arglen 
07c0: 3d 20 6c 2d 3e 61 70 74 72 20 2d 20 6c 2d 3e 61  = l->aptr - l->a
07d0: 72 67 73 3b 0a 20 20 69 6e 74 20 66 61 72 67 6c  rgs;.  int fargl
07e0: 65 6e 20 3d 20 6c 2d 3e 66 61 70 74 72 20 2d 20  en = l->faptr - 
07f0: 6c 2d 3e 66 61 72 67 73 3b 0a 20 20 69 6e 74 20  l->fargs;.  int 
0800: 69 61 72 67 77 6f 72 64 73 20 3d 20 28 61 72 67  iargwords = (arg
0810: 6c 65 6e 2d 6c 2d 3e 66 61 72 67 77 6f 72 64 73  len-l->fargwords
0820: 29 3c 35 3f 61 72 67 6c 65 6e 2d 6c 2d 3e 66 61  )<5?arglen-l->fa
0830: 72 67 77 6f 72 64 73 3a 35 3b 0a 20 20 5f 5f 61  rgwords:5;.  __a
0840: 76 77 6f 72 64 20 69 3b 0a 0a 20 20 66 6f 72 20  vword i;..  for 
0850: 28 69 20 3d 20 69 61 72 67 77 6f 72 64 73 3b 20  (i = iargwords; 
0860: 69 20 3c 20 61 72 67 6c 65 6e 3b 20 69 2b 2b 29  i < arglen; i++)
0870: 20 2f 2a 20 70 75 73 68 20 66 75 6e 63 74 69 6f   /* push functio
0880: 6e 20 61 72 67 73 20 6f 6e 74 6f 20 73 74 61 63  n args onto stac
0890: 6b 20 2a 2f 0a 20 20 20 61 72 67 66 72 61 6d 65  k */.   argframe
08a0: 5b 69 2d 69 61 72 67 77 6f 72 64 73 5d 20 3d 20  [i-iargwords] = 
08b0: 6c 2d 3e 61 72 67 73 5b 69 5d 3b 0a 0a 20 20 2f  l->args[i];..  /
08c0: 2a 20 70 61 73 73 20 66 69 72 73 74 20 32 20 66  * pass first 2 f
08d0: 6c 6f 61 74 69 6e 67 2d 70 6f 69 6e 74 20 61 72  loating-point ar
08e0: 67 73 20 69 6e 20 72 65 67 69 73 74 65 72 73 20  gs in registers 
08f0: 2a 2f 0a 20 20 69 66 20 28 66 61 72 67 6c 65 6e  */.  if (farglen
0900: 20 3d 3d 20 31 29 20 7b 0a 20 20 20 20 69 66 28   == 1) {.    if(
0910: 6c 2d 3e 66 61 72 67 73 75 73 65 64 5b 30 5d 29  l->fargsused[0])
0920: 20 20 66 61 72 67 31 20 3d 20 6c 2d 3e 66 61 72    farg1 = l->far
0930: 67 73 5b 30 5d 3b 20 65 6c 73 65 20 64 61 72 67  gs[0]; else darg
0940: 31 20 3d 20 6c 2d 3e 64 61 72 67 73 5b 30 5d 3b  1 = l->dargs[0];
0950: 0a 20 20 20 7d 0a 20 20 65 6c 73 65 20 69 66 20  .   }.  else if 
0960: 28 66 61 72 67 6c 65 6e 20 3d 3d 20 32 29 20 7b  (farglen == 2) {
0970: 0a 20 20 20 20 69 66 28 6c 2d 3e 66 61 72 67 73  .    if(l->fargs
0980: 75 73 65 64 5b 30 5d 20 26 26 20 6c 2d 3e 66 61  used[0] && l->fa
0990: 72 67 73 75 73 65 64 5b 31 5d 29 20 7b 0a 20 20  rgsused[1]) {.  
09a0: 20 20 20 20 20 66 61 72 67 31 20 3d 20 6c 2d 3e       farg1 = l->
09b0: 66 61 72 67 73 5b 30 5d 3b 20 66 61 72 67 32 20  fargs[0]; farg2 
09c0: 3d 20 6c 2d 3e 66 61 72 67 73 5b 31 5d 3b 0a 20  = l->fargs[1];. 
09d0: 20 20 20 7d 0a 20 20 20 20 65 6c 73 65 20 69 66     }.    else if
09e0: 28 6c 2d 3e 66 61 72 67 73 75 73 65 64 5b 30 5d  (l->fargsused[0]
09f0: 20 26 26 20 21 6c 2d 3e 66 61 72 67 73 75 73 65   && !l->fargsuse
0a00: 64 5b 31 5d 29 20 7b 0a 20 20 20 20 20 20 20 66  d[1]) {.       f
0a10: 61 72 67 31 20 3d 20 6c 2d 3e 66 61 72 67 73 5b  arg1 = l->fargs[
0a20: 30 5d 3b 20 64 61 72 67 32 20 3d 20 6c 2d 3e 64  0]; darg2 = l->d
0a30: 61 72 67 73 5b 31 5d 3b 0a 20 20 20 20 7d 0a 20  args[1];.    }. 
0a40: 20 20 20 65 6c 73 65 20 69 66 28 21 6c 2d 3e 66     else if(!l->f
0a50: 61 72 67 73 75 73 65 64 5b 30 5d 20 26 26 20 6c  argsused[0] && l
0a60: 2d 3e 66 61 72 67 73 75 73 65 64 5b 31 5d 29 20  ->fargsused[1]) 
0a70: 7b 0a 20 20 20 20 20 20 20 64 61 72 67 31 20 3d  {.       darg1 =
0a80: 20 6c 2d 3e 64 61 72 67 73 5b 30 5d 3b 20 66 61   l->dargs[0]; fa
0a90: 72 67 32 20 3d 20 6c 2d 3e 66 61 72 67 73 5b 31  rg2 = l->fargs[1
0aa0: 5d 3b 0a 20 20 20 20 7d 0a 20 20 20 20 65 6c 73  ];.    }.    els
0ab0: 65 20 69 66 28 21 6c 2d 3e 66 61 72 67 73 75 73  e if(!l->fargsus
0ac0: 65 64 5b 30 5d 20 26 26 20 21 6c 2d 3e 66 61 72  ed[0] && !l->far
0ad0: 67 73 75 73 65 64 5b 31 5d 29 20 7b 0a 20 20 20  gsused[1]) {.   
0ae0: 20 20 20 20 64 61 72 67 31 20 3d 20 6c 2d 3e 64      darg1 = l->d
0af0: 61 72 67 73 5b 30 5d 3b 20 64 61 72 67 32 20 3d  args[0]; darg2 =
0b00: 20 6c 2d 3e 64 61 72 67 73 5b 31 5d 3b 0a 20 20   l->dargs[1];.  
0b10: 20 20 7d 0a 20 20 7d 0a 0a 09 09 09 09 2f 2a 20    }.  }....../* 
0b20: 63 61 6c 6c 20 66 75 6e 63 74 69 6f 6e 2c 20 70  call function, p
0b30: 61 73 73 20 35 20 61 72 67 73 20 69 6e 20 72 65  ass 5 args in re
0b40: 67 69 73 74 65 72 73 20 2a 2f 0a 20 20 69 20 3d  gisters */.  i =
0b50: 20 28 2a 6c 2d 3e 66 75 6e 63 29 28 6c 2d 3e 61   (*l->func)(l->a
0b60: 72 67 73 5b 30 5d 2c 20 6c 2d 3e 61 72 67 73 5b  rgs[0], l->args[
0b70: 31 5d 2c 20 6c 2d 3e 61 72 67 73 5b 32 5d 2c 20  1], l->args[2], 
0b80: 6c 2d 3e 61 72 67 73 5b 33 5d 2c 0a 09 09 20 6c  l->args[3],... l
0b90: 2d 3e 61 72 67 73 5b 34 5d 29 3b 0a 0a 20 20 2f  ->args[4]);..  /
0ba0: 2a 20 73 61 76 65 20 72 65 74 75 72 6e 20 76 61  * save return va
0bb0: 6c 75 65 20 2a 2f 0a 20 20 69 66 20 28 6c 2d 3e  lue */.  if (l->
0bc0: 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 76 6f 69  rtype == __AVvoi
0bd0: 64 29 20 7b 0a 20 20 7d 20 65 6c 73 65 0a 20 20  d) {.  } else.  
0be0: 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20  if (l->rtype == 
0bf0: 5f 5f 41 56 77 6f 72 64 29 20 7b 0a 20 20 20 20  __AVword) {.    
0c00: 52 45 54 55 52 4e 28 5f 5f 61 76 77 6f 72 64 2c  RETURN(__avword,
0c10: 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20   i);.  } else.  
0c20: 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20  if (l->rtype == 
0c30: 5f 5f 41 56 63 68 61 72 29 20 7b 0a 20 20 20 20  __AVchar) {.    
0c40: 52 45 54 55 52 4e 28 63 68 61 72 2c 20 69 29 3b  RETURN(char, i);
0c50: 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28  .  } else.  if (
0c60: 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56  l->rtype == __AV
0c70: 73 63 68 61 72 29 20 7b 0a 20 20 20 20 52 45 54  schar) {.    RET
0c80: 55 52 4e 28 73 69 67 6e 65 64 20 63 68 61 72 2c  URN(signed char,
0c90: 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20   i);.  } else.  
0ca0: 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20  if (l->rtype == 
0cb0: 5f 5f 41 56 75 63 68 61 72 29 20 7b 0a 20 20 20  __AVuchar) {.   
0cc0: 20 52 45 54 55 52 4e 28 75 6e 73 69 67 6e 65 64   RETURN(unsigned
0cd0: 20 63 68 61 72 2c 20 69 29 3b 0a 20 20 7d 20 65   char, i);.  } e
0ce0: 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79  lse.  if (l->rty
0cf0: 70 65 20 3d 3d 20 5f 5f 41 56 73 68 6f 72 74 29  pe == __AVshort)
0d00: 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 73 68   {.    RETURN(sh
0d10: 6f 72 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73  ort, i);.  } els
0d20: 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65  e.  if (l->rtype
0d30: 20 3d 3d 20 5f 5f 41 56 75 73 68 6f 72 74 29 20   == __AVushort) 
0d40: 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73  {.    RETURN(uns
0d50: 69 67 6e 65 64 20 73 68 6f 72 74 2c 20 69 29 3b  igned short, i);
0d60: 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28  .  } else.  if (
0d70: 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56  l->rtype == __AV
0d80: 69 6e 74 29 20 7b 0a 20 20 20 20 52 45 54 55 52  int) {.    RETUR
0d90: 4e 28 69 6e 74 2c 20 69 29 3b 0a 20 20 7d 20 65  N(int, i);.  } e
0da0: 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79  lse.  if (l->rty
0db0: 70 65 20 3d 3d 20 5f 5f 41 56 75 69 6e 74 29 20  pe == __AVuint) 
0dc0: 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73  {.    RETURN(uns
0dd0: 69 67 6e 65 64 20 69 6e 74 2c 20 69 29 3b 0a 20  igned int, i);. 
0de0: 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d   } else.  if (l-
0df0: 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 6c 6f  >rtype == __AVlo
0e00: 6e 67 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e  ng) {.    RETURN
0e10: 28 6c 6f 6e 67 2c 20 69 29 3b 0a 20 20 7d 20 65  (long, i);.  } e
0e20: 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79  lse.  if (l->rty
0e30: 70 65 20 3d 3d 20 5f 5f 41 56 75 6c 6f 6e 67 29  pe == __AVulong)
0e40: 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e   {.    RETURN(un
0e50: 73 69 67 6e 65 64 20 6c 6f 6e 67 2c 20 69 29 3b  signed long, i);
0e60: 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28  .  } else.  if (
0e70: 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56  l->rtype == __AV
0e80: 6c 6f 6e 67 6c 6f 6e 67 20 7c 7c 20 6c 2d 3e 72  longlong || l->r
0e90: 74 79 70 65 20 3d 3d 20 5f 5f 41 56 75 6c 6f 6e  type == __AVulon
0ea0: 67 6c 6f 6e 67 29 20 7b 0a 20 20 20 20 28 28 5f  glong) {.    ((_
0eb0: 5f 61 76 77 6f 72 64 2a 29 6c 2d 3e 72 61 64 64  _avword*)l->radd
0ec0: 72 29 5b 30 5d 20 3d 20 69 3b 0a 20 20 20 20 28  r)[0] = i;.    (
0ed0: 28 5f 5f 61 76 77 6f 72 64 2a 29 6c 2d 3e 72 61  (__avword*)l->ra
0ee0: 64 64 72 29 5b 31 5d 20 3d 20 69 72 65 74 32 3b  ddr)[1] = iret2;
0ef0: 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28  .  } else.  if (
0f00: 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56  l->rtype == __AV
0f10: 66 6c 6f 61 74 29 20 7b 0a 20 20 20 20 52 45 54  float) {.    RET
0f20: 55 52 4e 28 66 6c 6f 61 74 2c 20 66 72 65 74 29  URN(float, fret)
0f30: 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20  ;.  } else.  if 
0f40: 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41  (l->rtype == __A
0f50: 56 64 6f 75 62 6c 65 29 20 7b 0a 20 20 20 20 52  Vdouble) {.    R
0f60: 45 54 55 52 4e 28 64 6f 75 62 6c 65 2c 20 64 72  ETURN(double, dr
0f70: 65 74 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20  et);.  } else.  
0f80: 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20  if (l->rtype == 
0f90: 5f 5f 41 56 76 6f 69 64 70 29 20 7b 0a 20 20 20  __AVvoidp) {.   
0fa0: 20 52 45 54 55 52 4e 28 76 6f 69 64 2a 2c 20 69   RETURN(void*, i
0fb0: 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66  );.  } else.  if
0fc0: 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f   (l->rtype == __
0fd0: 41 56 73 74 72 75 63 74 29 20 7b 0a 20 20 20 20  AVstruct) {.    
0fe0: 69 66 20 28 6c 2d 3e 66 6c 61 67 73 20 26 20 5f  if (l->flags & _
0ff0: 5f 41 56 5f 50 43 43 5f 53 54 52 55 43 54 5f 52  _AV_PCC_STRUCT_R
1000: 45 54 55 52 4e 29 20 7b 0a 20 20 20 20 20 20 2f  ETURN) {.      /
1010: 2a 20 70 63 63 20 73 74 72 75 63 74 20 72 65 74  * pcc struct ret
1020: 75 72 6e 20 63 6f 6e 76 65 6e 74 69 6f 6e 3a 20  urn convention: 
1030: 6e 65 65 64 20 61 20 20 2a 28 54 59 50 45 2a 29  need a  *(TYPE*)
1040: 6c 2d 3e 72 61 64 64 72 20 3d 20 2a 28 54 59 50  l->raddr = *(TYP
1050: 45 2a 29 69 3b 20 20 2a 2f 0a 20 20 20 20 20 20  E*)i;  */.      
1060: 69 66 20 28 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20  if (l->rsize == 
1070: 73 69 7a 65 6f 66 28 63 68 61 72 29 29 20 7b 0a  sizeof(char)) {.
1080: 20 20 20 20 20 20 20 20 52 45 54 55 52 4e 28 63          RETURN(c
1090: 68 61 72 2c 20 2a 28 63 68 61 72 2a 29 69 29 3b  har, *(char*)i);
10a0: 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 0a 20 20  .      } else.  
10b0: 20 20 20 20 69 66 20 28 6c 2d 3e 72 73 69 7a 65      if (l->rsize
10c0: 20 3d 3d 20 73 69 7a 65 6f 66 28 73 68 6f 72 74   == sizeof(short
10d0: 29 29 20 7b 0a 20 20 20 20 20 20 20 20 52 45 54  )) {.        RET
10e0: 55 52 4e 28 73 68 6f 72 74 2c 20 2a 28 73 68 6f  URN(short, *(sho
10f0: 72 74 2a 29 69 29 3b 0a 20 20 20 20 20 20 7d 20  rt*)i);.      } 
1100: 65 6c 73 65 0a 20 20 20 20 20 20 69 66 20 28 6c  else.      if (l
1110: 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65 6f  ->rsize == sizeo
1120: 66 28 69 6e 74 29 29 20 7b 0a 20 20 20 20 20 20  f(int)) {.      
1130: 20 20 52 45 54 55 52 4e 28 69 6e 74 2c 20 2a 28    RETURN(int, *(
1140: 69 6e 74 2a 29 69 29 3b 0a 20 20 20 20 20 20 7d  int*)i);.      }
1150: 20 65 6c 73 65 0a 20 20 20 20 20 20 69 66 20 28   else.      if (
1160: 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65  l->rsize == size
1170: 6f 66 28 64 6f 75 62 6c 65 29 29 20 7b 0a 20 20  of(double)) {.  
1180: 20 20 20 20 20 20 28 28 69 6e 74 2a 29 6c 2d 3e        ((int*)l->
1190: 72 61 64 64 72 29 5b 30 5d 20 3d 20 28 28 69 6e  raddr)[0] = ((in
11a0: 74 2a 29 69 29 5b 30 5d 3b 0a 20 20 20 20 20 20  t*)i)[0];.      
11b0: 20 20 28 28 69 6e 74 2a 29 6c 2d 3e 72 61 64 64    ((int*)l->radd
11c0: 72 29 5b 31 5d 20 3d 20 28 28 69 6e 74 2a 29 69  r)[1] = ((int*)i
11d0: 29 5b 31 5d 3b 0a 20 20 20 20 20 20 7d 20 65 6c  )[1];.      } el
11e0: 73 65 20 7b 0a 20 20 20 20 20 20 20 20 69 6e 74  se {.        int
11f0: 20 6e 20 3d 20 28 6c 2d 3e 72 73 69 7a 65 20 2b   n = (l->rsize +
1200: 20 73 69 7a 65 6f 66 28 5f 5f 61 76 77 6f 72 64   sizeof(__avword
1210: 29 2d 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 61 76  )-1)/sizeof(__av
1220: 77 6f 72 64 29 3b 0a 20 20 20 20 20 20 20 20 77  word);.        w
1230: 68 69 6c 65 20 28 2d 2d 6e 20 3e 3d 20 30 29 0a  hile (--n >= 0).
1240: 20 20 20 20 20 20 20 20 20 20 28 28 5f 5f 61 76            ((__av
1250: 77 6f 72 64 2a 29 6c 2d 3e 72 61 64 64 72 29 5b  word*)l->raddr)[
1260: 6e 5d 20 3d 20 28 28 5f 5f 61 76 77 6f 72 64 2a  n] = ((__avword*
1270: 29 69 29 5b 6e 5d 3b 0a 20 20 20 20 20 20 7d 0a  )i)[n];.      }.
1280: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20      } else {.   
1290: 20 20 20 2f 2a 20 6e 6f 72 6d 61 6c 20 73 74 72     /* normal str
12a0: 75 63 74 20 72 65 74 75 72 6e 20 63 6f 6e 76 65  uct return conve
12b0: 6e 74 69 6f 6e 20 2a 2f 0a 20 20 20 20 20 20 69  ntion */.      i
12c0: 66 20 28 6c 2d 3e 66 6c 61 67 73 20 26 20 5f 5f  f (l->flags & __
12d0: 41 56 5f 52 45 47 49 53 54 45 52 5f 53 54 52 55  AV_REGISTER_STRU
12e0: 43 54 5f 52 45 54 55 52 4e 29 20 7b 0a 20 20 20  CT_RETURN) {.   
12f0: 20 20 20 20 20 69 66 20 28 6c 2d 3e 72 73 69 7a       if (l->rsiz
1300: 65 20 3d 3d 20 73 69 7a 65 6f 66 28 63 68 61 72  e == sizeof(char
1310: 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 52  )) {.          R
1320: 45 54 55 52 4e 28 63 68 61 72 2c 20 69 29 3b 0a  ETURN(char, i);.
1330: 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 0a 20          } else. 
1340: 20 20 20 20 20 20 20 69 66 20 28 6c 2d 3e 72 73         if (l->rs
1350: 69 7a 65 20 3d 3d 20 73 69 7a 65 6f 66 28 73 68  ize == sizeof(sh
1360: 6f 72 74 29 29 20 7b 0a 20 20 20 20 20 20 20 20  ort)) {.        
1370: 20 20 52 45 54 55 52 4e 28 73 68 6f 72 74 2c 20    RETURN(short, 
1380: 69 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 6c  i);.        } el
1390: 73 65 0a 20 20 20 20 20 20 20 20 69 66 20 28 6c  se.        if (l
13a0: 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65 6f  ->rsize == sizeo
13b0: 66 28 69 6e 74 29 29 20 7b 0a 20 20 20 20 20 20  f(int)) {.      
13c0: 20 20 20 20 52 45 54 55 52 4e 28 69 6e 74 2c 20      RETURN(int, 
13d0: 69 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 6c  i);.        } el
13e0: 73 65 0a 20 20 20 20 20 20 20 20 69 66 20 28 6c  se.        if (l
13f0: 2d 3e 72 73 69 7a 65 20 3d 3d 20 32 2a 73 69 7a  ->rsize == 2*siz
1400: 65 6f 66 28 5f 5f 61 76 77 6f 72 64 29 29 20 7b  eof(__avword)) {
1410: 0a 20 20 20 20 20 20 20 20 20 20 28 28 5f 5f 61  .          ((__a
1420: 76 77 6f 72 64 2a 29 6c 2d 3e 72 61 64 64 72 29  vword*)l->raddr)
1430: 5b 30 5d 20 3d 20 69 3b 0a 20 20 20 20 20 20 20  [0] = i;.       
1440: 20 20 20 28 28 5f 5f 61 76 77 6f 72 64 2a 29 6c     ((__avword*)l
1450: 2d 3e 72 61 64 64 72 29 5b 31 5d 20 3d 20 69 72  ->raddr)[1] = ir
1460: 65 74 32 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20  et2;.        }. 
1470: 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 20 20 7d       }.    }.  }
1480: 0a 20 20 72 65 74 75 72 6e 20 30 3b 0a 7d 0a 0a  .  return 0;.}..
1490: 23 65 6e 64 69 66 20 2f 2a 5f 61 76 63 61 6c 6c  #endif /*_avcall
14a0: 5f 73 33 39 30 5f 63 20 2a 2f 0a                 _s390_c */.