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

« back to all changes in this revision

Viewing changes to testsuite/tests/asmcomp/power-rhapsody.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-rhapsody.S 2553 1999-11-17 18:59:06Z xleroy $ */
 
14
 
 
15
/* Save and restore all callee-save registers */
 
16
/* GPR 14 at sp+16 ... GPR 31 at sp+84
 
17
   FPR 14 at sp+92 ... FPR 31 at sp+228 */
 
18
 
 
19
#define Save_callee_save \
 
20
        addic   r11, r1, 16-4; \
 
21
        stwu    r14, 4(r11); \
 
22
        stwu    r15, 4(r11); \
 
23
        stwu    r16, 4(r11); \
 
24
        stwu    r17, 4(r11); \
 
25
        stwu    r18, 4(r11); \
 
26
        stwu    r19, 4(r11); \
 
27
        stwu    r20, 4(r11); \
 
28
        stwu    r21, 4(r11); \
 
29
        stwu    r22, 4(r11); \
 
30
        stwu    r23, 4(r11); \
 
31
        stwu    r24, 4(r11); \
 
32
        stwu    r25, 4(r11); \
 
33
        stwu    r26, 4(r11); \
 
34
        stwu    r27, 4(r11); \
 
35
        stwu    r28, 4(r11); \
 
36
        stwu    r29, 4(r11); \
 
37
        stwu    r30, 4(r11); \
 
38
        stwu    r31, 4(r11); \
 
39
        stfdu   f14, 8(r11); \
 
40
        stfdu   f15, 8(r11); \
 
41
        stfdu   f16, 8(r11); \
 
42
        stfdu   f17, 8(r11); \
 
43
        stfdu   f18, 8(r11); \
 
44
        stfdu   f19, 8(r11); \
 
45
        stfdu   f20, 8(r11); \
 
46
        stfdu   f21, 8(r11); \
 
47
        stfdu   f22, 8(r11); \
 
48
        stfdu   f23, 8(r11); \
 
49
        stfdu   f24, 8(r11); \
 
50
        stfdu   f25, 8(r11); \
 
51
        stfdu   f26, 8(r11); \
 
52
        stfdu   f27, 8(r11); \
 
53
        stfdu   f28, 8(r11); \
 
54
        stfdu   f29, 8(r11); \
 
55
        stfdu   f30, 8(r11); \
 
56
        stfdu   f31, 8(r11)
 
57
 
 
58
#define Restore_callee_save \
 
59
        addic   r11, r1, 16-4; \
 
60
        lwzu    r14, 4(r11); \
 
61
        lwzu    r15, 4(r11); \
 
62
        lwzu    r16, 4(r11); \
 
63
        lwzu    r17, 4(r11); \
 
64
        lwzu    r18, 4(r11); \
 
65
        lwzu    r19, 4(r11); \
 
66
        lwzu    r20, 4(r11); \
 
67
        lwzu    r21, 4(r11); \
 
68
        lwzu    r22, 4(r11); \
 
69
        lwzu    r23, 4(r11); \
 
70
        lwzu    r24, 4(r11); \
 
71
        lwzu    r25, 4(r11); \
 
72
        lwzu    r26, 4(r11); \
 
73
        lwzu    r27, 4(r11); \
 
74
        lwzu    r28, 4(r11); \
 
75
        lwzu    r29, 4(r11); \
 
76
        lwzu    r30, 4(r11); \
 
77
        lwzu    r31, 4(r11); \
 
78
        lfdu    f14, 8(r11); \
 
79
        lfdu    f15, 8(r11); \
 
80
        lfdu    f16, 8(r11); \
 
81
        lfdu    f17, 8(r11); \
 
82
        lfdu    f18, 8(r11); \
 
83
        lfdu    f19, 8(r11); \
 
84
        lfdu    f20, 8(r11); \
 
85
        lfdu    f21, 8(r11); \
 
86
        lfdu    f22, 8(r11); \
 
87
        lfdu    f23, 8(r11); \
 
88
        lfdu    f24, 8(r11); \
 
89
        lfdu    f25, 8(r11); \
 
90
        lfdu    f26, 8(r11); \
 
91
        lfdu    f27, 8(r11); \
 
92
        lfdu    f28, 8(r11); \
 
93
        lfdu    f29, 8(r11); \
 
94
        lfdu    f30, 8(r11); \
 
95
        lfdu    f31, 8(r11)
 
96
 
 
97
        .text
 
98
 
 
99
        .globl  _call_gen_code
 
100
_call_gen_code:
 
101
    /* Allocate and link stack frame */
 
102
        stwu    r1, -256(r1)
 
103
    /* Save return address */
 
104
        mflr    r0
 
105
        stw     r0, 256+4(r1)
 
106
    /* Save all callee-save registers */
 
107
        Save_callee_save
 
108
    /* Shuffle arguments */
 
109
        mtlr    r3
 
110
        mr r3, r4
 
111
        mr r4, r5
 
112
        mr r5, r6
 
113
        mr r6, r7
 
114
    /* Call the function */
 
115
        blrl
 
116
    /* Restore callee-save registers */
 
117
        Restore_callee_save
 
118
    /* Reload return address */
 
119
        lwz     r0, 256+4(r1)
 
120
        mtlr    r0
 
121
    /* Return */
 
122
        addi    r1, r1, 256
 
123
        blr
 
124
 
 
125
        .globl  _caml_c_call
 
126
_caml_c_call:
 
127
    /* Jump to C function (address in 11) */
 
128
        mtctr   r11
 
129
        bctr