Skip to content

Commit 1bd7d40

Browse files
igrrespressif-bot
authored andcommitted
ulp: add documentation for JUMPS instruction conditions
Hardware implements conditions LE, LT, GE, and conditions EQ and GT are implemented in the assembler by emitting two JUMPS instructions with other conditions.
1 parent c7fc5b1 commit 1bd7d40

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/en/api-guides/ulp_instruction_set.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,29 @@ Note that when accessing RTC memories and RTC registers, ULP coprocessor has low
512512
- *Condition*:
513513
- *EQ* (equal) – jump if value in stage_cnt == threshold
514514
- *LT* (less than) – jump if value in stage_cnt < threshold
515+
- *LE* (less or equal) - jump if value in stage_cnt <= threshold
515516
- *GT* (greater than) – jump if value in stage_cnt > threshold
517+
- *GE* (greater or equal) — jump if value in stage_cnt >= threshold
516518

517519
**Cycles**
518-
2 cycles to execute, 2 cycles to fetch next instruction
520+
Conditions *LE*, *LT*, *GE*: 2 cycles to execute, 2 cycles to fetch next instruction
521+
522+
Conditions *EQ*, *GT* are implemented in the assembler using two **JUMPS** instructions::
523+
524+
// JUMPS target, threshold, EQ is implemented as:
525+
526+
JUMPS next, threshold, LT
527+
JUMPS target, threshold, LE
528+
next:
529+
530+
// JUMPS target, threshold, GT is implemented as:
531+
532+
JUMPS next, threshold, LE
533+
JUMPS target, threshold, GE
534+
next:
535+
536+
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.
537+
519538

520539
**Description**
521540
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)