Skip to content

Limited size for runtime constants #2

@KilianMcGovernUGA

Description

@KilianMcGovernUGA

Since immediate (for Risc-V, at least) are capped at 12 bits giving any values over 4095 as HybroLang constants in the compilette will cause issues, and there seems to be no fail-safes in place to catch such cases.

Relatedly, since since the immediate value for some instructions is considered signed, going over 2047 will result in an overflow into negatives.

For example: In Risc-V, the ORI instruction, which is used to load immediate values into registers, uses signed immediates, such that a value of 3840 (0xF00) is loaded into the register as 0xFFFFFF00 instead of 0x00000F00

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions