mirror of
https://github.com/KarolS/millfork.git
synced 2024-10-30 21:30:52 +00:00
Slightly faster variable to register optimization
This commit is contained in:
parent
56e4b1fb70
commit
3cd6540f13
@ -195,19 +195,23 @@ object VariableToRegisterOptimization extends AssemblyOptimization {
|
|||||||
|
|
||||||
val variants = for {
|
val variants = for {
|
||||||
vx <- xCandidateSets.par
|
vx <- xCandidateSets.par
|
||||||
vy <- yCandidateSets
|
|
||||||
vz <- zCandidateSets
|
|
||||||
va <- aCandidateSets
|
|
||||||
na = va.map(_._1)
|
|
||||||
nx = vx.map(_._1)
|
nx = vx.map(_._1)
|
||||||
|
|
||||||
|
vy <- yCandidateSets
|
||||||
ny = vy.map(_._1)
|
ny = vy.map(_._1)
|
||||||
|
if (nx & ny).isEmpty
|
||||||
|
|
||||||
|
vz <- zCandidateSets
|
||||||
nz = vz.map(_._1)
|
nz = vz.map(_._1)
|
||||||
if (nx & nz).isEmpty
|
if (nx & nz).isEmpty
|
||||||
if (nz & ny).isEmpty
|
if (ny & nz).isEmpty
|
||||||
if (na & nz).isEmpty
|
|
||||||
if (nx & ny).isEmpty
|
va <- aCandidateSets
|
||||||
|
na = va.map(_._1)
|
||||||
|
if (nz & na).isEmpty
|
||||||
if (nx & na).isEmpty
|
if (nx & na).isEmpty
|
||||||
if (na & ny).isEmpty
|
if (ny & na).isEmpty
|
||||||
|
|
||||||
score = vx.toSeq.map(_._3).sum + vy.toSeq.map(_._3).sum + va.toSeq.map(_._3).sum + vz.toSeq.map(_._3).sum
|
score = vx.toSeq.map(_._3).sum + vy.toSeq.map(_._3).sum + va.toSeq.map(_._3).sum + vz.toSeq.map(_._3).sum
|
||||||
} yield (score, vx, vy, vz, va)
|
} yield (score, vx, vy, vz, va)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user