2 * Copyright (C) 2012-2019 Free Software Foundation, Inc.
4 * This file is part of GNU lightning.
6 * GNU lightning is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 3, or (at your option)
11 * GNU lightning is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 * License for more details.
17 * Paulo Cesar Pereira de Andrade
20 #define jit_arg_reg_p(i) ((i) >= 0 && (i) < 8)
22 # define jit_arg_f_reg_p(i) ((i) >= 0 && (i) < 13)
24 # define jit_arg_f_reg_p(i) ((i) >= 0 && (i) < 8)
26 # define va_gp_shift 2
28 # define va_gp_shift 3
30 # define va_gp_increment sizeof(jit_word_t)
31 # define first_gp_argument r3
32 # define first_gp_offset offsetof(jit_va_list_t, \
34 # define va_fp_increment sizeof(jit_float64_t)
35 # define first_fp_argument f1
36 # define first_fp_offset offsetof(jit_va_list_t, \
39 #if __BYTE_ORDER == __LITTLE_ENDIAN
45 # define C_DISP (__WORDSIZE >> 3) - sizeof(jit_int8_t)
46 # define S_DISP (__WORDSIZE >> 3) - sizeof(jit_int16_t)
47 # define I_DISP (__WORDSIZE >> 3) - sizeof(jit_int32_t)
48 # define F_DISP (__WORDSIZE >> 3) - sizeof(jit_float32_t)
55 typedef struct jit_va_list {
85 typedef jit_pointer_t jit_va_list_t;
91 #define patch(instr, node) _patch(_jit, instr, node)
92 static void _patch(jit_state_t*,jit_word_t,jit_node_t*);
95 extern void __clear_cache(void *, void *);
98 # include "jit_ppc-cpu.c"
99 # include "jit_ppc-fpu.c"
105 jit_register_t _rvs[] = {
106 { rc(sav) | 0, "r0" },
107 { rc(sav) | 11, "r11" }, /* env */
108 { rc(sav) | 12, "r12" }, /* exception */
109 { rc(sav) | 13, "r13" }, /* thread */
110 { rc(sav) | 2, "r2" }, /* toc */
111 { rc(sav) | rc(gpr) | 14, "r14" },
112 { rc(sav) | rc(gpr) | 15, "r15" },
113 { rc(sav) | rc(gpr) | 16, "r16" },
114 { rc(sav) | rc(gpr) | 17, "r17" },
115 { rc(sav) | rc(gpr) | 18, "r18" },
116 { rc(sav) | rc(gpr) | 19, "r19" },
117 { rc(sav) | rc(gpr) | 20, "r20" },
118 { rc(sav) | rc(gpr) | 21, "r21" },
119 { rc(sav) | rc(gpr) | 22, "r22" },
120 { rc(sav) | rc(gpr) | 23, "r23" },
121 { rc(sav) | rc(gpr) | 24, "r24" },
122 { rc(sav) | rc(gpr) | 25, "r25" },
123 { rc(sav) | rc(gpr) | 26, "r26" },
124 { rc(sav) | rc(gpr) | 27, "r27" },
125 { rc(sav) | rc(gpr) | 28, "r28" },
126 { rc(sav) | rc(gpr) | 29, "r29" },
127 { rc(sav) | rc(gpr) | 30, "r30" },
128 { rc(sav) | 1, "r1" },
129 { rc(sav) | 31, "r31" },
130 { rc(arg) | rc(gpr) | 10, "r10" },
131 { rc(arg) | rc(gpr) | 9, "r9" },
132 { rc(arg) | rc(gpr) | 8, "r8" },
133 { rc(arg) | rc(gpr) | 7, "r7" },
134 { rc(arg) | rc(gpr) | 6, "r6" },
135 { rc(arg) | rc(gpr) | 5, "r5" },
136 { rc(arg) | rc(gpr) | 4, "r4" },
137 { rc(arg) | rc(gpr) | 3, "r3" },
138 { rc(fpr) | 0, "f0" },
139 { rc(sav) | rc(fpr) | 14, "f14" },
140 { rc(sav) | rc(fpr) | 15, "f15" },
141 { rc(sav) | rc(fpr) | 16, "f16" },
142 { rc(sav) | rc(fpr) | 17, "f17" },
143 { rc(sav) | rc(fpr) | 18, "f18" },
144 { rc(sav) | rc(fpr) | 19, "f19" },
145 { rc(sav) | rc(fpr) | 20, "f20" },
146 { rc(sav) | rc(fpr) | 21, "f21" },
147 { rc(sav) | rc(fpr) | 22, "f22" },
148 { rc(sav) | rc(fpr) | 23, "f23" },
149 { rc(sav) | rc(fpr) | 24, "f24" },
150 { rc(sav) | rc(fpr) | 25, "f25" },
151 { rc(sav) | rc(fpr) | 26, "f26" },
152 { rc(sav) | rc(fpr) | 27, "f27" },
153 { rc(sav) | rc(fpr) | 28, "f28" },
154 { rc(sav) | rc(fpr) | 29, "f29" },
155 { rc(sav) | rc(fpr) | 30, "f30" },
156 { rc(sav) | rc(fpr) | 31, "f31" },
158 { rc(arg) | rc(fpr) | 13, "f13" },
159 { rc(arg) | rc(fpr) | 12, "f12" },
160 { rc(arg) | rc(fpr) | 11, "f11" },
161 { rc(arg) | rc(fpr) | 10, "f10" },
162 { rc(arg) | rc(fpr) | 9, "f9" },
164 { rc(fpr) | 13, "f13" },
165 { rc(fpr) | 12, "f12" },
166 { rc(fpr) | 11, "f11" },
167 { rc(fpr) | 10, "f10" },
168 { rc(fpr) | 9, "f9" },
170 { rc(arg) | rc(fpr) | 8, "f8" },
171 { rc(arg) | rc(fpr) | 7, "f7" },
172 { rc(arg) | rc(fpr) | 6, "f6" },
173 { rc(arg) | rc(fpr) | 5, "f5" },
174 { rc(arg) | rc(fpr) | 4, "f4" },
175 { rc(arg) | rc(fpr) | 3, "f3" },
176 { rc(arg) | rc(fpr) | 2, "f2" },
177 { rc(arg) | rc(fpr) | 1, "f1" },
178 { _NOREG, "<none>" },
190 _jit_init(jit_state_t *_jit)
192 _jitc->reglen = jit_size(_rvs) - 1;
196 _jit_prolog(jit_state_t *_jit)
202 assert(jit_regset_cmp_ui(&_jitc->regarg, 0) == 0);
203 jit_regset_set_ui(&_jitc->regsav, 0);
204 offset = _jitc->functions.offset;
205 if (offset >= _jitc->functions.length) {
206 jit_realloc((jit_pointer_t *)&_jitc->functions.ptr,
207 _jitc->functions.length * sizeof(jit_function_t),
208 (_jitc->functions.length + 16) * sizeof(jit_function_t));
209 _jitc->functions.length += 16;
211 _jitc->function = _jitc->functions.ptr + _jitc->functions.offset++;
212 _jitc->function->self.size = params_offset;
213 _jitc->function->self.argi = _jitc->function->self.argf =
214 _jitc->function->self.alen = 0;
215 /* float conversion */
216 _jitc->function->self.aoff = alloca_offset - 8;
217 _jitc->function->self.call = jit_call_default;
218 jit_alloc((jit_pointer_t *)&_jitc->function->regoff,
219 _jitc->reglen * sizeof(jit_int32_t));
221 /* _no_link here does not mean the jit_link() call can be removed
223 * _jitc->function->prolog = jit_new_node(jit_code_prolog);
225 _jitc->function->prolog = jit_new_node_no_link(jit_code_prolog);
226 jit_link(_jitc->function->prolog);
227 _jitc->function->prolog->w.w = offset;
228 _jitc->function->epilog = jit_new_node_no_link(jit_code_epilog);
230 * v: offset in blocks vector
231 * w: offset in functions vector
233 _jitc->function->epilog->w.w = offset;
235 jit_regset_new(&_jitc->function->regset);
239 _jit_allocai(jit_state_t *_jit, jit_int32_t length)
241 assert(_jitc->function);
243 case 0: case 1: break;
244 case 2: _jitc->function->self.aoff &= -2; break;
245 case 3: case 4: _jitc->function->self.aoff &= -4; break;
246 default: _jitc->function->self.aoff &= -8; break;
248 _jitc->function->self.aoff -= length;
249 if (!_jitc->realize) {
250 jit_inc_synth_ww(allocai, _jitc->function->self.aoff, length);
253 return (_jitc->function->self.aoff);
257 _jit_allocar(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
260 assert(_jitc->function);
261 jit_inc_synth_ww(allocar, u, v);
262 if (!_jitc->function->allocar) {
263 _jitc->function->aoffoff = jit_allocai(sizeof(jit_int32_t));
264 _jitc->function->allocar = 1;
266 r0 = jit_get_reg(jit_class_gpr);
267 r1 = jit_get_reg(jit_class_gpr);
270 jit_andi(r1, r1, -16);
271 jit_ldxi_i(u, JIT_FP, _jitc->function->aoffoff);
273 jit_addr(JIT_SP, JIT_SP, r1);
274 jit_stxi_i(_jitc->function->aoffoff, JIT_FP, u);
282 _jit_ret(jit_state_t *_jit)
285 assert(_jitc->function);
289 jit_patch_at(instr, _jitc->function->epilog);
294 _jit_retr(jit_state_t *_jit, jit_int32_t u)
296 jit_inc_synth_w(retr, u);
298 jit_movr(JIT_RET, u);
305 _jit_reti(jit_state_t *_jit, jit_word_t u)
307 jit_inc_synth_w(reti, u);
308 jit_movi(JIT_RET, u);
314 _jit_retr_f(jit_state_t *_jit, jit_int32_t u)
316 jit_inc_synth_w(retr_f, u);
318 jit_movr_f(JIT_FRET, u);
326 _jit_reti_f(jit_state_t *_jit, jit_float32_t u)
328 jit_inc_synth_f(reti_f, u);
329 jit_movi_f(JIT_FRET, u);
335 _jit_retr_d(jit_state_t *_jit, jit_int32_t u)
337 jit_inc_synth_w(retr_d, u);
339 jit_movr_d(JIT_FRET, u);
347 _jit_reti_d(jit_state_t *_jit, jit_float64_t u)
349 jit_inc_synth_d(reti_d, u);
350 jit_movi_d(JIT_FRET, u);
356 _jit_epilog(jit_state_t *_jit)
358 assert(_jitc->function);
359 assert(_jitc->function->epilog->next == NULL);
360 jit_link(_jitc->function->epilog);
361 _jitc->function = NULL;
365 _jit_arg_register_p(jit_state_t *_jit, jit_node_t *u)
367 if (u->code == jit_code_arg)
368 return (jit_arg_reg_p(u->u.w));
369 assert(u->code == jit_code_arg_f || u->code == jit_code_arg_d);
370 return (jit_arg_f_reg_p(u->u.w));
374 _jit_ellipsis(jit_state_t *_jit)
376 jit_inc_synth(ellipsis);
377 if (_jitc->prepare) {
379 assert(!(_jitc->function->call.call & jit_call_varargs));
380 _jitc->function->call.call |= jit_call_varargs;
384 assert(!(_jitc->function->self.call & jit_call_varargs));
385 _jitc->function->self.call |= jit_call_varargs;
387 /* Allocate va_list like object in the stack.
388 * If applicable, with enough space to save all argument
389 * registers, and use fixed offsets for them. */
390 _jitc->function->vaoff = jit_allocai(sizeof(jit_va_list_t));
392 _jitc->function->vagp = _jitc->function->self.argi;
393 _jitc->function->vafp = _jitc->function->self.argf;
399 _jit_va_push(jit_state_t *_jit, jit_int32_t u)
401 jit_inc_synth_w(va_push, u);
407 _jit_arg(jit_state_t *_jit)
412 assert(_jitc->function);
413 if (jit_arg_reg_p(_jitc->function->self.argi)) {
414 offset = _jitc->function->self.argi++;
420 offset = _jitc->function->self.size;
422 _jitc->function->self.size += sizeof(jit_word_t);
423 node = jit_new_node_ww(jit_code_arg, offset,
424 ++_jitc->function->self.argn);
430 _jit_arg_f(jit_state_t *_jit)
435 assert(_jitc->function);
436 if (jit_arg_f_reg_p(_jitc->function->self.argf)) {
437 offset = _jitc->function->self.argf++;
443 offset = _jitc->function->self.size + F_DISP;
445 if (jit_arg_reg_p(_jitc->function->self.argi)) {
446 # if __WORDSIZE == 32
447 _jitc->function->self.argi += 2;
449 _jitc->function->self.argi++;
454 _jitc->function->self.size += sizeof(jit_word_t);
455 node = jit_new_node_ww(jit_code_arg_f, offset,
456 ++_jitc->function->self.argn);
462 _jit_arg_d(jit_state_t *_jit)
467 assert(_jitc->function);
468 if (jit_arg_f_reg_p(_jitc->function->self.argf)) {
469 offset = _jitc->function->self.argf++;
476 if (_jitc->function->self.size & 7)
477 _jitc->function->self.size += 4;
479 offset = _jitc->function->self.size;
482 if (jit_arg_reg_p(_jitc->function->self.argi)) {
483 # if __WORDSIZE == 32
484 _jitc->function->self.argi += 2;
486 _jitc->function->self.argi++;
491 _jitc->function->self.size += sizeof(jit_float64_t);
492 node = jit_new_node_ww(jit_code_arg_d, offset,
493 ++_jitc->function->self.argn);
499 _jit_getarg_c(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
501 assert(v->code == jit_code_arg);
502 jit_inc_synth_wp(getarg_c, u, v);
503 if (jit_arg_reg_p(v->u.w))
504 jit_extr_c(u, JIT_RA0 - v->u.w);
506 jit_ldxi_c(u, JIT_FP, v->u.w + C_DISP);
511 _jit_getarg_uc(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
513 assert(v->code == jit_code_arg);
514 jit_inc_synth_wp(getarg_uc, u, v);
515 if (jit_arg_reg_p(v->u.w))
516 jit_extr_uc(u, JIT_RA0 - v->u.w);
518 jit_ldxi_uc(u, JIT_FP, v->u.w + C_DISP);
523 _jit_getarg_s(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
525 assert(v->code == jit_code_arg);
526 jit_inc_synth_wp(getarg_s, u, v);
527 if (jit_arg_reg_p(v->u.w))
528 jit_extr_s(u, JIT_RA0 - v->u.w);
530 jit_ldxi_s(u, JIT_FP, v->u.w + S_DISP);
535 _jit_getarg_us(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
537 assert(v->code == jit_code_arg);
538 jit_inc_synth_wp(getarg_us, u, v);
539 if (jit_arg_reg_p(v->u.w))
540 jit_extr_us(u, JIT_RA0 - v->u.w);
542 jit_ldxi_us(u, JIT_FP, v->u.w + S_DISP);
547 _jit_getarg_i(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
549 assert(v->code == jit_code_arg);
550 jit_inc_synth_wp(getarg_i, u, v);
551 if (jit_arg_reg_p(v->u.w)) {
553 jit_movr(u, JIT_RA0 - v->u.w);
555 jit_extr_i(u, JIT_RA0 - v->u.w);
559 jit_ldxi_i(u, JIT_FP, v->u.w + I_DISP);
565 _jit_getarg_ui(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
567 assert(v->code == jit_code_arg);
568 jit_inc_synth_wp(getarg_ui, u, v);
569 if (jit_arg_reg_p(v->u.w))
570 jit_extr_ui(u, JIT_RA0 - v->u.w);
572 jit_ldxi_ui(u, JIT_FP, v->u.w + I_DISP);
577 _jit_getarg_l(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
579 assert(v->code == jit_code_arg);
580 jit_inc_synth_wp(getarg_l, u, v);
581 if (jit_arg_reg_p(v->u.w))
582 jit_movr(u, JIT_RA0 - v->u.w);
584 jit_ldxi_l(u, JIT_FP, v->u.w);
590 _jit_putargr(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
592 assert(v->code == jit_code_arg);
593 jit_inc_synth_wp(putargr, u, v);
594 if (jit_arg_reg_p(v->u.w))
595 jit_movr(JIT_RA0 - v->u.w, u);
597 jit_stxi(v->u.w, JIT_FP, u);
602 _jit_putargi(jit_state_t *_jit, jit_word_t u, jit_node_t *v)
605 jit_inc_synth_wp(putargi, u, v);
606 assert(v->code == jit_code_arg);
607 if (jit_arg_reg_p(v->u.w))
608 jit_movi(JIT_RA0 - v->u.w, u);
610 regno = jit_get_reg(jit_class_gpr);
612 jit_stxi(v->u.w, JIT_FP, regno);
613 jit_unget_reg(regno);
619 _jit_getarg_f(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
621 assert(v->code == jit_code_arg_f);
622 jit_inc_synth_wp(getarg_f, u, v);
623 if (jit_arg_f_reg_p(v->u.w))
624 jit_movr_d(u, JIT_FA0 - v->u.w);
626 jit_ldxi_f(u, JIT_FP, v->u.w);
631 _jit_putargr_f(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
633 assert(v->code == jit_code_arg_f);
634 jit_inc_synth_wp(putargr_f, u, v);
635 if (jit_arg_f_reg_p(v->u.w))
636 jit_movr_d(JIT_FA0 - v->u.w, u);
638 jit_stxi_f(v->u.w, JIT_FP, u);
643 _jit_putargi_f(jit_state_t *_jit, jit_float32_t u, jit_node_t *v)
646 assert(v->code == jit_code_arg_f);
647 jit_inc_synth_fp(putargi_f, u, v);
648 if (jit_arg_f_reg_p(v->u.w))
649 jit_movi_d(JIT_FA0 - v->u.w, u);
651 regno = jit_get_reg(jit_class_fpr);
652 jit_movi_d(regno, u);
653 jit_stxi_f(v->u.w, JIT_FP, regno);
654 jit_unget_reg(regno);
660 _jit_getarg_d(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
662 assert(v->code == jit_code_arg_d);
663 jit_inc_synth_wp(getarg_d, u, v);
664 if (jit_arg_f_reg_p(v->u.w))
665 jit_movr_d(u, JIT_FA0 - v->u.w);
667 jit_ldxi_d(u, JIT_FP, v->u.w);
672 _jit_putargr_d(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
674 assert(v->code == jit_code_arg_d);
675 jit_inc_synth_wp(putargr_d, u, v);
676 if (jit_arg_f_reg_p(v->u.w))
677 jit_movr_d(JIT_FA0 - v->u.w, u);
679 jit_stxi_d(v->u.w, JIT_FP, u);
684 _jit_putargi_d(jit_state_t *_jit, jit_float64_t u, jit_node_t *v)
687 assert(v->code == jit_code_arg_d);
688 jit_inc_synth_dp(putargi_d, u, v);
689 if (jit_arg_f_reg_p(v->u.w))
690 jit_movi_d(JIT_FA0 - v->u.w, u);
692 regno = jit_get_reg(jit_class_fpr);
693 jit_movi_d(regno, u);
694 jit_stxi_d(v->u.w, JIT_FP, regno);
695 jit_unget_reg(regno);
701 _jit_pushargr(jit_state_t *_jit, jit_int32_t u)
704 assert(_jitc->function);
705 jit_inc_synth_w(pushargr, u);
707 if (jit_arg_reg_p(_jitc->function->call.argi)) {
708 jit_movr(JIT_RA0 - _jitc->function->call.argi, u);
709 ++_jitc->function->call.argi;
715 jit_stxi(_jitc->function->call.size + params_offset, JIT_SP, u);
717 _jitc->function->call.size += sizeof(jit_word_t);
722 _jit_pushargi(jit_state_t *_jit, jit_word_t u)
726 assert(_jitc->function);
727 jit_inc_synth_w(pushargi, u);
729 if (jit_arg_reg_p(_jitc->function->call.argi)) {
730 jit_movi(JIT_RA0 - _jitc->function->call.argi, u);
731 ++_jitc->function->call.argi;
737 regno = jit_get_reg(jit_class_gpr);
739 jit_stxi(_jitc->function->call.size + params_offset, JIT_SP, regno);
740 jit_unget_reg(regno);
743 _jitc->function->call.size += sizeof(jit_word_t);
748 _jit_pushargr_f(jit_state_t *_jit, jit_int32_t u)
751 assert(_jitc->function);
752 jit_inc_synth_w(pushargr_f, u);
754 if (jit_arg_f_reg_p(_jitc->function->call.argf)
756 && !(_jitc->function->call.call & jit_call_varargs)
759 jit_movr_d(JIT_FA0 - _jitc->function->call.argf, u);
760 ++_jitc->function->call.argf;
762 /* in case of excess arguments */
763 if (jit_arg_reg_p(_jitc->function->call.argi)) {
764 # if __WORDSIZE == 32
765 _jitc->function->call.argi += 2;
766 if (!jit_arg_reg_p(_jitc->function->call.argi - 1))
767 --_jitc->function->call.argi;
769 _jitc->function->call.argi++;
777 else if (jit_arg_reg_p(_jitc->function->call.argi
778 # if __WORDSIZE == 32
782 /* use reserved 8 bytes area */
783 jit_stxi_d(alloca_offset - 8, JIT_FP, u);
784 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
786 _jitc->function->call.argi++;
787 # if __WORDSIZE == 32
788 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
790 _jitc->function->call.argi++;
795 jit_stxi_f(_jitc->function->call.size + params_offset + F_DISP,
798 _jitc->function->call.size += sizeof(jit_word_t);
803 _jit_pushargi_f(jit_state_t *_jit, jit_float32_t u)
807 assert(_jitc->function);
808 jit_inc_synth_f(pushargi_f, u);
810 if (jit_arg_f_reg_p(_jitc->function->call.argf)
812 && !(_jitc->function->call.call & jit_call_varargs)
815 jit_movi_d(JIT_FA0 - _jitc->function->call.argf, u);
816 ++_jitc->function->call.argf;
818 /* in case of excess arguments */
819 # if __WORDSIZE == 32
820 _jitc->function->call.argi += 2;
821 if (!jit_arg_reg_p(_jitc->function->call.argi - 1))
822 --_jitc->function->call.argi;
824 _jitc->function->call.argi++;
831 regno = jit_get_reg(jit_class_fpr);
832 jit_movi_f(regno, u);
834 if (jit_arg_reg_p(_jitc->function->call.argi
835 # if __WORDSIZE == 32
839 /* use reserved 8 bytes area */
840 jit_stxi_d(alloca_offset - 8, JIT_FP, regno);
841 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
843 _jitc->function->call.argi++;
844 # if __WORDSIZE == 32
845 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
847 _jitc->function->call.argi++;
852 jit_stxi_f(_jitc->function->call.size + params_offset + F_DISP,
854 jit_unget_reg(regno);
857 _jitc->function->call.size += sizeof(jit_word_t);
862 _jit_pushargr_d(jit_state_t *_jit, jit_int32_t u)
865 assert(_jitc->function);
866 jit_inc_synth_w(pushargr_d, u);
868 if (jit_arg_f_reg_p(_jitc->function->call.argf)
870 && !(_jitc->function->call.call & jit_call_varargs)
873 jit_movr_d(JIT_FA0 - _jitc->function->call.argf, u);
874 ++_jitc->function->call.argf;
876 /* in case of excess arguments */
877 # if __WORDSIZE == 32
878 _jitc->function->call.argi += 2;
879 if (!jit_arg_reg_p(_jitc->function->call.argi - 1))
880 --_jitc->function->call.argi;
882 _jitc->function->call.argi++;
884 #else /* _CALL_SYSV */
889 else if (jit_arg_reg_p(_jitc->function->call.argi
890 # if __WORDSIZE == 32
894 /* use reserved 8 bytes area */
895 jit_stxi_d(alloca_offset - 8, JIT_FP, u);
896 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
898 _jitc->function->call.argi++;
899 # if __WORDSIZE == 32
900 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
902 _jitc->function->call.argi++;
906 #endif /* !_CALL_SYSV */
909 if (_jitc->function->call.size & 7)
910 _jitc->function->call.size += 4;
912 jit_stxi_d(_jitc->function->call.size + params_offset, JIT_SP, u);
913 #if !_CALL_SYSV && __WORDSIZE == 32
914 if (jit_arg_reg_p(_jitc->function->call.argi)) {
915 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_SP,
916 _jitc->function->call.size + params_offset);
917 _jitc->function->call.argi++;
922 _jitc->function->call.size += sizeof(jit_float64_t);
927 _jit_pushargi_d(jit_state_t *_jit, jit_float64_t u)
931 assert(_jitc->function);
932 jit_inc_synth_d(pushargi_d, u);
934 if (jit_arg_f_reg_p(_jitc->function->call.argf)
936 && !(_jitc->function->call.call & jit_call_varargs)
939 jit_movi_d(JIT_FA0 - _jitc->function->call.argf, u);
940 ++_jitc->function->call.argf;
942 /* in case of excess arguments */
943 if (jit_arg_reg_p(_jitc->function->call.argi)) {
944 # if __WORDSIZE == 32
945 _jitc->function->call.argi += 2;
946 if (!jit_arg_reg_p(_jitc->function->call.argi - 1))
947 --_jitc->function->call.argi;
949 _jitc->function->call.argi++;
952 #else /* _CALL_SYSV */
957 regno = jit_get_reg(jit_class_fpr);
958 jit_movi_d(regno, u);
960 if (jit_arg_reg_p(_jitc->function->call.argi
961 # if __WORDSIZE == 32
965 /* use reserved 8 bytes area */
966 jit_stxi_d(alloca_offset - 8, JIT_FP, regno);
967 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
969 _jitc->function->call.argi++;
970 # if __WORDSIZE == 32
971 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_FP,
973 _jitc->function->call.argi++;
977 #endif /* !_CALL_SYSV */
980 if (_jitc->function->call.size & 7)
981 _jitc->function->call.size += 4;
983 jit_stxi_d(_jitc->function->call.size + params_offset,
985 #if !_CALL_SYSV && __WORDSIZE == 32
986 if (jit_arg_reg_p(_jitc->function->call.argi)) {
987 jit_ldxi(JIT_RA0 - _jitc->function->call.argi, JIT_SP,
988 _jitc->function->call.size + params_offset);
989 _jitc->function->call.argi++;
993 jit_unget_reg(regno);
996 _jitc->function->call.size += sizeof(jit_float64_t);
1001 _jit_regarg_p(jit_state_t *_jit, jit_node_t *node, jit_int32_t regno)
1004 spec = jit_class(_rvs[regno].spec);
1005 if (spec & jit_class_arg) {
1006 if (spec & jit_class_gpr) {
1007 regno = JIT_RA0 - regno;
1008 if (regno >= 0 && regno < node->v.w)
1011 else if (spec & jit_class_fpr) {
1012 regno = JIT_FA0 - regno;
1013 if (regno >= 0 && regno < node->w.w)
1021 _jit_finishr(jit_state_t *_jit, jit_int32_t r0)
1024 assert(_jitc->function);
1025 jit_inc_synth_w(finishr, r0);
1026 if (_jitc->function->self.alen < _jitc->function->call.size)
1027 _jitc->function->self.alen = _jitc->function->call.size;
1028 call = jit_callr(r0);
1029 call->v.w = _jitc->function->call.argi;
1030 call->w.w = _jitc->function->call.argf;
1032 /* If passing float arguments in registers */
1033 if ((_jitc->function->call.call & jit_call_varargs) && call->w.w)
1034 call->flag |= jit_flag_varargs;
1036 _jitc->function->call.argi = _jitc->function->call.argf = 0;
1042 _jit_finishi(jit_state_t *_jit, jit_pointer_t i0)
1045 assert(_jitc->function);
1046 jit_inc_synth_w(finishi, (jit_word_t)i0);
1047 if (_jitc->function->self.alen < _jitc->function->call.size)
1048 _jitc->function->self.alen = _jitc->function->call.size;
1049 node = jit_calli(i0);
1050 node->v.w = _jitc->function->call.argi;
1051 node->w.w = _jitc->function->call.argf;
1053 if ((_jitc->function->call.call & jit_call_varargs) && node->w.w)
1054 node->flag |= jit_flag_varargs;
1056 _jitc->function->call.argi = _jitc->function->call.argf = 0;
1063 _jit_retval_c(jit_state_t *_jit, jit_int32_t r0)
1065 jit_inc_synth(retval_c);
1066 jit_extr_c(r0, JIT_RET);
1071 _jit_retval_uc(jit_state_t *_jit, jit_int32_t r0)
1073 jit_inc_synth(retval_uc);
1074 jit_extr_uc(r0, JIT_RET);
1079 _jit_retval_s(jit_state_t *_jit, jit_int32_t r0)
1081 jit_inc_synth(retval_s);
1082 jit_extr_s(r0, JIT_RET);
1087 _jit_retval_us(jit_state_t *_jit, jit_int32_t r0)
1089 jit_inc_synth(retval_us);
1090 jit_extr_us(r0, JIT_RET);
1095 _jit_retval_i(jit_state_t *_jit, jit_int32_t r0)
1097 jit_inc_synth(retval_i);
1098 #if __WORDSIZE == 32
1100 jit_movr(r0, JIT_RET);
1102 jit_extr_i(r0, JIT_RET);
1107 #if __WORDSIZE == 64
1109 _jit_retval_ui(jit_state_t *_jit, jit_int32_t r0)
1111 jit_inc_synth(retval_ui);
1112 jit_extr_ui(r0, JIT_RET);
1117 _jit_retval_l(jit_state_t *_jit, jit_int32_t r0)
1119 jit_inc_synth(retval_l);
1121 jit_movr(r0, JIT_RET);
1127 _jit_retval_f(jit_state_t *_jit, jit_int32_t r0)
1129 jit_inc_synth(retval_f);
1135 _jit_retval_d(jit_state_t *_jit, jit_int32_t r0)
1137 jit_inc_synth(retval_d);
1139 jit_movr_d(r0, JIT_FRET);
1144 _emit_code(jit_state_t *_jit)
1154 #if DEVEL_DISASSEMBLER
1157 jit_word_t patch_offset;
1159 jit_word_t prolog_offset;
1162 #if DEVEL_DISASSEMBLER
1166 _jitc->function = NULL;
1168 jit_reglive_setup();
1172 undo.patch_offset = 0;
1174 #if DEVEL_DISASSEMBLER
1178 undo.prolog_offset = 0;
1179 for (node = _jitc->head; node; node = node->next)
1180 if (node->code != jit_code_label &&
1181 node->code != jit_code_note &&
1182 node->code != jit_code_name)
1184 if (node && (node->code != jit_code_prolog ||
1185 !(_jitc->functions.ptr + node->w.w)->assume_frame)) {
1186 /* code may start with a jump so add an initial function descriptor */
1187 word = _jit->pc.w + sizeof(void*) * 3;
1188 iw(word); /* addr */
1194 #define case_rr(name, type) \
1195 case jit_code_##name##r##type: \
1196 name##r##type(rn(node->u.w), rn(node->v.w)); \
1198 #define case_rw(name, type) \
1199 case jit_code_##name##i##type: \
1200 name##i##type(rn(node->u.w), node->v.w); \
1202 #define case_wr(name, type) \
1203 case jit_code_##name##i##type: \
1204 name##i##type(node->u.w, rn(node->v.w)); \
1206 #define case_rrr(name, type) \
1207 case jit_code_##name##r##type: \
1208 name##r##type(rn(node->u.w), \
1209 rn(node->v.w), rn(node->w.w)); \
1211 #define case_rrrr(name, type) \
1212 case jit_code_##name##r##type: \
1213 name##r##type(rn(node->u.q.l), rn(node->u.q.h), \
1214 rn(node->v.w), rn(node->w.w)); \
1216 #define case_rrw(name, type) \
1217 case jit_code_##name##i##type: \
1218 name##i##type(rn(node->u.w), rn(node->v.w), node->w.w); \
1220 #define case_rrrw(name, type) \
1221 case jit_code_##name##i##type: \
1222 name##i##type(rn(node->u.q.l), rn(node->u.q.h), \
1223 rn(node->v.w), node->w.w); \
1225 #define case_rrf(name, type, size) \
1226 case jit_code_##name##i##type: \
1227 assert(node->flag & jit_flag_data); \
1228 name##i##type(rn(node->u.w), rn(node->v.w), \
1229 (jit_float##size##_t *)node->w.n->u.w); \
1231 #define case_wrr(name, type) \
1232 case jit_code_##name##i##type: \
1233 name##i##type(node->u.w, rn(node->v.w), rn(node->w.w)); \
1235 #define case_brr(name, type) \
1236 case jit_code_##name##r##type: \
1238 assert(temp->code == jit_code_label || \
1239 temp->code == jit_code_epilog); \
1240 if (temp->flag & jit_flag_patch) \
1241 name##r##type(temp->u.w, rn(node->v.w), \
1244 word = name##r##type(_jit->pc.w, \
1245 rn(node->v.w), rn(node->w.w)); \
1246 patch(word, node); \
1249 #define case_brw(name, type) \
1250 case jit_code_##name##i##type: \
1252 assert(temp->code == jit_code_label || \
1253 temp->code == jit_code_epilog); \
1254 if (temp->flag & jit_flag_patch) \
1255 name##i##type(temp->u.w, \
1256 rn(node->v.w), node->w.w); \
1258 word = name##i##type(_jit->pc.w, \
1259 rn(node->v.w), node->w.w); \
1260 patch(word, node); \
1263 #define case_brf(name, type, size) \
1264 case jit_code_##name##i##type: \
1266 assert(temp->code == jit_code_label || \
1267 temp->code == jit_code_epilog); \
1268 if (temp->flag & jit_flag_patch) \
1269 name##i##type(temp->u.w, rn(node->v.w), \
1270 (jit_float##size##_t *)node->w.n->u.w); \
1272 word = name##i##type(_jit->pc.w, rn(node->v.w), \
1273 (jit_float##size##_t *)node->w.n->u.w); \
1274 patch(word, node); \
1277 for (node = _jitc->head; node; node = node->next) {
1278 if (_jit->pc.uc >= _jitc->code.end)
1281 #if DEVEL_DISASSEMBLER
1282 node->offset = (jit_uword_t)_jit->pc.w - (jit_uword_t)prevw;
1285 value = jit_classify(node->code);
1286 jit_regarg_set(node, value);
1287 switch (node->code) {
1288 case jit_code_align:
1289 assert(!(node->u.w & (node->u.w - 1)) &&
1290 node->u.w <= sizeof(jit_word_t));
1291 if (node->u.w == sizeof(jit_word_t) &&
1292 (word = _jit->pc.w & (sizeof(jit_word_t) - 1)))
1293 nop(sizeof(jit_word_t) - word);
1295 case jit_code_note: case jit_code_name:
1296 node->u.w = _jit->pc.w;
1298 case jit_code_label:
1299 /* remember label is defined */
1300 node->flag |= jit_flag_patch;
1301 node->u.w = _jit->pc.w;
1320 case_rrrr(qmul, _u);
1321 case_rrrw(qmul, _u);
1328 case_rrrr(qdiv, _u);
1329 case_rrrw(qdiv, _u);
1350 # if __WORDSIZE == 64
1356 # if __WORDSIZE == 64
1363 if (node->flag & jit_flag_node) {
1365 if (temp->code == jit_code_data ||
1366 (temp->code == jit_code_label &&
1367 (temp->flag & jit_flag_patch)))
1368 movi(rn(node->u.w), temp->u.w);
1370 assert(temp->code == jit_code_label ||
1371 temp->code == jit_code_epilog);
1372 word = movi_p(rn(node->u.w), node->v.w);
1377 movi(rn(node->u.w), node->v.w);
1379 case_rr(trunc, _f_i);
1380 case_rr(trunc, _d_i);
1381 # if __WORDSIZE == 64
1382 case_rr(trunc, _f_l);
1383 case_rr(trunc, _d_l);
1433 case_brr(boadd, _u);
1434 case_brw(boadd, _u);
1437 case_brr(bxadd, _u);
1438 case_brw(bxadd, _u);
1441 case_brr(bosub, _u);
1442 case_brw(bosub, _u);
1445 case_brr(bxsub, _u);
1446 case_brw(bxsub, _u);
1465 #if __WORDSIZE == 64
1487 #if __WORDSIZE == 64
1494 case jit_code_movi_f:
1495 assert(node->flag & jit_flag_data);
1496 movi_f(rn(node->u.w), (jit_float32_t *)node->v.n->u.w);
1504 case_rrf(add, _f, 32);
1506 case_rrf(sub, _f, 32);
1507 case_rrf(rsb, _f, 32);
1509 case_rrf(mul, _f, 32);
1511 case_rrf(div, _f, 32);
1513 case_rrf(lt, _f, 32);
1515 case_rrf(le, _f, 32);
1517 case_rrf(eq, _f, 32);
1519 case_rrf(ge, _f, 32);
1521 case_rrf(gt, _f, 32);
1523 case_rrf(ne, _f, 32);
1525 case_rrf(unlt, _f, 32);
1527 case_rrf(unle, _f, 32);
1529 case_rrf(uneq, _f, 32);
1531 case_rrf(unge, _f, 32);
1533 case_rrf(ungt, _f, 32);
1535 case_rrf(ltgt, _f, 32);
1537 case_rrf(ord, _f, 32);
1538 case_rrr(unord, _f);
1539 case_rrf(unord, _f, 32);
1541 case_brf(blt, _f, 32);
1543 case_brf(ble, _f, 32);
1545 case_brf(beq, _f, 32);
1547 case_brf(bge, _f, 32);
1549 case_brf(bgt, _f, 32);
1551 case_brf(bne, _f, 32);
1552 case_brr(bunlt, _f);
1553 case_brf(bunlt, _f, 32);
1554 case_brr(bunle, _f);
1555 case_brf(bunle, _f, 32);
1556 case_brr(buneq, _f);
1557 case_brf(buneq, _f, 32);
1558 case_brr(bunge, _f);
1559 case_brf(bunge, _f, 32);
1560 case_brr(bungt, _f);
1561 case_brf(bungt, _f, 32);
1562 case_brr(bltgt, _f);
1563 case_brf(bltgt, _f, 32);
1565 case_brf(bord, _f, 32);
1566 case_brr(bunord, _f);
1567 case_brf(bunord, _f, 32);
1577 case jit_code_movi_d:
1578 assert(node->flag & jit_flag_data);
1579 movi_d(rn(node->u.w), (jit_float64_t *)node->v.n->u.w);
1587 case_rrf(add, _d, 64);
1589 case_rrf(sub, _d, 64);
1590 case_rrf(rsb, _d, 64);
1592 case_rrf(mul, _d, 64);
1594 case_rrf(div, _d, 64);
1596 case_rrf(lt, _d, 64);
1598 case_rrf(le, _d, 64);
1600 case_rrf(eq, _d, 64);
1602 case_rrf(ge, _d, 64);
1604 case_rrf(gt, _d, 64);
1606 case_rrf(ne, _d, 64);
1608 case_rrf(unlt, _d, 64);
1610 case_rrf(unle, _d, 64);
1612 case_rrf(uneq, _d, 64);
1614 case_rrf(unge, _d, 64);
1616 case_rrf(ungt, _d, 64);
1618 case_rrf(ltgt, _d, 64);
1620 case_rrf(ord, _d, 64);
1621 case_rrr(unord, _d);
1622 case_rrf(unord, _d, 64);
1624 case_brf(blt, _d, 64);
1626 case_brf(ble, _d, 64);
1628 case_brf(beq, _d, 64);
1630 case_brf(bge, _d, 64);
1632 case_brf(bgt, _d, 64);
1634 case_brf(bne, _d, 64);
1635 case_brr(bunlt, _d);
1636 case_brf(bunlt, _d, 64);
1637 case_brr(bunle, _d);
1638 case_brf(bunle, _d, 64);
1639 case_brr(buneq, _d);
1640 case_brf(buneq, _d, 64);
1641 case_brr(bunge, _d);
1642 case_brf(bunge, _d, 64);
1643 case_brr(bungt, _d);
1644 case_brf(bungt, _d, 64);
1645 case_brr(bltgt, _d);
1646 case_brf(bltgt, _d, 64);
1648 case_brf(bord, _d, 64);
1649 case_brr(bunord, _d);
1650 case_brf(bunord, _d, 64);
1660 jmpr(rn(node->u.w));
1663 if (node->flag & jit_flag_node) {
1665 if (_jit->pc.uc == _jit->code.ptr + sizeof(void*) * 3)
1669 assert(temp->code == jit_code_label ||
1670 temp->code == jit_code_epilog);
1671 if (temp->flag & jit_flag_patch)
1674 word = jmpi(_jit->pc.w);
1679 (void)jmpi_p(node->u.w);
1681 case jit_code_callr:
1684 , !!(node->flag & jit_flag_varargs)
1688 case jit_code_calli:
1689 if (node->flag & jit_flag_node) {
1691 assert(temp->code == jit_code_label ||
1692 temp->code == jit_code_epilog);
1693 word = calli_p(temp->u.w
1695 , !!(node->flag & jit_flag_varargs)
1698 if (!(temp->flag & jit_flag_patch))
1704 , !!(node->flag & jit_flag_varargs)
1708 case jit_code_prolog:
1709 _jitc->function = _jitc->functions.ptr + node->w.w;
1711 undo.word = _jit->pc.w;
1712 #if DEVEL_DISASSEMBLER
1715 undo.patch_offset = _jitc->patches.offset;
1717 undo.prolog_offset = _jitc->prolog.offset;
1722 if (_jitc->jump && !_jitc->function->assume_frame) {
1723 /* remember prolog to hide offset adjustment for a jump
1724 * to the start of a function, what is expected to be
1725 * a common practice as first jit instruction */
1726 if (_jitc->prolog.offset >= _jitc->prolog.length) {
1727 _jitc->prolog.length += 16;
1728 jit_realloc((jit_pointer_t *)&_jitc->prolog.ptr,
1729 (_jitc->prolog.length - 16) *
1731 _jitc->prolog.length * sizeof(jit_word_t));
1733 _jitc->prolog.ptr[_jitc->prolog.offset++] = _jit->pc.w;
1734 /* function descriptor */
1735 word = _jit->pc.w + sizeof(void*) * 3;
1736 iw(word); /* addr */
1743 case jit_code_epilog:
1744 assert(_jitc->function == _jitc->functions.ptr + node->w.w);
1746 for (temp = undo.node->next;
1747 temp != node; temp = temp->next) {
1748 if (temp->code == jit_code_label ||
1749 temp->code == jit_code_epilog)
1750 temp->flag &= ~jit_flag_patch;
1752 temp->flag &= ~jit_flag_patch;
1754 _jit->pc.w = undo.word;
1755 #if DEVEL_DISASSEMBLER
1758 _jitc->patches.offset = undo.patch_offset;
1760 _jitc->prolog.offset = undo.prolog_offset;
1762 goto restart_function;
1764 /* remember label is defined */
1765 node->flag |= jit_flag_patch;
1766 node->u.w = _jit->pc.w;
1768 _jitc->function = NULL;
1770 case jit_code_va_start:
1771 vastart(rn(node->u.w));
1773 case jit_code_va_arg:
1774 vaarg(rn(node->u.w), rn(node->v.w));
1776 case jit_code_va_arg_d:
1777 vaarg_d(rn(node->u.w), rn(node->v.w));
1780 case jit_code_arg: case jit_code_ellipsis:
1781 case jit_code_va_push:
1782 case jit_code_allocai: case jit_code_allocar:
1783 case jit_code_arg_f: case jit_code_arg_d:
1784 case jit_code_va_end:
1786 case jit_code_retr: case jit_code_reti:
1787 case jit_code_retr_f: case jit_code_reti_f:
1788 case jit_code_retr_d: case jit_code_reti_d:
1789 case jit_code_getarg_c: case jit_code_getarg_uc:
1790 case jit_code_getarg_s: case jit_code_getarg_us:
1791 case jit_code_getarg_i:
1792 #if __WORDSIZE == 64
1793 case jit_code_getarg_ui: case jit_code_getarg_l:
1795 case jit_code_getarg_f: case jit_code_getarg_d:
1796 case jit_code_putargr: case jit_code_putargi:
1797 case jit_code_putargr_f: case jit_code_putargi_f:
1798 case jit_code_putargr_d: case jit_code_putargi_d:
1799 case jit_code_pushargr: case jit_code_pushargi:
1800 case jit_code_pushargr_f: case jit_code_pushargi_f:
1801 case jit_code_pushargr_d: case jit_code_pushargi_d:
1802 case jit_code_retval_c: case jit_code_retval_uc:
1803 case jit_code_retval_s: case jit_code_retval_us:
1804 case jit_code_retval_i:
1805 #if __WORDSIZE == 64
1806 case jit_code_retval_ui: case jit_code_retval_l:
1808 case jit_code_retval_f: case jit_code_retval_d:
1809 case jit_code_prepare:
1810 case jit_code_finishr: case jit_code_finishi:
1815 jit_regarg_clr(node, value);
1816 assert(_jitc->regarg == 0 && _jitc->synth == 0);
1817 /* update register live state */
1831 for (offset = 0; offset < _jitc->patches.offset; offset++) {
1832 node = _jitc->patches.ptr[offset].node;
1833 word = node->code == jit_code_movi ? node->v.n->u.w : node->u.n->u.w;
1834 patch_at(_jitc->patches.ptr[offset].inst, word);
1837 jit_flush(_jit->code.ptr, _jit->pc.uc);
1839 return (_jit->code.ptr);
1843 # include "jit_ppc-cpu.c"
1844 # include "jit_ppc-fpu.c"
1848 jit_flush(void *fptr, void *tptr)
1850 #if defined(__GNUC__)
1853 s = sysconf(_SC_PAGE_SIZE);
1854 f = (jit_word_t)fptr & -s;
1855 t = (((jit_word_t)tptr) + s - 1) & -s;
1856 __clear_cache((void *)f, (void *)t);
1861 _emit_ldxi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
1863 #if __WORDSIZE == 32
1864 ldxi_i(rn(r0), rn(r1), i0);
1866 ldxi_l(rn(r0), rn(r1), i0);
1871 _emit_stxi(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
1873 #if __WORDSIZE == 32
1874 stxi_i(i0, rn(r0), rn(r1));
1876 stxi_l(i0, rn(r0), rn(r1));
1881 _emit_ldxi_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
1883 ldxi_d(rn(r0), rn(r1), i0);
1887 _emit_stxi_d(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
1889 stxi_d(i0, rn(r0), rn(r1));
1893 _patch(jit_state_t *_jit, jit_word_t instr, jit_node_t *node)
1897 assert(node->flag & jit_flag_node);
1898 if (node->code == jit_code_movi)
1899 flag = node->v.n->flag;
1901 flag = node->u.n->flag;
1902 assert(!(flag & jit_flag_patch));
1903 if (_jitc->patches.offset >= _jitc->patches.length) {
1904 jit_realloc((jit_pointer_t *)&_jitc->patches.ptr,
1905 _jitc->patches.length * sizeof(jit_patch_t),
1906 (_jitc->patches.length + 1024) * sizeof(jit_patch_t));
1907 _jitc->patches.length += 1024;
1909 _jitc->patches.ptr[_jitc->patches.offset].inst = instr;
1910 _jitc->patches.ptr[_jitc->patches.offset].node = node;
1911 ++_jitc->patches.offset;