Files
hakorune/docs/reference/mir/INSTRUCTION_SET.md

46 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Nyash MIR Instruction Set (Canonical 26)
Status: Canonical (Source of Truth)
Last Updated: 2025-08-25
この文書はNyashのMIR命令セットの唯一の参照26命令だよ。実装は常にこの一覧に一致し、総数はテストで26に固定する。
注意: Debug/Nop/Safepointはビルドモードでの降格用メタ命令であり、コア26命令には数えない。
## Core Instructions26
- Const
- Copy
- Load
- Store
- UnaryOp
- BinOp
- Compare
- Jump
- Branch
- Phi
- Return
- Call
- ExternCall
- BoxCall
- NewBox
- ArrayGet
- ArraySet
- RefNew
- RefGet
- RefSet
- Await
- Print
- TypeOpTypeCheck/Cast統合
- WeakRefWeakNew/WeakLoad統合
- BarrierRead/Write統合
## Meta (降格対象; カウント外)
- Debug
- Nop
- Safepoint
## 同期ルール
- 命令の追加/削除/統合は、まずこの文書を更新し、次に実装(列挙/Printer/Verifier/Optimizer/VMを同期。最後に「総数=26」テストを更新する。
- 実装が26を外れた場合はCIを赤にする設計の合意なく増減させないため