摘要 |
An instruction processing method of a network processor and a network processor are provided. The method includes: when the network processor performs an added in advance combined function call instruction, pushing the address of the next instruction to the top of a first stack; judging whether the enable flag of each additional characteristic is enabled based on the combined function call instruction; if so, pushing the function entry address of the corresponding additional characteristic to the top of the first stack; after all the enable flags are judged, starting to pop the function entry address in the first stack from the top of the stack, and performing the function corresponding to the popped function entry address until the address of the next instruction is popped. The network processor includes: a first processing module and a second processing module. The function call of all the enabled additional characteristics can be achieved only needing to add one judge-jump instruction in a main thread stream. It greatly saves the execution cycle of instructions and reduces the influence of additional characteristics to the main thread performance. |