mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-12 03:30:09 +00:00
Take into account that the sole byte parameter is passed via the accumulator in more locations
This commit is contained in:
parent
456c674a0c
commit
86ce4c75ad
@ -29,7 +29,9 @@ class Platform(
|
|||||||
val bankNumbers: Map[String, Int],
|
val bankNumbers: Map[String, Int],
|
||||||
val defaultCodeBank: String,
|
val defaultCodeBank: String,
|
||||||
val outputStyle: OutputStyle.Value
|
val outputStyle: OutputStyle.Value
|
||||||
)
|
) {
|
||||||
|
def cpuFamily: CpuFamily.Value = CpuFamily.forType(this.cpu)
|
||||||
|
}
|
||||||
|
|
||||||
object Platform {
|
object Platform {
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ object EmptyMemoryStoreRemoval extends AssemblyOptimization[AssemblyLine] {
|
|||||||
|
|
||||||
override def optimize(f: NormalFunction, code: List[AssemblyLine], options: CompilationOptions): List[AssemblyLine] = {
|
override def optimize(f: NormalFunction, code: List[AssemblyLine], options: CompilationOptions): List[AssemblyLine] = {
|
||||||
val paramVariables = f.params match {
|
val paramVariables = f.params match {
|
||||||
|
case NormalParamSignature(List(MemoryVariable(_, typ, _))) if typ.size == 1 =>
|
||||||
|
Set[String]()
|
||||||
case NormalParamSignature(ps) =>
|
case NormalParamSignature(ps) =>
|
||||||
ps.map(_.name).toSet
|
ps.map(_.name).toSet
|
||||||
case _ =>
|
case _ =>
|
||||||
|
@ -101,6 +101,8 @@ class Environment(val parent: Option[Environment], val prefix: String) {
|
|||||||
val p = get[Type]("pointer")
|
val p = get[Type]("pointer")
|
||||||
val params = nf.fold(List[String]()) { f =>
|
val params = nf.fold(List[String]()) { f =>
|
||||||
f.params match {
|
f.params match {
|
||||||
|
case NormalParamSignature(List(MemoryVariable(_, typ, _))) if typ.size == 1 && options.platform.cpuFamily == CpuFamily.M6502 =>
|
||||||
|
Nil
|
||||||
case NormalParamSignature(ps) =>
|
case NormalParamSignature(ps) =>
|
||||||
ps.map(p => p.name)
|
ps.map(p => p.name)
|
||||||
case _ =>
|
case _ =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user