1 /* This is a simple version of setjmp and longjmp for MIPS 32 and 64.
3 Ian Lance Taylor, Cygnus Support, 13 May 1993. */
6 /* This file contains 32 bit assembly code. */
11 GPR_OFFSET ($16, 0); \
12 GPR_OFFSET ($17, 1); \
13 GPR_OFFSET ($18, 2); \
14 GPR_OFFSET ($19, 3); \
15 GPR_OFFSET ($20, 4); \
16 GPR_OFFSET ($21, 5); \
17 GPR_OFFSET ($22, 6); \
18 GPR_OFFSET ($23, 7); \
19 GPR_OFFSET ($29, 8); \
20 GPR_OFFSET ($30, 9); \
23 #define NUM_GPRS_SAVED 11
25 #ifdef __mips_hard_float
27 FPR_OFFSET ($f20, 0); \
28 FPR_OFFSET ($f21, 1); \
29 FPR_OFFSET ($f22, 2); \
30 FPR_OFFSET ($f23, 3); \
31 FPR_OFFSET ($f24, 4); \
32 FPR_OFFSET ($f25, 5); \
33 FPR_OFFSET ($f26, 6); \
34 FPR_OFFSET ($f27, 7); \
35 FPR_OFFSET ($f28, 8); \
36 FPR_OFFSET ($f29, 9); \
37 FPR_OFFSET ($f30, 10); \
44 #define BYTES_PER_WORD 8
48 #define STORE_FPR sdc1
50 #define BYTES_PER_WORD 4
54 #define STORE_FPR swc1
57 #define GPOFF(INDEX) (INDEX * BYTES_PER_WORD)
58 #define FPOFF(INDEX) ((INDEX + NUM_GPRS_SAVED) * BYTES_PER_WORD)
60 /* int setjmp (jmp_buf); */
66 #define GPR_OFFSET(REG, INDEX) STORE_GPR REG,GPOFF(INDEX)($4)
67 #define FPR_OFFSET(REG, INDEX) STORE_FPR REG,FPOFF(INDEX)($4)
78 /* volatile void longjmp (jmp_buf, int); */
84 #define GPR_OFFSET(REG, INDEX) LOAD_GPR REG,GPOFF(INDEX)($4)
85 #define FPR_OFFSET(REG, INDEX) LOAD_FPR REG,FPOFF(INDEX)($4)