~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to testsuite/tests/asmcomp/power-aix.S

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#*********************************************************************
 
2
#*                                                                   *
 
3
#*                          Objective Caml                           *
 
4
#*                                                                   *
 
5
#*           Xavier Leroy, projet Cristal, INRIA Rocquencourt        *
 
6
#*                                                                   *
 
7
#* Copyright 1996 Institut National de Recherche en Informatique et  *
 
8
#* en Automatique.  All rights reserved.  This file is distributed   *
 
9
#* under the terms of the Q Public License version 1.0.              *
 
10
#*                                                                   *
 
11
#*********************************************************************
 
12
 
 
13
# $Id: power-aix.S 3042 2000-04-05 18:30:22Z doligez $
 
14
 
 
15
        .csect  .text[PR]
 
16
 
 
17
        .globl  .call_gen_code
 
18
.call_gen_code:
 
19
# Save return address
 
20
        mflr 0
 
21
        stw 0, 8(1)
 
22
# Save all callee-save registers
 
23
        stw 13,-76(1)
 
24
        stw 14,-72(1)
 
25
        stw 15,-68(1)
 
26
        stw 16,-64(1)
 
27
        stw 17,-60(1)
 
28
        stw 18,-56(1)
 
29
        stw 19,-52(1)
 
30
        stw 20,-48(1)
 
31
        stw 21,-44(1)
 
32
        stw 22,-40(1)
 
33
        stw 23,-36(1)
 
34
        stw 24,-32(1)
 
35
        stw 25,-28(1)
 
36
        stw 26,-24(1)
 
37
        stw 27,-20(1)
 
38
        stw 28,-16(1)
 
39
        stw 29,-12(1)
 
40
        stw 30,-8(1)
 
41
        stw 31,-4(1)
 
42
        stfd 14, -224(1)
 
43
        stfd 15, -216(1)
 
44
        stfd 16, -208(1)
 
45
        stfd 17, -200(1)
 
46
        stfd 18, -192(1)
 
47
        stfd 19, -184(1)
 
48
        stfd 20, -176(1)
 
49
        stfd 21, -168(1)
 
50
        stfd 22, -160(1)
 
51
        stfd 23, -152(1)
 
52
        stfd 24, -144(1)
 
53
        stfd 25, -136(1)
 
54
        stfd 26, -128(1)
 
55
        stfd 27, -120(1)
 
56
        stfd 28, -112(1)
 
57
        stfd 29, -104(1)
 
58
        stfd 30, -96(1)
 
59
        stfd 31, -88(1)
 
60
# Allocate and link stack frame
 
61
        stwu 1, -280(1)
 
62
# Save global pointer
 
63
        stw 2, 20(1)
 
64
# Load code to call
 
65
        lwz 0, 0(3)
 
66
        lwz 2, 4(3)
 
67
        mtlr 0
 
68
# Shuffle arguments
 
69
        mr 3, 4
 
70
        mr 4, 5
 
71
        mr 5, 6
 
72
        mr 6, 7
 
73
# Call the function
 
74
        blrl
 
75
# Restore global pointer
 
76
        lwz 2, 20(1)
 
77
# Deallocate stack frame
 
78
        addic 1, 1, 280
 
79
# Restore callee-save registers
 
80
        lwz 13,-76(1)
 
81
        lwz 14,-72(1)
 
82
        lwz 15,-68(1)
 
83
        lwz 16,-64(1)
 
84
        lwz 17,-60(1)
 
85
        lwz 18,-56(1)
 
86
        lwz 19,-52(1)
 
87
        lwz 20,-48(1)
 
88
        lwz 21,-44(1)
 
89
        lwz 22,-40(1)
 
90
        lwz 23,-36(1)
 
91
        lwz 24,-32(1)
 
92
        lwz 25,-28(1)
 
93
        lwz 26,-24(1)
 
94
        lwz 27,-20(1)
 
95
        lwz 28,-16(1)
 
96
        lwz 29,-12(1)
 
97
        lwz 30,-8(1)
 
98
        lwz 31,-4(1)
 
99
        lfd 14, -224(1)
 
100
        lfd 15, -216(1)
 
101
        lfd 16, -208(1)
 
102
        lfd 17, -200(1)
 
103
        lfd 18, -192(1)
 
104
        lfd 19, -184(1)
 
105
        lfd 20, -176(1)
 
106
        lfd 21, -168(1)
 
107
        lfd 22, -160(1)
 
108
        lfd 23, -152(1)
 
109
        lfd 24, -144(1)
 
110
        lfd 25, -136(1)
 
111
        lfd 26, -128(1)
 
112
        lfd 27, -120(1)
 
113
        lfd 28, -112(1)
 
114
        lfd 29, -104(1)
 
115
        lfd 30, -96(1)
 
116
        lfd 31, -88(1)
 
117
# Reload return address
 
118
        lwz 0, 8(1)
 
119
        mtlr 0
 
120
# Return
 
121
        blr
 
122
 
 
123
        .globl  .caml_c_call
 
124
.caml_c_call:
 
125
# Preserve RTOC and return address in callee-save registers
 
126
# The C function will preserve them, and the Caml code does not
 
127
# expect them to be preserved
 
128
# Return address is in 25, RTOC is in 26
 
129
        mflr    25
 
130
        mr      26, 2
 
131
# Call desired function (descriptor in r11)
 
132
        lwz     0, 0(11)
 
133
        lwz     2, 4(11)
 
134
        mtlr    0
 
135
        blrl
 
136
# Restore return address and RTOC
 
137
        mtlr    25
 
138
        mr      2, 26
 
139
# Return to caller
 
140
        blr
 
141
 
 
142
# Function closures
 
143
 
 
144
        .globl  call_gen_code
 
145
        .csect  call_gen_code[DS]
 
146
call_gen_code:
 
147
        .long   .call_gen_code, TOC[tc0], 0
 
148
 
 
149
        .globl  caml_c_call
 
150
        .csect  caml_c_call[DS]
 
151
caml_c_call:
 
152
        .long   .caml_c_call, TOC[tc0], 0