Refactor: remove unsupported extended float types (f128-f1024)#249
Merged
LunaStev merged 1 commit intowavefnd:masterfrom Dec 13, 2025
Merged
Refactor: remove unsupported extended float types (f128-f1024)#249LunaStev merged 1 commit intowavefnd:masterfrom
LunaStev merged 1 commit intowavefnd:masterfrom
Conversation
Remove f128, f256, f512, and f1024 float types from lexer and parser
as they are not supported by LLVM's standard code generation.
Changes:
- Remove extended float type variants from FloatType enum:
- Delete F128, F256, F512, F1024 enum variants
- Keep only F32 and F64 (standard IEEE 754 formats)
- Remove lexer tokenization for extended floats:
- Delete keyword matching for "f128", "f256", "f512", "f1024"
- Simplify lexer identifier classification logic
- Remove parser type conversion for extended floats:
- Delete FloatType::F{128,256,512,1024} match arms
- Keep only standard 32-bit and 64-bit float conversion
- Update test suite with realistic integer type tests:
- test67.wave: Demonstrate i8, u8, i32, u32, i128, u128 usage
- test68.wave: Show i1024 bit shifting (arbitrary precision int)
- test69.wave: Test i1024 overflow behavior with large values
Rationale:
LLVM's core code generator only supports f32 (float) and f64 (double)
natively. Extended precision floats (f128, f256, etc.) would require:
- Custom soft-float library implementations
- Complex runtime support for arithmetic operations
- Platform-specific ABI considerations
Wave focuses on standard IEEE 754 floats for portability and LLVM
compatibility. Arbitrary precision integers (i1024, etc.) remain
supported through LLVM's APInt infrastructure.
Users requiring extended float precision should use external libraries
or explicit soft-float implementations rather than built-in types.
Signed-off-by: LunaStev <luna@lunastev.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove f128, f256, f512, and f1024 float types from lexer and parser as they are not supported by LLVM's standard code generation.
Changes
Type System Updates
FloatTypeenumF128,F256,F512,F1024enum variantsF32andF64(standard IEEE 754 formats)Lexer Changes
"f128","f256","f512","f1024"Parser Changes
FloatType::F{128,256,512,1024}match armsTest Suite Updates
test67.wave: Demonstratei8,u8,i32,u32,i128,u128usagetest68.wave: Showi1024bit shifting (arbitrary precision int)test69.wave: Testi1024overflow behavior with large valuesRationale
LLVM's core code generator only supports
f32(float) andf64(double) natively. Extended precision floats (f128, f256, etc.) would require:Wave focuses on standard IEEE 754 floats for portability and LLVM compatibility. Arbitrary precision integers (i1024, etc.) remain supported through LLVM's APInt infrastructure.
Users requiring extended float precision should use external libraries or explicit soft-float implementations rather than built-in types.