diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-04-29 20:15:40 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-04-29 20:15:40 +0200 |
commit | ce62bbb8539eaa56c6646da3d445d968dabec99f (patch) | |
tree | d005ef75fea9f4cfd613d692d3ce9bccd117dcc6 | |
parent | b325475fc8da20bf15e95ab3e45cc9533061bec1 (diff) | |
download | plan9front-ce62bbb8539eaa56c6646da3d445d968dabec99f.tar.xz |
5c: dont emit conditional integer division instructions
the integer division instructions are emulated with _div()
function patched in by 5l which does not handle conditional
execution. so do not optimize away the branch in that case.
-rw-r--r-- | sys/src/cmd/5c/peep.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/src/cmd/5c/peep.c b/sys/src/cmd/5c/peep.c index c7b4c2a30..3d624a93d 100644 --- a/sys/src/cmd/5c/peep.c +++ b/sys/src/cmd/5c/peep.c @@ -1354,6 +1354,15 @@ joinsplit(Reg *r, Joininfo *j) j->end = r->s2; return Branch; } + switch(r->prog->as){ + case ADIV: + case ADIVU: + case AMOD: + case AMODU: + /* emulated by 5l, doesnt handle conditionals */ + j->end = r->s1; + return Toolong; + } if (modifiescpsr(r->prog)) { j->end = r->s1; return Setcond; |