Fix #4341: atan of complex bfloat calls rat
[maxima.git] / archive / src / execute.c
blobf73f4b9daea9b5d1090613f479b12deb13067b8f
1 #include "plot.h"
2 struct value_function
3 { char * body ;
4 struct value *constants;
5 };
6 extern int s_p;
7 extern struct value stack[];
9 enum m_ops {
10 m_real,
11 m_imag,
12 m_conj,
13 m_abs,
14 m_acsc,
15 m_acos,
16 m_tan,
17 m_sin,
18 m_tanh,
19 m_cos,
20 m_asin,
21 m_sinh,
22 m_cosh,
23 m_log,
24 m_factorial,
25 m_and,
26 m_set,
27 m_plus,
28 m_gt,
29 m_lt,
30 m_div,
31 m_ne,
32 m_mult,
33 m_ge,
34 m_eq,
35 m_minus,
36 m_power,
37 m_le,
38 m_or,
39 m_push,
40 m_push_0,
41 m_push_1,
42 m_push_2,
43 m_push_3,
44 m_push_i,
45 m_pushl_0,
46 m_pushl_1,
47 m_pushl_2,
48 m_pushl_3,
49 m_pushl_i,
50 m_pushc_0,
51 m_pushc_1,
52 m_pushc_2,
53 m_pushc_3,
54 m_pushc_4,
55 m_pushc_5,
56 m_pushc_6,
57 m_pushc_7,
58 m_pushc_8,
59 m_pushc_9,
60 m_pushc_i,
61 m_end,
62 m_reserve,
63 m_set_sp,
64 m_set_sp_frame_pointer,
65 m_return,
67 execute_fun(f,n)
68 struct value_function *f;
69 int n;
70 { unsigned char *body;
71 /* frame_pointer points just beyond last frames valid storage */
72 struct value *frame_pointer = &stack[sp -(n -1)];
73 body = f->body;
74 switch (*body)
76 case m_real: f_real(); break;
77 case m_imag: f_imag(); break;
78 case m_conj: f_conj(); break;
79 case m_abs: f_abs(); break;
80 case m_acsc: f_acsc(); break;
81 case m_acos: f_acos(); break;
82 case m_tan: f_tan(); break;
83 case m_sin: f_sin(); break;
84 case m_tanh: f_tanh(); break;
85 case m_cos: f_cos(); break;
86 case m_asin: f_asin(); break;
87 case m_sinh: f_sinh(); break;
88 case m_cosh: f_cosh(); break;
89 case m_log: f_log(); break;
90 case m_factorial: f_factorial(); break;
91 case m_and: f_and(); break;
92 case m_set: f_set(); break;
93 case m_plus: f_plus(); break;
94 case m_gt: f_gt(); break;
95 case m_lt: f_lt(); break;
96 case m_div: f_div(); break;
97 case m_ne: f_ne(); break;
98 case m_mult: f_mult(); break;
99 case m_ge: f_ge(); break;
100 case m_eq: f_eq(); break;
101 case m_minus: f_minus(); break;
102 case m_power: f_power(); break;
103 case m_le: f_le(); break;
104 case m_or: f_or(); break;
105 case m_push: f_push(); break;
106 case m_push_0: f_push_0(); break;
107 case m_push_1: f_push_1(); break;
108 case m_push_2: f_push_2(); break;
109 case m_push_3: f_push_3(); break;
110 case m_push_i: f_push_i(); break;
111 case m_pushl_0: f_pushl_0(); break;
112 case m_pushl_1: f_pushl_1(); break;
113 case m_pushl_2: f_pushl_2(); break;
114 case m_pushl_3: f_pushl_3(); break;
115 case m_pushl_i: f_pushl_i(); break;
116 case m_pushc_0: f_pushc_0(); break;
117 case m_pushc_1: f_pushc_1(); break;
118 case m_pushc_2: f_pushc_2(); break;
119 case m_pushc_3: f_pushc_3(); break;
120 case m_pushc_4: f_pushc_4(); break;
121 case m_pushc_5: f_pushc_5(); break;
122 case m_pushc_6: f_pushc_6(); break;
123 case m_pushc_7: f_pushc_7(); break;
124 case m_pushc_8: f_pushc_8(); break;
125 case m_pushc_9: f_pushc_9(); break;
126 case m_pushc_i: f_pushc_i(); break;
127 case m_end: f_end(); break;
128 case m_reserve: f_reserve(); break;
129 case m_set_sp: f_set_sp(); break;
130 case m_set_sp_frame_pointer: f_set_sp_frame_pointer(); break;
131 case m_return: f_return(); break;
132 default:
133 abort();
135 END: s_p = frame_pointer -stack -n;
136 pop(frame_pointer);
137 s_p = frame_pointer -stack -1;
138 return 1;