History

A partial reverse for commit eda2c756edc4dca004ba217d5bf361235dd9de1f

Author: Thomas Preud'homme <robotux@celest.fr> Date: Tue Dec 31 23:51:20 2013 +0800 Move logic for if (int value) to tccgen.c Move the logic to do a test of an integer value (ex if (0)) out of arch-specific code to tccgen.c to avoid code duplication. This also fixes test of long long value which was only testing the bottom half of such values on 32 bits architectures. I don't understand why if () in gtst(i) was removed. This patch allows to compile a linux kernel v.2.4.26 W/o this patch a tcc simply crashes.

seyko committed 11 years ago

Commit 2437ccd1 parent c45a8695 files · +5 −5Browse files

Unified · Split

5 files
  1. arm-gen.c +1 −1
  2. c67-gen.c +1 −1
  3. i386-gen.c +1 −1
  4. il-gen.c +1 −1
  5. x86_64-gen.c +1 −1
arm-gen.c+1−1
@@ -1418,7 +1418,7 @@ int gtst(int inv, int t) · 1417 unmodified lines
1418 op|=encbranch(r,t,1);1418 op|=encbranch(r,t,1);
1419 o(op);1419 o(op);
1420 t=r;1420 t=r;
1421 } else { /* VT_JMP || VT_JMPI */1421 } else if (v == VT_JMP || v == VT_JMPI) {
1422 if ((v & 1) == inv) {1422 if ((v & 1) == inv) {
1423 if(!vtop->c.i)1423 if(!vtop->c.i)
1424 vtop->c.i=t;1424 vtop->c.i=t;
c67-gen.c+1−1
@@ -2102,7 +2102,7 @@ int gtst(int inv, int t) · 2101 unmodified lines
2102 C67_NOP(5);2102 C67_NOP(5);
2103 t = ind1; //return where we need to patch2103 t = ind1; //return where we need to patch
2104 2104
2105 } else { /* VT_JMP || VT_JMPI */2105 } else if (v == VT_JMP || v == VT_JMPI) {
2106 /* && or || optimization */2106 /* && or || optimization */
2107 if ((v & 1) == inv) {2107 if ((v & 1) == inv) {
2108 /* insert vtop->c jump list in t */2108 /* insert vtop->c jump list in t */
i386-gen.c+1−1
@@ -677,7 +677,7 @@ ST_FUNC int gtst(int inv, int t) · 676 unmodified lines
677 /* fast case : can jump directly since flags are set */677 /* fast case : can jump directly since flags are set */
678 g(0x0f);678 g(0x0f);
679 t = psym((vtop->c.i - 16) ^ inv, t);679 t = psym((vtop->c.i - 16) ^ inv, t);
680 } else { /* VT_JMP || VT_JMPI */680 } else if (v == VT_JMP || v == VT_JMPI) {
681 /* && or || optimization */681 /* && or || optimization */
682 if ((v & 1) == inv) {682 if ((v & 1) == inv) {
683 /* insert vtop->c jump list in t */683 /* insert vtop->c jump list in t */
il-gen.c+1−1
@@ -516,7 +516,7 @@ int gtst(int inv, int t) · 515 unmodified lines
516 break;516 break;
517 }517 }
518 t = out_opj(c, t);518 t = out_opj(c, t);
519 } else { /* VT_JMP || VT_JMPI */519 } else if (v == VT_JMP || v == VT_JMPI) {
520 /* && or || optimization */520 /* && or || optimization */
521 if ((v & 1) == inv) {521 if ((v & 1) == inv) {
522 /* insert vtop->c jump list in t */522 /* insert vtop->c jump list in t */
x86_64-gen.c+1−1
@@ -1592,7 +1592,7 @@ int gtst(int inv, int t) · 1591 unmodified lines
1592 }1592 }
1593 g(0x0f);1593 g(0x0f);
1594 t = psym((vtop->c.i - 16) ^ inv, t);1594 t = psym((vtop->c.i - 16) ^ inv, t);
1595 } else { /* VT_JMP || VT_JMPI */1595 } else if (v == VT_JMP || v == VT_JMPI) {
1596 /* && or || optimization */1596 /* && or || optimization */
1597 if ((v & 1) == inv) {1597 if ((v & 1) == inv) {
1598 /* insert vtop->c jump list in t */1598 /* insert vtop->c jump list in t */

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