Skip to content

Conversation

@LunaStev
Copy link
Member

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

  • Remove extended float type variants from FloatType enum
    • Delete F128, F256, F512, F1024 enum variants
    • Keep only F32 and F64 (standard IEEE 754 formats)

Lexer Changes

  • Remove tokenization for extended floats
    • Delete keyword matching for "f128", "f256", "f512", "f1024"
    • Simplify lexer identifier classification logic

Parser Changes

  • Remove type conversion for extended floats
    • Delete FloatType::F{128,256,512,1024} match arms
    • Keep only standard 32-bit and 64-bit float conversion

Test Suite Updates

  • Add 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.

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>
@LunaStev LunaStev self-assigned this Dec 13, 2025
@LunaStev LunaStev merged commit 9ac99c7 into wavefnd:master Dec 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant