Mercurial > hg > octave-lyh
comparison liboctave/mk-ops.awk @ 6119:fabb1be5fd84
[project @ 2006-10-28 00:13:58 by jwe]
author | jwe |
---|---|
date | Sat, 28 Oct 2006 00:13:59 +0000 |
parents | 160365410ad4 |
children | 0ce71beb1cf3 |
comparison
equal
deleted
inserted
replaced
6118:2803c70d8d01 | 6119:fabb1be5fd84 |
---|---|
24 } { | 24 } { |
25 if (declare_types) | 25 if (declare_types) |
26 { | 26 { |
27 ntypes++; | 27 ntypes++; |
28 | 28 |
29 if (NF == 6) | 29 if (NF == 6 || NF == 7) |
30 { | 30 { |
31 if (NF == 7) | |
32 core_type[ntypes] = $7; | |
33 | |
31 scalar_zero_val[ntypes] = $6; | 34 scalar_zero_val[ntypes] = $6; |
32 fwd_decl_ok[ntypes] = $5 == "YES"; | 35 fwd_decl_ok[ntypes] = $5 == "YES"; |
33 header[ntypes] = $4 == "NONE" ? "" : $4; | 36 header[ntypes] = $4 == "NONE" ? "" : $4; |
34 class[ntypes] = $3; | 37 class[ntypes] = $3; |
35 type[ntypes] = $2; | 38 type[ntypes] = $2; |
95 rhs_num = rev_tag[rhs_tag]; | 98 rhs_num = rev_tag[rhs_tag]; |
96 | 99 |
97 result_type = type[result_num]; | 100 result_type = type[result_num]; |
98 lhs_type = type[lhs_num]; | 101 lhs_type = type[lhs_num]; |
99 rhs_type = type[rhs_num]; | 102 rhs_type = type[rhs_num]; |
103 | |
104 lhs_core_type = core_type[lhs_num]; | |
105 rhs_core_type = core_type[rhs_num]; | |
100 | 106 |
101 result_scalar_zero_val = scalar_zero_val[result_num]; | 107 result_scalar_zero_val = scalar_zero_val[result_num]; |
102 lhs_scalar_zero_val = scalar_zero_val[lhs_num]; | 108 lhs_scalar_zero_val = scalar_zero_val[lhs_num]; |
103 rhs_scalar_zero_val = scalar_zero_val[rhs_num]; | 109 rhs_scalar_zero_val = scalar_zero_val[rhs_num]; |
104 | 110 |
194 lhs_class, rhs_class, result_type, | 200 lhs_class, rhs_class, result_type, |
195 lhs_type, rhs_type) >> cc_file | 201 lhs_type, rhs_type) >> cc_file |
196 } | 202 } |
197 | 203 |
198 if (cmp_ops) | 204 if (cmp_ops) |
199 printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n", lhs_class, rhs_class, | 205 { |
200 lhs_type, lhs_conv, rhs_type, rhs_conv) >> cc_file | 206 if (lhs_class == "S" || rhs_class == "S") |
207 { | |
208 if (lhs_core_type) | |
209 { | |
210 if (rhs_core_type) | |
211 printf ("%s%s_CMP_OPS2 (%s, %s, %s, %s, %s, %s)\n", | |
212 lhs_class, rhs_class, lhs_type, lhs_conv, | |
213 rhs_type, rhs_conv, | |
214 lhs_core_type, rhs_core_type) >> cc_file | |
215 else | |
216 printf ("%s%s_CMP_OPS1 (%s, %s, %s, %s, %s)\n", | |
217 lhs_class, rhs_class, lhs_type, lhs_conv, | |
218 rhs_type, rhs_conv, lhs_core_type) >> cc_file | |
219 } | |
220 else | |
221 { | |
222 if (rhs_core_type) | |
223 printf ("%s%s_CMP_OPS1 (%s, %s, %s, %s, %s)\n", | |
224 lhs_class, rhs_class, lhs_type, lhs_conv, | |
225 rhs_type, rhs_conv, rhs_core_type) >> cc_file | |
226 else | |
227 printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n", | |
228 lhs_class, rhs_class, lhs_type, lhs_conv, | |
229 rhs_type, rhs_conv) >> cc_file | |
230 } | |
231 } | |
232 else | |
233 printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n", | |
234 lhs_class, rhs_class, lhs_type, lhs_conv, | |
235 rhs_type, rhs_conv) >> cc_file | |
236 } | |
201 | 237 |
202 if (bool_ops) | 238 if (bool_ops) |
203 printf ("%s%s_BOOL_OPS2 (%s, %s, %s, %s)\n", lhs_class, rhs_class, | 239 printf ("%s%s_BOOL_OPS2 (%s, %s, %s, %s)\n", lhs_class, rhs_class, |
204 lhs_type, rhs_type, lhs_scalar_zero_val, | 240 lhs_type, rhs_type, lhs_scalar_zero_val, |
205 rhs_scalar_zero_val) >> cc_file | 241 rhs_scalar_zero_val) >> cc_file |