diff --git a/src/main/java/dk/camelot64/kickc/asm/AsmFragmentManager.java b/src/main/java/dk/camelot64/kickc/asm/AsmFragmentManager.java index 9a6ae1c5b..59ff17300 100644 --- a/src/main/java/dk/camelot64/kickc/asm/AsmFragmentManager.java +++ b/src/main/java/dk/camelot64/kickc/asm/AsmFragmentManager.java @@ -76,7 +76,7 @@ public class AsmFragmentManager { } } if(signature.startsWith("zpby1=")) { - if(signature.contains("{zpby2}")) { + if(signature.contains("zpby2")) { String subSignature = "aby="+signature.substring(6).replace("zpby2", "zpby1"); CharStream subCharStream = loadOrSynthesizeFragment(subSignature); if(subCharStream!=null) { @@ -97,6 +97,9 @@ public class AsmFragmentManager { sigNew = regexpRewriteSignature(sigNew, "(.*)=(.*)_plus_aby", "$1=aby_plus_$2"); sigNew = regexpRewriteSignature(sigNew, "(.*)=(.*)_plus_xby", "$1=xby_plus_$2"); sigNew = regexpRewriteSignature(sigNew, "(.*)=(.*)_plus_yby", "$1=yby_plus_$2"); + sigNew = regexpRewriteSignature(sigNew, "(.*)_lt_aby_then_(.*)", "aby_ge_$1_then_$2"); + sigNew = regexpRewriteSignature(sigNew, "(.*)_lt_xby_then_(.*)", "xby_ge_$1_then_$2"); + sigNew = regexpRewriteSignature(sigNew, "(.*)_lt_yby_then_(.*)", "yby_ge_$1_then_$2"); sigNew = regexpRewriteSignature(sigNew, "(.*)_ge_aby_then_(.*)", "aby_lt_$1_then_$2"); sigNew = regexpRewriteSignature(sigNew, "(.*)_ge_xby_then_(.*)", "xby_lt_$1_then_$2"); sigNew = regexpRewriteSignature(sigNew, "(.*)_ge_yby_then_(.*)", "yby_lt_$1_then_$2"); diff --git a/src/main/java/dk/camelot64/kickc/test/ref/voronoi.log b/src/main/java/dk/camelot64/kickc/test/ref/voronoi.log index 487469981..eac7a2ca1 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/voronoi.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/voronoi.log @@ -9476,17 +9476,6 @@ Statement [44] (byte~) animate::$26 ← (byte~) animate::$25 + (byte) 7 [ animat Statement [49] (byte~) animate::$31 ← (byte~) animate::$30 - (byte) 40 [ animate::$31 ] always clobbers reg byte a Statement [62] (byte*) render::colline#1 ← (byte*) render::colline#2 + (byte) 40 [ render::y#2 render::colline#1 numpoints#1 ] always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ render::y#2 render::y#1 ] -Potential register analysis [75] findcol::diff#1 ← findcol::xp#0 - findcol::x#0 missing fragment zpby1=xby_minus_zpby2 allocation: zp ZP_BYTE:9 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 ] reg byte x [ findcol::xp#0 ] zp ZP_BYTE:37 [ findcol::x#0 ] -Potential register analysis [75] findcol::diff#1 ← findcol::xp#0 - findcol::x#0 missing fragment zpby1=yby_minus_zpby2 allocation: zp ZP_BYTE:9 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 ] reg byte y [ findcol::xp#0 ] zp ZP_BYTE:37 [ findcol::x#0 ] -Potential register analysis [75] findcol::diff#1 ← findcol::xp#0 - findcol::x#0 missing fragment zpby1=zpby2_minus_aby allocation: zp ZP_BYTE:9 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 ] zp ZP_BYTE:40 [ findcol::xp#0 ] reg byte a [ findcol::x#0 ] -Potential register analysis [75] findcol::diff#1 ← findcol::xp#0 - findcol::x#0 missing fragment zpby1=zpby2_minus_xby allocation: zp ZP_BYTE:9 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 ] zp ZP_BYTE:40 [ findcol::xp#0 ] reg byte x [ findcol::x#0 ] -Potential register analysis [75] findcol::diff#1 ← findcol::xp#0 - findcol::x#0 missing fragment zpby1=zpby2_minus_yby allocation: zp ZP_BYTE:9 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 ] zp ZP_BYTE:40 [ findcol::xp#0 ] reg byte y [ findcol::x#0 ] -MISSING FRAGMENTS - zpby1=xby_minus_zpby2 - zpby1=yby_minus_zpby2 - zpby1=zpby2_minus_aby - zpby1=zpby2_minus_xby - zpby1=zpby2_minus_yby Statement [75] (byte) findcol::diff#1 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ findcol::x#0 findcol::y#0 findcol::i#12 findcol::mindiff#10 findcol::mincol#11 findcol::yp#0 findcol::diff#1 numpoints#1 ] always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:37 [ findcol::x#0 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:38 [ findcol::y#0 ] @@ -9495,43 +9484,9 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ fi Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ findcol::return#0 findcol::mincol#11 findcol::mincol#2 findcol::mincol#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:41 [ findcol::yp#0 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ render::x#2 render::x#1 ] -Potential register analysis [78] findcol::$12 ← findcol::yp#0 - findcol::y#0 missing fragment zpby1=xby_minus_zpby2 allocation: zp ZP_BYTE:42 [ findcol::$12 ] reg byte x [ findcol::yp#0 ] zp ZP_BYTE:38 [ findcol::y#0 ] -Potential register analysis [78] findcol::$12 ← findcol::yp#0 - findcol::y#0 missing fragment zpby1=yby_minus_zpby2 allocation: zp ZP_BYTE:42 [ findcol::$12 ] reg byte y [ findcol::yp#0 ] zp ZP_BYTE:38 [ findcol::y#0 ] -Potential register analysis [78] findcol::$12 ← findcol::yp#0 - findcol::y#0 missing fragment zpby1=zpby2_minus_xby allocation: zp ZP_BYTE:42 [ findcol::$12 ] zp ZP_BYTE:41 [ findcol::yp#0 ] reg byte x [ findcol::y#0 ] -Potential register analysis [78] findcol::$12 ← findcol::yp#0 - findcol::y#0 missing fragment zpby1=zpby2_minus_yby allocation: zp ZP_BYTE:42 [ findcol::$12 ] zp ZP_BYTE:41 [ findcol::yp#0 ] reg byte y [ findcol::y#0 ] -MISSING FRAGMENTS - zpby1=xby_minus_zpby2 - zpby1=yby_minus_zpby2 - zpby1=zpby2_minus_xby - zpby1=zpby2_minus_yby Statement [78] (byte~) findcol::$12 ← (byte) findcol::yp#0 - (byte) findcol::y#0 [ findcol::x#0 findcol::y#0 findcol::i#12 findcol::mindiff#10 findcol::mincol#11 findcol::diff#4 findcol::$12 numpoints#1 ] always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 ] -Potential register analysis [85] if(findcol::i#1