aboutsummaryrefslogtreecommitdiff
path: root/chapters/control_flow.adoc
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2020-10-01 18:50:46 -0700
committerEric Kunze <eric.kunze@arm.com>2020-10-01 18:50:46 -0700
commit3309a5362a13f840e84a2f67b9ba7141aae58cc4 (patch)
tree74bde543bc11bf43208fa4b3789e2def23919890 /chapters/control_flow.adoc
parentc92cb063a2ebfad2fd9ffd4c4a73184327b864ed (diff)
downloadspecification-a4f3b169d12b26845c568b10314fc88fedc1ae66.tar.gz
TOSA spec 0.20.0, initial public versionv0.20.0
Change-Id: I7c528ebf7e78759ada4bb951b2471c367d3f4525
Diffstat (limited to 'chapters/control_flow.adoc')
-rw-r--r--chapters/control_flow.adoc48
1 files changed, 48 insertions, 0 deletions
diff --git a/chapters/control_flow.adoc b/chapters/control_flow.adoc
new file mode 100644
index 0000000..9efa3e7
--- /dev/null
+++ b/chapters/control_flow.adoc
@@ -0,0 +1,48 @@
+//
+// This confidential and proprietary software may be used only as
+// authorised by a licensing agreement from ARM Limited
+// (C) COPYRIGHT 2020 ARM Limited
+// ALL RIGHTS RESERVED
+// The entire notice above must be reproduced on all authorised
+// copies and copies may only be made to the extent permitted
+// by a licensing agreement from ARM Limited.
+
+=== Control Flow Operators
+
+TOSA implements two control flow operators, for conditional branching and loop based transfer of control. Both refer to region labels, which express the address of another operator in the TOSA program, to which control transfers.
+
+==== COND_IF
+
+Evaluates a Boolean condition and then takes one of two distinct execution paths. This implements the semantic If-then-else structure.
+
+*Input Operands:*
+
+* List of Input tensors – up to 4D tensor of any data layout.
+* A Boolean condition.
+
+*Output Operands:*
+
+* List of Input tensors – up to 4D tensor of any data layout. These need not have the same shapes as the list of input tensors.
+
+*Region Labels:*
+
+* Then: a reference to an operator that execution control transfers to if the Boolean condition is TRUE.
+* Else: a reference to an operator that execution control transfers to if the Boolean condition is FALSE.
+
+==== WHILE_LOOP
+
+Generates and evaluates a Bool condition and either executes a loop body or exits to another control point. This action is performed repeatedly after updating and re-evaluating the Boolean condition every iteration. This implements the semantic foreach or while iterative loop structure.
+
+*Input Operands:*
+
+* List of Input tensors – up to 4D tensor of any data layout. The list comprises both the tensors that are used to compute each iteration of the Bool condition, and the inputs to the body of the loop.
+
+*Output Operands:*
+
+* List of Input tensors – up to 4D tensor of any data layout. These must have the same dynamic shapes as the list of input tensors.
+
+*Region Labels:*
+
+* Cond: a reference to an operator that execution control transfers to in order to evaluate the current iteration of the Bool condition, and to update the condition for the next iteration.
+* Body: a reference to an operator that execution control transfers to in order to begin executing the body of the loop.
+