CMI was translated wrongly; corrected

This commit is contained in:
ceriel 1988-03-14 13:56:33 +00:00
parent 23be652f11
commit bf3cfae610
4 changed files with 45 additions and 17 deletions

View file

@ -1854,8 +1854,15 @@ pat tge ior $2==4 call txxior("bgt")
pat tgt ior $2==4 call txxior("bge") pat tgt ior $2==4 call txxior("bge")
pat cmi $1==4 pat cmi $1==4
with src4 REG with src4 src4
gen subd %1, %2 yields %2 uses REG={const4, 0}
gen cmpd %2, %1
blt {label, "1f"}
shid %a
br {label, "2f"}
1:
addd {const4, 0-1}, %a
2: yields %a
#ifndef NOFLOAT #ifndef NOFLOAT
pat cmf $1==4 pat cmf $1==4

View file

@ -1804,15 +1804,16 @@ lar !defined($1) | | remove(all)
* group 12 : Compare instructions * * group 12 : Compare instructions *
****************************************/ ****************************************/
cmi $1==2 | source2 SCR_REG | cmi $1==2 | source2 source2 |
"sub %[1],%[2]" allocate(REG = {CONST2,0})
setcc(%[2]) "cmp %[1],%[2]"
erase(%[2]) | %[2] | | "beq 2f"
... | SCR_REG source2 | "bgt 1f"
"sub %[2],%[1]" "inc %[a]"
"neg %[1]" "br 2f"
setcc(%[1]) "1:\tdec %[a]\n2:"
erase(%[1]) | %[1] | | setcc(%[a])
erase(%[a]) | %[a] | |
ldc cmi zlt highw(1)==0 && loww(1)==0 && $2==4 | source2 source2 | ldc cmi zlt highw(1)==0 && loww(1)==0 && $2==4 | source2 source2 |
| %[1] | zlt $3 | | %[1] | zlt $3 |
ldc cmi zge highw(1)==0 && loww(1)==0 && $2==4 | source2 source2 | ldc cmi zge highw(1)==0 && loww(1)==0 && $2==4 | source2 source2 |

View file

@ -1632,11 +1632,16 @@ gen jsr pc,{label, "ilar~"}
****************************************/ ****************************************/
pat cmi $1==2 pat cmi $1==2
with src2 REG with src2 src2
gen sub %1,%2 yields %2 uses REG = {const2,0}
with REG src2 gen cmp %1,%2
gen sub %2,%1 beq {label,2f}
neg %1 yields %1 bgt {label,1f}
inc %a
br {label,2f}
1:
dec %a
2: yields %a
pat cmi $1==4 pat cmi $1==4
kills ALL kills ALL

View file

@ -1157,7 +1157,22 @@ lae lar defined(rom(1,3)) | | | | lae $1 aar $2 loi rom(1,3) |
******** GROUP 12 ******** ******** GROUP 12 ********
***************************************/ ***************************************/
cmi $1==2 | | | | sbi $1 | cmi $1==2 | src2 REG | allocate( REG = {im2, 0} )
"cp %[2], %[1]"
"jr EQ, 2f"
"jr LT, 1f"
"inc %[a]"
"jr 2f"
"1:\tdec %[a]\n2:"
erase(%[a]) nocc | %[a] | |
... | NC im2 src2a | allocate( REG = {im2, 0} )
"cp %[2], %[1]"
"jr EQ, 2f"
"jr LT, 1f"
"inc %[a]"
"jr 2f"
"1:\tdec %[a]\n2:"
erase(%[a]) nocc | %[a] | |
cmi $1==4 | STACK | "calr cmi4" | R0 | | cmi $1==4 | STACK | "calr cmi4" | R0 | |
cmi !defined($1)| src2 STACK | move( %[1], R0 ) cmi !defined($1)| src2 STACK | move( %[1], R0 )
"calr cmi" "calr cmi"