~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ipf64.s

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// Select C numeric constant
 
3
        .radix  C
 
4
        .psr    abi64
 
5
        .psr    lsb
 
6
// Section has executable code
 
7
        .section .text, "ax","progbits"
 
8
// procedure named 'SharedStub'
 
9
        .proc   SharedStub
 
10
// manual bundling
 
11
        .explicit
 
12
 
 
13
        .global PrepareAndDispatch
 
14
//      .exclass  PrepareAndDispatch, @fullyvisible
 
15
        .type   PrepareAndDispatch,@function
 
16
 
 
17
SharedStub::
 
18
// 9 arguments, first 8 are the input arguments of previous
 
19
// function call.  The last one is methodIndex, and is passed in memory
 
20
        .prologue
 
21
        .save ar.pfs , r41
 
22
// allocate 8 input args, 4 local args, and 5 output args
 
23
        alloc           r41 = ar.pfs, 8, 4, 5, 0   // M
 
24
        .save rp, r40
 
25
        mov             r40 = rp                   // I
 
26
        nop.i           0                       ;; // I
 
27
 
 
28
        .save ar.unat, r42
 
29
        mov             r42 = ar.unat              // M
 
30
        .fframe 144
 
31
        add             sp = -144, sp              // A
 
32
// unwind table already knows gp, don't need to specify anything
 
33
        add             r43 = 0, gp             ;; // A
 
34
 
 
35
// We have possible 8 integer registers and 8 float registers that could
 
36
// be arguments.  We also have a stack region from the previous
 
37
// stack frame that may hold some stack arguments.
 
38
// We need to write the integer registers to a memory region, write
 
39
// the float registers to a memory region (making sure we don't step
 
40
// on NAT while touching the registers).  We also mark the memory
 
41
// address of the stack arguments.
 
42
// We then call PrepareAndDispatch() specifying the three memory
 
43
// region pointers.
 
44
 
 
45
 
 
46
        .body
 
47
        add             out0 = 0, in0        // A  move self ptr
 
48
// 144 bytes = 16 byte stack header + 64 byte int space + 64 byte float space
 
49
// current frame is 144 bytes, previous frame is 112 bytes
 
50
// restarg is at 144 + 112 + 16 bytes away from current sp
 
51
// (current frame + previous frame + previous previous frame header)
 
52
// methodIndex is at 144 + 16 bytes away from current sp
 
53
// (current frame + previous frame header)
 
54
        add             out4 = 192, sp       // A  restarg address
 
55
        add             r11  = 160, sp    ;; // A  address of methodIndex
 
56
 
 
57
        ld8             out1 = [r11]         // M  load methodIndex
 
58
// sp + 16 is the start of intargs
 
59
        add             out2 = 16, sp        // A  address of intargs
 
60
// the intargs take up 64 bytes, so sp + 16 + 64 is the start of floatargs
 
61
        add             out3 = 80, sp     ;; // A  address of floatargs
 
62
 
 
63
        add             r11 = 0, out2     ;; // A
 
64
        st8.spill       [r11] = in1, 8       // M
 
65
        add             r10 = 0, out3     ;; // A
 
66
 
 
67
        st8.spill       [r11] = in2, 8    ;; // M
 
68
        st8.spill       [r11] = in3, 8       // M
 
69
        nop.i           0                 ;; // I
 
70
 
 
71
        st8.spill       [r11] = in4, 8    ;; // M
 
72
        st8.spill       [r11] = in5, 8       // M
 
73
        nop.i           0                 ;; // I
 
74
 
 
75
        st8.spill       [r11] = in6, 8    ;; // M
 
76
        st8.spill       [r11] = in7          // M
 
77
        fclass.nm       p14,p15 = f8,@nat ;; // F
 
78
 
 
79
(p14)   stfd            [r10] = f8, 8        // M
 
80
(p15)   add             r10 = 8, r10         // A
 
81
        fclass.nm       p12,p13 = f9,@nat ;; // F
 
82
 
 
83
(p12)   stfd            [r10] = f9, 8        // M
 
84
(p13)   add             r10 = 8, r10         // A
 
85
        fclass.nm       p14,p15 =f10,@nat ;; // F
 
86
 
 
87
(p14)   stfd            [r10] = f10, 8       // M
 
88
(p15)   add             r10 = 8, r10         // A
 
89
        fclass.nm       p12,p13 =f11,@nat ;; // F
 
90
 
 
91
(p12)   stfd            [r10] = f11, 8       // M
 
92
(p13)   add             r10 = 8, r10         // A
 
93
        fclass.nm       p14,p15 =f12,@nat ;; // F
 
94
 
 
95
(p14)   stfd            [r10] = f12, 8       // M
 
96
(p15)   add             r10 = 8, r10         // A
 
97
        fclass.nm       p12,p13 =f13,@nat ;; // F
 
98
 
 
99
(p12)   stfd            [r10] = f13, 8       // M
 
100
(p13)   add             r10 = 8, r10         // A
 
101
        fclass.nm       p14,p15 =f14,@nat ;; // F
 
102
 
 
103
(p14)   stfd            [r10] = f14, 8       // M
 
104
(p15)   add             r10 = 8, r10         // A
 
105
        fclass.nm       p12,p13 =f15,@nat ;; // F
 
106
 
 
107
(p12)   stfd            [r10] = f15, 8       // M
 
108
(p13)   add             r10 = 8, r10         // A
 
109
 
 
110
// branch to PrepareAndDispatch
 
111
        br.call.dptk.few rp = PrepareAndDispatch ;; // B
 
112
 
 
113
// epilog
 
114
        mov             ar.unat = r42        // M
 
115
        mov             ar.pfs = r41         // I
 
116
        mov             rp = r40          ;; // I
 
117
 
 
118
        add             gp = 0, r43          // A
 
119
        add             sp = 144, sp         // A
 
120
        br.ret.dptk.few rp                ;; // B
 
121
 
 
122
        .endp
 
123
 
 
124