diff options
| author | bellard <bellard> | 2004-10-04 22:19:21 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2004-10-04 22:19:21 +0000 |
| commit | 6e5b1cc43a308e1154090349f6452d6a03bacb00 (patch) | |
| tree | c28b0403d900bef69dd27676996964ff231730db /tcc.c | |
| parent | 3bd3c71fd11b1a64cd5d3b54df9520a4443b2702 (diff) | |
| download | tinycc-6e5b1cc43a308e1154090349f6452d6a03bacb00.tar.gz tinycc-6e5b1cc43a308e1154090349f6452d6a03bacb00.tar.bz2 | |
ARM fixes (Daniel Glockner)
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 50 |
1 files changed, 46 insertions, 4 deletions
@@ -728,6 +728,8 @@ int ieee_finite(double d); void error(const char *fmt, ...); void vpushi(int v); void vrott(int n); +void vnrott(int n); +void lexpand_nr(void); static void vpush_global_sym(CType *type, int v); void vset(CType *type, int r, int v); void type_to_str(char *buf, int buf_size, @@ -4685,6 +4687,34 @@ void lexpand(void) vtop[-1].type.t = VT_INT | u; } +#ifdef TCC_TARGET_ARM +/* expand long long on stack */ +void lexpand_nr(void) +{ + int u,v; + + u = vtop->type.t & VT_UNSIGNED; + vdup(); + vtop->r2 = VT_CONST; + vtop->type.t = VT_INT | u; + v=vtop[-1].r & (VT_VALMASK | VT_LVAL); + if (v == VT_CONST) { + vtop[-1].c.ui = vtop->c.ull; + vtop->c.ui = vtop->c.ull >> 32; + vtop->r = VT_CONST; + } else if (v == (VT_LVAL|VT_CONST) || v == (VT_LVAL|VT_LOCAL)) { + vtop->c.ui += 4; + vtop->r = vtop[-1].r; + } else if (v > VT_CONST) { + vtop--; + lexpand(); + } else + vtop->r = vtop[-1].r2; + vtop[-1].r2 = VT_CONST; + vtop[-1].type.t = VT_INT | u; +} +#endif + /* build a long long from two ints */ void lbuild(int t) { @@ -4722,6 +4752,22 @@ void vrott(int n) vtop[-n + 1] = tmp; } +#ifdef TCC_TARGET_ARM +/* like vrott but in other direction + In ... I1 -> I(n-1) ... I1 In [top is right] + */ +void vnrott(int n) +{ + int i; + SValue tmp; + + tmp = vtop[-n + 1]; + for(i = n - 1; i > 0; i--) + vtop[-i] = vtop[-i + 1]; + vtop[0] = tmp; +} +#endif + /* pop stack value */ void vpop(void) { @@ -5531,11 +5577,7 @@ static void gen_cast(CType *type) } } else { do_itof: -#if !defined(TCC_TARGET_ARM) - gen_cvt_itof1(dbt); -#else gen_cvt_itof(dbt); -#endif } } else if (sf) { /* convert fp to int */ |
