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)
138 typedef signed char _c;
139 typedef unsigned char _uc;
140 typedef signed short _s;
141 typedef unsigned short _us;
142 typedef signed int _i;
144 typedef unsigned int _ui;
145 typedef jit_word_t _l;
150 #define prt0(T) T C##T##0(void);
151 #define prt1(T) prt0(T) \
153 #define prt2(T) prt1(T) \
155 #define prt3(T) prt2(T) \
157 #define prt4(T) prt3(T) \
159 #define prt5(T) prt4(T) \
160 T C##T##5(T,T,T,T,T);
161 #define prt6(T) prt5(T) \
162 T C##T##6(T,T,T,T,T,T);
163 #define prt7(T) prt6(T) \
164 T C##T##7(T,T,T,T,T,T,T);
165 #define prt8(T) prt7(T) \
166 T C##T##8(T,T,T,T,T,T,T,T);
167 #define prt9(T) prt8(T) \
168 T C##T##9(T,T,T,T,T,T,T,T,T);
169 #define prt10(T) prt9(T) \
170 T C##T##10(T,T,T,T,T,T,T,T,T,T);
171 #define prt11(T) prt10(T) \
172 T C##T##11(T,T,T,T,T,T,T,T,T,T,T);
173 #define prt12(T) prt11(T) \
174 T C##T##12(T,T,T,T,T,T,T,T,T,T,T,T);
175 #define prt13(T) prt12(T) \
176 T C##T##13(T,T,T,T,T,T,T,T,T,T,T,T,T);
177 #define prt14(T) prt13(T) \
178 T C##T##14(T,T,T,T,T,T,T,T,T,T,T,T,T,T);
179 #define prt15(T) prt14(T) \
180 T C##T##15(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);
181 #define prt(T) prt15(T)
211 #define prtn(N,T) T J##T##n(void);
212 #define prt0(T) prtn(0,T)
213 #define prt1(T) prt0(T) prtn(1,T)
214 #define prt2(T) prt1(T) prtn(2,T)
215 #define prt3(T) prt2(T) prtn(3,T)
216 #define prt4(T) prt3(T) prtn(4,T)
217 #define prt5(T) prt4(T) prtn(5,T)
218 #define prt6(T) prt5(T) prtn(6,T)
219 #define prt7(T) prt6(T) prtn(7,T)
220 #define prt8(T) prt7(T) prtn(8,T)
221 #define prt9(T) prt8(T) prtn(9,T)
222 #define prt10(T) prt9(T) prtn(10,T)
223 #define prt11(T) prt10(T) prtn(11,T)
224 #define prt12(T) prt11(T) prtn(12,T)
225 #define prt13(T) prt12(T) prtn(13,T)
226 #define prt14(T) prt13(T) prtn(14,T)
227 #define prt15(T) prt14(T) prtn(15,T)
228 #define prt(T) prt15(T)
263 #define dat0(T) T (*j##T##0)(void); \
265 #define dat1(T) dat0(T) \
268 #define dat2(T) dat1(T) \
271 #define dat3(T) dat2(T) \
272 T (*j##T##3)(T,T,T); \
274 #define dat4(T) dat3(T) \
275 T (*j##T##4)(T,T,T,T); \
277 #define dat5(T) dat4(T) \
278 T (*j##T##5)(T,T,T,T,T); \
280 #define dat6(T) dat5(T) \
281 T (*j##T##6)(T,T,T,T,T,T); \
283 #define dat7(T) dat6(T) \
284 T (*j##T##7)(T,T,T,T,T,T,T); \
286 #define dat8(T) dat7(T) \
287 T (*j##T##8)(T,T,T,T,T,T,T,T); \
289 #define dat9(T) dat8(T) \
290 T (*j##T##9)(T,T,T,T,T,T,T,T,T); \
292 #define dat10(T) dat9(T) \
293 T (*j##T##10)(T,T,T,T,T,T,T,T,T,T); \
294 jit_node_t *n##T##10;
295 #define dat11(T) dat10(T) \
296 T (*j##T##11)(T,T,T,T,T,T,T,T,T,T,T); \
297 jit_node_t *n##T##11;
298 #define dat12(T) dat11(T) \
299 T (*j##T##12)(T,T,T,T,T,T,T,T,T,T,T,T); \
300 jit_node_t *n##T##12;
301 #define dat13(T) dat12(T) \
302 T (*j##T##13)(T,T,T,T,T,T,T,T,T,T,T,T,T);\
303 jit_node_t *n##T##13;
304 #define dat14(T) dat13(T) \
305 T (*j##T##14)(T,T,T,T,T,T,T,T,T,T,T,T,T,T);\
306 jit_node_t *n##T##14;
307 #define dat15(T) dat14(T) \
308 T (*j##T##15)(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);\
309 jit_node_t *n##T##15;
310 #define dat(T) dat15(T)
362 T C##T##3(T A,T B,T C) \
368 T C##T##4(T A,T B,T C,T D) \
374 T C##T##5(T A,T B,T C,T D,T E) \
376 return (A-B-C-D-E); \
380 T C##T##6(T A,T B,T C,T D,T E,T F) \
382 return (A-B-C-D-E-F); \
386 T C##T##7(T A,T B,T C,T D,T E,T F,T G) \
388 return (A-B-C-D-E-F-G); \
392 T C##T##8(T A,T B,T C,T D,T E,T F,T G,T H) \
394 return (A-B-C-D-E-F-G-H); \
398 T C##T##9(T A,T B,T C,T D,T E,T F,T G,T H,T I) \
400 return (A-B-C-D-E-F-G-H-I); \
404 T C##T##10(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J) \
406 return (A-B-C-D-E-F-G-H-I-J); \
410 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) \
412 return (A-B-C-D-E-F-G-H-I-J-K); \
416 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) \
418 return (A-B-C-D-E-F-G-H-I-J-K-L); \
422 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) \
424 return (A-B-C-D-E-F-G-H-I-J-K-L-M); \
428 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) \
430 return (A-B-C-D-E-F-G-H-I-J-K-L-M-N); \
434 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) \
436 return (A-B-C-D-E-F-G-H-I-J-K-L-M-N-O); \
438 #define dcl(T) dcl15(T)
471 return ((*j##T##0)()); \
477 return ((*j##T##1)(1)); \
483 return ((*j##T##2)(1,2)); \
489 return ((*j##T##3)(1,2,3)); \
495 return ((*j##T##4)(1,2,3,4)); \
501 return ((*j##T##5)(1,2,3,4,5)); \
507 return ((*j##T##6)(1,2,3,4,5,6)); \
513 return ((*j##T##7)(1,2,3,4,5,6,7)); \
519 return ((*j##T##8)(1,2,3,4,5,6,7,8)); \
525 return ((*j##T##9)(1,2,3,4,5,6,7,8,9)); \
531 return ((*j##T##10)(1,2,3,4,5,6,7,8,9,10)); \
537 return ((*j##T##11)(1,2,3,4,5,6,7,8,9,10,11)); \
543 return ((*j##T##12)(1,2,3,4,5,6,7,8,9,10,11,12)); \
549 return ((*j##T##13)(1,2,3,4,5,6,7,8,9,10,11,12,13)); \
555 return ((*j##T##14)(1,2,3,4,5,6,7,8,9,10,11,12,13,14)); \
561 return ((*j##T##15)(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)); \
563 #define dcl(t) dcl15(t)
594 main(int argc, char *argv[])
597 jit_node_t *jmpi_main;
598 void (*function)(void);
599 jit_node_t *a1,*a2,*a3,*a4,*a5,*a6,*a7,*a8,*a9;
600 jit_node_t *a10,*a11,*a12,*a13,*a14,*a15;
604 _jit = jit_new_state();
606 jmpi_main = jit_jmpi();
610 #define arg1(T) a1 = jit_arg##T();
611 #define arg2(T) arg1(T) a2 = jit_arg##T();
612 #define arg3(T) arg2(T) a3 = jit_arg##T();
613 #define arg4(T) arg3(T) a4 = jit_arg##T();
614 #define arg5(T) arg4(T) a5 = jit_arg##T();
615 #define arg6(T) arg5(T) a6 = jit_arg##T();
616 #define arg7(T) arg6(T) a7 = jit_arg##T();
617 #define arg8(T) arg7(T) a8 = jit_arg##T();
618 #define arg9(T) arg8(T) a9 = jit_arg##T();
619 #define arg10(T) arg9(T) a10 = jit_arg##T();
620 #define arg11(T) arg10(T) a11 = jit_arg##T();
621 #define arg12(T) arg11(T) a12 = jit_arg##T();
622 #define arg13(T) arg12(T) a13 = jit_arg##T();
623 #define arg14(T) arg13(T) a14 = jit_arg##T();
624 #define arg15(T) arg14(T) a15 = jit_arg##T();
626 #define get0(B,T,R) jit_movi##B(R##0,0);
627 #define get1(B,T,R) jit_getarg##B(R##0,a##1);
628 #define get2(B,T,R) \
630 jit_movr##B(R##1, R##0); \
631 jit_getarg##T(R##0, a##2); \
632 jit_subr##B(R##0, R##1, R##0);
633 #define get3(B,T,R) \
635 jit_movr##B(R##1, R##0); \
636 jit_getarg##T(R##0, a##3); \
637 jit_subr##B(R##0, R##1, R##0);
638 #define get4(B,T,R) \
640 jit_movr##B(R##1, R##0); \
641 jit_getarg##T(R##0, a##4); \
642 jit_subr##B(R##0, R##1, R##0);
643 #define get5(B,T,R) \
645 jit_movr##B(R##1, R##0); \
646 jit_getarg##T(R##0, a##5); \
647 jit_subr##B(R##0, R##1, R##0);
648 #define get6(B,T,R) \
650 jit_movr##B(R##1, R##0); \
651 jit_getarg##T(R##0, a##6); \
652 jit_subr##B(R##0, R##1, R##0);
653 #define get7(B,T,R) \
655 jit_movr##B(R##1, R##0); \
656 jit_getarg##T(R##0, a##7); \
657 jit_subr##B(R##0, R##1, R##0);
658 #define get8(B,T,R) \
660 jit_movr##B(R##1, R##0); \
661 jit_getarg##T(R##0, a##8); \
662 jit_subr##B(R##0, R##1, R##0);
663 #define get9(B,T,R) \
665 jit_movr##B(R##1, R##0); \
666 jit_getarg##T(R##0, a##9); \
667 jit_subr##B(R##0, R##1, R##0);
668 #define get10(B,T,R) \
670 jit_movr##B(R##1, R##0); \
671 jit_getarg##T(R##0, a##10); \
672 jit_subr##B(R##0, R##1, R##0);
673 #define get11(B,T,R) \
675 jit_movr##B(R##1, R##0); \
676 jit_getarg##T(R##0, a##11); \
677 jit_subr##B(R##0, R##1, R##0);
678 #define get12(B,T,R) \
680 jit_movr##B(R##1, R##0); \
681 jit_getarg##T(R##0, a##12); \
682 jit_subr##B(R##0, R##1, R##0);
683 #define get13(B,T,R) \
685 jit_movr##B(R##1, R##0); \
686 jit_getarg##T(R##0, a##13); \
687 jit_subr##B(R##0, R##1, R##0);
688 #define get14(B,T,R) \
690 jit_movr##B(R##1, R##0); \
691 jit_getarg##T(R##0, a##14); \
692 jit_subr##B(R##0, R##1, R##0);
693 #define get15(B,T,R) \
695 jit_movr##B(R##1, R##0); \
696 jit_getarg##T(R##0, a##15); \
697 jit_subr##B(R##0, R##1, R##0);
700 # define jit_extr_i(u, v) /**/
702 # define jit_extr_l(u, v) /**/
707 n##T##N = jit_name(strfy(n##T##N)); \
708 jit_note("ccall.c", __LINE__); \
712 jit_extr##T(JIT_R0, JIT_R0); \
716 n##T##N = jit_name(strfy(n##T##N)); \
717 jit_note("ccall.c", __LINE__); \
721 jit_retr##T(JIT_F0); \
724 #define def0(X, T) def##X(T, 0)
725 #define def1(X, T) def0(X, T) def##X(T, 1)
726 #define def2(X, T) def1(X, T) def##X(T, 2)
727 #define def3(X, T) def2(X, T) def##X(T, 3)
728 #define def4(X, T) def3(X, T) def##X(T, 4)
729 #define def5(X, T) def4(X, T) def##X(T, 5)
730 #define def6(X, T) def5(X, T) def##X(T, 6)
731 #define def7(X, T) def6(X, T) def##X(T, 7)
732 #define def8(X, T) def7(X, T) def##X(T, 8)
733 #define def9(X, T) def8(X, T) def##X(T, 9)
734 #define def10(X, T) def9(X, T) def##X(T, 10)
735 #define def11(X, T) def10(X, T) def##X(T, 11)
736 #define def12(X, T) def11(X, T) def##X(T, 12)
737 #define def13(X, T) def12(X, T) def##X(T, 13)
738 #define def14(X, T) def13(X, T) def##X(T, 14)
739 #define def15(X, T) def14(X, T) def##X(T, 15)
740 #define def(T) def15(i, T)
751 #define def(T) def15(f, T)
756 jit_patch(jmpi_main);
758 jit_note("ccall.c", __LINE__);
761 #define push0(T) /**/
762 #define push1(T) jit_pushargi##T(1);
763 #define push2(T) push1(T) jit_pushargi##T(2);
764 #define push3(T) push2(T) jit_pushargi##T(3);
765 #define push4(T) push3(T) jit_pushargi##T(4);
766 #define push5(T) push4(T) jit_pushargi##T(5);
767 #define push6(T) push5(T) jit_pushargi##T(6);
768 #define push7(T) push6(T) jit_pushargi##T(7);
769 #define push8(T) push7(T) jit_pushargi##T(8);
770 #define push9(T) push8(T) jit_pushargi##T(9);
771 #define push10(T) push9(T) jit_pushargi##T(10);
772 #define push11(T) push10(T) jit_pushargi##T(11);
773 #define push12(T) push11(T) jit_pushargi##T(12);
774 #define push13(T) push12(T) jit_pushargi##T(13);
775 #define push14(T) push13(T) jit_pushargi##T(14);
776 #define push15(T) push14(T) jit_pushargi##T(15);
781 jit_finishi(C##T##N); \
782 jit_retval##T(JIT_R0); \
783 jmp = jit_beqi(JIT_R0, T##N); \
789 jit_finishi(C##T##N); \
790 jit_retval##T(JIT_F0); \
791 jmp = jit_beqi##T(JIT_F0, _w##N); \
794 #define calx0(X,T) cal##X##n(T,0)
795 #define calx1(X,T) calx0(X,T) cal##X##n(T,1)
796 #define calx2(X,T) calx1(X,T) cal##X##n(T,2)
797 #define calx3(X,T) calx2(X,T) cal##X##n(T,3)
798 #define calx4(X,T) calx3(X,T) cal##X##n(T,4)
799 #define calx5(X,T) calx4(X,T) cal##X##n(T,5)
800 #define calx6(X,T) calx5(X,T) cal##X##n(T,6)
801 #define calx7(X,T) calx6(X,T) cal##X##n(T,7)
802 #define calx8(X,T) calx7(X,T) cal##X##n(T,8)
803 #define calx9(X,T) calx8(X,T) cal##X##n(T,9)
804 #define calx10(X,T) calx9(X,T) cal##X##n(T,10)
805 #define calx11(X,T) calx10(X,T) cal##X##n(T,11)
806 #define calx12(X,T) calx11(X,T) cal##X##n(T,12)
807 #define calx13(X,T) calx12(X,T) cal##X##n(T,13)
808 #define calx14(X,T) calx13(X,T) cal##X##n(T,14)
809 #define calx15(X,T) calx14(X,T) cal##X##n(T,15)
810 #define cali(T) calx15(i,T)
811 #define calf(T) calx15(f,T)
830 jit_finishi(CJ##T##N); \
831 jit_retval##T(JIT_R0); \
832 jmp = jit_beqi(JIT_R0, T##N); \
838 jit_finishi(CJ##T##N); \
839 jit_retval##T(JIT_F0); \
840 jmp = jit_beqi##T(JIT_F0, _w##N); \
857 function = jit_emit();
859 #define initn(T,N) j##T##N = jit_address(n##T##N);
860 #define init0(T) initn(T,0)
861 #define init1(T) init0(T) initn(T,1)
862 #define init2(T) init1(T) initn(T,2)
863 #define init3(T) init2(T) initn(T,3)
864 #define init4(T) init3(T) initn(T,4)
865 #define init5(T) init4(T) initn(T,5)
866 #define init6(T) init5(T) initn(T,6)
867 #define init7(T) init6(T) initn(T,7)
868 #define init8(T) init7(T) initn(T,8)
869 #define init9(T) init8(T) initn(T,9)
870 #define init10(T) init9(T) initn(T,10)
871 #define init11(T) init10(T) initn(T,11)
872 #define init12(T) init11(T) initn(T,12)
873 #define init13(T) init12(T) initn(T,13)
874 #define init14(T) init13(T) initn(T,14)
875 #define init15(T) init14(T) initn(T,15)
876 #define init(T) init15(T)