Add loop syntactic sugar; errors now use print instead of debug; add check for duplicate labels.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
(
|
||||
; Unlabeled loop. Can be exited by jumping out
|
||||
|
||||
(loop
|
||||
(nop)
|
||||
(nop)
|
||||
(nop)
|
||||
)
|
||||
|
||||
(barrier)
|
||||
|
||||
; The above is equivalent to:
|
||||
|
||||
(:label)
|
||||
(nop)
|
||||
(nop)
|
||||
(nop)
|
||||
(j :label)
|
||||
|
||||
(barrier)
|
||||
|
||||
; The label name can be specified.
|
||||
; This adds a start label and ":label-end" at the end of the loop:
|
||||
|
||||
(loop :repeat
|
||||
(nop)
|
||||
(nop)
|
||||
(j :repeat-end)
|
||||
(nop)
|
||||
)
|
||||
|
||||
(barrier)
|
||||
|
||||
; The above is equivalent to: (labels changed to avoid a compile error)
|
||||
|
||||
(:repeat2)
|
||||
(nop)
|
||||
(nop)
|
||||
(j :repeat2-end)
|
||||
(nop)
|
||||
(j :repeat2)
|
||||
(:repeat2-end)
|
||||
)
|
||||
Reference in New Issue
Block a user