History

Import 409,410: ARM EABI by Daniel Gl�ckner

grischka committed 18 years ago

Commit f99d3de1 parent 2de1b2d7 files · +517 −79Browse files

Unified · Split

7 files
  1. Changelog +2 −0
  2. Makefile +1 −1
  3. arm-gen.c +380 −66
  4. elf.h +9 −3
  5. tcc.c +59 −0
  6. tccelf.c +35 −7
  7. tcctok.h +31 −2
Changelog+2−0
@@ -1,5 +1,7 @@
11 version 0.9.24:
22
3+- Import 409,410: ARM EABI by Daniel Gl�ckner
4+
35 - Some in-between fixes:
46 TCC -E no longer hangs with macro calls involving newlines.
57 (next_nomacro1 now advances the read-pointer with TOK_LINEFEED)
Makefile+1−1
@@ -158,7 +158,7 @@ c67-tcc$(EXESUF): tcc.c c67-gen.c tccelf.c tccasm.c tcctok.h libtcc.h tcccoff.c · 157 unmodified lines
158158 $(CC) $(CFLAGS) -DTCC_TARGET_C67 -o $@ $< $(LIBS)
159159
160160 arm-tcc$(EXESUF): tcc.c arm-gen.c tccelf.c tccasm.c tcctok.h libtcc.h
161− $(CC) $(CFLAGS) -DTCC_TARGET_ARM -o $@ $< $(LIBS)
161+ $(CC) $(CFLAGS) -DTCC_TARGET_ARM -DTCC_ARM_EABI -o $@ $< $(LIBS)
162162
163163 i386-win32-tcc$(EXESUF): tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h tccpe.c
164164 $(CC) $(CFLAGS) -DTCC_TARGET_PE -o $@ $< $(LIBS)
arm-gen.c+380−66
@@ -20,8 +20,17 @@ · 19 unmodified lines
2020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121 */
2222
23+#ifdef TCC_ARM_EABI
24+#define TCC_ARM_VFP
25+#endif
26+
27+
2328 /* number of available registers */
29+#ifdef TCC_ARM_VFP
30+#define NB_REGS 13
31+#else
2432 #define NB_REGS 9
33+#endif
2534
2635 /* a register can belong to several classes. The classes must be
2736 sorted from more general to more precise (see gv2() code which does
@@ -37,6 +46,12 @@ · 9 unmodified lines
3746 #define RC_F1 0x0100
3847 #define RC_F2 0x0200
3948 #define RC_F3 0x0400
49+#ifdef TCC_ARM_VFP
50+#define RC_F4 0x0800
51+#define RC_F5 0x1000
52+#define RC_F6 0x2000
53+#define RC_F7 0x4000
54+#endif
4055 #define RC_IRET RC_R0 /* function return: integer register */
4156 #define RC_LRET RC_R1 /* function return: second integer register */
4257 #define RC_FRET RC_F0 /* function return: float register */
@@ -52,6 +67,12 @@ enum { · 9 unmodified lines
5267 TREG_F1,
5368 TREG_F2,
5469 TREG_F3,
70+#ifdef TCC_ARM_VFP
71+ TREG_F4,
72+ TREG_F5,
73+ TREG_F6,
74+ TREG_F7,
75+#endif
5576 };
5677
5778 int reg_classes[NB_REGS] = {
@@ -64,6 +85,12 @@ int reg_classes[NB_REGS] = { · 6 unmodified lines
6485 /* f1 */ RC_FLOAT | RC_F1,
6586 /* f2 */ RC_FLOAT | RC_F2,
6687 /* f3 */ RC_FLOAT | RC_F3,
88+#ifdef TCC_ARM_VFP
89+ /* d4/s8 */ RC_FLOAT | RC_F4,
90+/* d5/s10 */ RC_FLOAT | RC_F5,
91+/* d6/s12 */ RC_FLOAT | RC_F6,
92+/* d7/s14 */ RC_FLOAT | RC_F7,
93+#endif
6794 };
6895
6996 static int two2mask(int a,int b) {
@@ -74,6 +101,10 @@ static int regmask(int r) { · 4 unmodified lines
74101 return reg_classes[r]&~(RC_INT|RC_FLOAT);
75102 }
76103
104+#ifdef TCC_ARM_VFP
105+#define T2CPR(t) (((t) & VT_BTYPE) != VT_FLOAT ? 0x100 : 0)
106+#endif
107+
77108 /* return registers for function */
78109 #define REG_IRET TREG_R0 /* single word int return register */
79110 #define REG_LRET TREG_R1 /* second word return register (for long long) */
@@ -86,12 +117,28 @@ static int regmask(int r) { · 6 unmodified lines
86117 are directly pushed on stack. */
87118 //#define FUNC_STRUCT_PARAM_AS_PTR
88119
120+#if defined(TCC_ARM_EABI) && defined(TCC_ARM_VFP)
121+static CType float_type, double_type, func_float_type, func_double_type;
122+#endif
123+
89124 /* pointer size, in bytes */
90125 #define PTR_SIZE 4
91126
92127 /* long double size and alignment, in bytes */
128+#ifdef TCC_ARM_VFP
129+#define LDOUBLE_SIZE 8
130+#endif
131+
132+#ifndef LDOUBLE_SIZE
93133 #define LDOUBLE_SIZE 8
134+#endif
135+
136+#ifdef TCC_ARM_EABI
137+#define LDOUBLE_ALIGN 8
138+#else
94139 #define LDOUBLE_ALIGN 4
140+#endif
141+
95142 /* maximum alignment (for aligned attribute support) */
96143 #define MAX_ALIGN 8
97144
@@ -112,6 +159,7 @@ static int regmask(int r) { · 14 unmodified lines
112159
113160 /******************************************************/
114161 static unsigned long func_sub_sp_offset,last_itod_magic;
162+static int leaffunc;
115163
116164 void o(unsigned long i)
117165 {
@@ -287,19 +335,28 @@ void gsym(int t) · 169 unmodified lines
287335 gsym_addr(t, ind);
288336 }
289337
338+#ifdef TCC_ARM_VFP
339+static unsigned long vfpr(int r)
340+{
341+ if(r<TREG_F0 || r>TREG_F7)
342+ error("compiler error! register %i is no vfp register",r);
343+ return r-5;
344+}
345+#else
290346 static unsigned long fpr(int r)
291347 {
292348 if(r<TREG_F0 || r>TREG_F3)
293− error("compiler error! register %i is no fp register\n",r);
349+ error("compiler error! register %i is no fpa register",r);
294350 return r-5;
295351 }
352+#endif
296353
297354 static unsigned long intr(int r)
298355 {
299356 if(r==4)
300357 return 12;
301358 if((r<0 || r>4) && r!=14)
302− error("compiler error! register %i is no int register\n",r);
359+ error("compiler error! register %i is no int register",r);
303360 return r;
304361 }
305362
@@ -335,28 +392,32 @@ static unsigned long mapcc(int cc) · 29 unmodified lines
335392 switch(cc)
336393 {
337394 case TOK_ULT:
338− return 0x30000000;
395+ return 0x30000000; /* CC/LO */
339396 case TOK_UGE:
340− return 0x20000000;
397+ return 0x20000000; /* CS/HS */
341398 case TOK_EQ:
342− return 0x00000000;
399+ return 0x00000000; /* EQ */
343400 case TOK_NE:
344− return 0x10000000;
401+ return 0x10000000; /* NE */
345402 case TOK_ULE:
346− return 0x90000000;
403+ return 0x90000000; /* LS */
347404 case TOK_UGT:
348− return 0x80000000;
405+ return 0x80000000; /* HI */
406+ case TOK_Nset:
407+ return 0x40000000; /* MI */
408+ case TOK_Nclear:
409+ return 0x50000000; /* PL */
349410 case TOK_LT:
350− return 0xB0000000;
411+ return 0xB0000000; /* LT */
351412 case TOK_GE:
352− return 0xA0000000;
413+ return 0xA0000000; /* GE */
353414 case TOK_LE:
354− return 0xD0000000;
415+ return 0xD0000000; /* LE */
355416 case TOK_GT:
356− return 0xC0000000;
417+ return 0xC0000000; /* GT */
357418 }
358419 error("unexpected condition code");
359− return 0xE0000000;
420+ return 0xE0000000; /* AL */
360421 }
361422
362423 static int negcc(int cc)
@@ -375,6 +436,10 @@ static int negcc(int cc) · 12 unmodified lines
375436 return TOK_UGT;
376437 case TOK_UGT:
377438 return TOK_ULE;
439+ case TOK_Nset:
440+ return TOK_Nclear;
441+ case TOK_Nclear:
442+ return TOK_Nset;
378443 case TOK_LT:
379444 return TOK_GE;
380445 case TOK_GE:
@@ -432,6 +497,14 @@ void load(int r, SValue *sv) · 51 unmodified lines
432497 if(v == VT_LOCAL) {
433498 if(is_float(ft)) {
434499 calcaddr(&base,&fc,&sign,1020,2);
500+#ifdef TCC_ARM_VFP
501+ op=0xED100A00; /* flds */
502+ if(!sign)
503+ op|=0x800000;
504+ if ((ft & VT_BTYPE) != VT_FLOAT)
505+ op|=0x100; /* flds -> fldd */
506+ o(op|(vfpr(r)<<12)|(fc>>2)|(base<<16));
507+#else
435508 op=0xED100100;
436509 if(!sign)
437510 op|=0x800000;
@@ -445,7 +518,9 @@ void load(int r, SValue *sv) · 7 unmodified lines
445518 op|=0x400000;
446519 #endif
447520 o(op|(fpr(r)<<12)|(fc>>2)|(base<<16));
448− } else if((ft & VT_TYPE) == VT_BYTE || (ft & VT_BTYPE) == VT_SHORT) {
521+#endif
522+ } else if((ft & (VT_BTYPE|VT_UNSIGNED)) == VT_BYTE
523+ || (ft & VT_BTYPE) == VT_SHORT) {
449524 calcaddr(&base,&fc,&sign,255,0);
450525 op=0xE1500090;
451526 if ((ft & VT_BTYPE) == VT_SHORT)
@@ -504,7 +579,11 @@ void load(int r, SValue *sv) · 52 unmodified lines
504579 return;
505580 } else if (v < VT_CONST) {
506581 if(is_float(ft))
582+#ifdef TCC_ARM_VFP
583+ o(0xEEB00A40|(vfpr(r)<<12)|vfpr(v)|T2CPR(ft)); /* fcpyX */
584+#else
507585 o(0xEE008180|(fpr(r)<<12)|fpr(v));
586+#endif
508587 else
509588 o(0xE1A00000|(intr(r)<<12)|intr(v));
510589 return;
@@ -550,6 +629,14 @@ void store(int r, SValue *sv) · 39 unmodified lines
550629 if(v == VT_LOCAL) {
551630 if(is_float(ft)) {
552631 calcaddr(&base,&fc,&sign,1020,2);
632+#ifdef TCC_ARM_VFP
633+ op=0xED000A00; /* fsts */
634+ if(!sign)
635+ op|=0x800000;
636+ if ((ft & VT_BTYPE) != VT_FLOAT)
637+ op|=0x100; /* fsts -> fstd */
638+ o(op|(vfpr(r)<<12)|(fc>>2)|(base<<16));
639+#else
553640 op=0xED000100;
554641 if(!sign)
555642 op|=0x800000;
@@ -563,6 +650,7 @@ void store(int r, SValue *sv) · 7 unmodified lines
563650 op|=0x400000;
564651 #endif
565652 o(op|(fpr(r)<<12)|(fc>>2)|(base<<16));
653+#endif
566654 return;
567655 } else if((ft & VT_BTYPE) == VT_SHORT) {
568656 calcaddr(&base,&fc,&sign,255,0);
@@ -635,19 +723,44 @@ void gfunc_call(int nb_args) · 66 unmodified lines
635723 r = vtop->r & VT_VALMASK;
636724 if (r == VT_CMP || (r & ~1) == VT_JMP)
637725 gv(RC_INT);
726+#ifdef TCC_ARM_EABI
727+ if((vtop[-nb_args].type.ref->type.t & VT_BTYPE) == VT_STRUCT
728+ && type_size(&vtop[-nb_args].type, &align) <= 4) {
729+ SValue tmp;
730+ tmp=vtop[-nb_args];
731+ vtop[-nb_args]=vtop[-nb_args+1];
732+ vtop[-nb_args+1]=tmp;
733+ --nb_args;
734+ }
735+
736+ vpushi(0);
737+ vtop->type.t = VT_LLONG;
738+ args_size = 0;
739+ for(i = nb_args + 1 ; i-- ;) {
740+ size = type_size(&vtop[-i].type, &align);
741+ if(args_size & (align-1)) {
742+ vpushi(0);
743+ vtop->type.t = VT_VOID; /* padding */
744+ vrott(i+2);
745+ args_size += 4;
746+ ++nb_args;
747+ }
748+ args_size += (size + 3) & -4;
749+ }
750+ vtop--;
751+#endif
638752 args_size = 0;
639753 for(i = nb_args ; i-- && args_size < 16 ;) {
640− if ((vtop[-i].type.t & VT_BTYPE) == VT_STRUCT) {
754+ switch(vtop[-i].type.t & VT_BTYPE) {
755+ case VT_STRUCT:
756+ case VT_FLOAT:
757+ case VT_DOUBLE:
758+ case VT_LDOUBLE:
641759 size = type_size(&vtop[-i].type, &align);
642− size = (size + 3) & ~3;
760+ size = (size + 3) & -4;
643761 args_size += size;
644− } else if ((vtop[-i].type.t & VT_BTYPE) == VT_FLOAT)
645− args_size += 4;
646− else if ((vtop[-i].type.t & VT_BTYPE) == VT_DOUBLE)
647− args_size += 8;
648− else if ((vtop[-i].type.t & VT_BTYPE) == VT_LDOUBLE)
649− args_size += LDOUBLE_SIZE;
650− else {
762+ break;
763+ default:
651764 plan[nb_args-1-i][0]=args_size/4;
652765 args_size += 4;
653766 if ((vtop[-i].type.t & VT_BTYPE) == VT_LLONG && args_size < 16) {
@@ -662,7 +775,7 @@ void gfunc_call(int nb_args) · 8 unmodified lines
662775 if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
663776 size = type_size(&vtop->type, &align);
664777 /* align to stack align size */
665− size = (size + 3) & ~3;
778+ size = (size + 3) & -4;
666779 /* allocate the necessary size on stack */
667780 gadd_sp(-size);
668781 /* generate structure store */
@@ -674,6 +787,16 @@ void gfunc_call(int nb_args) · 5 unmodified lines
674787 vtop--;
675788 args_size += size;
676789 } else if (is_float(vtop->type.t)) {
790+#ifdef TCC_ARM_VFP
791+ r=vfpr(gv(RC_FLOAT))<<12;
792+ size=4;
793+ if ((vtop->type.t & VT_BTYPE) != VT_FLOAT)
794+ {
795+ size=8;
796+ r|=0x101; /* fstms -> fstmd */
797+ }
798+ o(0xED2D0A01+r);
799+#else
677800 r=fpr(gv(RC_FLOAT))<<12;
678801 if ((vtop->type.t & VT_BTYPE) == VT_FLOAT)
679802 size = 4;
@@ -688,6 +811,7 @@ void gfunc_call(int nb_args) · 8 unmodified lines
688811 r|=0x8000;
689812
690813 o(0xED2D0100|r|(size>>2));
814+#endif
691815 vtop--;
692816 args_size += size;
693817 } else {
@@ -718,7 +842,14 @@ void gfunc_call(int nb_args) · 24 unmodified lines
718842 s=regmask(plan[nb_args-i-1][0]);
719843 todo&=~(1<<plan[nb_args-i-1][0]);
720844 }
721− if(s==RC_INT) {
845+#ifdef TCC_ARM_EABI
846+ if(vtop->type.t == VT_VOID) {
847+ if(s == RC_INT)
848+ o(0xE24DD004); /* sub sp,sp,#4 */
849+ vtop--;
850+ } else
851+#endif
852+ if(s == RC_INT) {
722853 r = gv(s);
723854 o(0xE52D0004|(intr(r)<<12)); /* str r,[sp,#-4]! */
724855 vtop--;
@@ -733,7 +864,7 @@ void gfunc_call(int nb_args) · 8 unmodified lines
733864 gv(plan2[i]);
734865 vrott(keep);
735866 }
736− save_regs(keep); /* save used temporary registers */
867+save_regs(keep); /* save used temporary registers */
737868 keep++;
738869 if(args_size) {
739870 int n;
@@ -758,7 +889,26 @@ void gfunc_call(int nb_args) · 18 unmodified lines
758889 gcall_or_jmp(0);
759890 if (args_size)
760891 gadd_sp(args_size);
892+#ifdef TCC_ARM_EABI
893+ if((vtop->type.ref->type.t & VT_BTYPE) == VT_STRUCT
894+ && type_size(&vtop->type.ref->type, &align) <= 4)
895+ {
896+ store(REG_IRET,vtop-keep);
897+ ++keep;
898+ }
899+#ifdef TCC_ARM_VFP
900+ else if(is_float(vtop->type.ref->type.t)) {
901+ if((vtop->type.ref->type.t & VT_BTYPE) == VT_FLOAT) {
902+ o(0xEE000A10); /* fmsr s0,r0 */
903+ } else {
904+ o(0xEE000B10); /* fmdlr d0,r0 */
905+ o(0xEE201B10); /* fmdhr d0,r1 */
906+ }
907+ }
908+#endif
909+#endif
761910 vtop-=keep;
911+ leaffunc = 0;
762912 }
763913
764914 /* generate function prolog of type 't' */
@@ -770,17 +920,18 @@ void gfunc_prolog(CType *func_type) · 5 unmodified lines
770920 sym = func_type->ref;
771921 func_vt = sym->type;
772922
773− n=0;
774− addr=12;
775− if((func_vt.t & VT_BTYPE) == VT_STRUCT) {
923+ n = 0;
924+ addr = 0;
925+ if((func_vt.t & VT_BTYPE) == VT_STRUCT
926+ && type_size(&func_vt,&align) > 4)
927+ {
776928 func_vc = addr;
777929 addr += 4;
778930 n++;
779931 }
780932 for(sym2=sym->next;sym2 && n<4;sym2=sym2->next) {
781933 size = type_size(&sym2->type, &align);
782− size = (size + 3) & ~3;
783− n+=size/4;
934+ n += (size + 3) / 4;
784935 }
785936 o(0xE1A0C00D); /* mov ip,sp */
786937 if(func_type->ref->c == FUNC_ELLIPSIS)
@@ -788,40 +939,63 @@ void gfunc_prolog(CType *func_type) · 1 unmodified line
788939 if(n) {
789940 if(n>4)
790941 n=4;
942+#ifdef TCC_ARM_EABI
943+ n=(n+1)&-2;
944+#endif
791945 o(0xE92D0000|((1<<n)-1)); /* save r0-r4 on stack if needed */
792946 }
793− o(0xE92D5800); /* save fp, ip, lr*/
794− o(0xE1A0B00D); /* mov fp,sp */
947+ o(0xE92D5800); /* save fp, ip, lr */
948+ o(0xE28DB00C); /* add fp, sp, #12 */
795949 func_sub_sp_offset = ind;
796950 o(0xE1A00000); /* nop, leave space for stack adjustment */
797951 while ((sym = sym->next)) {
798952 CType *type;
799953 type = &sym->type;
800− sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | VT_LVAL, addr);
801954 size = type_size(type, &align);
802− size = (size + 3) & ~3;
955+ size = (size + 3) & -4;
956+#ifdef TCC_ARM_EABI
957+ addr = (addr + align - 1) & -align;
958+#endif
959+ sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | VT_LVAL, addr);
803960 addr += size;
804961 }
805962 last_itod_magic=0;
806− loc = 0;
963+ leaffunc = 1;
964+ loc = -12;
807965 }
808966
809967 /* generate function epilog */
810968 void gfunc_epilog(void)
811969 {
812970 unsigned long x;
813− o(0xE89BA800); /* restore fp, sp, pc */
814− if(loc) {
815− x=stuff_const(0xE24DD000, (-loc + 3) & -4); /* sub sp,sp,# */
971+ int diff;
972+#ifdef TCC_ARM_EABI
973+ if(is_float(func_vt.t)) {
974+ if((func_vt.t & VT_BTYPE) == VT_FLOAT)
975+ o(0xEE100A10); /* fmrs r0, s0 */
976+ else {
977+ o(0xEE100B10); /* fmrdl r0, d0 */
978+ o(0xEE301B10); /* fmrdh r1, d0 */
979+ }
980+ }
981+#endif
982+ o(0xE91BA800); /* restore fp, sp, pc */
983+ diff = (-loc + 3) & -4;
984+#ifdef TCC_ARM_EABI
985+ if(!leaffunc)
986+ diff = (diff + 7) & -8;
987+#endif
988+ if(diff > 12) {
989+ x=stuff_const(0xE24BD000, diff); /* sub sp,fp,# */
816990 if(x)
817991 *(unsigned long *)(cur_text_section->data + func_sub_sp_offset) = x;
818992 else {
819993 unsigned long addr;
820994 addr=ind;
821995 o(0xE59FC004); /* ldr ip,[pc+4] */
822− o(0xE04DD00C); /* sub sp,sp,ip */
996+ o(0xE04BD00C); /* sub sp,fp,ip */
823997 o(0xE1A0F00E); /* mov pc,lr */
824− o((-loc + 3) & -4);
998+ o(diff);
825999 *(unsigned long *)(cur_text_section->data + func_sub_sp_offset) = 0xE1000000|encbranch(func_sub_sp_offset,addr,1);
8261000 }
8271001 }
@@ -879,7 +1053,12 @@ int gtst(int inv, int t) · 51 unmodified lines
8791053 } else {
8801054 if (is_float(vtop->type.t)) {
8811055 r=gv(RC_FLOAT);
882− o(0xEE90F118|fpr(r)<<16);
1056+#ifdef TCC_ARM_VFP
1057+ o(0xEEB50A40|(vfpr(r)<<12)|T2CPR(vtop->type.t)); /* fcmpzX */
1058+ o(0xEEF1FA10); /* fmstat */
1059+#else
1060+ o(0xEE90F118|(fpr(r)<<16));
1061+#endif
8831062 vtop->r = VT_CMP;
8841063 vtop->c.i = TOK_NE;
8851064 return gtst(inv, t);
@@ -1058,6 +1237,110 @@ done: · 172 unmodified lines
10581237 }
10591238 }
10601239
1240+#ifdef TCC_ARM_VFP
1241+static int is_zero(int i)
1242+{
1243+ if((vtop[i].r & (VT_VALMASK | VT_LVAL | VT_SYM)) != VT_CONST)
1244+ return 0;
1245+ if (vtop[i].type.t == VT_FLOAT)
1246+ return (vtop[i].c.f == 0.f);
1247+ else if (vtop[i].type.t == VT_DOUBLE)
1248+ return (vtop[i].c.d == 0.0);
1249+ return (vtop[i].c.ld == 0.l);
1250+}
1251+
1252+/* generate a floating point operation 'v = t1 op t2' instruction. The
1253+ * two operands are guaranted to have the same floating point type */
1254+void gen_opf(int op)
1255+{
1256+ unsigned long x;
1257+ int fneg=0,r;
1258+ x=0xEE000A00|T2CPR(vtop->type.t);
1259+ switch(op) {
1260+ case '+':
1261+ if(is_zero(-1))
1262+ vswap();
1263+ if(is_zero(0)) {
1264+ vtop--;
1265+ return;
1266+ }
1267+ x|=0x300000;
1268+ break;
1269+ case '-':
1270+ x|=0x300040;
1271+ if(is_zero(0)) {
1272+ vtop--;
1273+ return;
1274+ }
1275+ if(is_zero(-1)) {
1276+ x|=0x810000; /* fsubX -> fnegX */
1277+ vswap();
1278+ vtop--;
1279+ fneg=1;
1280+ }
1281+ break;
1282+ case '*':
1283+ x|=0x200000;
1284+ break;
1285+ case '/':
1286+ x|=0x800000;
1287+ break;
1288+ default:
1289+ if(op < TOK_ULT && op > TOK_GT) {
1290+ error("unknown fp op %x!",op);
1291+ return;
1292+ }
1293+ if(is_zero(-1)) {
1294+ vswap();
1295+ switch(op) {
1296+ case TOK_LT: op=TOK_GT; break;
1297+ case TOK_GE: op=TOK_ULE; break;
1298+ case TOK_LE: op=TOK_GE; break;
1299+ case TOK_GT: op=TOK_ULT; break;
1300+ }
1301+ }
1302+ x|=0xB40040; /* fcmpX */
1303+ if(op!=TOK_EQ && op!=TOK_NE)
1304+ x|=0x80; /* fcmpX -> fcmpeX */
1305+ if(is_zero(0)) {
1306+ vtop--;
1307+ o(x|0x10000|(vfpr(gv(RC_FLOAT))<<12)); /* fcmp(e)X -> fcmp(e)zX */
1308+ } else {
1309+ x|=vfpr(gv(RC_FLOAT));
1310+ vswap();
1311+ o(x|(vfpr(gv(RC_FLOAT))<<12));
1312+ vtop--;
1313+ }
1314+ o(0xEEF1FA10); /* fmstat */
1315+
1316+ switch(op) {
1317+ case TOK_LE: op=TOK_ULE; break;
1318+ case TOK_LT: op=TOK_ULT; break;
1319+ case TOK_UGE: op=TOK_GE; break;
1320+ case TOK_UGT: op=TOK_GT; break;
1321+ }
1322+
1323+ vtop->r = VT_CMP;
1324+ vtop->c.i = op;
1325+ return;
1326+ }
1327+ r=gv(RC_FLOAT);
1328+ x|=vfpr(r);
1329+ r=regmask(r);
1330+ if(!fneg) {
1331+ int r2;
1332+ vswap();
1333+ r2=gv(RC_FLOAT);
1334+ x|=vfpr(r2)<<16;
1335+ r|=regmask(r2);
1336+ }
1337+ vtop->r=get_reg_ex(RC_FLOAT,r);
1338+ if(!fneg)
1339+ vtop--;
1340+ o(x|(vfpr(vtop->r)<<12));
1341+}
1342+
1343+#else
10611344 static int is_fconst()
10621345 {
10631346 long double f;
@@ -1193,24 +1476,20 @@ void gen_opf(int op) · 129 unmodified lines
11931476 default:
11941477 if(op >= TOK_ULT && op <= TOK_GT) {
11951478 x|=0xd0f110; // cmfe
1479+/* bug (intention?) in Linux FPU emulator
1480+ doesn't set carry if equal */
11961481 switch(op) {
11971482 case TOK_ULT:
11981483 case TOK_UGE:
11991484 case TOK_ULE:
12001485 case TOK_UGT:
1201− fputs("unsigned comparision on floats?\n",stderr);
1486+ error("unsigned comparision on floats?");
12021487 break;
12031488 case TOK_LT:
1204− op=TOK_ULT;
1205− break;
1206− case TOK_GE:
1207− op=TOK_UGE;
1489+ op=TOK_Nset;
12081490 break;
12091491 case TOK_LE:
1210− op=TOK_ULE;
1211− break;
1212− case TOK_GT:
1213− op=TOK_UGT;
1492+ op=TOK_ULE; /* correct in unordered case only if AC bit in FPSR set */
12141493 break;
12151494 case TOK_EQ:
12161495 case TOK_NE:
@@ -1221,26 +1500,20 @@ void gen_opf(int op) · 4 unmodified lines
12211500 c2=c1;
12221501 vswap();
12231502 switch(op) {
1224− case TOK_ULT:
1225− op=TOK_UGT;
1503+ case TOK_Nset:
1504+ op=TOK_GT;
12261505 break;
1227− case TOK_UGE:
1506+ case TOK_GE:
12281507 op=TOK_ULE;
12291508 break;
12301509 case TOK_ULE:
1231− op=TOK_UGE;
1510+ op=TOK_GE;
12321511 break;
1233− case TOK_UGT:
1234− op=TOK_ULT;
1512+ case TOK_GT:
1513+ op=TOK_Nset;
12351514 break;
12361515 }
12371516 }
1238−// bug (intention?) in Linux FPU emulator
1239−// doesn't set carry if equal
1240− if(op==TOK_ULT)
1241− op=TOK_LT;
1242− else if(op==TOK_UGE)
1243− op=TOK_GE;
12441517 vswap();
12451518 r=fpr(gv(RC_FLOAT));
12461519 vswap();
@@ -1254,7 +1527,7 @@ void gen_opf(int op) · 7 unmodified lines
12541527 vtop[-1].r = VT_CMP;
12551528 vtop[-1].c.i = op;
12561529 } else {
1257− error("unknown fp op %x!\n",op);
1530+ error("unknown fp op %x!",op);
12581531 return;
12591532 }
12601533 }
@@ -1270,6 +1543,7 @@ void gen_opf(int op) · 9 unmodified lines
12701543 vtop--;
12711544 o(x|(r<<16)|(c1<<12)|r2);
12721545 }
1546+#endif
12731547
12741548 /* convert integers to fp 't' type. Must handle 'int', 'unsigned int'
12751549 and 'long long' cases. */
@@ -1279,6 +1553,14 @@ void gen_cvt_itof(int t) · 3 unmodified lines
12791553 bt=vtop->type.t & VT_BTYPE;
12801554 if(bt == VT_INT || bt == VT_SHORT || bt == VT_BYTE) {
12811555 r=intr(gv(RC_INT));
1556+#ifdef TCC_ARM_VFP
1557+ r2=vfpr(vtop->r=get_reg(RC_FLOAT));
1558+ o(0xEE000A10|(r<<12)|(r2<<16)); /* fmsr */
1559+ r2<<=12;
1560+ if(!(vtop->type.t & VT_UNSIGNED))
1561+ r2|=0x80; /* fuitoX -> fsituX */
1562+ o(0xEEB80A40|r2|T2CPR(t)); /* fYitoX*/
1563+#else
12821564 r2=fpr(vtop->r=get_reg(RC_FLOAT));
12831565 o(0xEE000190|(r2<<16)|(r<<12));
12841566 if((vtop->type.t & (VT_UNSIGNED|VT_BTYPE)) == (VT_UNSIGNED|VT_INT)) {
@@ -1300,14 +1582,30 @@ void gen_cvt_itof(int t) · 15 unmodified lines
13001582 }
13011583 o(0xBE000180|(r2<<16)|(r2<<12)|r);
13021584 }
1585+#endif
13031586 return;
13041587 } else if(bt == VT_LLONG) {
13051588 int func;
1589+ CType *func_type = &func_old_type;
1590+#ifdef TCC_ARM_VFP
1591+#ifdef TCC_ARM_EABI
1592+ func_type = &func_double_type;
1593+#endif
1594+ if((t & VT_BTYPE) == VT_FLOAT) {
1595+#ifdef TCC_ARM_EABI
1596+ func_type = &func_float_type;
1597+#endif
1598+ if(vtop->type.t & VT_UNSIGNED)
1599+ func=TOK___ulltof;
1600+ else
1601+ func=TOK___slltof;
1602+ } else
1603+#endif
13061604 if(vtop->type.t & VT_UNSIGNED)
13071605 func=TOK___ulltold;
13081606 else
13091607 func=TOK___slltold;
1310− vpush_global_sym(&func_old_type, func);
1608+ vpush_global_sym(func_type, func);
13111609 vswap();
13121610 gfunc_call(1);
13131611 vpushi(0);
@@ -1325,6 +1623,14 @@ void gen_cvt_ftoi(int t) · 11 unmodified lines
13251623 t&=VT_BTYPE;
13261624 r2=vtop->type.t & VT_BTYPE;
13271625 if(t==VT_INT) {
1626+#ifdef TCC_ARM_VFP
1627+ r=vfpr(gv(RC_FLOAT));
1628+ u=u?0:0x10000;
1629+ o(0xEEBC0A40|(r<<12)|r|T2CPR(r2)); /* ftoXiY */
1630+ r2=intr(vtop->r=get_reg(RC_INT));
1631+ o(0xEE100A10|(r<<16)|(r2<<12));
1632+ return;
1633+#else
13281634 if(u) {
13291635 if(r2 == VT_FLOAT)
13301636 func=TOK___fixunssfsi;
@@ -1342,6 +1648,7 @@ void gen_cvt_ftoi(int t) · 11 unmodified lines
13421648 o(0xEE100170|(r2<<12)|r);
13431649 return;
13441650 }
1651+#endif
13451652 } else if(t == VT_LLONG) { // unsigned handled in gen_cvt_ftoi1
13461653 if(r2 == VT_FLOAT)
13471654 func=TOK___fixsfdi;
@@ -1370,8 +1677,15 @@ void gen_cvt_ftoi(int t) · 22 unmodified lines
13701677 /* convert from one floating point type to another */
13711678 void gen_cvt_ftof(int t)
13721679 {
1373− /* all we have to do on i386 and ARM is to put the float in a register */
1680+#ifdef TCC_ARM_VFP
1681+ if(((vtop->type.t & VT_BTYPE) == VT_FLOAT) != ((t & VT_BTYPE) == VT_FLOAT)) {
1682+ int r=vfpr(gv(RC_FLOAT));
1683+ o(0xEEB70AC0|(r<<12)|r|T2CPR(vtop->type.t));
1684+ }
1685+#else
1686+ /* all we have to do on i386 and FPA ARM is to put the float in a register */
13741687 gv(RC_FLOAT);
1688+#endif
13751689 }
13761690
13771691 /* computed goto support */
elf.h+9−3
@@ -290,6 +290,9 @@ typedef struct · 289 unmodified lines
290290 #define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
291291 #define SHT_HIOS 0x6fffffff /* End OS-specific type */
292292 #define SHT_LOPROC 0x70000000 /* Start of processor-specific */
293+#define SHT_ARM_EXIDX 0x70000001 /* Exception Index table */
294+#define SHT_ARM_PREEMPTMAP 0x70000002 /* dynamic linking pre-emption map */
295+#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility attrs */
293296 #define SHT_HIPROC 0x7fffffff /* End of processor-specific */
294297 #define SHT_LOUSER 0x80000000 /* Start of application-specific */
295298 #define SHT_HIUSER 0x8fffffff /* End of application-specific */
@@ -1589,10 +1592,13 @@ typedef Elf32_Addr Elf32_Conflict; · 1293 unmodified lines
15891592 #define R_ARM_GLOB_DAT 21 /* Create GOT entry */
15901593 #define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
15911594 #define R_ARM_RELATIVE 23 /* Adjust by program base */
1592−#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
1593−#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
1594−#define R_ARM_GOT32 26 /* 32 bit GOT entry */
1595+#define R_ARM_GOTOFF32 24 /* 32 bit offset to GOT */
1596+#define R_ARM_BASE_PREL 25 /* 32 bit PC relative offset to GOT */
1597+#define R_ARM_GOT_BREL 26 /* 32 bit GOT entry */
15951598 #define R_ARM_PLT32 27 /* 32 bit PLT address */
1599+#define R_ARM_CALL 28
1600+#define R_ARM_JUMP24 29
1601+#define R_ARM_PREL31 42
15961602 #define R_ARM_GNU_VTENTRY 100
15971603 #define R_ARM_GNU_VTINHERIT 101
15981604 #define R_ARM_THM_PC11 102 /* thumb unconditional branch */
tcc.c+59−0
@@ -577,6 +577,8 @@ struct TCCState { · 576 unmodified lines
577577 #define TOK_NE 0x95
578578 #define TOK_ULE 0x96
579579 #define TOK_UGT 0x97
580+#define TOK_Nset 0x98
581+#define TOK_Nclear 0x99
580582 #define TOK_LT 0x9c
581583 #define TOK_GE 0x9d
582584 #define TOK_LE 0x9e
@@ -4827,6 +4829,9 @@ int gv(int rc) · 4244 unmodified lines
48274829 Sym *sym;
48284830 int *ptr;
48294831 unsigned long offset;
4832+#if defined(TCC_TARGET_ARM) && !defined(TCC_ARM_VFP)
4833+ CValue check;
4834+#endif
48304835
48314836 /* XXX: unify with initializers handling ? */
48324837 /* CPUs usually cannot use float constants, so we store them
@@ -4842,6 +4847,13 @@ int gv(int rc) · 9 unmodified lines
48424847 #endif
48434848 ptr = section_ptr_add(data_section, size);
48444849 size = size >> 2;
4850+#if defined(TCC_TARGET_ARM) && !defined(TCC_ARM_VFP)
4851+ check.d = 1;
4852+ if(check.tab[0])
4853+ for(i=0;i<size;i++)
4854+ ptr[i] = vtop->c.tab[size-1-i];
4855+ else
4856+#endif
48454857 for(i=0;i<size;i++)
48464858 ptr[i] = vtop->c.tab[i];
48474859 sym = get_sym_ref(&vtop->type, data_section, offset, size << 2);
@@ -6022,6 +6034,12 @@ static int type_size(CType *type, int *a) · 1174 unmodified lines
60226034 } else if (bt == VT_DOUBLE || bt == VT_LLONG) {
60236035 #ifdef TCC_TARGET_I386
60246036 *a = 4;
6037+#elif defined(TCC_TARGET_ARM)
6038+#ifdef TCC_ARM_EABI
6039+ *a = 8;
6040+#else
6041+ *a = 4;
6042+#endif
60256043 #else
60266044 *a = 8;
60276045 #endif
@@ -6337,6 +6355,13 @@ void vstore(void) · 309 unmodified lines
63376355 if (!nocode_wanted) {
63386356 size = type_size(&vtop->type, &align);
63396357
6358+#ifdef TCC_ARM_EABI
6359+ if(!(align & 7))
6360+ vpush_global_sym(&func_old_type, TOK_memcpy8);
6361+ else if(!(align & 3))
6362+ vpush_global_sym(&func_old_type, TOK_memcpy4);
6363+ else
6364+#endif
63406365 vpush_global_sym(&func_old_type, TOK_memcpy);
63416366
63426367 /* destination */
@@ -8113,6 +8138,27 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 1770 unmodified lines
81138138 CType type;
81148139 /* if returning structure, must copy it to implicit
81158140 first pointer arg location */
8141+#ifdef TCC_ARM_EABI
8142+ int align, size;
8143+ size = type_size(&func_vt,&align);
8144+ if(size <= 4)
8145+ {
8146+ if((vtop->r != (VT_LOCAL | VT_LVAL) || (vtop->c.i & 3))
8147+ && (align & 3))
8148+ {
8149+ int addr;
8150+ loc = (loc - size) & -4;
8151+ addr = loc;
8152+ type = func_vt;
8153+ vset(&type, VT_LOCAL | VT_LVAL, addr);
8154+ vswap();
8155+ vstore();
8156+ vset(&int_type, VT_LOCAL | VT_LVAL, addr);
8157+ }
8158+ vtop->type = int_type;
8159+ gv(RC_IRET);
8160+ } else {
8161+#endif
81168162 type = func_vt;
81178163 mk_pointer(&type);
81188164 vset(&type, VT_LOCAL | VT_LVAL, func_vc);
@@ -8120,6 +8166,9 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 1 unmodified line
81208166 vswap();
81218167 /* copy structure value to pointer */
81228168 vstore();
8169+#ifdef TCC_ARM_EABI
8170+ }
8171+#endif
81238172 } else if (is_float(func_vt.t)) {
81248173 gv(RC_FRET);
81258174 } else {
@@ -9360,6 +9409,16 @@ static int tcc_compile(TCCState *s1) · 1234 unmodified lines
93609409 func_old_type.t = VT_FUNC;
93619410 func_old_type.ref = sym_push(SYM_FIELD, &int_type, FUNC_CDECL, FUNC_OLD);
93629411
9412+#if defined(TCC_ARM_EABI) && defined(TCC_ARM_VFP)
9413+ float_type.t = VT_FLOAT;
9414+ double_type.t = VT_DOUBLE;
9415+
9416+ func_float_type.t = VT_FUNC;
9417+ func_float_type.ref = sym_push(SYM_FIELD, &float_type, FUNC_CDECL, FUNC_OLD);
9418+ func_double_type.t = VT_FUNC;
9419+ func_double_type.ref = sym_push(SYM_FIELD, &double_type, FUNC_CDECL, FUNC_OLD);
9420+#endif
9421+
93639422 #if 0
93649423 /* define 'void *alloca(unsigned int)' builtin function */
93659424 {
tccelf.c+35−7
@@ -532,6 +532,8 @@ static void relocate_section(TCCState *s1, Section *s) · 531 unmodified lines
532532 break;
533533 #elif defined(TCC_TARGET_ARM)
534534 case R_ARM_PC24:
535+ case R_ARM_CALL:
536+ case R_ARM_JUMP24:
535537 case R_ARM_PLT32:
536538 {
537539 int x;
@@ -548,13 +550,27 @@ static void relocate_section(TCCState *s1, Section *s) · 10 unmodified lines
548550 (*(int *)ptr) |= x;
549551 }
550552 break;
553+ case R_ARM_PREL31:
554+ {
555+ int x;
556+ x = (*(int *)ptr) & 0x7fffffff;
557+ (*(int *)ptr) &= 0x80000000;
558+ x = (x * 2) / 2;
559+ x += val - addr;
560+ if((x^(x>>1))&0x40000000)
561+ error("can't relocate value at %x",addr);
562+ (*(int *)ptr) |= x & 0x7fffffff;
563+ }
551564 case R_ARM_ABS32:
552565 *(int *)ptr += val;
553566 break;
554− case R_ARM_GOTPC:
567+ case R_ARM_BASE_PREL:
555568 *(int *)ptr += s1->got->sh_addr - addr;
556569 break;
557− case R_ARM_GOT32:
570+ case R_ARM_GOTOFF32:
571+ *(int *)ptr += val - s1->got->sh_addr;
572+ break;
573+ case R_ARM_GOT_BREL:
558574 /* we load the got offset */
559575 *(int *)ptr += s1->got_offsets[sym_index];
560576 break;
@@ -856,17 +872,17 @@ static void build_got_entries(TCCState *s1) · 295 unmodified lines
856872 }
857873 break;
858874 #elif defined(TCC_TARGET_ARM)
859− case R_ARM_GOT32:
860− case R_ARM_GOTOFF:
861− case R_ARM_GOTPC:
875+ case R_ARM_GOT_BREL:
876+ case R_ARM_GOTOFF32:
877+ case R_ARM_BASE_PREL:
862878 case R_ARM_PLT32:
863879 if (!s1->got)
864880 build_got(s1);
865− if (type == R_ARM_GOT32 || type == R_ARM_PLT32) {
881+ if (type == R_ARM_GOT_BREL || type == R_ARM_PLT32) {
866882 sym_index = ELF32_R_SYM(rel->r_info);
867883 sym = &((Elf32_Sym *)symtab_section->data)[sym_index];
868884 /* look at the symbol got offset. If none, then add one */
869− if (type == R_ARM_GOT32)
885+ if (type == R_ARM_GOT_BREL)
870886 reloc_type = R_ARM_GLOB_DAT;
871887 else
872888 reloc_type = R_ARM_JUMP_SLOT;
@@ -1081,8 +1097,12 @@ static void tcc_add_linker_symbols(TCCState *s1) · 208 unmodified lines
10811097 #ifdef __FreeBSD__
10821098 static char elf_interp[] = "/usr/libexec/ld-elf.so.1";
10831099 #else
1100+#ifdef TCC_ARM_EABI
1101+static char elf_interp[] = "/lib/ld-linux.so.3";
1102+#else
10841103 static char elf_interp[] = "/lib/ld-linux.so.2";
10851104 #endif
1105+#endif
10861106
10871107 static void tcc_output_binary(TCCState *s1, FILE *f,
10881108 const int *section_order)
@@ -1661,7 +1681,12 @@ int tcc_output_file(TCCState *s1, const char *filename) · 572 unmodified lines
16611681 ehdr.e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
16621682 #endif
16631683 #ifdef TCC_TARGET_ARM
1684+#ifdef TCC_ARM_EABI
1685+ ehdr.e_ident[EI_OSABI] = 0;
1686+ ehdr.e_flags = 4 << 24;
1687+#else
16641688 ehdr.e_ident[EI_OSABI] = ELFOSABI_ARM;
1689+#endif
16651690 #endif
16661691 switch(file_type) {
16671692 default:
@@ -1833,6 +1858,9 @@ static int tcc_load_object_file(TCCState *s1, · 165 unmodified lines
18331858 /* ignore sections types we do not handle */
18341859 if (sh->sh_type != SHT_PROGBITS &&
18351860 sh->sh_type != SHT_REL &&
1861+#ifdef TCC_ARM_EABI
1862+ sh->sh_type != SHT_ARM_EXIDX &&
1863+#endif
18361864 sh->sh_type != SHT_NOBITS)
18371865 continue;
18381866 if (sh->sh_addralign < 1)
tcctok.h+31−2
@@ -121,17 +121,36 @@ · 120 unmodified lines
121121 #endif
122122
123123 /* builtin functions or variables */
124+#ifdef TCC_ARM_EABI
125+ DEF(TOK_memcpy, "__aeabi_memcpy")
126+ DEF(TOK_memcpy4, "__aeabi_memcpy4")
127+ DEF(TOK_memcpy8, "__aeabi_memcpy8")
128+ DEF(TOK_memset, "__aeabi_memset")
129+#else
124130 DEF(TOK_memcpy, "memcpy")
125131 DEF(TOK_memset, "memset")
132+#endif
126133 DEF(TOK___divdi3, "__divdi3")
127134 DEF(TOK___moddi3, "__moddi3")
128135 DEF(TOK___udivdi3, "__udivdi3")
129136 DEF(TOK___umoddi3, "__umoddi3")
130137 #if defined(TCC_TARGET_ARM)
131− DEF(TOK___divsi3, "__divsi3")
132138 DEF(TOK___modsi3, "__modsi3")
133− DEF(TOK___udivsi3, "__udivsi3")
134139 DEF(TOK___umodsi3, "__umodsi3")
140+#ifdef TCC_ARM_EABI
141+ DEF(TOK___divsi3, "__aeabi_idiv")
142+ DEF(TOK___udivsi3, "__aeabi_uidiv")
143+ DEF(TOK___sardi3, "__aeabi_lasr")
144+ DEF(TOK___shrdi3, "__aeabi_llsr")
145+ DEF(TOK___shldi3, "__aeabi_llsl")
146+ DEF(TOK___slltof, "__aeabi_l2f")
147+ DEF(TOK___slltold, "__aeabi_l2d")
148+ DEF(TOK___fixsfdi, "__aeabi_f2lz")
149+ DEF(TOK___fixdfdi, "__aeabi_d2lz")
150+ DEF(TOK___fixxfdi, "__aeabi_d2lz")
151+#else
152+ DEF(TOK___divsi3, "__divsi3")
153+ DEF(TOK___udivsi3, "__udivsi3")
135154 DEF(TOK___sardi3, "__ashrdi3")
136155 DEF(TOK___shrdi3, "__lshrdi3")
137156 DEF(TOK___shldi3, "__ashldi3")
@@ -142,6 +161,7 @@ · 4 unmodified lines
142161 DEF(TOK___fixsfdi, "__fixsfdi")
143162 DEF(TOK___fixdfdi, "__fixdfdi")
144163 DEF(TOK___fixxfdi, "__fixxfdi")
164+#endif
145165 #elif defined(TCC_TARGET_C67)
146166 DEF(TOK__divi, "_divi")
147167 DEF(TOK__divu, "_divu")
@@ -160,12 +180,21 @@ · 12 unmodified lines
160180 #endif
161181 DEF(TOK___tcc_int_fpu_control, "__tcc_int_fpu_control")
162182 DEF(TOK___tcc_fpu_control, "__tcc_fpu_control")
183+#ifdef TCC_ARM_EABI
184+ DEF(TOK___ulltof, "__aeabi_ul2f")
185+ DEF(TOK___ulltod, "__aeabi_ul2d")
186+ DEF(TOK___ulltold, "__aeabi_ul2d")
187+ DEF(TOK___fixunssfdi, "__aeabi_f2ulz")
188+ DEF(TOK___fixunsdfdi, "__aeabi_d2ulz")
189+ DEF(TOK___fixunsxfdi, "__aeabi_d2ulz")
190+#else
163191 DEF(TOK___ulltof, "__ulltof")
164192 DEF(TOK___ulltod, "__ulltod")
165193 DEF(TOK___ulltold, "__ulltold")
166194 DEF(TOK___fixunssfdi, "__fixunssfdi")
167195 DEF(TOK___fixunsdfdi, "__fixunsdfdi")
168196 DEF(TOK___fixunsxfdi, "__fixunsxfdi")
197+#endif
169198 DEF(TOK___chkstk, "__chkstk")
170199
171200 /* bound checking symbols */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t