INSTRUCTION PROCESSING METHOD OF NETWORK PROCESSOR AND NETWORK PROCESSOR
First Claim
1. An instruction processing method of a network processor, comprising:
- when the network processor executes a pre-added combined function call instruction, adding an address of a next instruction of the combined function call instruction to a stack top of a first stack, wherein the first stack is a preset stack used for calling the combined function;
determining, according to the combined function call instruction, whether an enable flag of each additional feature of the network processor is enabled, and if an enable flag of an additional feature is enabled, adding a function entry address corresponding to the additional feature to the stack top of the first stack; and
after finishing determining enable flags of all additional features, popping the function entry address from the stack top of the stack, wherein the function entry address is added to the first stack, and executing a function corresponding to a popped function entry address until the address of the next instruction of the combined function call instruction is popped.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention provides an instruction processing method of a network processor and a network processor. The method includes: when executes a pre-added combined function call instruction, adding an address of its next instruction to a stack top of a first stack; judging, according to the combined function call instruction, whether an enable flag of each additional feature is enabled, and if enabled, adding a function entry address corresponding to an additional feature to the stack top of the first stack; and after finishing judging all enable flags, popping a function entry address in the first stack, and executing a function corresponding to a popped function entry address until the address of the next instruction is popped. In the present invention, only one judgment jump instruction needs to be added to a main line procedure to implement function call of enabled additional features, which saves an instruction execution cycle.
-
Citations
10 Claims
-
1. An instruction processing method of a network processor, comprising:
-
when the network processor executes a pre-added combined function call instruction, adding an address of a next instruction of the combined function call instruction to a stack top of a first stack, wherein the first stack is a preset stack used for calling the combined function; determining, according to the combined function call instruction, whether an enable flag of each additional feature of the network processor is enabled, and if an enable flag of an additional feature is enabled, adding a function entry address corresponding to the additional feature to the stack top of the first stack; and after finishing determining enable flags of all additional features, popping the function entry address from the stack top of the stack, wherein the function entry address is added to the first stack, and executing a function corresponding to a popped function entry address until the address of the next instruction of the combined function call instruction is popped. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A network processor, comprising:
-
a first processing module, configured to, when the network processor executes a pre-added combined function call instruction, add an address of a next instruction of the combined function call instruction to a stack top of a first stack; and
determine, according to the combined function call instruction, whether an enable flag of each additional feature of the network processor is enabled, and if an enable flag of an additional feature is enabled, add a function entry address corresponding to the additional feature to the stack top of the first stack, wherein the first stack is a preset stack used for calling the combined function; anda second processing module, configured to, after finishing determining enable flags of all additional features, pop the function entry address from the stack top of the stack, wherein the function entry address is added to the first stack, and execute a function corresponding to a popped function entry address until the address of the next instruction of the combined function call instruction is popped. - View Dependent Claims (7, 8, 9, 10)
-
Specification