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

« back to all changes in this revision

Viewing changes to testsuite/tests/asmcomp/ia64.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: ia64.S 3573 2001-07-12 12:54:24Z doligez $ */
 
14
 
 
15
#define ST8OFF(a,b,d) st8 [a] = b, d
 
16
#define LD8OFF(a,b,d) ld8 a = [b], d
 
17
#define STFDOFF(a,b,d) stfd [a] = b, d
 
18
#define LDFDOFF(a,b,d) ldfd a = [b], d
 
19
#define STFSPILLOFF(a,b,d) stf.spill [a] = b, d
 
20
#define LDFFILLOFF(a,b,d) ldf.fill a = [b], d
 
21
 
 
22
        .text
 
23
        .align 16
 
24
 
 
25
        .global call_gen_code#
 
26
        .proc   call_gen_code#
 
27
 
 
28
call_gen_code:
 
29
        /* Allocate 64 "out" registers (for the Caml code) and no locals */
 
30
        alloc   r3 = ar.pfs, 0, 0, 64, 0
 
31
 
 
32
        /* Save PFS, return address and GP on stack */
 
33
        add     sp = -368, sp ;;
 
34
        add     r2 = 16, sp ;;
 
35
        ST8OFF(r2,r3,8) ;;
 
36
        mov     r3 = b0 ;;
 
37
        ST8OFF(r2,r3,8) ;;
 
38
        ST8OFF(r2,gp,8) ;;
 
39
 
 
40
        /* Save predicates on stack */
 
41
        mov     r3 = pr ;;
 
42
        st8     [r2] = r3
 
43
 
 
44
        /* Save callee-save floating-point registers on stack */
 
45
        add     r2 = 48, sp
 
46
        add     r3 = 64, sp ;;
 
47
        STFSPILLOFF(r2,f2,16) ;;
 
48
        STFSPILLOFF(r3,f3,16) ;;
 
49
        STFSPILLOFF(r2,f4,16) ;;
 
50
        STFSPILLOFF(r3,f5,16) ;;
 
51
        STFSPILLOFF(r2,f16,16) ;;
 
52
        STFSPILLOFF(r3,f17,16) ;;
 
53
        STFSPILLOFF(r2,f18,16) ;;
 
54
        STFSPILLOFF(r3,f19,16) ;;
 
55
        STFSPILLOFF(r2,f20,16) ;;
 
56
        STFSPILLOFF(r3,f21,16) ;;
 
57
        STFSPILLOFF(r2,f22,16) ;;
 
58
        STFSPILLOFF(r3,f23,16) ;;
 
59
        STFSPILLOFF(r2,f24,16) ;;
 
60
        STFSPILLOFF(r3,f25,16) ;;
 
61
        STFSPILLOFF(r2,f26,16) ;;
 
62
        STFSPILLOFF(r3,f27,16) ;;
 
63
        STFSPILLOFF(r2,f28,16) ;;
 
64
        STFSPILLOFF(r3,f29,16) ;;
 
65
        STFSPILLOFF(r2,f30,16) ;;
 
66
        STFSPILLOFF(r3,f31,16) ;;
 
67
 
 
68
        /* Recover entry point and gp from the function pointer in in0 */
 
69
        LD8OFF(r2,r32,8) ;;
 
70
        ld8     r3 = [r32] ;;
 
71
        mov     b6 = r2
 
72
        mov     gp = r3 ;;
 
73
 
 
74
        /* Shift arguments r33 ... r35 to r32 ... r34 */
 
75
        mov     r32 = r33
 
76
        mov     r33 = r34
 
77
        mov     r34 = r35
 
78
 
 
79
        /* Do the call */
 
80
        br.call.sptk b0 = b6 ;;
 
81
 
 
82
        /* Restore the saved floating-point registers */
 
83
        add     r2 = 48, sp
 
84
        add     r3 = 64, sp ;;
 
85
        LDFFILLOFF(f2,r2,16) ;;
 
86
        LDFFILLOFF(f3,r3,16) ;;
 
87
        LDFFILLOFF(f4,r2,16) ;;
 
88
        LDFFILLOFF(f5,r3,16) ;;
 
89
        LDFFILLOFF(f16,r2,16) ;;
 
90
        LDFFILLOFF(f17,r3,16) ;;
 
91
        LDFFILLOFF(f18,r2,16) ;;
 
92
        LDFFILLOFF(f19,r3,16) ;;
 
93
        LDFFILLOFF(f20,r2,16) ;;
 
94
        LDFFILLOFF(f21,r3,16) ;;
 
95
        LDFFILLOFF(f22,r2,16) ;;
 
96
        LDFFILLOFF(f23,r3,16) ;;
 
97
        LDFFILLOFF(f24,r2,16) ;;
 
98
        LDFFILLOFF(f25,r3,16) ;;
 
99
        LDFFILLOFF(f26,r2,16) ;;
 
100
        LDFFILLOFF(f27,r3,16) ;;
 
101
        LDFFILLOFF(f28,r2,16) ;;
 
102
        LDFFILLOFF(f29,r3,16) ;;
 
103
        LDFFILLOFF(f30,r2,16) ;;
 
104
        LDFFILLOFF(f31,r3,16) ;;
 
105
 
 
106
        /* Restore gp, predicates and return */
 
107
        add     r2 = 16, sp ;;
 
108
        LD8OFF(r3,r2,8) ;;
 
109
        mov     ar.pfs = r3
 
110
        LD8OFF(r3,r2,8) ;;
 
111
        mov     b0 = r3
 
112
        LD8OFF(gp,r2,8) ;;
 
113
        LD8OFF(r3,r2,8) ;;
 
114
        mov     pr = r3, -1
 
115
 
 
116
        br.ret.sptk.many b0 ;;
 
117
 
 
118
        .endp   call_gen_code#