Chapter 3 of r700 Instruction Set Architecture Reference Manual-control flow (CF) Program

Source: Internet
Author: User

One control flow (CF)ProgramIs a main program. It uses control flow commands (jump with conditions, loops, and child routines) to guide the flow of Program Sub-statements, in addition, it can include memory allocation commands and other commands that specify when vertex and ry programs have completed their operations. The r700 hardware maintains a single multi-entry stack, which is used to store and restore the active mask, cyclic counter, and the return address of the subroutine.

 

The CF Command can be:

1. Execute An ALU, get texture or get vertex clause, local data sharing clause, or memory read clause. These operations obtain the address of the sub-statement execution and a count of the sub-statement size. A program can specify that a clause must wait until the previously executed clause is completed; or a clause must be executed conditionally (only the active pixel executes this clause, if no active pixel exists, this clause is skipped ).

 

2. Execute a directx9 loop. Two commands mark the beginning and end of a loop. The address of the loop_start and loop_end commands in pairs for each command. One cycle reads from one of the 32 constants to obtain the cyclic count, initial index value, and index increment value. Loops can be nested.

 

3. Execute a directx10 loop. Two commands mark the beginning and end of a loop. The address of the loop_start and loop_end commands in pairs for each command. Loops can be nested.

 

4. Execute a repeating loop (the repeating loop does not maintain a repeating index ). Repeated loops are implemented using the loop_start_no_al and loop_end commands. These loops can be nested.

 

5. jump out of the loop at the bottom layer. The loop_break command gets an address of the corresponding loop_end command. The loop_break command can be conditional (only for Pixel execution that meets one bounce condition ). (Note: similar to the keyword break in C)

 

6. Continue a loop and start the next iteration of the innermost loop. The loop_continue command gets an address of the corresponding loop_end command. The loop_continue command can be conditional. (Note: similar to the continue keyword in C)

 

7. Execute a subroutine call or return. One call gets a jump address. A return statement does not obtain the address; it returns the address at the top of the stack. Call can be conditional (the command is executed only when the pixel that meets the condition ). Call can be nested.

 

8. Call the vertex coloring tool (FS ). The address field in a vtx or vtx_tc control flow instruction is not used. The address of the vertex clause is global and written by the host. Therefore, nesting these calls is meaningless.

 

9. Jump to a specified address in the control flow. A jump command can be conditional or unconditional.

 

10. Execute operations on the active mask of the current traffic control (for example, execute an else command to save and restore the active mask on the stack ).

 

11. Allocate data storage space in a cache and import (read) or export (write) addresses or data.

 

12. Send the signal. The geometric coloring machine (GS) has finished outputting a vertex and can be used as the end of a primitive strip (primitive strip.

 

The end of the CF program is marked by the end_of_program bit of the last CF Command in the program. The CF program is terminated after the completion of this instruction, regardless of whether the instruction is executed conditionally.

 

3.1 CF microCodeEncoding

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.