Affix

 view release on metacpan or  search on metacpan

dyncall/buildsys/cmake/Modules/UseLATEX.cmake  view on Meta::CPAN

# 1.5.0 Allow any type of file in the INPUTS lists, not just tex file
#       (suggested by Eric Noulard).  As a consequence, the ability to
#       specify tex files without the .tex extension is removed.  The removed
#       function is of dubious value anyway.
#
#       When copying input files, skip over any file that exists in the
#       binary directory but does not exist in the source directory with the
#       assumption that these files were added by some other mechanism.  I
#       find this useful when creating large documents with multiple
#       chapters that I want to build separately (for speed) as I work on
#       them.  I use the same boilerplate as the starting point for all
#       and just copy it with different configurations.  This was what the
#       separate ADD_LATEX_DOCUMENT method was supposed to originally be for.
#       Since its external use is pretty much deprecated, I removed that
#       documentation.
#
# 1.4.1 Copy .sty files along with the other class and package files.
#
# 1.4.0 Added a MANGLE_TARGET_NAMES option that will mangle the target names.
#
#       Fixed problem with copying bib files that became apparent with

dyncall/doc/disas_examples/arm.armhf.disas  view on Meta::CPAN

  28:   e92d4800        push    {fp, lr}          ; |
  2c:   e28db004        add     fp, sp, #4        ; | prolog
  30:   e24dd020        sub     sp, sp, #32       ; |
  34:   e50b0008        str     r0, [fp, #-8]     ; in arg 0 -> temp space in local area
  38:   e50b100c        str     r1, [fp, #-12]    ; in arg 1 -> temp space in local area
  3c:   e50b2010        str     r2, [fp, #-16]    ; in arg 2 -> temp space in local area
  40:   e50b3014        str     r3, [fp, #-20]    ; in arg 3 -> temp space in local area
  44:   e24dd0e8        sub     sp, sp, #232      ; alloca(220) - with padding to guarantee alignment
  48:   e28d3010        add     r3, sp, #16       ; |
  4c:   e2833007        add     r3, r3, #7        ; |
  50:   e1a031a3        lsr     r3, r3, #3        ; | start of (aligned) alloca()'d memory -> r3, leaving room at top of stack for param area
  54:   e1a03183        lsl     r3, r3, #3        ; |
  58:   e3a0204c        mov     r2, #76           ; 'L' -> r2, and ...
  5c:   e5c32000        strb    r2, [r3]          ; ... store in local area (of alloca()'d space) 
  60:   e59b3008        ldr     r3, [fp, #8]      ; arg 4 (fetched from prev frame's param area), and ...
  64:   e58d3000        str     r3, [sp]          ; ... "pushed" onto stack
  68:   e59b300c        ldr     r3, [fp, #12]     ; arg 5 (fetched from prev frame's param area), and ...
  6c:   e58d3004        str     r3, [sp, #4]      ; ... "pushed" onto stack
  70:   e59b3010        ldr     r3, [fp, #16]     ; arg 6 (fetched from prev frame's param area), and ...
  74:   e58d3008        str     r3, [sp, #8]      ; ... "pushed" onto stack
  78:   e51b000c        ldr     r0, [fp, #-12]    ; arg 0

dyncall/doc/disas_examples/arm.atpcs_arm.disas  view on Meta::CPAN

  30:   e24cb004        sub     fp, ip, #4             ; | prolog
  34:   e24dd020        sub     sp, sp, #32            ; |
  38:   e50b0010        str     r0, [fp, #-16]         ; in arg 0 -> temp space in local area
  3c:   e50b1014        str     r1, [fp, #-20]         ; in arg 1 -> temp space in local area
  40:   e50b2018        str     r2, [fp, #-24]         ; in arg 2 -> temp space in local area
  44:   e50b301c        str     r3, [fp, #-28]         ; in arg 3 -> temp space in local area
  48:   e24dd0e0        sub     sp, sp, #224           ; alloca(220) - with padding to guarantee alignment
  4c:   e28d200c        add     r2, sp, #12            ; |
  50:   e50b2020        str     r2, [fp, #-32]         ; |        @@@ pointless push of r2 to local area to put it back ...
  54:   e51b2020        ldr     r2, [fp, #-32]         ; |        @@@ ... into r2
  58:   e2823003        add     r3, r2, #3             ; | start of (aligned) alloca()'d memory -> r3, leaving room at top of stack for param area
  5c:   e1a03123        mov     r3, r3, lsr #2         ; |
  60:   e1a03103        mov     r3, r3, lsl #2         ; /
  64:   e50b3020        str     r3, [fp, #-32]         ; \
  68:   e51b2020        ldr     r2, [fp, #-32]         ; | r2 -> r3, to free r2 (kinda pointless as followup code could use r2 and r3 the other way round)
  6c:   e3a0304c        mov     r3, #76                ; 'L' -> r3, and ...
  70:   e5c23000        strb    r3, [r2]               ; ... store in local area (of alloca()'d space)
  74:   e59b3008        ldr     r3, [fp, #8]           ; arg 4 (fetched from prev frame's param area), and ...
  78:   e58d3000        str     r3, [sp]               ; ... "pushed" onto stack
  7c:   e59b300c        ldr     r3, [fp, #12]          ; arg 5 (fetched from prev frame's param area), and ...
  80:   e58d3004        str     r3, [sp, #4]           ; ... "pushed" onto stack

dyncall/doc/disas_examples/arm.darwin_arm.disas  view on Meta::CPAN

; #include <stdarg.h>
;
; void leaf_call(int b, int c, int d, int e, int f, int g, int h)
; {
; }
;
; void nonleaf_call(int a, ...)
; {
; 	int b,c,d,e,f,g,h;
; 	va_list ap;
; 	va_start(ap,a);
; 	b = va_arg(ap,int);
; 	c = va_arg(ap,int);
; 	d = va_arg(ap,int);
; 	e = va_arg(ap,int);
; 	f = va_arg(ap,int);
; 	g = va_arg(ap,int);
; 	h = va_arg(ap,int);
; 	/* use some local data */
; 	char x = 'L';
; 	leaf_call(b,c,d,e,f,g,h);

dyncall/doc/disas_examples/arm.darwin_thumb.disas  view on Meta::CPAN

; #include <stdarg.h>
;
; void leaf_call(int b, int c, int d, int e, int f, int g, int h)
; {
; }
;
; void nonleaf_call(int a, ...)
; {
; 	int b,c,d,e,f,g,h;
; 	va_list ap;
; 	va_start(ap,a);
; 	b = va_arg(ap,int);
; 	c = va_arg(ap,int);
; 	d = va_arg(ap,int);
; 	e = va_arg(ap,int);
; 	f = va_arg(ap,int);
; 	g = va_arg(ap,int);
; 	h = va_arg(ap,int);
; 	/* use some local data */
; 	char x = 'L';
; 	leaf_call(b,c,d,e,f,g,h);

dyncall/doc/disas_examples/arm64.aapcs.disas  view on Meta::CPAN

; #include <stdarg.h>
;
; void leaf_call(int b, int c, int d, int e, int f, int g, int h, int i, int j)
; {
; }
;
; void nonleaf_call(int a, ...)
; {
;     int b,c,d,e,f,g,h,i,j;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = va_arg(ap, int);
;     g = va_arg(ap, int);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = va_arg(ap, int);
;

dyncall/doc/disas_examples/arm64.aapcs.disas  view on Meta::CPAN

;
; void leaf_call(int b, int c, int d, int e, float f, int g, int h, int i, int j)
; {
; }
;
; void nonleaf_call(int a, ...)
; {
;     int b,c,d,e,g,h,i,j;
;     float f;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = va_arg(ap, float);
;     g = va_arg(ap, int);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = va_arg(ap, int);
;

dyncall/doc/disas_examples/arm64.aapcs.disas  view on Meta::CPAN

       c:       08 01 00 91     add     x8, x8, #0          ; addr offset (pointless)
      10:       e2 03 40 b2     orr     x2, xzr, #0x1       ; @@@ unsure, #1 -> x2
      14:       e9 3f 00 91     add     x9, sp, #15         ; addr to #132 -> x9 @@@?
      18:       e0 03 09 aa     mov     x0, x9              ; @@@ unsure
      1c:       e1 03 08 aa     mov     x1, x8              ; @@@ unsure
      20:       e9 03 00 f9     str     x9, [sp]            ; store addr to #132 to top of stack
      24:       00 00 00 94     bl      #0 <f0+0x24>        ; @@@unsure
      28:       e8 03 40 f9     ldr     x8, [sp]            ; *sp -> x8
      2c:       0a 01 40 39     ldrb    w10, [x8]           ; *x8 -> w10
      30:       e9 03 0a 2a     mov     w9, w10             ; w10 -> w9
      34:       20 1d 40 d3     ubfx    x0, x9, #0, #8      ; return value ("Unsigned Bit Field Extract", copy 8 bits from x9's LSBits starting at bit 0 to x0, and zero extend; = struct in reg)
      38:       fe 0b 40 f9     ldr     x30, [sp, #16]      ; |
      3c:       ff 83 00 91     add     sp, sp, #32         ; | epilog
      40:       c0 03 5f d6     ret                         ; |

0000000000000044 f1:
      44:       ff 03 01 d1     sub     sp, sp, #64         ; |
      48:       fe 1b 00 f9     str     x30, [sp, #48]      ; | prolog
      4c:       09 00 80 52     mov     w9, #0              ; @@@ unsure
      50:       02 05 80 d2     mov     x2, #40             ; @@@ unsure
      54:       6a 80 83 d2     mov     x10, #7171          ; |                                i

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

  28:   03c0e821        move    sp,s8
  2c:   8fbe0024        lw      s8,36(sp)
  30:   27bd0028        addiu   sp,sp,40
  34:   03e00008        jr      ra
  38:   00000000        nop

0000003c <nonleaf_call>:
  3c:   27bdffd8        addiu   sp,sp,-40     ; |
  40:   afbf0024        sw      ra,36(sp)     ; |
  44:   afbe0020        sw      s8,32(sp)     ; | prolog
  48:   03a0f021        move    s8,sp         ; /         frame pointer (note: with offset to frame start, but static compared to sp)
  4c:   afc40000        sw      a0,0(s8)      ; \
  50:   afc50004        sw      a1,4(s8)      ; |
  54:   afc60008        sw      a2,8(s8)      ; |
  58:   afc7000c        sw      a3,12(s8)     ; |
  5c:   afc80010        sw      t0,16(s8)     ; | in args 0,1,2,3,4,5,6,7 -> temp space in local area
  60:   afc90014        sw      t1,20(s8)     ; |
  64:   afca0018        sw      t2,24(s8)     ; |
  68:   afcb001c        sw      t3,28(s8)     ; |
  6c:   27bdff18        addiu   sp,sp,-232    ; alloca(220) - with padding to guarantee alignment
  70:   03a01021        move    v0,sp         ; |
  74:   24420007        addiu   v0,v0,7       ; |
  78:   000210c2        srl     v0,v0,0x3     ; | start of alloca()'d memory -> v1, by ...
  7c:   000210c0        sll     v0,v0,0x3     ; | ... using v0 as helper to align to 8b
  80:   00401821        move    v1,v0         ; |
  84:   2402004c        li      v0,76         ; 'L' -> v0, and...
  88:   a0620000        sb      v0,0(v1)      ; ... store in local area (of alloca()'d space)
  8c:   8fc40004        lw      a0,4(s8)      ; |
  90:   8fc50008        lw      a1,8(s8)      ; |
  94:   8fc6000c        lw      a2,12(s8)     ; |
  98:   8fc70010        lw      a3,16(s8)     ; | arg 0,1,2,3,4,5,6 (fetched from local area stored to above)
  9c:   8fc80014        lw      t0,20(s8)     ; |       (t0 = a4)
  a0:   8fc90018        lw      t1,24(s8)     ; |       (t1 = a5)

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

  b4:   8fbf0024        lw      ra,36(sp)     ; |
  b8:   8fbe0020        lw      s8,32(sp)     ; |
  bc:   27bd0028        addiu   sp,sp,40      ; | epilog
  c0:   03e00008        jr      ra            ; |
  c4:   00000000        nop                   ; |       branch delay slot

000000c8 <main>:
  c8:   27bdfff8        addiu   sp,sp,-8      ; |
  cc:   afbf0004        sw      ra,4(sp)      ; |
  d0:   afbe0000        sw      s8,0(sp)      ; | prolog
  d4:   03a0f021        move    s8,sp         ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  d8:   00002021        move    a0,zero       ; arg 0
  dc:   24050001        li      a1,1          ; arg 1
  e0:   24060002        li      a2,2          ; arg 2
  e4:   24070003        li      a3,3          ; arg 3
  e8:   24080004        li      t0,4          ; arg 4 (t0 = a4)
  ec:   24090005        li      t1,5          ; arg 5 (t1 = a5)
  f0:   240a0006        li      t2,6          ; arg 6 (t2 = a6)
  f4:   240b0007        li      t3,7          ; arg 7 (t3 = a7)
  f8:   0c000000        jal     0 <leaf_call> ; call and ret addr -> ra
  fc:   00000000        nop                   ; branch delay slot

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

  2c:   03c0e821        move    sp,s8
  30:   8fbe0024        lw      s8,36(sp)
  34:   27bd0028        addiu   sp,sp,40
  38:   03e00008        jr      ra
  3c:   00000000        nop

00000040 <nonleaf_call>:
  40:   27bdffd0        addiu   sp,sp,-48     ; |
  44:   afbf002c        sw      ra,44(sp)     ; |
  48:   afbe0028        sw      s8,40(sp)     ; | prolog
  4c:   03a0f021        move    s8,sp         ; /         frame pointer (note: with offset to frame start, but static compared to sp)
  50:   afc40008        sw      a0,8(s8)      ; \
  54:   afc5000c        sw      a1,12(s8)     ; |
  58:   afc60010        sw      a2,16(s8)     ; |
  5c:   afc70014        sw      a3,20(s8)     ; |
  60:   afc80018        sw      t0,24(s8)     ; | in args 0,1,2,3,4,5,6,7 -> temp space in local area
  64:   afc9001c        sw      t1,28(s8)     ; |
  68:   afca0020        sw      t2,32(s8)     ; |
  6c:   afcb0024        sw      t3,36(s8)     ; |
  70:   27bdff18        addiu   sp,sp,-232    ; alloca(220) - with padding to guarantee alignment
  74:   27a20008        addiu   v0,sp,8       ; |
  78:   24420007        addiu   v0,v0,7       ; |
  7c:   000210c2        srl     v0,v0,0x3     ; | start of alloca()'d memory -> v1, by ...
  80:   000210c0        sll     v0,v0,0x3     ; | ... using v0 as helper to align to 8b
  84:   00401821        move    v1,v0         ; |
  88:   2402004c        li      v0,76         ; 'L' -> v0, and...
  8c:   a0620000        sb      v0,0(v1)      ; ... store in local area (of alloca()'d space)
  90:   8fc20034        lw      v0,52(s8)     ; arg 8 (fetched from prev frame's param area), and ...
  94:   afa20000        sw      v0,0(sp)      ; ... "pushed" onto stack
  98:   8fc4000c        lw      a0,12(s8)     ; |
  9c:   8fc50010        lw      a1,16(s8)     ; |
  a0:   8fc60014        lw      a2,20(s8)     ; |
  a4:   8fc70018        lw      a3,24(s8)     ; | arg 0,1,2,3,4,5,6 (fetched from local area stored to above)

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

  c4:   8fbf002c        lw      ra,44(sp)     ; |
  c8:   8fbe0028        lw      s8,40(sp)     ; |
  cc:   27bd0030        addiu   sp,sp,48      ; | epilog
  d0:   03e00008        jr      ra            ; |
  d4:   00000000        nop                   ; |       branch delay slot

000000d8 <main>:
  d8:   27bdfff0        addiu   sp,sp,-16     ; |
  dc:   afbf000c        sw      ra,12(sp)     ; |
  e0:   afbe0008        sw      s8,8(sp)      ; | prolog
  e4:   03a0f021        move    s8,sp         ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  e8:   24020008        li      v0,8          ; arg 8
  ec:   afa20000        sw      v0,0(sp)      ; ... "pushed" onto stack
  f0:   24020009        li      v0,9          ; arg 9
  f4:   afa20004        sw      v0,4(sp)      ; ... "pushed" onto stack
  f8:   00002021        move    a0,zero       ; arg 0
  fc:   24050001        li      a1,1          ; arg 1
 100:   24060002        li      a2,2          ; arg 2
 104:   24070003        li      a3,3          ; arg 3
 108:   24080004        li      t0,4          ; arg 4 (t0 = a4)
 10c:   24090005        li      t1,5          ; arg 5 (t1 = a5)

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

; #include <stdarg.h>
; 
; void leaf_call(int b, int c, int d, int e, int f, int g, int h, int i, int j)
; {
; }
; 
; void nonleaf_call(int a, ...)
; {
;     int b, c, d, e, f, g, h, i, j;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = va_arg(ap, int);
;     g = va_arg(ap, int);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = va_arg(ap, int);
;     /* use some local data */

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

  2c:   03c0e821        move    sp,s8
  30:   8fbe0024        lw      s8,36(sp)
  34:   27bd0028        addiu   sp,sp,40
  38:   03e00008        jr      ra
  3c:   00000000        nop

00000040 <nonleaf_call>:
  40:   27bdffa0        addiu   sp,sp,-96     ; |         leaving 32b extra space adjacent to prev frame's param area for spilling
  44:   afbf003c        sw      ra,60(sp)     ; |
  48:   afbe0038        sw      s8,56(sp)     ; | prolog
  4c:   03a0f021        move    s8,sp         ; /         frame pointer (note: with offset to frame start, but static compared to sp)
  50:   afc50044        sw      a1,68(s8)     ; \
  54:   afc60048        sw      a2,72(s8)     ; |
  58:   afc7004c        sw      a3,76(s8)     ; |
  5c:   afc80050        sw      t0,80(s8)     ; | in args 1,2,3,4,5,6,7 -> spill area in current frame (adjacent to prev frame's param area)
  60:   afc90054        sw      t1,84(s8)     ; |
  64:   afca0058        sw      t2,88(s8)     ; |
  68:   afcb005c        sw      t3,92(s8)     ; |
  6c:   afc40030        sw      a0,48(s8)     ; in arg 0 -> temp space in local area
  70:   27c20060        addiu   v0,s8,96      ; v0 initialized to point ...
  74:   2442ffe4        addiu   v0,v0,-28     ; ... to start of spill area (96 - 28 = 68, where we spilled a1)
  78:   afc2002c        sw      v0,44(s8)     ; store read ptr in local area
  7c:   8fc2002c        lw      v0,44(s8)     ; |            get read pointer in v0 (pointless here, but part of following pattern) ...
  80:   24430004        addiu   v1,v0,4       ; |            ... advance ...
  84:   afc3002c        sw      v1,44(s8)     ; | in arg 1   ... store again ...
  88:   8c420000        lw      v0,0(v0)      ; |            ... arg -> v0 (using pre-inc read location), then ...
  8c:   afc20008        sw      v0,8(s8)      ; /            ... write to local area on stack for later
  90:   8fc2002c        lw      v0,44(s8)     ; \
  94:   24430004        addiu   v1,v0,4       ; |
  98:   afc3002c        sw      v1,44(s8)     ; | in arg 2
  9c:   8c420000        lw      v0,0(v0)      ; |

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

 114:   8c420000        lw      v0,0(v0)      ; |
 118:   afc20024        sw      v0,36(s8)     ; /
 11c:   8fc2002c        lw      v0,44(s8)     ; \
 120:   24430004        addiu   v1,v0,4       ; |
 124:   afc3002c        sw      v1,44(s8)     ; | in arg 9
 128:   8c420000        lw      v0,0(v0)      ; |
 12c:   afc20028        sw      v0,40(s8)     ; /
 130:   27bdff18        addiu   sp,sp,-232    ; alloca(220) - with padding to guarantee alignment
 134:   27a20008        addiu   v0,sp,8       ; |
 138:   24420007        addiu   v0,v0,7       ; |
 13c:   000210c2        srl     v0,v0,0x3     ; | start of alloca()'d memory -> v1, by ...
 140:   000210c0        sll     v0,v0,0x3     ; | ... using v0 as helper to align to 8b
 144:   00401821        move    v1,v0         ; |
 148:   2402004c        li      v0,76         ; 'L' -> v0, and...
 14c:   a0620000        sb      v0,0(v1)      ; ... store in local area (of alloca()'d space)
 150:   8fc20028        lw      v0,40(s8)     ; arg 8 (fetched from local area stored to above) and ...
 154:   afa20000        sw      v0,0(sp)      ; ... "pushed" onto stack
 158:   8fc40008        lw      a0,8(s8)      ; |
 15c:   8fc5000c        lw      a1,12(s8)     ; |
 160:   8fc60010        lw      a2,16(s8)     ; |
 164:   8fc70014        lw      a3,20(s8)     ; | arg 0,1,2,3,4,5,6 (fetched from local area stored to above)

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

 184:   8fbf003c        lw      ra,60(sp)     ; |
 188:   8fbe0038        lw      s8,56(sp)     ; |
 18c:   27bd0060        addiu   sp,sp,96      ; | epilog
 190:   03e00008        jr      ra            ; |
 194:   00000000        nop                     |       branch delay slot

00000198 <main>:
 198:   27bdfff0        addiu   sp,sp,-16     ; |
 19c:   afbf000c        sw      ra,12(sp)     ; |
 1a0:   afbe0008        sw      s8,8(sp)      ; | prolog
 1a4:   03a0f021        move    s8,sp         ; |         frame pointer (note: with offset to frame start, but static compared to sp)
 1a8:   24020008        li      v0,8          ; arg 8
 1ac:   afa20000        sw      v0,0(sp)      ; ... "pushed" onto stack
 1b0:   24020009        li      v0,9          ; arg 9
 1b4:   afa20004        sw      v0,4(sp)      ; ... "pushed" onto stack
 1b8:   00002021        move    a0,zero       ; arg 0
 1bc:   24050001        li      a1,1          ; arg 1
 1c0:   24060002        li      a2,2          ; arg 2
 1c4:   24070003        li      a3,3          ; arg 3
 1c8:   24080004        li      t0,4          ; arg 4 (t0 = a4)
 1cc:   24090005        li      t1,5          ; arg 5 (t1 = a5)

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

; 
; void leaf_call(int b, int c, int d, int e, float f, float g, int h, int i, float j)
; {
; }
; 
; void nonleaf_call(int a, ...)
; {
;     int b, c, d, e, h, i;
;     float f, g, j;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = (float)va_arg(ap, double);
;     g = (float)va_arg(ap, double);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = (float)va_arg(ap, double);
;     /* use some local data */

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

  30:   03c0e821        move    sp,s8
  34:   8fbe002c        lw      s8,44(sp)
  38:   27bd0030        addiu   sp,sp,48
  3c:   03e00008        jr      ra
  40:   00000000        nop

00000044 <nonleaf_call>:
  44:   27bdffa8        addiu   sp,sp,-88     ; |         leaving 32b extra space adjacent to prev frame's param area for spilling
  48:   afbf0034        sw      ra,52(sp)     ; |
  4c:   afbe0030        sw      s8,48(sp)     ; | prolog
  50:   03a0f021        move    s8,sp         ; /         frame pointer (note: with offset to frame start, but static compared to sp)
  54:   afc5003c        sw      a1,60(s8)     ; \
  58:   afc60040        sw      a2,64(s8)     ; |
  5c:   afc70044        sw      a3,68(s8)     ; |
  60:   afc80048        sw      t0,72(s8)     ; | in args 1,2,3,4,5 (spread out over 7 param regs) -> spill area in current frame (adjacent to prev frame's param area)
  64:   afc9004c        sw      t1,76(s8)     ; |            this one is just padding
  68:   afca0050        sw      t2,80(s8)     ; |            |
  6c:   afcb0054        sw      t3,84(s8)     ; |            | this is arg 5, passed as a double, spilled like integers
  70:   afc40028        sw      a0,40(s8)     ; in arg 0 -> temp space in local area
  74:   27c20058        addiu   v0,s8,88      ; v0 initialized to point ...
  78:   2442ffe4        addiu   v0,v0,-28     ; ... to start of spill area (88 - 28 = 60, where we spilled a1)
  7c:   afc20024        sw      v0,36(s8)     ; store read ptr in local area
  80:   8fc20024        lw      v0,36(s8)     ; |            get read pointer in v0 (pointless here, but part of following pattern) ...
  84:   24430004        addiu   v1,v0,4       ; |            ... advance ...
  88:   afc30024        sw      v1,36(s8)     ; | in arg 1   ... store again ...
  8c:   8c420000        lw      v0,0(v0)      ; |            ... arg -> v0 (using pre-inc read location), then ...
  90:   afc20000        sw      v0,0(s8)      ; /            ... write to local area on stack for later
  94:   8fc20024        lw      v0,36(s8)     ; \
  98:   24430004        addiu   v1,v0,4       ; |
  9c:   afc30024        sw      v1,36(s8)     ; | in arg 2
  a0:   8c420000        lw      v0,0(v0)      ; |

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

 178:   8c430004        lw      v1,4(v0)      ; | in arg 9
 17c:   8c420000        lw      v0,0(v0)      ; |
 180:   00402021        move    a0,v0         ; |
 184:   00602821        move    a1,v1         ; |
 188:   0c000000        jal     0 <leaf_call> ; |
 18c:   00000000        nop                   ; |
 190:   e7c00020        swc1    $f0,32(s8)    ; /
 194:   27bdff18        addiu   sp,sp,-232    ; alloca(220) - with padding to guarantee alignment
 198:   03a01021        move    v0,sp         ; |
 19c:   24420007        addiu   v0,v0,7       ; |
 1a0:   000210c2        srl     v0,v0,0x3     ; | start of alloca()'d memory -> v1, by ...
 1a4:   000210c0        sll     v0,v0,0x3     ; | ... using v0 as helper to align to 8b
 1a8:   00401821        move    v1,v0         ; |
 1ac:   2402004c        li      v0,76         ; 'L' -> v0, and...
 1b0:   a0620000        sb      v0,0(v1)      ; ... store in local area (of alloca()'d space)
 1b4:   8fc40000        lw      a0,0(s8)      ; |
 1b8:   8fc50004        lw      a1,4(s8)      ; |
 1bc:   8fc60008        lw      a2,8(s8)      ; | arg 0,1,2,3 (int args, fetched from local area stored to above)
 1c0:   8fc7000c        lw      a3,12(s8)     ; |
 1c4:   c7cc0010        lwc1    $f12,16(s8)   ; arg 4 (float, fetched from local area stored to above)
 1c8:   c7cd0014        lwc1    $f13,20(s8)   ; arg 5 (float, fetched from local area stored to above)

dyncall/doc/disas_examples/mips.eabi.disas  view on Meta::CPAN

 1e4:   8fbf0034        lw      ra,52(sp)     ; |
 1e8:   8fbe0030        lw      s8,48(sp)     ; |
 1ec:   27bd0058        addiu   sp,sp,88      ; | epilog
 1f0:   03e00008        jr      ra            ; |
 1f4:   00000000        nop                   ; |       branch delay slot

000001f8 <main>:
 1f8:   27bdffe0        addiu   sp,sp,-32     ; |
 1fc:   afbf001c        sw      ra,28(sp)     ; |
 200:   afbe0018        sw      s8,24(sp)     ; | prolog
 204:   03a0f021        move    s8,sp         ; /         frame pointer (note: with offset to frame start, but static compared to sp)
 208:   8f8a0000        lw      t2,0(gp)      ; \
 20c:   8f8b0004        lw      t3,4(gp)      ; / arg 5 (t1,t2 = a4,a5), as double b/c of vararg, effectively skipping t1 (=a5)
 210:   8f820008        lw      v0,8(gp)      ; \
 214:   8f83000c        lw      v1,12(gp)     ; | arg 6, as double b/c of vararg, via v0 and v1 ...
 218:   afa20000        sw      v0,0(sp)      ; |
 21c:   afa30004        sw      v1,4(sp)      ; | ... "pushed" onto stack
 220:   24020007        li      v0,7          ; arg 7
 224:   afa20008        sw      v0,8(sp)      ; ... "pushed" onto stack
 228:   24020008        li      v0,8          ; arg 8
 22c:   afa2000c        sw      v0,12(sp)     ; ... "pushed" onto stack

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  30:   03e00008        jr      ra
  34:   27bd0008        addiu   sp,sp,8

00000038 <nonleaf_call>:
  38:   3c1c0000        lui     gp,0x0     ; |
  3c:   279c0000        addiu   gp,gp,0    ; |
  40:   0399e021        addu    gp,gp,t9   ; |
  44:   27bdffc8        addiu   sp,sp,-56  ; | prolog
  48:   afbf0034        sw      ra,52(sp)  ; |
  4c:   afbe0030        sw      s8,48(sp)  ; |
  50:   03a0f021        move    s8,sp      ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  54:   afbc0020        sw      gp,32(sp)  ; /
  58:   afc40038        sw      a0,56(s8)  ; \
  5c:   afc5003c        sw      a1,60(s8)  ; |
  60:   afc60040        sw      a2,64(s8)  ; | spill first 4 args into prev frame's reserved spill space in param area (although not actually needing to spill, here but just do a temp copy, but space is reserved for them anyways)
  64:   afc70044        sw      a3,68(s8)  ; |
  68:   27bdff18        addiu   sp,sp,-232 ; alloca(220) - with padding to guarantee alignment
  6c:   27a20020        addiu   v0,sp,32   ; |
  70:   afc20028        sw      v0,40(s8)  ; |
  74:   8fc30028        lw      v1,40(s8)  ; | start of alloca()'d memory -> v1, by ...
  78:   24620007        addiu   v0,v1,7    ; | ... using v0 as helper to align to 8b
  7c:   000210c2        srl     v0,v0,0x3  ; |    @@@ unsure about use of helper space at 40(s8) in prev frame..?
  80:   000210c0        sll     v0,v0,0x3  ; |
  84:   afc20028        sw      v0,40(s8)  ; |
  88:   8fc30028        lw      v1,40(s8)  ; |
  8c:   2402004c        li      v0,76      ; 'L' -> v0, and...
  90:   a0620000        sb      v0,0(v1)   ; ... store in local area (of alloca()'d space)
  94:   8fc2004c        lw      v0,76(s8)  ; arg 4 (fetched from prev frame's param area), and ...
  98:   afa20010        sw      v0,16(sp)  ; ... "pushed" onto stack
  9c:   8fc20050        lw      v0,80(s8)  ; arg 5 (fetched from prev frame's param area), and ...

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  d8:   03e00008        jr      ra         ; |
  dc:   27bd0038        addiu   sp,sp,56   ; |

000000e0 <main>:
  e0:   3c1c0000        lui     gp,0x0     ; |
  e4:   279c0000        addiu   gp,gp,0    ; |
  e8:   0399e021        addu    gp,gp,t9   ; |
  ec:   27bdffd0        addiu   sp,sp,-48  ; | prolog
  f0:   afbf002c        sw      ra,44(sp)  ; |
  f4:   afbe0028        sw      s8,40(sp)  ; |
  f8:   03a0f021        move    s8,sp      ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  fc:   afbc0020        sw      gp,32(sp)  ; |
 100:   24020004        li      v0,4       ; arg 4, and ...
 104:   afa20010        sw      v0,16(sp)  ; ... "pushed" onto stack
 108:   24020005        li      v0,5       ; arg 5, and ...
 10c:   afa20014        sw      v0,20(sp)  ; ... "pushed" onto stack
 110:   24020006        li      v0,6       ; arg 6, and ...
 114:   afa20018        sw      v0,24(sp)  ; ... "pushed" onto stack
 118:   24020007        li      v0,7       ; arg 7, and ...
 11c:   afa2001c        sw      v0,28(sp)  ; ... "pushed" onto stack
 120:   00002021        move    a0,zero    ; arg 0

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  f0:   03e00008        jr      ra
  f4:   27bd00a0        addiu   sp,sp,160

000000f8 <main>:
  f8:   3c1c0000        lui     gp,0x0    ; |
  fc:   279c0000        addiu   gp,gp,0   ; |
 100:   0399e021        addu    gp,gp,t9  ; |
 104:   27bdffb0        addiu   sp,sp,-80 ; | prolog
 108:   afbf004c        sw      ra,76(sp) ; |
 10c:   afbe0048        sw      s8,72(sp) ; |
 110:   03a0f021        move    s8,sp     ; |         frame pointer (note: with offset to frame start, but static compared to sp)
 114:   afbc0030        sw      gp,48(sp) ; /
 118:   8f820000        lw      v0,0(gp)  ; \                               \
 11c:   24420000        addiu   v0,v0,0   ; |                               | field j -> v0
 120:   8c420000        lw      v0,0(v0)  ; |                               /
 124:   8f830000        lw      v1,0(gp)  ; |                               \
 128:   24630000        addiu   v1,v1,0   ; |                               | field j -> v1
 12c:   8c630004        lw      v1,4(v1)  ; | prep local struct A data ...  /
 130:   8f840000        lw      a0,0(gp)  ; |                               \
 134:   24840000        addiu   a0,a0,0   ; |                               |
 138:   8c840008        lw      a0,8(a0)  ; |                               | field l -> a0 & a1

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  f0:   03e00008        jr      ra
  f4:   27bd00a0        addiu   sp,sp,160

000000f8 <main>:
  f8:   3c1c0000        lui     gp,0x0    ; |
  fc:   279c0000        addiu   gp,gp,0   ; |
 100:   0399e021        addu    gp,gp,t9  ; |
 104:   27bdffb0        addiu   sp,sp,-80 ; | prolog
 108:   afbf004c        sw      ra,76(sp) ; |
 10c:   afbe0048        sw      s8,72(sp) ; |
 110:   03a0f021        move    s8,sp     ; |         frame pointer (note: with offset to frame start, but static compared to sp)
 114:   afbc0030        sw      gp,48(sp) ; /
 118:   8f820000        lw      v0,0(gp)  ; \                               \
 11c:   24420000        addiu   v0,v0,0   ; |                               | field j -> v0
 120:   8c420000        lw      v0,0(v0)  ; |                               /
 124:   8f830000        lw      v1,0(gp)  ; |                               \
 128:   24630000        addiu   v1,v1,0   ; |                               | field j -> v1
 12c:   8c630004        lw      v1,4(v1)  ; | prep local struct A data ...  /
 130:   8f840000        lw      a0,0(gp)  ; |                               \
 134:   24840000        addiu   a0,a0,0   ; |                               |
 138:   8c840008        lw      a0,8(a0)  ; |                               | field l -> a0 & a1

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

 138:   03e00008        jr      ra
 13c:   27bd00c8        addiu   sp,sp,200

00000140 <main>:
 140:   3c1c0000        lui     gp,0x0     ; |
 144:   279c0000        addiu   gp,gp,0    ; |
 148:   0399e021        addu    gp,gp,t9   ; |
 14c:   27bdff58        addiu   sp,sp,-168 ; | prolog
 150:   afbf00a4        sw      ra,164(sp) ; |
 154:   afbe00a0        sw      s8,160(sp) ; |
 158:   03a0f021        move    s8,sp      ; |         frame pointer (note: with offset to frame start, but static compared to sp)
 15c:   afbc0058        sw      gp,88(sp)  ; /
 160:   8f820000        lw      v0,0(gp)   ; \                                       |
 164:   24420030        addiu   v0,v0,48   ; |                                       | field j -> v0
 168:   8c420000        lw      v0,0(v0)   ; |                                       /
 16c:   8f830000        lw      v1,0(gp)   ; | prep (first) local struct A data ...  \
 170:   24630030        addiu   v1,v1,48   ; |                                       | field j -> v1
 174:   8c630004        lw      v1,4(v1)   ; |                                       /
 178:   8f840000        lw      a0,0(gp)   ; |                                       \
 17c:   24840030        addiu   a0,a0,48   ; |                                       | field f -> a0
 180:   8c840008        lw      a0,8(a0)   ; /                                       |

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

 138:   03e00008        jr      ra
 13c:   27bd00c8        addiu   sp,sp,200

00000140 <main>:
 140:   3c1c0000        lui     gp,0x0     ; |
 144:   279c0000        addiu   gp,gp,0    ; |
 148:   0399e021        addu    gp,gp,t9   ; |
 14c:   27bdff58        addiu   sp,sp,-168 ; | prolog
 150:   afbf00a4        sw      ra,164(sp) ; |
 154:   afbe00a0        sw      s8,160(sp) ; |
 158:   03a0f021        move    s8,sp      ; |         frame pointer (note: with offset to frame start, but static compared to sp)
 15c:   afbc0058        sw      gp,88(sp)  ; /
 160:   8f820000        lw      v0,0(gp)   ; \                                       |
 164:   24420030        addiu   v0,v0,48   ; |                                       | field j -> v0
 168:   8c420000        lw      v0,0(v0)   ; |                                       /
 16c:   8f830000        lw      v1,0(gp)   ; | prep (first) local struct A data ...  \
 170:   24630030        addiu   v1,v1,48   ; |                                       | field j -> v1
 174:   8c630004        lw      v1,4(v1)   ; |                                       /
 178:   8f840000        lw      a0,0(gp)   ; |                                       \
 17c:   24840030        addiu   a0,a0,48   ; |                                       | field f -> a0
 180:   8c840008        lw      a0,8(a0)   ; /                                       |

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  30:   03e00008        jr      ra
  34:   27bd0008        addiu   sp,sp,8

00000038 <main>:
  38:   3c1c0000        lui     gp,0x0     ; |
  3c:   279c0000        addiu   gp,gp,0    ; |
  40:   0399e021        addu    gp,gp,t9   ; |
  44:   27bdff60        addiu   sp,sp,-160 ; | prolog
  48:   afbf009c        sw      ra,156(sp) ; |
  4c:   afbe0098        sw      s8,152(sp) ; |
  50:   03a0f021        move    s8,sp      ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  54:   afbc0048        sw      gp,72(sp)  ; /
  58:   8f820000        lw      v0,0(gp)   ; \
  5c:   24420044        addiu   v0,v0,68   ; | prep local struct A data ...
  60:   8c420000        lw      v0,0(v0)   ; /
  64:   afc20094        sw      v0,148(s8) ; ... and write to local area
  68:   8f820000        lw      v0,0(gp)   ; \
  6c:   2442003c        addiu   v0,v0,60   ; |
  70:   8c420000        lw      v0,0(v0)   ; |
  74:   8f830000        lw      v1,0(gp)   ; | prep local struct B data ...
  78:   2463003c        addiu   v1,v1,60   ; |

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  30:   03e00008        jr      ra
  34:   27bd0008        addiu   sp,sp,8

00000038 <main>:
  38:   3c1c0000        lui     gp,0x0      ; |
  3c:   279c0000        addiu   gp,gp,0     ; |
  40:   0399e021        addu    gp,gp,t9    ; |
  44:   27bdff60        addiu   sp,sp,-160  ; | prolog
  48:   afbf009c        sw      ra,156(sp)  ; |
  4c:   afbe0098        sw      s8,152(sp)  ; |
  50:   03a0f021        move    s8,sp       ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  54:   afbc0048        sw      gp,72(sp)   ; /
  58:   8f810000        lw      at,0(gp)    ; \
  5c:   24210044        addiu   at,at,68    ; | prep local struct A (single float field) data ...
  60:   c4200000        lwc1    $f0,0(at)   ; /
  64:   e7c00094        swc1    $f0,148(s8) ; ... and write to local area
  68:   8f820000        lw      v0,0(gp)    ; \
  6c:   2442003c        addiu   v0,v0,60    ; |
  70:   8c420000        lw      v0,0(v0)    ; |
  74:   8f830000        lw      v1,0(gp)    ; | prep local struct B data ...
  78:   2463003c        addiu   v1,v1,60    ; |

dyncall/doc/disas_examples/mips.o32.disas  view on Meta::CPAN

  4008dc:       27bd0008        addiu   sp,sp,8

004008e0 <_Z2f2v>:
  4008e0:       3c1c0002        lui     gp,0x2        ; |
  4008e4:       279c82e0        addiu   gp,gp,-32032  ; |
  4008e8:       0399e021        addu    gp,gp,t9      ; |
  4008ec:       27bdffd8        addiu   sp,sp,-40     ; | prolog
  4008f0:       afbf0020        sw      ra,32(sp)     ; |
  4008f4:       afbe001c        sw      s8,28(sp)     ; |
  4008f8:       afb00018        sw      s0,24(sp)     ; |
  4008fc:       03a0f021        move    s8,sp         ; |         frame pointer (note: with offset to frame start, but static compared to sp)
  400900:       afbc0010        sw      gp,16(sp)     ;
  400904:       00808021        move    s0,a0         ;
  400908:       02001021        move    v0,s0         ;
  40090c:       00402021        move    a0,v0         ;
  400910:       8f998060        lw      t9,-32672(gp) ;
  400914:       0320f809        jalr    t9            ;
  400918:       00000000        nop                   ;
  40091c:       8fdc0010        lw      gp,16(s8)     ;
  400920:       02001021        move    v0,s0         ; ptr to retval space -> v0
  400924:       03c0e821        move    sp,s8         ; |

dyncall/doc/disas_examples/mips64.n64.disas  view on Meta::CPAN

  e8:   00061000        sll     v0,a2,0x0  ; | (using the set of pointlessly moved-to regs, above)
  ec:   afc20010        sw      v0,16(s8)  ; |
  f0:   00071000        sll     v0,a3,0x0  ; |
  f4:   afc20014        sw      v0,20(s8)  ; |
  f8:   00081000        sll     v0,a4,0x0  ; |
  fc:   afc20018        sw      v0,24(s8)  ; |
 100:   00091000        sll     v0,a5,0x0  ; |
 104:   afc2001c        sw      v0,28(s8)  ; |
 108:   67bdff10        daddiu  sp,sp,-240 ; alloca(220) - with padding to guarantee alignment
 10c:   ffdd0020        sd      sp,32(s8)  ; |
 110:   dfc30020        ld      v1,32(s8)  ; | start of alloca()'d memory -> v1, by ...
 114:   64620007        daddiu  v0,v1,7    ; | ... using v0 as helper to align to 8b, and some unnecessary stores/reloads instead of a move
 118:   000210fa        dsrl    v0,v0,0x3  ; |
 11c:   000210f8        dsll    v0,v0,0x3  ; |
 120:   ffc20020        sd      v0,32(s8)  ; move addr in v0 via local area ...
 124:   dfc30020        ld      v1,32(s8)  ; ... to v1
 128:   2402004c        li      v0,76      ; 'L' -> v0, and ...
 12c:   a0620000        sb      v0,0(v1)   ; ... store in local area (of alloca()'d space)
 130:   8fc20004        lw      v0,4(s8)   ; prep arg 0 (pointlessly) to move to a0 below
 134:   8fc30008        lw      v1,8(s8)   ; prep arg 1 (pointlessly) to move to a1 below
 138:   8fc6000c        lw      a2,12(s8)  ; arg 2

dyncall/doc/disas_examples/mips64.n64.disas  view on Meta::CPAN

  d0:   00052800        sll     a1,a1,0x0  ; | (using the set of pointlessly moved-to regs, above)
  d4:   afc50010        sw      a1,16(s8)  ; |
  d8:   00042000        sll     a0,a0,0x0  ; |
  dc:   afc40014        sw      a0,20(s8)  ; |
  e0:   00031800        sll     v1,v1,0x0  ; |
  e4:   afc30018        sw      v1,24(s8)  ; |
  e8:   00021000        sll     v0,v0,0x0  ; |
  ec:   afc2001c        sw      v0,28(s8)  ; |
  f0:   67bdff10        daddiu  sp,sp,-240 ; alloca(220) - with padding to guarantee alignment
  f4:   03a0102d        move    v0,sp      ; |
  f8:   6442000f        daddiu  v0,v0,15   ; | start of alloca()'d memory -> v1, by ...
  fc:   0002113a        dsrl    v0,v0,0x4  ; | ... using v0 as helper to align to 8b
 100:   00021138        dsll    v0,v0,0x4  ; |
 104:   0040182d        move    v1,v0      ; |
 108:   2402004c        li      v0,76      ; 'L' -> v0, and ...
 10c:   a0620000        sb      v0,0(v1)   ; ... store in local area (of alloca()'d space)
 110:   8fc40004        lw      a0,4(s8)   ; arg 0
 114:   8fc50008        lw      a1,8(s8)   ; arg 1
 118:   8fc6000c        lw      a2,12(s8)  ; arg 2
 11c:   8fc70010        lw      a3,16(s8)  ; arg 3
 120:   8fc80014        lw      a4,20(s8)  ; arg 4

dyncall/doc/disas_examples/mips64.n64.disas  view on Meta::CPAN

; 
; void leaf_call(int b, int c, int d, int e, float f, float g, int h, int i, float j)
; {
; }
; 
; void nonleaf_call(int a, ...)
; {
;     int b, c, d, e, h, i;
;     float f, g, j;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = (float)va_arg(ap, double);
;     g = (float)va_arg(ap, double);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = (float)va_arg(ap, double);
;     /* use some local data */

dyncall/doc/disas_examples/mips64.n64.disas  view on Meta::CPAN

 180:   64430008        daddiu  v1,v0,8     ; |
 184:   ffc30038        sd      v1,56(s8)   ; |
 188:   dc420000        ld      v0,0(v0)    ; |
 18c:   44a20000        dmtc1   v0,$f0      ; |
 190:   46200020        cvt.s.d $f0,$f0     ; |
 194:   44020000        mfc1    v0,$f0      ; |
 198:   afc20030        sw      v0,48(s8)   ; |
 19c:   67bdff10        daddiu  sp,sp,-240  ; alloca(220) - with padding to guarantee alignment
 1a0:   67a20010        daddiu  v0,sp,16    ; |
 1a4:   6442000f        daddiu  v0,v0,15    ; |
 1a8:   0002113a        dsrl    v0,v0,0x4   ; | start of alloca()'d memory -> v1, by ...
 1ac:   00021138        dsll    v0,v0,0x4   ; | ... using v0 as helper to align to 16b
 1b0:   0040182d        move    v1,v0       ; |
 1b4:   2402004c        li      v0,76       ; 'L' -> v0, and ...
 1b8:   a0620000        sb      v0,0(v1)    ; ... store in local area (of alloca()'d space)
 1bc:   8fc40010        lw      a0,16(s8)   ; arg 0
 1c0:   8fc50014        lw      a1,20(s8)   ; arg 1
 1c4:   8fc60018        lw      a2,24(s8)   ; arg 2
 1c8:   8fc7001c        lw      a3,28(s8)   ; arg 3
 1cc:   8fc80028        lw      a4,40(s8)   ; prepare arg 6 (using a4 only as temp reg), to move to a6 below
 1d0:   8fc3002c        lw      v1,44(s8)   ; prepare arg 7 (pointlessly) to move to a7 below

dyncall/doc/disas_examples/ppc.darwin.disas  view on Meta::CPAN

      4c:       90 9e 00 6c     stw 4, 108(30)  ; |
      50:       90 be 00 70     stw 5, 112(30)  ; |
      54:       90 de 00 74     stw 6, 116(30)  ; |
      58:       90 fe 00 78     stw 7, 120(30)  ; | all in args -> spill area in prev frame
      5c:       91 1e 00 7c     stw 8, 124(30)  ; |
      60:       91 3e 00 80     stw 9, 128(30)  ; |
      64:       91 5e 00 84     stw 10, 132(30) ; |
      68:       80 01 00 00     lwz 0, 0(1)     ; fetch back-chain ptr (parent frame's sp) from stack of top by prolog -> gpr0, and ...
      6c:       94 01 ff 10     stwu 0, -240(1) ; ... update it further up the stack for alloca(220) - with padding to guarantee alignment
      70:       38 41 00 40     addi 2, 1, 64   ; |
      74:       38 02 00 0f     addi 0, 2, 15   ; | start of alloca()'d memory -> gpr2, by ...
      78:       54 00 e1 3e     srwi 0, 0, 4    ; | ... using gpr0 as helper to align to 16b, leaving at least 64b at top of stack
      7c:       54 02 20 36     slwi 2, 0, 4    ; |
      80:       38 00 00 4c     li 0, 76        ; 'L' -> gpr0, and ...
      84:       98 02 00 00     stb 0, 0(2)     ; ... store in local area (of alloca()'d space)
      88:       80 7e 00 6c     lwz 3, 108(30)  ; |
      8c:       80 9e 00 70     lwz 4, 112(30)  ; |
      90:       80 be 00 74     lwz 5, 116(30)  ; |
      94:       80 de 00 78     lwz 6, 120(30)  ; | arg 0,1,2,3,4,5,6 (fetched from spill area from prev frame)
      98:       80 fe 00 7c     lwz 7, 124(30)  ; |
      9c:       81 1e 00 80     lwz 8, 128(30)  ; |

dyncall/doc/disas_examples/ppc.darwin.disas  view on Meta::CPAN

      50:       90 9e 00 7c     stw 4, 124(30)  ; |
      54:       90 be 00 80     stw 5, 128(30)  ; |
      58:       90 de 00 84     stw 6, 132(30)  ; |
      5c:       90 fe 00 88     stw 7, 136(30)  ; | in args 0,1,2,3,4,5,6,7 -> spill area in prev frame
      60:       91 1e 00 8c     stw 8, 140(30)  ; |
      64:       91 3e 00 90     stw 9, 144(30)  ; |
      68:       91 5e 00 94     stw 10, 148(30) ; |
      6c:       80 01 00 00     lwz 0, 0(1)     ; fetch back-chain ptr (parent frame's sp) from stack of top by prolog -> gpr0, and ...
      70:       94 01 ff 10     stwu 0, -240(1) ; ... update it further up the stack for alloca(220) - with padding to guarantee alignment
      74:       38 41 00 50     addi 2, 1, 80   ; |
      78:       38 02 00 0f     addi 0, 2, 15   ; | start of alloca()'d memory -> gpr2, by ...
      7c:       54 00 e1 3e     srwi 0, 0, 4    ; | ... using gpr0 as helper to align to 16b, leaving at least 64b at top of stack
      80:       54 02 20 36     slwi 2, 0, 4    ; |
      84:       38 00 00 4c     li 0, 76        ; 'L' -> gpr0, and ...
      88:       98 02 00 00     stb 0, 0(2)     ; ... store in local area (of alloca()'d space)
      8c:       80 1e 00 9c     lwz 0, 156(30)  ; arg 7 (fetched from stack param area from prev frame), and ...
      90:       90 01 00 38     stw 0, 56(1)    ; ... "pushed" onto stack
      94:       80 7e 00 7c     lwz 3, 124(30)  ; |
      98:       80 9e 00 80     lwz 4, 128(30)  ; |
      9c:       80 be 00 84     lwz 5, 132(30)  ; |
      a0:       80 de 00 88     lwz 6, 136(30)  ; | arg 0,1,2,3,4,5,6 (fetched from spill area from prev frame)

dyncall/doc/disas_examples/ppc.darwin.disas  view on Meta::CPAN

; 
; void leaf_call(int b, int c, int d, int e, float f, float g, int h, int i, float j)
; {
; }
; 
; void nonleaf_call(int a, ...)
; {
;     int b, c, d, e, h, i;
;     float f, g, j;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = (float)va_arg(ap, double);
;     g = (float)va_arg(ap, double);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = (float)va_arg(ap, double);
;     /* use some local data */

dyncall/doc/disas_examples/ppc.darwin.disas  view on Meta::CPAN

     140:       81 3e 00 74     lwz 9, 116(30)  ; \
     144:       80 5e 00 74     lwz 2, 116(30)  ; |
     148:       38 02 00 08     addi 0, 2, 8    ; |
     14c:       90 1e 00 74     stw 0, 116(30)  ; | in arg 9 (float, promoted to double)
     150:       c8 09 00 00     lfd 0, 0(9)     ; |
     154:       fc 00 00 18     frsp 0, 0       ; |
     158:       d0 1e 00 70     stfs 0, 112(30) ; /
     15c:       80 01 00 00     lwz 0, 0(1)     ; fetch back-chain ptr (parent frame's sp) from stack of top by prolog -> gpr0, and ...
     160:       94 01 ff 10     stwu 0, -240(1) ; ... update it further up the stack for alloca
     164:       38 41 00 50     addi 2, 1, 80   ; |
     168:       38 02 00 0f     addi 0, 2, 15   ; | start of alloca()'d memory -> gpr2, by ...
     16c:       54 00 e1 3e     srwi 0, 0, 4    ; | ... using gpr0 as helper to align to 16b, l
     170:       54 02 20 36     slwi 2, 0, 4    ; |
     174:       38 00 00 4c     li 0, 76        ; 'L' -> gpr0, and ...
     178:       98 02 00 00     stb 0, 0(2)     ; ... store in local area (of alloca()'d space)
     17c:       80 7e 00 50     lwz 3, 80(30)   ; arg 0
     180:       80 9e 00 54     lwz 4, 84(30)   ; arg 1
     184:       80 be 00 58     lwz 5, 88(30)   ; arg 2
     188:       80 de 00 5c     lwz 6, 92(30)   ; arg 3
     18c:       c0 3e 00 68     lfs 1, 104(30)  ; arg 4 (float)
     190:       c0 5e 00 6c     lfs 2, 108(30)  ; arg 5 (float)

dyncall/doc/disas_examples/ppc.sysv.disas  view on Meta::CPAN

  58:   90 df 00 14     stw     r6,20(r31)             ; |
  5c:   90 ff 00 18     stw     r7,24(r31)             ; | all in args -> temp space in local area
  60:   91 1f 00 1c     stw     r8,28(r31)             ; |
  64:   91 3f 00 20     stw     r9,32(r31)             ; |
  68:   91 5f 00 24     stw     r10,36(r31)            ; |
  6c:   80 01 00 00     lwz     r0,0(r1)               ; fetch sp saved on stack of top by prolog -> gpr0, and ...
  70:   94 01 ff 10     stwu    r0,-240(r1)            ; ... update it further up the stack for alloca(220) - with padding to guarantee alignment
  74:   39 21 00 08     addi    r9,r1,8                ; |
  78:   91 3f 00 28     stw     r9,40(r31)             ; |
  7c:   81 3f 00 28     lwz     r9,40(r31)             ; |
  80:   38 09 00 0f     addi    r0,r9,15               ; | start of alloca()'d memory -> gpr9, by ...
  84:   54 00 e1 3e     rlwinm  r0,r0,28,4,31          ; | ... using gpr0 as helper to align to 16b, leaving at least 8b at top of stock
  88:   54 00 20 36     rlwinm  r0,r0,4,0,27           ; |
  8c:   90 1f 00 28     stw     r0,40(r31)             ; |
  90:   81 3f 00 28     lwz     r9,40(r31)             ; |
  94:   38 00 00 4c     li      r0,76                  ; 'L' -> gpr0, and ...
  98:   98 09 00 00     stb     r0,0(r9)               ; ... store in local area (of alloca()'d space)
  9c:   80 7f 00 0c     lwz     r3,12(r31)             ; arg 0
  a0:   80 9f 00 10     lwz     r4,16(r31)             ; arg 1
  a4:   80 bf 00 14     lwz     r5,20(r31)             ; arg 2
  a8:   80 df 00 18     lwz     r6,24(r31)             ; arg 3

dyncall/doc/disas_examples/ppc.sysv.disas  view on Meta::CPAN

; 
; void leaf_call(int b, int c, int d, int e, float f, float g, int h, int i, float j)
; {
; }
; 
; void nonleaf_call(int a, ...)
; {
;     int b, c, d, e, h, i;
;     float f, g, j;
;     va_list ap;
;     va_start(ap, a);
;     b = va_arg(ap, int);
;     c = va_arg(ap, int);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = (float)va_arg(ap, double);
;     g = (float)va_arg(ap, double);
;     h = va_arg(ap, int);
;     i = va_arg(ap, int);
;     j = (float)va_arg(ap, double);
;     /* use some local data */

dyncall/doc/disas_examples/ppc.sysv.disas  view on Meta::CPAN

  80:   d8 9f 00 70     stfd    f4,112(r31)
  84:   d8 bf 00 78     stfd    f5,120(r31)
  88:   d8 df 00 80     stfd    f6,128(r31)
  8c:   d8 ff 00 88     stfd    f7,136(r31)
  90:   d9 1f 00 90     stfd    f8,144(r31)
  94:   90 7f 00 98     stw     r3,152(r31)
  98:   38 00 00 01     li      r0,1
  9c:   98 1f 00 2c     stb     r0,44(r31)
  a0:   38 00 00 00     li      r0,0
  a4:   98 1f 00 2d     stb     r0,45(r31)
  a8:   38 1f 00 d8     addi    r0,r31,216  ; make r0 point to start of prev frame's param area (would make sense as no spill area to define param area start for iteration)
  ac:   90 1f 00 30     stw     r0,48(r31)
  b0:   38 1f 00 38     addi    r0,r31,56   ; make r0 point to end of prev frame's param area (would make sense as no spill area to define param area end for iteration)
  b4:   90 1f 00 34     stw     r0,52(r31)
  b8:   88 1f 00 2c     lbz     r0,44(r31)
  bc:   54 00 06 3e     clrlwi  r0,r0,24
  c0:   2b 80 00 08     cmplwi  cr7,r0,8
  c4:   40 9c 00 30     bge-    cr7,f4 <nonleaf_call+0xb4>
  c8:   81 7f 00 34     lwz     r11,52(r31)
  cc:   88 1f 00 2c     lbz     r0,44(r31)
  d0:   54 09 06 3e     clrlwi  r9,r0,24

dyncall/doc/disas_examples/ppc64.elfabi.disas  view on Meta::CPAN

  74:	90 df 00 d8 	stw     r6,216(r31)              ; |
  78:	90 ff 00 e0 	stw     r7,224(r31)              ; | all in args -> spill area in prev frame (jump over own frame (144) + linkage area of prev frame (48) = 192)
  7c:	91 1f 00 e8 	stw     r8,232(r31)              ; |
  80:	91 3f 00 f0 	stw     r9,240(r31)              ; |
  84:	91 5f 00 f8 	stw     r10,248(r31)             ; |
  88:	e8 01 00 00 	ld      r0,0(r1)                 ; fetch back-chain ptr (parent frame's sp) from stack of top by prolog -> gpr0, and ...
  8c:	f8 01 ff 11 	stdu    r0,-240(r1)              ; ... update it further up the stack for alloca(220) - with padding to guarantee alignment
  90:	39 21 00 70 	addi    r9,r1,112                ; |
  94:	f9 3f 00 70 	std     r9,112(r31)              ; |
  98:	e9 3f 00 70 	ld      r9,112(r31)              ; |
  9c:	38 09 00 0f 	addi    r0,r9,15                 ; | start of alloca()'d memory -> gpr9, by ...
  a0:	78 00 e1 02 	rldicl  r0,r0,60,4               ; | ... using gpr0 as helper to align to 16b, leaving at least 112b at top of stack
  a4:	78 00 26 e4 	rldicr  r0,r0,4,59               ; |
  a8:	f8 1f 00 70 	std     r0,112(r31)              ; |
  ac:	e9 3f 00 70 	ld      r9,112(r31)              ; |
  b0:	38 00 00 4c 	li      r0,76                    ; 'L' -> gpr0, and ...
  b4:	98 09 00 00 	stb     r0,0(r9)                 ; ... store in local area (of alloca()'d space)
  b8:	80 1f 00 c8 	lwz     r0,200(r31)              ; prep arg 0 (from prev frame's spill area), ...
  bc:	7c 08 07 b4 	extsw   r8,r0                    ; ... -> gpr8 (w/ sign extension b/c int param in 64bit reg)
  c0:	80 1f 00 d0 	lwz     r0,208(r31)              ; prep arg 1 (from prev frame's spill area), ...
  c4:	7c 07 07 b4 	extsw   r7,r0                    ; ... -> gpr7

dyncall/doc/disas_examples/ppc64.elfabi.disas  view on Meta::CPAN

; }
; 
; struct aggr { int x; int y; int z; };
; 
; struct aggr nonleaf_call(int a, int b, float c, int d, float e, int f, ...)
; {
;     va_list v;
;     int i;
;     float g, h, j;
;     struct aggr st = { b, d, f };
;     va_start(v, f);
;     g = va_arg(v, float);
;     h = va_arg(v, float);
;     i = va_arg(v, int);
;     h = va_arg(v, float);
;     /* use some local data */
;     *(char*)alloca(220) = 'L';
;     leaf_call(b, c, d, e, f, g, h, i, j);
; 
;     return st;
; }

dyncall/doc/disas_examples/sparc64.sparc64.disas  view on Meta::CPAN

; }
;
; struct aggr { int x; int y; int z; };
;
; struct aggr nonleaf_call(int a, int b, float c, int d, float e, int f, ...)
; {
;     va_list v;
;     int g;
;     float h;
;     struct aggr st = { b, d, f };
;     va_start(v, f);
;     g = va_arg(v, int);
;     h = va_arg(v, float);
;     /* use some local data */
;     *(char*)alloca(220) = 'L';
;     leaf_call(b, c, d, e, f, g, h);
;
;     return st;
; }
;
; int main()

dyncall/doc/disas_examples/sparc64.sparc64.disas  view on Meta::CPAN

  5c:   c4 27 a8 97     st  %g2, [ %fp + 0x897 ]        ; |
  60:   c2 27 a8 a7     st  %g1, [ %fp + 0x8a7 ]        ; |
  64:   c2 07 a8 87     ld  [ %fp + 0x887 ], %g1        ; in arg 1 (int b, fetched from prev frame's spill area), ...
  68:   c2 27 a7 db     st  %g1, [ %fp + 0x7db ]        ; ... copied to local space (0x7db - bias = -36)
  6c:   c2 07 a8 97     ld  [ %fp + 0x897 ], %g1        ; in arg 3 (int d, fetched from prev frame's spill area), ...
  70:   c2 27 a7 df     st  %g1, [ %fp + 0x7df ]        ; ... copied to local space (0x7df - bias = -32)
  74:   c2 07 a8 a7     ld  [ %fp + 0x8a7 ], %g1        ; in arg 5 (int f, fetched from prev frame's spill area), ...
  78:   c2 27 a7 e3     st  %g1, [ %fp + 0x7e3 ]        ; ... copied to local space (0x7e3 - bias = -28)
  7c:   82 07 a8 af     add  %fp, 0x8af, %g1            ; va_list: pointer to arg 5 -> g1 ...
  80:   c2 77 a7 e7     stx  %g1, [ %fp + 0x7e7 ]       ; ... store to local space (0x7e7 - bias = -24)
  84:   c2 5f a7 e7     ldx  [ %fp + 0x7e7 ], %g1       ; reread to start iteration (pointlessly)
  88:   84 00 60 04     add  %g1, 4, %g2                ; point read ptr in g2 to first unnamed param (int)
  8c:   c4 00 80 00     ld  [ %g2 ], %g2                ; in arg 6 (fetched from prev frame's stack param area), ...
  90:   c4 27 a7 fb     st  %g2, [ %fp + 0x7fb ]        ; ... copied to local space (0x7fb - bias = -4) helper var (probably int g)
  94:   82 00 60 08     add  %g1, 8, %g1                ; point read ptr in g1 to second unnamed param (float, promoted to double), ...
  98:   c2 77 a7 e7     stx  %g1, [ %fp + 0x7e7 ]       ; ... store in local space (0x7fb - bias = -24)
  9c:   91 d0 20 05     ta  5                           ; trap - not sure what else is involved (objdump was made from .o, not finally linked exec) - maybe just b/c objdump skipped this for the output?

00000000000000a0 <main>:
  a0:   9d e3 bf 30     save  %sp, -208, %sp            ; prolog
  a4:   03 00 00 00     sethi  %hi(0), %g1              ; |

dyncall/doc/disas_examples/x64.sysv.disas  view on Meta::CPAN

;
; void leaf_call(int b, int c, int d, int e, ...)
; {
; }
;
; void nonleaf_call(int a, int b, int c, ...)
; {
;     int d, e, g, h;
;     struct A f;
;     va_list ap;
;     va_start(ap, c);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = va_arg(ap, struct A);
;     g = va_arg(ap, int);
;     h = va_arg(ap, int);
;     /* use some local data */
;     *(char*)alloca(220) = 'L';
;     leaf_call(b, c, d, e, f, g, h);
;     va_end(ap);
; }

dyncall/doc/disas_examples/x64.win.disas  view on Meta::CPAN

;
; void leaf_call(int b, int c, int d, int e, ...)
; {
; }
;
; void nonleaf_call(int a, int b, int c, ...)
; {
;     int d, e, g, h;
;     struct A f;
;     va_list ap;
;     va_start(ap, c);
;     d = va_arg(ap, int);
;     e = va_arg(ap, int);
;     f = va_arg(ap, struct A);
;     g = va_arg(ap, int);
;     h = va_arg(ap, int);
;     /* use some local data */
;     *(char*)alloca(220) = 'L';
;     leaf_call(b, c, d, e, f, g, h);
;     va_end(ap);
; }

dyncall/doc/disas_examples/x86.cdecl.disas  view on Meta::CPAN

   8:   83 ec 38                sub    $0x38,%esp             ; /
   b:   b8 10 00 00 00          mov    $0x10,%eax             ; \                     |
  10:   83 e8 01                sub    $0x1,%eax              ; |                     | creative way to move 250 to eax
  13:   05 eb 00 00 00          add    $0xeb,%eax             ; |                     /
  18:   c7 45 f4 10 00 00 00    movl   $0x10,-0xc(%ebp)       ; | size comp wtf?      \
  1f:   ba 00 00 00 00          mov    $0x0,%edx              ; |                     |
  24:   f7 75 f4                divl   -0xc(%ebp)             ; |                     | obviously fastest way to round to multiple of 16
  27:   6b c0 10                imul   $0x10,%eax,%eax        ; |                     |
  2a:   29 c4                   sub    %eax,%esp              ; alloca(220) with size containing some padding computed above
  2c:   8d 44 24 1c             lea    0x1c(%esp),%eax        ; |
  30:   83 c0 0f                add    $0xf,%eax              ; | start of alloca()'d memory -> eax, by ...
  33:   c1 e8 04                shr    $0x4,%eax              ; | ... using ebx and 2 pointless store/reads in local space as helper to align to 16b
  36:   c1 e0 04                shl    $0x4,%eax              ; |
  39:   c6 00 4c                movb   $0x4c,(%eax)           ; 'L' -> alloca()'d space
  3c:   8b 45 24                mov    0x24(%ebp),%eax        ; |
  3f:   89 44 24 18             mov    %eax,0x18(%esp)        ; |
  43:   8b 45 20                mov    0x20(%ebp),%eax        ; |
  46:   89 44 24 14             mov    %eax,0x14(%esp)        ; |
  4a:   8b 45 1c                mov    0x1c(%ebp),%eax        ; |
  4d:   89 44 24 10             mov    %eax,0x10(%esp)        ; |
  51:   8b 45 18                mov    0x18(%ebp),%eax        ; | read in args 1-7 from prev frame's param area, and ...

dyncall/doc/disas_examples/x86.cdecl.disas  view on Meta::CPAN

   9:   8d bc 27 00 00 00 00    lea    0x0(%edi),%edi

00000010 <nonleaf_call>:
  10:   55                      push   %ebp                   ; |
  11:   89 e5                   mov    %esp,%ebp              ; | prolog
  13:   83 ec 28                sub    $0x28,%esp             ; |
  16:   81 ec f0 00 00 00       sub    $0xf0,%esp             ; alloca(220) - with padding for 16b alignment
  1c:   8d 44 24 1c             lea    0x1c(%esp),%eax        ; |
  20:   89 45 fc                mov    %eax,-0x4(%ebp)        ; |
  23:   8b 45 fc                mov    -0x4(%ebp),%eax        ; |
  26:   83 c0 0f                add    $0xf,%eax              ; | start of alloca()'d memory -> eax, by ...
  29:   c1 e8 04                shr    $0x4,%eax              ; | ... using ebx and 2 pointless store/reads in local space as helper to align to 16b
  2c:   c1 e0 04                shl    $0x4,%eax              ; |
  2f:   89 45 fc                mov    %eax,-0x4(%ebp)        ; |
  32:   8b 45 fc                mov    -0x4(%ebp),%eax        ; |
  35:   c6 00 4c                movb   $0x4c,(%eax)           ; 'L' -> alloca()'d space
  38:   8b 45 24                mov    0x24(%ebp),%eax        ; |
  3b:   89 44 24 18             mov    %eax,0x18(%esp)        ; |
  3f:   8b 45 20                mov    0x20(%ebp),%eax        ; |
  42:   89 44 24 14             mov    %eax,0x14(%esp)        ; |
  46:   8b 45 1c                mov    0x1c(%ebp),%eax        ; |

dyncall/doc/manual/callconvs/callconv_mips32.tex  view on Meta::CPAN


\paragraph{Parameter passing}

\begin{itemize}
\item Stack grows down
\item Stack parameter order: right-to-left
\item Caller cleans up the stack
\item first 8 integers (\textless=\ 32bit) are passed in registers \$a0-\$a7
\item first 8 single precision floating point arguments are passed in registers \$f12-\$f19
\item 64-bit stack arguments are always aligned to 8 bytes
\item 64-bit integers or double precision floats are passed in two general purpose registers starting at an even register number, skipping one odd register
\item if either integer or float registers are used up, the stack is used
\item if the callee takes the address of one of the parameters and uses it to address other unnamed parameters (e.g. varargs) it has to copy - in its prolog - the the argument registers to a reserved stack area adjacent to the other parameters on the...
\item float registers don't seem to ever need to be saved that way, because floats passed to an ellipsis function are promoted to doubles, which in turn are passed in a? register pairs, so only \$a0-\$a7 are need to be spilled
\item aggregates (struct, union) \textless=\ 32bit are passed like an integer
\item {\it non-trivial} C++ aggregates (as defined by the language) of any size, are passed indirectly via a pointer to a copy of the aggregate
\item all other aggregates (struct, union) are passed indirectly, as a pointer to a copy (if needed, and for vararg arguments required to be copied by the caller) of the struct
\end{itemize}

\paragraph{Return values}

dyncall/doc/manual/callconvs/callconv_mips32.tex  view on Meta::CPAN

\paragraph{Parameter passing}

\begin{itemize}
\item Stack grows down
\item Stack parameter order: right-to-left
\item Caller cleans up the stack
\item Caller is required to always leave a 16-byte spill area for \$a0-\$a3 at the end of {\bf its} frame, to be used and spilled to by the callee, if needed
\item The different stack areas (local data, register save area, parameter area) are each aligned to 8 bytes
\item generally, first four 32bit arguments are passed in registers \$a0-\$a3, respectively (only on hard-float targets: see below for exceptions if first arg is a float)
\item subsequent parameters are passed vie the stack
\item 64-bit params passed via registers are passed using either two registers (starting at an even register number, skipping an odd one if necessary), or via the stack using an 8-byte alignment
\item only on hard-float targets: if the very first call argument is a float, up to 2 floats or doubles can be passed via \$f12 and \$f14, respectively, for first and second argument
\item only on hard-float targets: if any arguments are passed via float registers, skip \$a0-\$a3 for subsequent arguments as if the values were passed via them
\item only on hard-float targets: note that if the first argument is not a float, but the second, it'll get passed via the \$a? registers
\item single precision float parameters (32 bit) are right-justified in their 8-byte slot on the stack on big endian targets, as they aren't promoted % @@@ verify
\item aggregates (struct, union) are passed as a sequence of words like integers, no matter the fields or if hard-float target (splitting across registers and stack is allowed)
\item {\it non-trivial} C++ aggregates (as defined by the language) of any size, are passed indirectly via a pointer to a copy of the aggregate
\end{itemize}

\paragraph{Return values}

dyncall/doc/manual/dyncall_logo.pdf  view on Meta::CPAN

0000000068 00000 n 
0000019716 00000 n 
0000000276 00000 n 
0000019695 00000 n 
trailer
<<
  /Size 7
  /Root 3 0 R
  /Info 1 0 R
>>
startxref
20020
%%EOF

dyncall/doc/manual/manual.tex  view on Meta::CPAN

% Set the normal line height for the entire document (some command depend on it).
\newcommand{\normallineheight}{10pt}
\documentclass[\normallineheight,a4paper]{article}


% Value multiplier.
\newlength\mrbraceheight
\newcommand{\tassimultiply}[2]{%
\setlength{\mrbraceheight}{0pt}%
\newcount\qq%
\qq=1	% Subtract 1 by starting at 1 .
\loop%
	\addtolength\mrbraceheight{#2}%
	\advance\qq by 1%
\ifnum\qq < #1 \repeat%
}


% Conditional if tex4ht is on or not
\newcommand{\ifhtml}[1]{%
	\ifx\HCode\Undef \else%

dyncall/doc/manual/manual_devel.tex  view on Meta::CPAN

\subsection{Noteworthy files in the project root}
\begin{tabular*}{0.75\textwidth}{ll}
{\tt configure}      & pre-make configuration tool (unix-shell)     \\
{\tt configure.bat}  & pre-nmake configuration tool (windows batch) \\
{\tt configure.rc}   & pre-mk configuration tool (Plan 9's rc)      \\
{\tt CMakeLists.txt} & top-level project information for CMake      \\
{\tt Makefile}       & GNU/BSD makefile (output of ./configure)     \\
{\tt Nmakefile}      & MS nmake makefile                            \\
{\tt mkfile}         & Plan 9 mkfile                                \\
{\tt LICENSE}        & license information                          \\
{\tt README}         & quickstart doc                               \\
{\tt buildsys/}      & build system details and extras              \\
{\tt doc/}           & platform specific readme's and manual        \\
{\tt dyncall/}       & dyncall library source code                  \\
{\tt dyncallback/}   & dyncallback library source code              \\
{\tt dynload/}       & dynload library source code                  \\
{\tt test/}          & test suites                                  \\
\end{tabular*}


\subsection{Test suites}

dyncall/dyncall/dyncall.3  view on Meta::CPAN

after having described all fields of an aggregate.
.Pp
Note that c99 flexible array members do not count as a field, and must be
omitted, as passing aggregates with a flexible array member by value in C would
also omit it.
.Sh EXAMPLES
.Em Note :
none of the examples below perform any error checking for simplicity of
the example.
.Pp
Let's start with a simple example, making a call to the function
.Xr sqrt 3 .
Using the
.Nm
library, this function would be called as follows: 
.Bd -literal -offset indent
double r;
DCCallVM* vm = dcNewCallVM(4096);
dcMode(vm, DC_CALL_C_DEFAULT);
dcReset(vm);
/* call: double sqrt(double x); */

dyncall/dyncall/dyncall_aggregate.c  view on Meta::CPAN

		case DC_SIGCHAR_ULONG:      f->size = sizeof(DClong);     break;
		case DC_SIGCHAR_LONGLONG:
		case DC_SIGCHAR_ULONGLONG:  f->size = sizeof(DClonglong); break;
		case DC_SIGCHAR_FLOAT:      f->size = sizeof(DCfloat);    break;
		case DC_SIGCHAR_DOUBLE:     f->size = sizeof(DCdouble);   break;
		case DC_SIGCHAR_POINTER:
		case DC_SIGCHAR_STRING:     f->size = sizeof(DCpointer);  break;
		case DC_SIGCHAR_AGGREGATE:
		{
			va_list ap;
			va_start(ap, array_len);
			f->sub_aggr = va_arg(ap, const DCaggr*);
			va_end(ap);

			f->size = f->sub_aggr->size;
			f->alignment = f->sub_aggr->alignment; /* field inherit's sub aggrs alignment*/
			break;
		}
		default:
			assert(0);
	}

dyncall/dyncall/dyncall_call_mips_n32.S  view on Meta::CPAN

	ld      $5 , 8($13)
	ld      $6 ,16($13)
	ld      $7 ,24($13)
	ld      $8 ,32($13)
	ld      $9 ,40($13)
	ld      $10,48($13)
	ld      $11,56($13)

	/* load float-or-double floating pointer parameter registers 
	   a 64-bit bitmask given at byte offset 128 of regdata indicates
	   if loading a float (bit cleared) or double (bit set), starting
	   at bit position 0 in bitmask.
	*/
.t0:
	and     $15, $14, 1
	bgtz    $15, .d0
.f0:
	l.s     $f12, 64($13)
	j       .t1
.d0:
	l.d     $f12, 64($13)

dyncall/dyncall/dyncall_call_mips_n64.S  view on Meta::CPAN

	ld      $10,48($13)
	ld      $11,56($13)

#if defined(DC__ABI_HARDFLOAT)

	/* $14 = useDouble flags */
	ld      $14, 128($13)

	/* load float-or-double floating pointer parameter registers 
	   a 64-bit bitmask given at byte offset 128 of regdata indicates
	   if loading a float (bit cleared) or double (bit set), starting
	   at bit position 0 in bitmask.
	*/
.t0:
	and     $15, $14, 1
	bgtz    $15, .d0
.f0:
	l.s     $f12, 64($13)
	j       .t1
.d0:
	l.d     $f12, 64($13)

dyncall/dyncall/dyncall_call_sparc64.s  view on Meta::CPAN

   BIAS+XX: should be 16 byte aligned.
                 ...
       136: argument overflow area
       128:  1 extended word  for struct/union poiner return value
   BIAS+ 0: 16 extended words for registers (in/local) save area [register window]


Function Argument Passing:
- integer %o0..%o5 (caller view).
- floating-point %f0 .. %f31
- continuous memory starting at %sp+BIAS+136 (caller view).

Register Usage:
%fp0..%fp31  : floating-point arguments.
%sp  or  %o6 : stack pointer, always 8 (or 16?)-byte aligned.
%fp  or  %i6 : frame pointer.
%i0  and %o0 : integer and pointer return values.
%i7  and %o7 : return address. (caller puts return address to %o7, callee uses %i7)
%fp0 and %fp1: return value (float).
%i0..%i5     : input argument registers 
%o0..%o5     : output argument registers

dyncall/dyncall/dyncall_callf.c  view on Meta::CPAN

}

void dcVArgF(DCCallVM* vm, const DCsigchar* signature, va_list args)
{
  dcArgF_impl(vm, &signature, args);
}

void dcArgF(DCCallVM* vm, const DCsigchar* signature, ...)
{
  va_list va;
  va_start(va, signature);
  dcVArgF(vm,signature,va);
  va_end(va);
}


/* msvc introduced C99'w va_copy() late (in 2013 w/ msvc 18.00); plan9 APE does
 * not have it either; luckily given their va_list being only a ptr in both
 * cases, work around the issue for older versions */
#if (defined(DC__C_MSVC) || defined(DC__OS_Plan9)) && !defined(va_copy)
	#define va_copy(dst, src) ((dst)=(src))

dyncall/dyncall/dyncall_callf.c  view on Meta::CPAN

    case DC_SIGCHAR_AGGREGATE: {
      result->p = dcCallAggr(vm, funcptr, ret_ag, result->p);
      break;
    }
  }
}

void dcCallF(DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, ...)
{
  va_list va;
  va_start(va, signature);
  dcVCallF(vm,result,funcptr,signature,va);
  va_end(va);
}

dyncall/dyncallback/dyncall_callback_mips_o32.S  view on Meta::CPAN

#if defined(DC__ABI_HARDFLOAT)
	s.d $f12, 40($sp)   /* -16($fp) */
	s.d $f14, 48($sp)   /*  -8($fp) */
#endif /* DC__ABI_HARDFLOAT */
	sw $4,    56($sp)   /*   0($fp) */
	sw $5,    60($sp)   /*   4($fp) */
	sw $6,    64($sp)   /*   8($fp) */
	sw $7,    68($sp)   /*  12($fp) */

	/* Init DCArg, which contains reg_count and stackptr* to the args. Point  */
	/* stackptr to the area where the non-float args start (which is at $fp). */
	addiu $4, $sp, 56   /* <- non-$fp replacement for: */
	sw    $4, 28($sp)   /* <-   sw $fp, 28($sp)        */
#if defined(DC__ABI_HARDFLOAT)
	sw $zero, 24($sp)   /* init num float-regs (unused for soft-float) */
#endif /* DC__ABI_HARDFLOAT */

	/* Prepare callback handler call. */
	move  $4, $12       /* Param 0 = DCCallback*, $12 ($t4) holds pointer to thunk */
	addiu $5, $sp, 24   /* Param 1 = DCArgs*, pointer to where pointer to args is stored */
	addiu $6, $sp, 32   /* Param 2 = results pointer to 8b of local data on stack */

dyncall/dynload/README.txt  view on Meta::CPAN

Idea: "GNU hash" method ([3])


Symbol Versioning:



OS supported prelinking:

linux has prelink
irix has quickstart
solaris has crle

sparc uses STT_REGISTER:
  STT_REGISTER is
    The Sparc architecture has a concept known as a "register symbol". These
    symbols are used to validate symbol/register usage, and can also be
    used to initialize global registers. Other architectures don't use these.



dyncall/dynload/dynload.3  view on Meta::CPAN

The parameter
.Ar sOut
is a pointer to a buffer of size
.Ar bufSize
(in bytes), to hold the output string (UTF-8 encoded). The return value is the size of the buffer (in bytes) needed to hold the null-terminated string, or 0 if it can't be looked up. If
.Ar bufSize
>= return value >= 1, a null-terminted string with the path to the library should be in
.Ar sOut .
If it returns 0, the library name wasn't able to be found. Please note that this might happen in some rare cases, so make sure to always check. Passing a null pointer as
.Ar pLib
returns the path to the executable (not guaranteed to be absolute - if it isn't it's relative to the working directory the process was started in, not the current one).
.Pp
The dlSyms* functions can be used to iterate over symbols. Since they can be used on libraries that are not linked, they are made
for symbol name lookups, not to get symbols' addresses. For that refer to
.Fn dlFindSymbol .
.Fn dlSymsInit
will return a handle (or null pointer on error) to the shared object specified by
.Ar libPath ,
to be used with the other dlSyms* functions. Note that contrary to loading and linking libraries, no (OS-specific) rules for searching libraries in library paths, etc. apply. The handle must be freed with
.Fn dlSymsCleanup .
.Fn dlSymsCount



( run in 0.402 second using v1.01-cache-2.11-cpan-0d8aa00de5b )