Skip to content

Add reference page for newyork IR#522

Merged
elle-j merged 10 commits into
cl/newyorkfrom
lj/newyork-ir-docs
May 22, 2026
Merged

Add reference page for newyork IR#522
elle-j merged 10 commits into
cl/newyorkfrom
lj/newyork-ir-docs

Conversation

@elle-j
Copy link
Copy Markdown
Contributor

@elle-j elle-j commented May 21, 2026

Adds a per-operation reference for the newyork IR to the compiler book for easily being able to view printed syntax, operand and result types, examples, etc. for any operation. Using easily readable syntax notation. The new page is partly inspired by MLIR's docs.

Example entry

and

(Expression::Binary with BinaryOperation::And)

Description

Bitwise AND. The common idiom for type narrowing: a constant mask on the right lets forward analysis pick up a tight result width.

Syntax

and($lhs[: <type>], $rhs[: <type>])

Example

let v2 := and(v0, v1)
let v3 := and(v0, 0xff)     // type inference narrows result to i8

Operands

Name Type Notes
lhs i256
rhs i256

Result and purity

Result Purity
min(width(lhs), width(rhs)) — AND can only clear bits, so the result fits in the narrower operand Pure

Annotations

None.

@elle-j elle-j requested a review from xermicus May 21, 2026 14:19
Copy link
Copy Markdown
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@elle-j elle-j merged commit ada3f2d into cl/newyork May 22, 2026
3 checks passed
@elle-j elle-j deleted the lj/newyork-ir-docs branch May 22, 2026 09:48
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.

2 participants