update docs about call convention for multi-value results (first is in A or AY, then R15...R0)

added sprites+coroutines+defer part to benchmark program
This commit is contained in:
Irmen de Jong
2025-02-19 21:05:33 +01:00
parent bc550a4549
commit fb1e89d9ef
7 changed files with 20 additions and 14 deletions

View File

@@ -635,7 +635,10 @@ internal class ExpressionGen(private val codeGen: IRCodeGen) {
}
}
// return value(s)
val returnRegSpecs = if(fcall.void) emptyList() else {
// TODO: for current implemenation of the call convention in case of multiple return values,
// a list of Ir virtual registers to hold the results is NOT correct (they're loaded into AY + R15..R0 instead!)
// So we use an empty list to avoid confusion here. This may change in a future version.
val returnRegSpecs = if(fcall.void || callTarget.returns.size>1) emptyList() else {
callTarget.returns.map {
val returnIrType = irType(it)
FunctionCallArgs.RegSpec(returnIrType, codeGen.registers.next(returnIrType), null)