{"pub_number":"US12373216B2","doc_number":"12373216","country":"US","kind_code":"B2","patent_type":"utility","status":"active","title":"Conditional branch instructions","abstract_text":"Various embodiments of the present disclosure relate to conditional branch instructions to support software pipelining techniques. In an example embodiment, a system including instruction fetch circuitry, decoder circuitry, and conditional branch circuitry is provided. The instruction fetch circuitry is configured to fetch a conditional branch instruction from memory and provide the instruction to the decoder circuitry. The instruction includes an iteration count and multiple branch destinations. The branch destinations include two or more branch destinations corresponding to conditions against which the conditional branch circuitry evaluates the iteration count. The decoder circuitry is configured to cause the conditional branch circuitry to select a branch destination, of the two or more branch destinations, based on a comparison of the iteration count to each of the conditions and cause the instruction fetch circuitry to fetch an indication of an instruction from a memory location stored at the selected branch destination.","claims":[{"number":1,"text":"A system, comprising: instruction fetch circuitry; decoder circuitry coupled to the instruction fetch circuitry; and conditional branch circuitry coupled to the decoder circuitry; wherein the instruction fetch circuitry is configured to: fetch a conditional branch instruction from a memory, wherein the conditional branch instruction specifies an iteration count and two or more branch destinations, corresponding to conditions against which the conditional branch circuitry evaluates the iteration count; and provide the conditional branch instruction to the decoder circuitry; and wherein the decoder circuitry is configured to cause the conditional branch circuitry to: select a branch destination, of the two or more branch destinations, based on a comparison of the iteration count to each of the conditions; and cause the instruction fetch circuitry to fetch an indication of an instruction from a memory location stored at the selected branch destination.","independent":true},{"number":2,"text":"The system of claim 1, wherein the decoder circuitry is further configured to cause the conditional branch circuitry to perform the comparison of the iteration count to each of the conditions, wherein each condition of the conditions corresponds to a branch destination of the two or more branch destinations.","independent":false,"depends_on":[1]},{"number":3,"text":"The system of claim 1, wherein the iteration count is based on a number of remainder operations resulting after performing a loop instruction a number of times.","independent":false,"depends_on":[1]},{"number":4,"text":"The system of claim 3, wherein the instruction fetch circuitry is further configured to fetch the loop instruction from the memory and provide the loop instruction to the decoder circuitry.","independent":false,"depends_on":[3]},{"number":5,"text":"The system of claim 4, wherein the decoder circuitry is further configured to cause conditional branch circuitry to perform the loop instruction the number of times and the conditional branch circuitry to decrement the iteration count each time the conditional branch circuitry performs the loop instruction.","independent":false,"depends_on":[4]},{"number":6,"text":"The system of claim 1, wherein the conditional branch instruction further identifies a field.","independent":false,"depends_on":[1]},{"number":7,"text":"The system of claim 1, wherein the instruction at the memory location stored at the selected branch destination corresponds to a number of remainder operations.","independent":false,"depends_on":[1]},{"number":8,"text":"The system of claim 1, further comprising the memory.","independent":false,"depends_on":[1]},{"number":9,"text":"One or more computer-readable storage media, comprising: program instructions stored thereon comprising a conditional branch instruction that specifies an iteration count and two or more branch destinations corresponding to conditions against which a processor evaluates the iteration count, wherein the program instructions, when read and executed by a processing system, direct the processor to: select a branch destination, of the two or more branch destinations, based on a comparison of the iteration count to each of the conditions; and fetch an indication of an instruction from a memory location stored at the selected branch destination.","independent":true},{"number":10,"text":"The one or more computer-readable storage media of claim 9, wherein the program instructions further direct the processor to perform the comparison of the iteration count to each of the conditions, wherein each condition of the conditions corresponds to a branch destination of the two or more branch destinations.","independent":false,"depends_on":[9]},{"number":11,"text":"The one or more computer-readable storage media of claim 9, wherein the iteration count is based on a number of remainder operations resulting after performing a loop instruction a number of times.","independent":false,"depends_on":[9]},{"number":12,"text":"The one or more computer-readable storage media of claim 11, wherein the program instructions further comprise a loop instructions.","independent":false,"depends_on":[11]},{"number":13,"text":"The one or more computer-readable storage media of claim 12, wherein the program instructions further direct the processor to perform the loop instruction the number of times and decrement the iteration count each time the loop instruction is performed.","independent":false,"depends_on":[12]},{"number":14,"text":"The one or more computer-readable storage media of claim 9, wherein the conditional branch instruction further identifies a field.","independent":false,"depends_on":[9]},{"number":15,"text":"The one or more computer-readable storage media of claim 9, wherein the instruction at the memory location stored at the selected branch destination corresponds to a number of remainder operations.","independent":false,"depends_on":[9]},{"number":16,"text":"A method, comprising: receiving, instruction fetch circuitry, a conditional branch instruction from memory; performing a comparison of an iteration count specified by the conditional branch instruction to each of multiple conditions corresponding to two or more branch destinations specified by the conditional branch instruction; selecting a branch destination, of the two or more branch destinations, based on the result of the comparison; and causing the instruction fetch circuitry to fetch an indication of an instruction from a memory location stored at the selected branch destination.","independent":true},{"number":17,"text":"The method of claim 16, wherein the iteration count is based on a number of remainder operations resulting after performing a loop instruction a number of times.","independent":false,"depends_on":[16]},{"number":18,"text":"The method of claim 17, further comprising receiving, via the instruction fetch circuitry, the loop instruction from the memory.","independent":false,"depends_on":[17]},{"number":19,"text":"The method of claim 18, further comprising: performing the loop instruction the number of times; and decrementing the iteration count each time the loop instruction is performed.","independent":false,"depends_on":[18]},{"number":20,"text":"The method of claim 16, wherein the instruction at the memory location stored at the selected branch destination corresponds to a number of remainder operations.","independent":false,"depends_on":[16]}],"claim_stats":{"total":20,"independent":3,"dependent":17},"description":"CROSS-REFERENCE TO RELATED APPLICATIONS\nThis application claims the benefit of and priority to U.S. Patent Application No. 63/532,941, filed Aug. 16, 2023, entitled\n“\nINSTRUCTION SET TECHNIQUE TO OPTIMIZE REMAINDER OF LOOP ITERATIONS,\n”\nwhich is hereby incorporated herein by reference.\nTECHNICAL FIELD\nThis disclosure relates generally to instruction set architectures, and in particular embodiments, to conditional branching.\nBACKGROUND\nIn computing, software pipelining is a technique that may be used to take advantage of multiple processing resources by scheduling the execution of application code across the multiple processing resources in parallel and in a loop. Code within a first loop may be re-arranged by unrolling, which may reduce the number of loop iterations by techniques such as replacing the first loop with a larger second loop that includes multiple copies of the instructions of the first loop such that each iteration of the second loop performs multiple iterations of the first loop. In this way, the application code associated with the first loop may be executed a number of times in the course of a single iteration of the second loop. However, there may be limits on the number of smaller loops that may be grouped into a larger loop. In other words, following the execution of the application code within the larger loop, a processing system may still need to perform leftover iterations of the application code from the original, smaller loop as the loop count may not be an integral multiple of the number of times the application code is executed in the larger loop. For example, if the originally specified loop is to be executed 43 times and the loop body of the new, larger loop executes 4 iterations of the original loop, then 3 iterations of the original loop have to be executed outside the loop body of the larger loop.\nExisting solutions may use predication and conditional branching techniques to perform the leftover iterations of the application code. For","inventors":[{"name":"Alexander Tessarolo","slug":"alexander-tessarolo","city":"Lindfield","country":"AU"},{"name":"Venkatesh Natarajan","slug":"venkatesh-natarajan","city":"Bangalore","country":"IN"},{"name":"Alan Davis","slug":"alan-davis","city":"Sugar Land","country":"US"}],"assignees":[{"name":"Texas Instruments Incorporated","slug":"texas-instruments-incorporated","country":"US"}],"examiners":[],"cpc_codes":["G06F 9/30058","G06F 9/30061","G06F 9/323","G06F 9/3804"],"ipc_codes":["G06F 9/30","G06F 9/32","G06F 9/38"],"filing_date":"2024-01-30","pub_date":"2025-07-29","grant_date":"2025-07-29","expiration_date":"2044-01-30","family_members":[],"citations_made":[{"pub_number":"US20070234019A1","category":"examiner"},{"pub_number":"US20080313443A1","category":"examiner"},{"pub_number":"US20090177874A1","category":"examiner"},{"pub_number":"US20140189296A1","category":"examiner"},{"pub_number":"US20190079770A1","category":"examiner"},{"pub_number":"US20200341765A1","category":"examiner"},{"pub_number":"US20240086295A1","category":"examiner"},{"pub_number":"US20240202002A1","category":"examiner"}],"non_patent_literature":[],"drawings_count":5,"source_id":"uspto_patent_grants","upstream_forward_citations":0,"metrics":{"forward_citations":0,"indexed_forward_citations":0,"backward_citations":8,"npl_citations":0,"citations_per_year":0.0,"pagerank":0.0,"citation_rank":3484124,"pagerank_rank":3484124,"velocity_rank":3484124,"family_citations":0}}