OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [arm/] [aapcs/] [abitest.h] - Blame information for rev 859

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 313 jeremybenn
#define IN_FRAMEWORK
2
 
3
#ifdef VFP
4
#define D0      0
5
#define D1      8
6
#define D2      16
7
#define D3      24
8
#define D4      32
9
#define D5      40
10
#define D6      48
11
#define D7      56
12
 
13
#define S0      64
14
#define S1      68
15
#define S2      72
16
#define S3      76
17
#define S4      80
18
#define S5      84
19
#define S6      88
20
#define S7      92
21
#define S8      86
22
#define S9      100
23
#define S10     104
24
#define S11     108
25
#define S12     112
26
#define S13     116
27
#define S14     120
28
#define S15     124
29
 
30
#define R0      128
31
#define R1      132
32
#define R2      136
33
#define R3      140
34
 
35
#define STACK   144
36
 
37
#else
38
 
39
#define R0      0
40
#define R1      4
41
#define R2      8
42
#define R3      12
43
 
44
#define STACK   16
45
 
46
#endif
47
 
48
extern void abort (void);
49
 
50
__attribute__((naked))  void dumpregs () __asm("myfunc");
51
__attribute__((naked))  void dumpregs ()
52
{
53
  asm(
54
      "mov      ip, sp\n\t"
55
      "stmfd    sp!, {r0-r3}\n\t"
56
#ifdef VFP
57
      "fstmdbs  sp!, {s0-s15}\n\t"
58
      "fstmdbd  sp!, {d0-d7}\n\t"
59
#endif
60
      "mov      r0, sp\n\t"
61
      "stmfd    sp!, {ip, r14}\n\t"
62
      "bl       testfunc\n\t"
63
      "ldmfd    sp!, {r0, r14}\n\t"
64
      "mov      sp, r0\n\t"
65
      "bx       lr");
66
}
67
 
68
 
69
#define LAST_ARG(type,val,offset) { type __x = val; if (memcmp(&__x, stack+offset, sizeof(type)) != 0) abort(); }
70
#define ARG(type,val,offset) LAST_ARG(type, val, offset)
71
#define ANON(type,val,offset) LAST_ARG(type, val, offset)
72
#define LAST_ANON(type,val,offset) LAST_ARG(type, val, offset)
73
#define DOTS
74
 
75
void testfunc(char* stack)
76
{
77
#include TESTFILE
78
  return;
79
}
80
 
81
#undef LAST_ARG
82
#undef ARG
83
#undef DOTS
84
#undef ANON
85
#undef LAST_ANON
86
#define LAST_ARG(type,val,offset) type
87
#define ARG(type,val,offset) LAST_ARG(type, val, offset),
88
#define DOTS ...
89
#define ANON(type,val, offset)
90
#define LAST_ANON(type,val, offset)
91
 
92
#ifndef MYFUNCTYPE
93
#define MYFUNCTYPE void
94
#endif
95
 
96
#ifndef PCSATTR
97
#define PCSATTR
98
#endif
99
 
100
MYFUNCTYPE myfunc(
101
#include TESTFILE
102
) PCSATTR;
103
 
104
#undef LAST_ARG
105
#undef ARG
106
#undef DOTS
107
#undef ANON
108
#undef LAST_ANON
109
#define LAST_ARG(type,val,offset) val
110
#define ARG(type,val,offset) LAST_ARG(type, val, offset),
111
#define DOTS
112
#define LAST_ANON(type,val,offset) LAST_ARG(type, val, offset)
113
#define ANON(type,val,offset) LAST_ARG(type, val, offset),
114
 
115
 
116
int main()
117
{
118
  myfunc(
119
#include TESTFILE
120
);
121
  return 0;
122
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.