Skip to content

Commit 1559b63

Browse files
Merge branch 'bugfix/ulp_docs_incorrect_jump_desc' into 'master'
docs: Updated incorrect description for ULP FSM JUMPR and JUMPS instructions Closes IDFGH-9574 See merge request espressif/esp-idf!22695
2 parents ba5fa07 + 2f4c32a commit 1559b63

File tree

1 file changed

+58
-19
lines changed

1 file changed

+58
-19
lines changed

docs/en/api-reference/system/ulp_instruction_set.rst

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -798,20 +798,48 @@ The detailed description of all instructions is presented below:
798798
- *GE* (greater or equal) – jump if value in R0 >= threshold
799799

800800
**Cycles**
801-
Conditions *EQ*, *GT* and *LT*: 2 cycles to execute, 2 cycles to fetch next instruction
802-
Conditions *LE* and *GE* are implemented in the assembler using two **JUMPR** instructions::
803801

804-
// JUMPR target, threshold, LE is implemented as:
802+
.. only:: esp32
803+
804+
Conditions *LT*, *GE*, *LE* and *GT*: 2 cycles to execute, 2 cycles to fetch next instruction
805+
806+
Conditions *LE* and *GT* are implemented in the assembler using one **JUMPR** instruction::
807+
808+
// JUMPR target, threshold, GT is implemented as:
809+
810+
JUMPR target, threshold+1, GE
811+
812+
// JUMPR target, threshold, LE is implemented as:
813+
814+
JUMPR target, threshold + 1, LT
815+
816+
Conditions *EQ* is implemented in the assembler using two **JUMPR** instructions::
817+
818+
// JUMPR target, threshold, EQ is implemented as:
819+
820+
JUMPR next, threshold + 1, GE
821+
JUMPR target, threshold, GE
822+
next:
823+
824+
825+
.. only:: esp32s2 or esp32s3
805826

806-
JUMPR target, threshold, EQ
807-
JUMPR target, threshold, LT
827+
Conditions *EQ*, *GT* and *LT*: 2 cycles to execute, 2 cycles to fetch next instruction
808828

809-
// JUMPR target, threshold, GE is implemented as:
829+
Conditions *LE* and *GE* are implemented in the assembler using two **JUMPR** instructions::
810830

811-
JUMPR target, threshold, EQ
812-
JUMPR target, threshold, GT
831+
// JUMPR target, threshold, LE is implemented as:
832+
833+
JUMPR target, threshold, EQ
834+
JUMPR target, threshold, LT
835+
836+
// JUMPR target, threshold, GE is implemented as:
837+
838+
JUMPR target, threshold, EQ
839+
JUMPR target, threshold, GT
840+
841+
Therefore the execution time will depend on the branches taken: either 2 cycles to execute + 2 cycles to fetch, or 4 cycles to execute + 4 cycles to fetch.
813842

814-
Therefore the execution time will depend on the branches taken: either 2 cycles to execute + 2 cycles to fetch, or 4 cycles to execute + 4 cycles to fetch.
815843

816844
**Description**
817845
The instruction makes a jump to a relative address if condition is true. Condition is the result of comparison of R0 register value and the threshold value.
@@ -844,21 +872,32 @@ The detailed description of all instructions is presented below:
844872
- *GE* (greater or equal) — jump if value in stage_cnt >= threshold
845873

846874
**Cycles**
847-
2 cycles to execute, 2 cycles to fetch next instruction::
848875

849-
// JUMPS target, threshold, EQ is implemented as:
876+
.. only:: esp32
877+
878+
Conditions *LE*, *LT*, *GE*: 2 cycles to execute, 2 cycles to fetch next instruction
879+
880+
Conditions *EQ*, *GT* are implemented in the assembler using two **JUMPS** instructions::
850881

851-
JUMPS next, threshold, LT
852-
JUMPS target, threshold, LE
853-
next:
882+
// JUMPS target, threshold, EQ is implemented as:
854883

855-
// JUMPS target, threshold, GT is implemented as:
884+
JUMPS next, threshold, LT
885+
JUMPS target, threshold, LE
886+
next:
887+
888+
// JUMPS target, threshold, GT is implemented as:
889+
890+
JUMPS next, threshold, LE
891+
JUMPS target, threshold, GE
892+
next:
893+
894+
Therefore the execution time will depend on the branches taken: either 2 cycles to execute + 2 cycles to fetch, or 4 cycles to execute + 4 cycles to fetch.
895+
896+
897+
.. only:: esp32s2 or esp32s3
856898

857-
JUMPS next, threshold, LE
858-
JUMPS target, threshold, GE
859-
next:
899+
2 cycles to execute, 2 cycles to fetch next instruction
860900

861-
Therefore the execution time will depend on the branches taken: either 2 cycles to execute + 2 cycles to fetch, or 4 cycles to execute + 4 cycles to fetch.
862901

863902
**Description**
864903
The instruction makes a jump to a relative address if condition is true. Condition is the result of comparison of count register value and threshold value.

0 commit comments

Comments
 (0)