work on longs

This commit is contained in:
Irmen de Jong
2025-09-19 06:41:16 +02:00
parent a2b9d78cf3
commit d66dc664de
17 changed files with 483 additions and 64 deletions

View File

@@ -446,7 +446,7 @@ internal class ExpressionGen(private val codeGen: IRCodeGen) {
else (it as PtNumber).number.toInt()
}
when {
elementDt.isIntegerOrBool -> {
elementDt.isWordOrByteOrBool -> {
if (elementDt.isByteOrBool) require(haystack.size in 0..PtContainmentCheck.MAX_SIZE_FOR_INLINE_CHECKS_BYTE)
if (elementDt.isWord) require(haystack.size in 0..PtContainmentCheck.MAX_SIZE_FOR_INLINE_CHECKS_WORD)
val gottemLabel = codeGen.createLabelName()

View File

@@ -10,12 +10,14 @@ internal object DummyMemsizer : IMemSizer {
return when(dt.sub) {
BaseDataType.BOOL, BaseDataType.BYTE, BaseDataType.UBYTE -> numElements
BaseDataType.UWORD, BaseDataType.WORD -> numElements*2
BaseDataType.LONG -> numElements*4
BaseDataType.FLOAT -> numElements*5
else -> throw IllegalArgumentException("invalid sub type")
}
}
return when {
dt.isByteOrBool -> 1 * (numElements ?: 1)
dt.isLong -> 4 * (numElements ?: 1)
dt.isFloat -> 5 * (numElements ?: 1)
else -> 2 * (numElements ?: 1)
}