15 #define _w11 (_w10-11)
16 #define _w12 (_w11-12)
17 #define _w13 (_w12-13)
18 #define _w14 (_w13-14)
19 #define _w15 (_w14-15)
36 #define _uc0 (_w0&0xff)
37 #define _uc1 (_w1&0xff)
38 #define _uc2 (_w2&0xff)
39 #define _uc3 (_w3&0xff)
40 #define _uc4 (_w4&0xff)
41 #define _uc5 (_w5&0xff)
42 #define _uc6 (_w6&0xff)
43 #define _uc7 (_w7&0xff)
44 #define _uc8 (_w8&0xff)
45 #define _uc9 (_w9&0xff)
46 #define _uc10 (_w10&0xff)
47 #define _uc11 (_w11&0xff)
48 #define _uc12 (_w12&0xff)
49 #define _uc13 (_w13&0xff)
50 #define _uc14 (_w14&0xff)
51 #define _uc15 (_w15&0xff)
68 #define _us0 (_w0&0xffff)
69 #define _us1 (_w1&0xffff)
70 #define _us2 (_w2&0xffff)
71 #define _us3 (_w3&0xffff)
72 #define _us4 (_w4&0xffff)
73 #define _us5 (_w5&0xffff)
74 #define _us6 (_w6&0xffff)
75 #define _us7 (_w7&0xffff)
76 #define _us8 (_w8&0xffff)
77 #define _us9 (_w9&0xffff)
78 #define _us10 (_w10&0xffff)
79 #define _us11 (_w11&0xffff)
80 #define _us12 (_w12&0xffff)
81 #define _us13 (_w13&0xffff)
82 #define _us14 (_w14&0xffff)
83 #define _us15 (_w15&0xffff)
101 # define _ui0 (_w0&0xffffffff)
102 # define _ui1 (_w1&0xffffffff)
103 # define _ui2 (_w2&0xffffffff)
104 # define _ui3 (_w3&0xffffffff)
105 # define _ui4 (_w4&0xffffffff)
106 # define _ui5 (_w5&0xffffffff)
107 # define _ui6 (_w6&0xffffffff)
108 # define _ui7 (_w7&0xffffffff)
109 # define _ui8 (_w8&0xffffffff)
110 # define _ui9 (_w9&0xffffffff)
111 # define _ui10 (_w10&0xffffffff)
112 # define _ui11 (_w11&0xffffffff)
113 # define _ui12 (_w12&0xffffffff)
114 # define _ui13 (_w13&0xffffffff)
115 # define _ui14 (_w14&0xffffffff)
116 # define _ui15 (_w15&0xffffffff)
136 # define jit_arg_uc jit_arg_c
139 # define jit_arg_us jit_arg_s
142 # define jit_arg_ui jit_arg_i
148 typedef signed char _c;
149 typedef unsigned char _uc;
150 typedef signed short _s;
151 typedef unsigned short _us;
152 typedef signed int _i;
154 typedef unsigned int _ui;
155 typedef jit_word_t _l;
160 #define prt0(T) T C##T##0(void);
161 #define prt1(T) prt0(T) \
163 #define prt2(T) prt1(T) \
165 #define prt3(T) prt2(T) \
167 #define prt4(T) prt3(T) \
169 #define prt5(T) prt4(T) \
170 T C##T##5(T,T,T,T,T);
171 #define prt6(T) prt5(T) \
172 T C##T##6(T,T,T,T,T,T);
173 #define prt7(T) prt6(T) \
174 T C##T##7(T,T,T,T,T,T,T);
175 #define prt8(T) prt7(T) \
176 T C##T##8(T,T,T,T,T,T,T,T);
177 #define prt9(T) prt8(T) \
178 T C##T##9(T,T,T,T,T,T,T,T,T);
179 #define prt10(T) prt9(T) \
180 T C##T##10(T,T,T,T,T,T,T,T,T,T);
181 #define prt11(T) prt10(T) \
182 T C##T##11(T,T,T,T,T,T,T,T,T,T,T);
183 #define prt12(T) prt11(T) \
184 T C##T##12(T,T,T,T,T,T,T,T,T,T,T,T);
185 #define prt13(T) prt12(T) \
186 T C##T##13(T,T,T,T,T,T,T,T,T,T,T,T,T);
187 #define prt14(T) prt13(T) \
188 T C##T##14(T,T,T,T,T,T,T,T,T,T,T,T,T,T);
189 #define prt15(T) prt14(T) \
190 T C##T##15(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);
191 #define prt(T) prt15(T)
221 #define prtn(N,T) T J##T##n(void);
222 #define prt0(T) prtn(0,T)
223 #define prt1(T) prt0(T) prtn(1,T)
224 #define prt2(T) prt1(T) prtn(2,T)
225 #define prt3(T) prt2(T) prtn(3,T)
226 #define prt4(T) prt3(T) prtn(4,T)
227 #define prt5(T) prt4(T) prtn(5,T)
228 #define prt6(T) prt5(T) prtn(6,T)
229 #define prt7(T) prt6(T) prtn(7,T)
230 #define prt8(T) prt7(T) prtn(8,T)
231 #define prt9(T) prt8(T) prtn(9,T)
232 #define prt10(T) prt9(T) prtn(10,T)
233 #define prt11(T) prt10(T) prtn(11,T)
234 #define prt12(T) prt11(T) prtn(12,T)
235 #define prt13(T) prt12(T) prtn(13,T)
236 #define prt14(T) prt13(T) prtn(14,T)
237 #define prt15(T) prt14(T) prtn(15,T)
238 #define prt(T) prt15(T)
273 #define dat0(T) T (*j##T##0)(void); \
275 #define dat1(T) dat0(T) \
278 #define dat2(T) dat1(T) \
281 #define dat3(T) dat2(T) \
282 T (*j##T##3)(T,T,T); \
284 #define dat4(T) dat3(T) \
285 T (*j##T##4)(T,T,T,T); \
287 #define dat5(T) dat4(T) \
288 T (*j##T##5)(T,T,T,T,T); \
290 #define dat6(T) dat5(T) \
291 T (*j##T##6)(T,T,T,T,T,T); \
293 #define dat7(T) dat6(T) \
294 T (*j##T##7)(T,T,T,T,T,T,T); \
296 #define dat8(T) dat7(T) \
297 T (*j##T##8)(T,T,T,T,T,T,T,T); \
299 #define dat9(T) dat8(T) \
300 T (*j##T##9)(T,T,T,T,T,T,T,T,T); \
302 #define dat10(T) dat9(T) \
303 T (*j##T##10)(T,T,T,T,T,T,T,T,T,T); \
304 jit_node_t *n##T##10;
305 #define dat11(T) dat10(T) \
306 T (*j##T##11)(T,T,T,T,T,T,T,T,T,T,T); \
307 jit_node_t *n##T##11;
308 #define dat12(T) dat11(T) \
309 T (*j##T##12)(T,T,T,T,T,T,T,T,T,T,T,T); \
310 jit_node_t *n##T##12;
311 #define dat13(T) dat12(T) \
312 T (*j##T##13)(T,T,T,T,T,T,T,T,T,T,T,T,T);\
313 jit_node_t *n##T##13;
314 #define dat14(T) dat13(T) \
315 T (*j##T##14)(T,T,T,T,T,T,T,T,T,T,T,T,T,T);\
316 jit_node_t *n##T##14;
317 #define dat15(T) dat14(T) \
318 T (*j##T##15)(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);\
319 jit_node_t *n##T##15;
320 #define dat(T) dat15(T)
372 T C##T##3(T A,T B,T C) \
378 T C##T##4(T A,T B,T C,T D) \
384 T C##T##5(T A,T B,T C,T D,T E) \
386 return (A-B-C-D-E); \
390 T C##T##6(T A,T B,T C,T D,T E,T F) \
392 return (A-B-C-D-E-F); \
396 T C##T##7(T A,T B,T C,T D,T E,T F,T G) \
398 return (A-B-C-D-E-F-G); \
402 T C##T##8(T A,T B,T C,T D,T E,T F,T G,T H) \
404 return (A-B-C-D-E-F-G-H); \
408 T C##T##9(T A,T B,T C,T D,T E,T F,T G,T H,T I) \
410 return (A-B-C-D-E-F-G-H-I); \
414 T C##T##10(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J) \
416 return (A-B-C-D-E-F-G-H-I-J); \
420 T C##T##11(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K) \
422 return (A-B-C-D-E-F-G-H-I-J-K); \
426 T C##T##12(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L) \
428 return (A-B-C-D-E-F-G-H-I-J-K-L); \
432 T C##T##13(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L,T M) \
434 return (A-B-C-D-E-F-G-H-I-J-K-L-M); \
438 T C##T##14(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L,T M,T N) \
440 return (A-B-C-D-E-F-G-H-I-J-K-L-M-N); \
444 T C##T##15(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L,T M,T N,T O) \
446 return (A-B-C-D-E-F-G-H-I-J-K-L-M-N-O); \
448 #define dcl(T) dcl15(T)
481 return ((*j##T##0)()); \
487 return ((*j##T##1)(1)); \
493 return ((*j##T##2)(1,2)); \
499 return ((*j##T##3)(1,2,3)); \
505 return ((*j##T##4)(1,2,3,4)); \
511 return ((*j##T##5)(1,2,3,4,5)); \
517 return ((*j##T##6)(1,2,3,4,5,6)); \
523 return ((*j##T##7)(1,2,3,4,5,6,7)); \
529 return ((*j##T##8)(1,2,3,4,5,6,7,8)); \
535 return ((*j##T##9)(1,2,3,4,5,6,7,8,9)); \
541 return ((*j##T##10)(1,2,3,4,5,6,7,8,9,10)); \
547 return ((*j##T##11)(1,2,3,4,5,6,7,8,9,10,11)); \
553 return ((*j##T##12)(1,2,3,4,5,6,7,8,9,10,11,12)); \
559 return ((*j##T##13)(1,2,3,4,5,6,7,8,9,10,11,12,13)); \
565 return ((*j##T##14)(1,2,3,4,5,6,7,8,9,10,11,12,13,14)); \
571 return ((*j##T##15)(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)); \
573 #define dcl(t) dcl15(t)
604 main(int argc, char *argv[])
607 jit_node_t *jmpi_main;
608 void (*function)(void);
609 jit_node_t *a1,*a2,*a3,*a4,*a5,*a6,*a7,*a8,*a9;
610 jit_node_t *a10,*a11,*a12,*a13,*a14,*a15;
614 _jit = jit_new_state();
616 jmpi_main = jit_jmpi();
620 #define arg1(T) a1 = jit_arg##T();
621 #define arg2(T) arg1(T) a2 = jit_arg##T();
622 #define arg3(T) arg2(T) a3 = jit_arg##T();
623 #define arg4(T) arg3(T) a4 = jit_arg##T();
624 #define arg5(T) arg4(T) a5 = jit_arg##T();
625 #define arg6(T) arg5(T) a6 = jit_arg##T();
626 #define arg7(T) arg6(T) a7 = jit_arg##T();
627 #define arg8(T) arg7(T) a8 = jit_arg##T();
628 #define arg9(T) arg8(T) a9 = jit_arg##T();
629 #define arg10(T) arg9(T) a10 = jit_arg##T();
630 #define arg11(T) arg10(T) a11 = jit_arg##T();
631 #define arg12(T) arg11(T) a12 = jit_arg##T();
632 #define arg13(T) arg12(T) a13 = jit_arg##T();
633 #define arg14(T) arg13(T) a14 = jit_arg##T();
634 #define arg15(T) arg14(T) a15 = jit_arg##T();
636 #define get0(B,T,R) jit_movi##B(R##0,0);
637 #define get1(B,T,R) jit_getarg##T(R##0,a##1);
638 #define get2(B,T,R) \
640 jit_movr##B(R##1, R##0); \
641 jit_getarg##T(R##0, a##2); \
642 jit_subr##B(R##0, R##1, R##0);
643 #define get3(B,T,R) \
645 jit_movr##B(R##1, R##0); \
646 jit_getarg##T(R##0, a##3); \
647 jit_subr##B(R##0, R##1, R##0);
648 #define get4(B,T,R) \
650 jit_movr##B(R##1, R##0); \
651 jit_getarg##T(R##0, a##4); \
652 jit_subr##B(R##0, R##1, R##0);
653 #define get5(B,T,R) \
655 jit_movr##B(R##1, R##0); \
656 jit_getarg##T(R##0, a##5); \
657 jit_subr##B(R##0, R##1, R##0);
658 #define get6(B,T,R) \
660 jit_movr##B(R##1, R##0); \
661 jit_getarg##T(R##0, a##6); \
662 jit_subr##B(R##0, R##1, R##0);
663 #define get7(B,T,R) \
665 jit_movr##B(R##1, R##0); \
666 jit_getarg##T(R##0, a##7); \
667 jit_subr##B(R##0, R##1, R##0);
668 #define get8(B,T,R) \
670 jit_movr##B(R##1, R##0); \
671 jit_getarg##T(R##0, a##8); \
672 jit_subr##B(R##0, R##1, R##0);
673 #define get9(B,T,R) \
675 jit_movr##B(R##1, R##0); \
676 jit_getarg##T(R##0, a##9); \
677 jit_subr##B(R##0, R##1, R##0);
678 #define get10(B,T,R) \
680 jit_movr##B(R##1, R##0); \
681 jit_getarg##T(R##0, a##10); \
682 jit_subr##B(R##0, R##1, R##0);
683 #define get11(B,T,R) \
685 jit_movr##B(R##1, R##0); \
686 jit_getarg##T(R##0, a##11); \
687 jit_subr##B(R##0, R##1, R##0);
688 #define get12(B,T,R) \
690 jit_movr##B(R##1, R##0); \
691 jit_getarg##T(R##0, a##12); \
692 jit_subr##B(R##0, R##1, R##0);
693 #define get13(B,T,R) \
695 jit_movr##B(R##1, R##0); \
696 jit_getarg##T(R##0, a##13); \
697 jit_subr##B(R##0, R##1, R##0);
698 #define get14(B,T,R) \
700 jit_movr##B(R##1, R##0); \
701 jit_getarg##T(R##0, a##14); \
702 jit_subr##B(R##0, R##1, R##0);
703 #define get15(B,T,R) \
705 jit_movr##B(R##1, R##0); \
706 jit_getarg##T(R##0, a##15); \
707 jit_subr##B(R##0, R##1, R##0);
710 # define jit_extr_i(u, v) /**/
712 # define jit_extr_l(u, v) /**/
717 n##T##N = jit_name(strfy(n##T##N)); \
718 jit_note("ccall.c", __LINE__); \
722 jit_extr##T(JIT_R0, JIT_R0); \
726 n##T##N = jit_name(strfy(n##T##N)); \
727 jit_note("ccall.c", __LINE__); \
731 jit_retr##T(JIT_F0); \
734 #define def0(X, T) def##X(T, 0)
735 #define def1(X, T) def0(X, T) def##X(T, 1)
736 #define def2(X, T) def1(X, T) def##X(T, 2)
737 #define def3(X, T) def2(X, T) def##X(T, 3)
738 #define def4(X, T) def3(X, T) def##X(T, 4)
739 #define def5(X, T) def4(X, T) def##X(T, 5)
740 #define def6(X, T) def5(X, T) def##X(T, 6)
741 #define def7(X, T) def6(X, T) def##X(T, 7)
742 #define def8(X, T) def7(X, T) def##X(T, 8)
743 #define def9(X, T) def8(X, T) def##X(T, 9)
744 #define def10(X, T) def9(X, T) def##X(T, 10)
745 #define def11(X, T) def10(X, T) def##X(T, 11)
746 #define def12(X, T) def11(X, T) def##X(T, 12)
747 #define def13(X, T) def12(X, T) def##X(T, 13)
748 #define def14(X, T) def13(X, T) def##X(T, 14)
749 #define def15(X, T) def14(X, T) def##X(T, 15)
750 #define def(T) def15(i, T)
761 #define def(T) def15(f, T)
766 jit_patch(jmpi_main);
768 jit_note("ccall.c", __LINE__);
771 #define push0(T) /**/
772 #define push1(T) jit_pushargi##T(1);
773 #define push2(T) push1(T) jit_pushargi##T(2);
774 #define push3(T) push2(T) jit_pushargi##T(3);
775 #define push4(T) push3(T) jit_pushargi##T(4);
776 #define push5(T) push4(T) jit_pushargi##T(5);
777 #define push6(T) push5(T) jit_pushargi##T(6);
778 #define push7(T) push6(T) jit_pushargi##T(7);
779 #define push8(T) push7(T) jit_pushargi##T(8);
780 #define push9(T) push8(T) jit_pushargi##T(9);
781 #define push10(T) push9(T) jit_pushargi##T(10);
782 #define push11(T) push10(T) jit_pushargi##T(11);
783 #define push12(T) push11(T) jit_pushargi##T(12);
784 #define push13(T) push12(T) jit_pushargi##T(13);
785 #define push14(T) push13(T) jit_pushargi##T(14);
786 #define push15(T) push14(T) jit_pushargi##T(15);
791 jit_finishi(C##T##N); \
792 jit_retval##T(JIT_R0); \
793 jmp = jit_beqi(JIT_R0, T##N); \
799 jit_finishi(C##T##N); \
800 jit_retval##T(JIT_F0); \
801 jmp = jit_beqi##T(JIT_F0, _w##N); \
804 #define calx0(X,T) cal##X##n(T,0)
805 #define calx1(X,T) calx0(X,T) cal##X##n(T,1)
806 #define calx2(X,T) calx1(X,T) cal##X##n(T,2)
807 #define calx3(X,T) calx2(X,T) cal##X##n(T,3)
808 #define calx4(X,T) calx3(X,T) cal##X##n(T,4)
809 #define calx5(X,T) calx4(X,T) cal##X##n(T,5)
810 #define calx6(X,T) calx5(X,T) cal##X##n(T,6)
811 #define calx7(X,T) calx6(X,T) cal##X##n(T,7)
812 #define calx8(X,T) calx7(X,T) cal##X##n(T,8)
813 #define calx9(X,T) calx8(X,T) cal##X##n(T,9)
814 #define calx10(X,T) calx9(X,T) cal##X##n(T,10)
815 #define calx11(X,T) calx10(X,T) cal##X##n(T,11)
816 #define calx12(X,T) calx11(X,T) cal##X##n(T,12)
817 #define calx13(X,T) calx12(X,T) cal##X##n(T,13)
818 #define calx14(X,T) calx13(X,T) cal##X##n(T,14)
819 #define calx15(X,T) calx14(X,T) cal##X##n(T,15)
820 #define cali(T) calx15(i,T)
821 #define calf(T) calx15(f,T)
840 jit_finishi(CJ##T##N); \
841 jit_retval##T(JIT_R0); \
842 jmp = jit_beqi(JIT_R0, T##N); \
848 jit_finishi(CJ##T##N); \
849 jit_retval##T(JIT_F0); \
850 jmp = jit_beqi##T(JIT_F0, _w##N); \
867 function = jit_emit();
869 #define initn(T,N) j##T##N = jit_address(n##T##N);
870 #define init0(T) initn(T,0)
871 #define init1(T) init0(T) initn(T,1)
872 #define init2(T) init1(T) initn(T,2)
873 #define init3(T) init2(T) initn(T,3)
874 #define init4(T) init3(T) initn(T,4)
875 #define init5(T) init4(T) initn(T,5)
876 #define init6(T) init5(T) initn(T,6)
877 #define init7(T) init6(T) initn(T,7)
878 #define init8(T) init7(T) initn(T,8)
879 #define init9(T) init8(T) initn(T,9)
880 #define init10(T) init9(T) initn(T,10)
881 #define init11(T) init10(T) initn(T,11)
882 #define init12(T) init11(T) initn(T,12)
883 #define init13(T) init12(T) initn(T,13)
884 #define init14(T) init13(T) initn(T,14)
885 #define init15(T) init14(T) initn(T,15)
886 #define init(T) init15(T)