Skip to content

Adding machine info #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kmir/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "kmir"
version = "0.3.153"
version = "0.3.154"
description = ""
requires-python = "~=3.10"
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion kmir/src/kmir/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from typing import Final

VERSION: Final = '0.3.153'
VERSION: Final = '0.3.154'
4 changes: 2 additions & 2 deletions kmir/src/kmir/kdist/mir-semantics/kmir-ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ module KMIR-AST
imports TYPES


syntax Pgm ::= Symbol GlobalAllocs FunctionNames MonoItems TypeMappings
[symbol(pgm), group(mir---name--allocs--functions--items--types)]
syntax Pgm ::= Symbol GlobalAllocs FunctionNames MonoItems TypeMappings MachineInfo
[symbol(pgm), group(mir---name--allocs--functions--items--types--machine)]

syntax FunctionKind ::= functionNormalSym(Symbol) [symbol(FunctionKind::NormalSym), group(mir-enum)]
| functionIntrinsic(Symbol) [symbol(FunctionKind::IntrinsicSym), group(mir-enum)]
Expand Down
2 changes: 1 addition & 1 deletion kmir/src/kmir/kdist/mir-semantics/kmir.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function map and the initial memory have to be set up.

```k
// #init step, assuming a singleton in the K cell
rule <k> #init(_NAME:Symbol _ALLOCS:GlobalAllocs FUNCTIONS:FunctionNames ITEMS:MonoItems TYPES:TypeMappings)
rule <k> #init(_NAME:Symbol _ALLOCS:GlobalAllocs FUNCTIONS:FunctionNames ITEMS:MonoItems TYPES:TypeMappings _MACHINE:MachineInfo)
=>
#execFunction(#findItem(ITEMS, FUNCNAME), FUNCTIONS)
</k>
Expand Down
10 changes: 7 additions & 3 deletions kmir/src/kmir/kdist/mir-semantics/target.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
```k
requires "ty.md"

module TARGET-SORTS

syntax MachineSize
Expand All @@ -8,10 +10,12 @@ endmodule
module TARGET
imports TARGET-SORTS
imports INT
imports TYPES

syntax MachineInfo ::= machineInfo(endian: Endian, pointerWidth: MachineSize)
syntax Endian ::= "endianLittle" | "endianBig"
syntax MachineSize ::= machineSize(numBits: Int)
syntax MachineInfo ::= machineInfo(endian: Endian, pointerWidth: MachineSize) [group(mir---endian--pointer-width)]
syntax Endian ::= "endianLittle" [group(mir-enum), symbol(Endian::Little)]
| "endianBig" [group(mir-enum), symbol(Endian::Big)]
syntax MachineSize ::= machineSize(numBits: MIRInt) [group(mir---num-bits), symbol(MachineSize::num_bits)]

endmodule
```
Expand Down
Loading