Skip to content

Implement integer bitwise operators #49

Description

@itsfuad

Goal

Add finite-width integer bitwise operators through normal compiler pipeline.

Scope

  • Unary complement: ~.
  • Binary AND, OR, XOR: &, |, ^.
  • Checked shifts: <<, >>.
  • Integral-only typing with normal common numeric conversion.
  • Arithmetic right shift for signed integers; logical right shift for unsigned integers and byte.
  • Compile-time rejection and runtime trap for shift counts outside [0, bit_width).
  • Conventional precedence from shifts through logical operators.
  • Positive runtime and negative semantic fixtures.

Explicit Non-Scope

  • Compound bitwise assignments.
  • Bitwise operations on bool, floats, rawptr, or composites.
  • SIMD/vector operators.

Validation

  • Focused lexer, parser, typechecker, constvalue, consteval, HIR/MIR, LLVM, and pipeline tests.
  • Positive and negative x_test fixtures.
  • Capped full Go suite, vet, bundle, diff, format, and artifact checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguage-modelPeeper language model, ownership, pointer, optional, array/slice workruntime-loweringHIR/MIR/backend runtime lowering work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions