Skip to content
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

NIR: asm statement support, Wip #22992

Closed
wants to merge 36 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ddaea3b
Asm (gcc extended asm) for nir
ASVIEST Nov 27, 2023
73eb391
Update genasm.nim
ASVIEST Nov 27, 2023
73f9b60
Asm parsing now working on backends (WIP(
ASVIEST Nov 29, 2023
a4ddb3b
Emit targets
ASVIEST Nov 29, 2023
03af260
Remove asm instrs
ASVIEST Nov 29, 2023
545d35a
Update nirinsts.nim
ASVIEST Dec 1, 2023
5cefc65
verbatims
ASVIEST Dec 1, 2023
cd5de29
gcc asm (simple)
ASVIEST Dec 2, 2023
c0ab580
fix lastSon
ASVIEST Dec 2, 2023
78a4c61
Seperated file
ASVIEST Dec 2, 2023
e4af3f0
target properties
ASVIEST Dec 2, 2023
e9221ae
GCC asm c codegen
ASVIEST Dec 2, 2023
8419151
Small fix
ASVIEST Dec 2, 2023
57802ed
apply suggestions
ASVIEST Dec 3, 2023
a1f9c3f
msvc asm
ASVIEST Dec 3, 2023
f41557d
info's
ASVIEST Dec 3, 2023
fc8b91f
fix
ASVIEST Dec 3, 2023
68bc65d
fix
ASVIEST Dec 3, 2023
3d4f45e
Extended asm is now default inline asm syntax
ASVIEST Dec 3, 2023
119e15b
Merge branch 'devel' into nir-asm
ASVIEST Dec 3, 2023
24b6c55
support asmNoStackFrame
ASVIEST Dec 3, 2023
bb463f1
Merge branch 'nir-asm' of https://github.com/ASVIEST/Nim into nir-asm
ASVIEST Dec 3, 2023
5f58ec9
use strings for verbatims
ASVIEST Dec 4, 2023
330ae88
fix asmNoStackFrame
ASVIEST Dec 4, 2023
21ee838
fix
ASVIEST Dec 4, 2023
cc45710
small refactor
ASVIEST Dec 7, 2023
1b88194
Merge branch 'nim-lang:devel' into nir-asm
ASVIEST Dec 7, 2023
c7d3093
Merge branch 'nim-lang:devel' into nir-asm
ASVIEST Dec 12, 2023
11a6fe8
inlineAsmSyntax pragma
ASVIEST Dec 12, 2023
ec8beea
Merge branch 'nim-lang:devel' into nir-asm
ASVIEST Dec 12, 2023
540ef8f
simple dialect switch
ASVIEST Dec 13, 2023
5d6c354
Update cir.nim
ASVIEST Dec 13, 2023
f0efd4c
Update cir.nim
ASVIEST Dec 13, 2023
811e6ab
Revert "Update cir.nim"
ASVIEST Dec 13, 2023
94c7fa0
Merge branch 'nim-lang:devel' into nir-asm
ASVIEST Dec 13, 2023
747ead5
Merge branch 'nim-lang:devel' into nir-asm
ASVIEST Dec 14, 2023
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
11 changes: 9 additions & 2 deletions compiler/nir/nirinsts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,17 @@ proc next*(tree: Tree; pos: var NodePos) {.inline.} = nextChild tree, int(pos)

template firstSon*(n: NodePos): NodePos = NodePos(n.int+1)
proc lastSon*(tree: Tree; n: NodePos): NodePos =
ASVIEST marked this conversation as resolved.
Show resolved Hide resolved
var pos = n.int
var
pos = n.int
oldPos = pos

assert tree.nodes[pos].kind > LastAtomicValue
let last = pos + tree.nodes[pos].rawSpan
NodePos last
inc pos
while pos < last:
oldPos = pos
nextChild tree, pos
NodePos oldPos
ASVIEST marked this conversation as resolved.
Show resolved Hide resolved

template skipTyped*(n: NodePos): NodePos = NodePos(n.int+2)

Expand Down