CN105892995B - Search the method, apparatus and processor of negative - Google Patents

Search the method, apparatus and processor of negative Download PDF

Info

Publication number
CN105892995B
CN105892995B CN201610184539.6A CN201610184539A CN105892995B CN 105892995 B CN105892995 B CN 105892995B CN 201610184539 A CN201610184539 A CN 201610184539A CN 105892995 B CN105892995 B CN 105892995B
Authority
CN
China
Prior art keywords
negative
vector data
pending
information
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610184539.6A
Other languages
Chinese (zh)
Other versions
CN105892995A (en
Inventor
汪文祥
杨灿
邢金璋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Loongson Technology Corp Ltd
Original Assignee
Loongson Technology Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Loongson Technology Corp Ltd filed Critical Loongson Technology Corp Ltd
Priority to CN201610184539.6A priority Critical patent/CN105892995B/en
Publication of CN105892995A publication Critical patent/CN105892995A/en
Application granted granted Critical
Publication of CN105892995B publication Critical patent/CN105892995B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/34Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Display Devices Of Pinball Game Machines (AREA)
  • Complex Calculations (AREA)

Abstract

The present invention provides a kind of method, apparatus and processor for searching negative, and this method includes:It receives and searches negative instruction, wherein, it searches negative instruction and includes the first operand as pending vector data, the second operand as looked-up sequence, as the destination of negative information that the third operand of the storage width of element and storage are searched in pending vector data;Decoding searches negative instruction and the negative information obtained in pending vector data is searched according to lookup negative instruction;Negative information is stored in destination.In the present invention, operand information and destination information according to searching in negative instruction search the negative information in pending vector data, and the negative information found is stored in destination, so as to improve the efficiency for searching negative, it avoids in the prior art, CPU must read instruction one by one in internal storage, the problem of could realizing the lookup to negative in vector data, cause to search negative inefficiency.

Description

Search the method, apparatus and processor of negative
Technical field
The present invention relates to computer instruction field more particularly to a kind of method, apparatus and processor for searching negative.
Background technology
Central processing unit (Central Processing Unit, abbreviation CPU) is one piece of ultra-large integrated circuit, It is the arithmetic core and control core of a computer.Its function is mainly that interpretive machine instruction and processing computer are soft Data in part, central processing unit mainly include arithmetic unit and cache memory and realize that the data contacted between them are total Line, controlling bus and status bus.CPU is collectively referred to as three big core of electronic computer with internal storage and input-output apparatus Component.Usual CPU reads the computer instruction in internal storage, to realize corresponding function.
In the prior art, in application scenes, CPU generally requires to carry out a large amount of data identical operation, is The treatment effeciency of CPU is improved, would commonly be used for carrying out the data vector of same operation, that is, forms vector data, then opposite Amount data are handled, for example, when carrying out string matching, it usually needs to two character string comparisons treated all members The vector data of element composition carries out searching negative processing, to obtain the position of the negative element in the vector data, convenient for word Symbol string carries out matching treatment, specifically, the operation that negative is searched in vector data is to run a plurality of instruction by CPU to realize , this plurality of instruction is stored in internal storage, and CPU reads this plurality of finger one by one in internal storage during specific implementation It enables, finally to obtain the negative information in vector data.
But using the prior art, CPU must read instruction one by one in internal storage, could realize to vectorial number According to the lookup of middle negative, cause to search negative inefficiency.
Invention content
The present invention provides a kind of method, apparatus and processor for searching negative, for solving in the prior art, to search negative The problem of inefficiency.
First aspect present invention provides a kind of method for searching negative, including:
It receives and searches negative instruction, the negative of searching instructs the first operation included as pending vector data Number, the second operand as looked-up sequence, the third behaviour as the storage width of element in the pending vector data Count and store the destination of searched negative information;
It decodes the lookup negative instruction and is searched according to the lookup negative instruction and obtain the pending vectorial number The negative information in;
The negative information is stored in the destination.
Second aspect of the present invention provides a kind of device for searching negative, including:Receiving module, searching module and storage mould Block;
The receiving module, for receive search negative instruction, it is described lookup negative instruction include as it is pending to Measure data first operand, as the second operand of looked-up sequence, as element in the pending vector data The destination of negative information that the third operand of storage width and storage are searched;
The searching module obtains for decoding the lookup negative instruction and being searched according to the lookup negative instruction The negative information in the pending vector data;
The memory module, for storing the negative information in the destination.
Third aspect present invention provides a kind of processor, including:Arithmetic unit and register;
The arithmetic unit and register electrical connection;
Wherein, the arithmetic unit searches negative instruction and according to the lookup negative instruction in the operation for receiving The negative information obtained in the pending vector data is searched in device, and the negative information is stored in described post In storage, wherein, the lookup negative instruction includes the first operand as pending vector data, as looked-up sequence Second operand, as the third operand of the storage width of element in the pending vector data and storage looked into The destination of negative information looked for.
The method, apparatus and processor provided by the invention for searching negative is searched negative by reception and is instructed, wherein, it looks into Negative instruction is looked for include the first operand as pending vector data, the second operand as looked-up sequence, conduct The destination of negative information that the third operand of the storage width of element and storage are searched in pending vector data; Decoding searches negative instruction and the negative information obtained in pending vector data is searched according to lookup negative instruction;It will be negative Number information is stored in destination, in this way, searching according to the operand information and destination information searched in negative instruction and waiting to locate Negative information in the vector data of reason, and the negative information found is stored in destination, it is born so as to improve to search Several efficiency avoids in the prior art, and CPU must read instruction one by one in internal storage, could realize to vectorial number According to the lookup of middle negative, the problem of causing to search negative inefficiency.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the structure diagram of computer hardware system provided by the invention;
Fig. 2 is the flow chart of the embodiment of the method one provided by the invention for searching negative;
Fig. 3 is the flow chart of the embodiment of the method two provided by the invention for searching negative;
Fig. 4 is the flow chart of the embodiment of the method three provided by the invention for searching negative;
Fig. 5 is the structure diagram of the device embodiment one provided by the invention for searching negative;
Fig. 6 is the structure diagram of processor embodiment one provided by the invention;
Fig. 7 is the structure diagram of processor embodiment two provided by the invention;
Fig. 8 is the structure diagram of processor embodiment three provided by the invention.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art All other embodiments obtained without creative efforts shall fall within the protection scope of the present invention.
The present embodiments relate to lookup negative method, apparatus and processor, can be adapted for computer system.Meter Calculation machine system is made of computer hardware system and computer software.
Fig. 1 is the structure diagram of computer hardware system provided by the invention, as shown in Figure 1, the computer hardware system System includes CPU 1, internal storage 2, input-output apparatus 3 and system bus 4, wherein, CPU 1 is that information is carried out at a high speed The critical piece of calculation process, processing speed are operated up to several hundred million times per second or more, internal storage 2 for store program, Data and file, often by quick main memory and at a slow speed, magnanimity additional storage forms, and input-output apparatus 3 is between humans and machines Transcriber.Wherein, the effect of input equipment is to adopt program, initial data, word, character, control command or scene The information such as the data of collection are input to computer.Common input equipment has keyboard, Genius mouse, photoreader, magnetic tape station, disk Machine, CD player etc., the effect of output equipment are each in the intermediate result or final result of computer system, computer system The information output such as kind data symbol and word or various control signals.Common output equipment have display terminal CRT, printer, Laser printer, plotter and tape, CD player etc., system bus 4 for connect CPU 1, internal storage 2 and input/it is defeated Go out equipment 3.
Computer software includes program and related document information, computer software when computer system is run Program is transmitted to internal storage 2 by the input equipment and system bus of computer hardware system, and CPU 1 is by reading and transporting Program in row internal storage 2 is to realize corresponding function.
It is provided by the invention search negative method, apparatus and processor, to solve in the prior art CPU must including Instruction is read in portion's memory one by one, could realize the lookup to negative in vector data, causes to search negative inefficiency Problem.
Technical scheme of the present invention is described in detail with specifically embodiment below.These specific implementations below Example can be combined with each other, and the same or similar concept or process may be repeated no more in certain embodiments.
Fig. 2 is the flow chart of the embodiment of the method one provided by the invention for searching negative, and this method can be performed by CPU, As shown in Fig. 2, this method includes:
Step 101 receives and searches negative instruction, searches negative and instructs the first behaviour included as pending vector data It counts, the second operand as looked-up sequence, the third as the storage width of element in pending vector data operate Number and the destination for storing searched negative information.
In the present embodiment, for example, pending vector data is made of 12 elements, and the storage of each element Of same size, looked-up sequence is looked into search from left to right since the corresponding element of highest order of pending vector data It looks for, the destination of the searched negative information of storage can be register, but be not limited thereto.
Step 102, decoding are searched negative instruction and are searched according to lookup negative instruction and obtained in pending vector data Negative information.
In the present embodiment, specifically, will search negative instruction decoding is the identifiable binary instructions of CPU, and according to First operand that pending vector data is provided as in the instruction, second operand and work as looked-up sequence Third operand for the storage width of element in pending vector data, which is searched, obtains bearing in pending vector data Number information.
Negative information is stored in destination by step 103.
In the present embodiment, specifically, it is pending by what is found according to the destination provided in lookup negative instruction Negative information in vector data is stored in the destination.
In addition, negative information, which is stored in destination, following three kinds of concrete implementation modes, but it is not limited to this.
The corresponding numerical value of location information of the negative found in vector data is stored in mesh by the first realization method Ground in, then will " 0000000000000003H " deposit mesh for example, find third element in vector data as negative Ground, to represent the third element in vector data as negative.
Location information of the negative found in vector data is stored in destination with being somebody's turn to do by second of realization method In the corresponding byte in position where negative, for example, it is negative to find the third element in vector data, then will " 0000030000000000H " is stored in destination, to represent the third element in vector data as negative.
The third realization method, by word corresponding with the position at the negative found place in vector data in register All bits of section are set as 1, for example, it is negative to find the third element in vector data, then will " 0000FF0000000000H " is stored in destination, to represent the third element in vector data as negative.
In the present embodiment, by reception search negative instruct, wherein, search negative instruction include as it is pending to The first operand of amount data, the second operand as looked-up sequence, the storage as element in pending vector data The destination of negative information that the third operand of width and storage are searched;Decoding searches negative instruction and according to lookup The negative information obtained in pending vector data is searched in negative instruction;Negative information is stored in destination, in this way, root It is investigated that the operand information and destination information looked in negative instruction search the negative information in pending vector data, and will The negative information found is stored in destination, so as to improve the efficiency for searching negative, is avoided in the prior art, CPU Instruction must be read one by one in internal storage, could realize the lookup to negative in vector data, cause to search negative effect The problem of rate is low.
Fig. 3 is the flow chart of the embodiment of the method two provided by the invention for searching negative, as shown in figure 3, in a step 102 Negative information in the vector data pending according to negative instruction lookup acquisition is searched, specifically includes:
Step 201, judge successively according to the storage width of element in looked-up sequence and pending vector data it is pending Vector data in element whether be negative.
In the present embodiment, specifically, by judging the value of the highest-order bit of each element in vector data, to determine Whether the element is negative, for example, when judge the highest-order bit of the element for 1 when, then the element is negative.
Wherein, preset looked-up sequence can from left to right be searched or search from right to left.
Step 202 will be preserved for location information of the element of negative in pending vector data.
In the present embodiment, sentenced successively by the storage width according to element in looked-up sequence and pending vector data Whether the element in disconnected pending vector data is negative, and by the position for the element of negative in pending vector data Confidence breath is preserved, in this way, improving the efficiency for searching negative.
Fig. 4 is the flow chart of the embodiment of the method three provided by the invention for searching negative, on the basis of above-described embodiment, It searches negative and instructs the 4th operand further included as negative information to be found in pending vector data, wherein, it treats The negative information expression of lookup finds the serial number of negative in pending vector data, as shown in figure 4, this method includes:
Step 301, judge successively according to the storage width of element in looked-up sequence and pending vector data it is pending Vector data in element whether be negative.
Step 302, when judging element for negative, preserve location information of the element in pending vector data, bear Several numbers increase one step.
In the present embodiment, specifically, one step 1.
Step 303, cycle perform step 301- steps 302, stop performing when negative number meets preset value, wherein, Preset value is configured according to negative information to be found in pending vector data, and preset value represents pending vectorial number The number of negative to be found in.
In the present embodiment, for example, vector data information is in lookup negative instruction " 010282311DC11107H ", for looked-up sequence information from left to right to search, the length information of element is 1 byte, pending Vector data in the negative information to be found negative that represents to require to look up serial number 1 for 1, then according to pending vector Preset value is set as 1 by negative information to be found in data, specifically, first determines whether element " 01H " is negative, is judged It is not negative to go out " 01H ", then continues to judge whether " 02H " is negative, and it is not negative to judge " 02H ", then continues to judge element Whether " 82H " is negative, judges that " 82H " for negative, then preserves location information of the element in pending vector data, And by negative number increase by 1, i.e. the number of negative meets preset value for 1 at this time, then stops performing stopping execution step 301- steps 302。
In the present embodiment, judge to treat successively according to the storage width of element in looked-up sequence and pending vector data Whether the element in the vector data of processing is negative, when judging element for negative, preserves element in pending vectorial number Location information in, negative number increase one step, and cycle performs above step, until when negative number meets preset value Stop performing, wherein, preset value is configured according to negative information to be found in pending vector data, and preset value represents The number of negative to be found in pending vector data, in this way, improving the efficiency for searching negative.
Fig. 5 is the structure diagram of the device embodiment one provided by the invention for searching negative, as shown in figure 5, the device Including:Receiving module 30, searching module 31 and memory module 32.
Receiving module 30 searches negative instruction for receiving, and searches negative instruction and includes as pending vector data First operand, as the second operand of looked-up sequence, as the storage width of element in pending vector data The destination of negative information that third operand and storage are searched.
Searching module 31, for decode search negative instruction and according to search negative instruction search obtain it is pending to Measure the negative information in data.
Memory module 32, for storing negative information in destination.
In the present embodiment, memory module 32 can be the general register inside arithmetic unit, but be not limited thereto.
The device of lookup negative in the present embodiment can perform the technical solution of embodiment of the method shown in Fig. 2, realize Principle and advantageous effect are similar, and details are not described herein again.
Further, on the basis of above-described embodiment, in the embodiment two of the device provided by the invention for searching negative, Searching module 31 is specifically used for:
Storage width according to element in looked-up sequence and pending vector data judges pending vectorial number successively Whether the element in is negative.
It will be preserved for location information of the element of negative in pending vector data.
The device of lookup negative in the present embodiment can perform the technical solution of embodiment of the method shown in Fig. 3, realize Principle and advantageous effect are similar, and details are not described herein again.
Further, it on the basis of above-described embodiment, searches negative instruction and further includes as pending vector data In negative information to be found the 4th operand, wherein, negative information to be found is represented in pending vector data Find the serial number of negative, in the embodiment three of the device provided by the invention for searching negative, searching module 31 is specifically used for:
A, pending vector is judged successively according to the storage width of element in looked-up sequence and pending vector data Whether the element in data is negative;
B, when judging element for negative, location information of the element in pending vector data, negative number are preserved Increase one step;
C, cycle performs A-B, stops performing when negative number meets preset value, wherein, preset value is according to pending Negative information to be found is configured in vector data, negative to be found in the pending vector data of preset value expression Number.
The device of lookup negative in the present embodiment can perform the technical solution of embodiment of the method shown in Fig. 4, realize Principle and advantageous effect are similar, and details are not described herein again.
Fig. 6 is the structure diagram of processor embodiment one provided by the invention, as shown in fig. 6, the processor includes:Fortune Calculate device 10 and register 11.
Arithmetic unit 10 and register 11 are electrically connected.
Wherein, arithmetic unit 10 is searched negative instruction for reception and is searched in arithmetic unit 10 according to negative instruction is searched The negative information in pending vector data is obtained, and negative information is stored in register 11, wherein, it searches negative and refers to Order includes the first operand as pending vector data, the second operand as looked-up sequence, as pending The destination of negative information that the third operand of the storage width of element and storage are searched in vector data.
The device of lookup negative in the present embodiment can perform the technical solution of embodiment of the method shown in Fig. 2, realize Principle and advantageous effect are similar, and details are not described herein again.
Further, with continued reference to Fig. 6, on the basis of embodiment described in Fig. 6, processor provided by the invention also wraps It includes:Decoder 12.
Decoder 12, which is read, searches negative instruction, and will search after negative is instructed into row decoding and be sent to arithmetic unit 10.
In the present embodiment, decoder 12 is read from internal storage by system bus and searches negative instruction, and will The Instruction decoding is is sent to arithmetic unit 10 so that arithmetic unit 10 performs accordingly according to the binary instruction after binary instruction Operation.
Fig. 7 is the structure diagram of processor embodiment two provided by the invention, as shown in fig. 7, arithmetic unit 10 includes sentencing Disconnected unit 20 and storage unit 21, wherein, judging unit 20 and storage unit 21 are electrically connected, storage unit 21 and 11 electricity of register Connection.
Judging unit 20 is used to successively judge according to the storage width of element in looked-up sequence and pending vector data Whether the element in pending vector data is negative.
Storage unit 21 is used for when judging unit 20 judges element for negative, preserves position of the element in vector data Information.
In the present embodiment, specifically, storage unit 21 can be to look for the memory module 32 in the device of negative.
The device of lookup negative in the present embodiment can perform the technical solution of embodiment of the method shown in Fig. 3, realize Principle and advantageous effect are similar, and details are not described herein again.
Fig. 8 is the structure diagram of processor embodiment three provided by the invention, on the basis of above-described embodiment, is searched Negative instruction further includes the 4th operand as negative information to be found in pending vector data, wherein, it is to be found The expression of negative information the serial number of negative is found in pending vector data, as shown in figure 8, arithmetic unit includes:It counts Unit 22, judging unit 20 and storage unit 21, judging unit 20 and storage unit 21 are electrically connected, and counting unit 22 and storage Unit 21 is electrically connected;Wherein, the initial value of counting unit 22 is zero.
Judging unit 20, for judging successively according to the storage width of element in looked-up sequence and pending vector data Whether the element in pending vector data is negative;
Storage unit 21 for when element is negative, preserving location information of the element in vector data, and will count The value of unit 22 increases one step and the value of counting unit 22 is sent to judging unit 20, to indicate that judging unit 20 exists Stop judging whether the element in pending vector data is negative when the value of counting unit 22 meets preset value, wherein, in advance If value is configured according to negative information to be found in pending vector data, preset value represents pending vector data In negative to be found number.
In this embodiment, the memory module 32 in device of the storage unit 21 from searching negative is different, and storage unit 21 was both Including being used to store the storing sub-units (not shown) of negative found, while further include to control counting unit Subelement (not shown) is controlled, wherein, storing sub-units can be to look for the memory module 32 in the device of negative.
The device of lookup negative in the present embodiment can perform the technical solution of embodiment of the method shown in Fig. 4, realize Principle and advantageous effect are similar, and details are not described herein again.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Aforementioned program can be stored in a computer read/write memory medium.The journey Sequence when being executed, performs the step of including above-mentioned each method embodiment;And aforementioned storage medium includes:ROM, RAM, magnetic disc or The various media that can store program code such as person's CD.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical features into Row equivalent replacement;And these modifications or replacement, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (10)

  1. A kind of 1. method for searching negative, which is characterized in that including:
    It receives and searches negative instruction, the lookup negative instruction includes the first operand as pending vector data, makees Second operand for looked-up sequence, as the storage width of element in the pending vector data third operand with And store the destination of searched negative information;
    It decodes the lookup negative instruction and is searched according to the lookup negative instruction and obtained in the pending vector data The negative information;
    The negative information is stored in the destination;
    It is described that the negative information obtained in the pending vector data, packet are searched according to the lookup negative instruction It includes:
    Storage width according to element in the looked-up sequence and the pending vector data judges described pending successively Vector data in element whether be negative;Wherein, according to the highest ratio of each element in the pending vector data The value of special position determines whether each element is negative;
    It will be preserved for location information of the element of negative in the pending vector data.
  2. 2. according to the method described in claim 1, it is characterized in that, the lookup negative instruction is further included as described pending Vector data in negative information to be found the 4th operand, wherein, the negative information to be found is represented described The serial number of negative is found in pending vector data.
  3. It is 3. according to the method described in claim 2, it is characterized in that, described according to acquisition is searched in the lookup negative instruction The negative information in pending vector data, including:
    A, judge successively according to the storage width of element in the looked-up sequence and the pending vector data pending Whether the element in vector data is negative;
    B, when judging the element for negative, location information of the element in the pending vector data is preserved, Negative number increases one step;
    C, cycle performs A-B, stops performing when the negative number meets preset value, wherein, the preset value is according to Negative information to be found is configured in pending vector data, and the preset value represents the pending vector data In negative to be found number.
  4. 4. a kind of device for searching negative, which is characterized in that including:Receiving module, searching module and memory module;
    The receiving module searches negative instruction for receiving, and the lookup negative instruction is included as pending vectorial number According to first operand, the second operand as looked-up sequence, the storage as element in the pending vector data The destination of negative information that the third operand of width and storage are searched;
    The searching module instructs and for decoding the lookup negative according to obtaining the lookup negative instruction lookup The negative information in pending vector data;
    The memory module, for storing the negative information in the destination;
    Wherein, the searching module, is specifically used for:
    Storage width according to element in the looked-up sequence and the pending vector data judges described pending successively Vector data in element whether be negative;Wherein, according to the highest ratio of each element in the pending vector data The value of special position determines whether each element is negative;
    It will be preserved for location information of the element of negative in the pending vector data.
  5. 5. device according to claim 4, which is characterized in that the lookup negative instruction is further included as described pending Vector data in negative information to be found the 4th operand, wherein, the negative information to be found is represented described The serial number of negative is found in pending vector data.
  6. 6. device according to claim 5, which is characterized in that the searching module is specifically used for:
    A, judge successively according to the storage width of element in the looked-up sequence and the pending vector data pending Whether the element in vector data is negative;
    B, when judging the element for negative, location information of the element in the pending vector data is preserved, Negative number increases one step;
    C, cycle performs A-B, stops performing when the negative number meets preset value, wherein, the preset value is according to Negative information to be found is configured in pending vector data, and the preset value represents the pending vector data In negative to be found number.
  7. 7. a kind of processor, which is characterized in that including:Arithmetic unit and register;
    The arithmetic unit and register electrical connection;
    Wherein, the arithmetic unit searches negative instruction and according to the lookup negative instruction in the arithmetic unit for receiving The negative information obtained in pending vector data is searched, and the negative information is stored in the register, wherein, The lookup negative instruction includes the first operand as pending vector data, the second operation as looked-up sequence Number is believed as the negative that the third operand of the storage width of element and storage are searched in the pending vector data The destination of breath;
    The arithmetic unit includes judging unit and storage unit, wherein, the judging unit and storage unit electrical connection, institute Storage unit is stated to be electrically connected with the register;
    The judging unit be used for according to element in the looked-up sequence and the pending vector data storage width according to Whether the secondary element judged in the pending vector data is negative;Wherein, according in the pending vector data The value of the highest-order bit of each element determines whether each element is negative;
    The storage unit is used for when the judging unit judges the element for negative, preserves the element in vector data In location information.
  8. 8. processor according to claim 7, which is characterized in that the processor further includes:Decoder;
    The decoder reads the lookup negative instruction, and is sent to the fortune after the lookup negative is instructed into row decoding Calculate device.
  9. 9. processor according to claim 7, which is characterized in that the lookup negative instruction is further included to be waited to locate as described 4th operand of negative information to be found in the vector data of reason, wherein, the negative information to be found is represented in institute State the serial number that negative is found in pending vector data.
  10. 10. processor according to claim 9, which is characterized in that the arithmetic unit includes:Counting unit, judging unit And storage unit, the judging unit and storage unit electrical connection, and the counting unit is electrically connected with the storage unit It connects;Wherein, the initial value of the counting unit is zero;
    The judging unit, for according to the storage width of element in the looked-up sequence and the pending vector data according to Whether the secondary element judged in pending vector data is negative;
    The storage unit, for when the element is negative, preserving location information of the element in vector data, and The value of the counting unit is increased into one step and the value of the counting unit is sent to the judging unit, with instruction The judging unit stops judging that the element in pending vector data is when the value of the counting unit meets preset value No is negative, wherein, the preset value is configured according to negative information to be found in the pending vector data, institute State the number that preset value represents negative to be found in the pending vector data.
CN201610184539.6A 2016-03-28 2016-03-28 Search the method, apparatus and processor of negative Active CN105892995B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610184539.6A CN105892995B (en) 2016-03-28 2016-03-28 Search the method, apparatus and processor of negative

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610184539.6A CN105892995B (en) 2016-03-28 2016-03-28 Search the method, apparatus and processor of negative

Publications (2)

Publication Number Publication Date
CN105892995A CN105892995A (en) 2016-08-24
CN105892995B true CN105892995B (en) 2018-06-12

Family

ID=57014306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610184539.6A Active CN105892995B (en) 2016-03-28 2016-03-28 Search the method, apparatus and processor of negative

Country Status (1)

Country Link
CN (1) CN105892995B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656756B (en) * 2017-08-21 2020-07-28 龙芯中科技术有限公司 Method and device for searching first target number, searching unit and processor
CN111124497B (en) * 2018-10-11 2022-03-29 上海寒武纪信息科技有限公司 Operation method, operation device, computer equipment and storage medium
CN111399661A (en) * 2020-05-19 2020-07-10 华普通用技术研究(广州)有限公司 Virtual reality implementation system and display method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452482A (en) * 2007-12-03 2009-06-10 英特尔公司 Method and apparatus for searching extensible markup language (xml) data
CN104169907A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Vector find element equal instruction
CN104169869A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Comparing sets of character data having termination characters
CN104169868A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Vector string range compare

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7299342B2 (en) * 2005-05-24 2007-11-20 Coresonic Ab Complex vector executing clustered SIMD micro-architecture DSP with accelerator coupled complex ALU paths each further including short multiplier/accumulator using two's complement

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452482A (en) * 2007-12-03 2009-06-10 英特尔公司 Method and apparatus for searching extensible markup language (xml) data
CN104169907A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Vector find element equal instruction
CN104169869A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Comparing sets of character data having termination characters
CN104169868A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Vector string range compare

Also Published As

Publication number Publication date
CN105892995A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
US9886017B2 (en) Counter operation in a state machine lattice
TWI489779B (en) Boolean logic in a state machine lattice
TWI515668B (en) Methods and systems for detection in a state machine
US8680888B2 (en) Methods and systems for routing in a state machine
JP6122121B2 (en) Method and system for power management in pattern recognition processing
US10671295B2 (en) Methods and systems for using state vector data in a state machine engine
CN103154883B (en) Instruction from multiple instruction set is decoded
CN108121688B (en) Calculation method and related product
TW201333838A (en) System and method for data analysis in state machine
CN107436752A (en) Abnormal in-situ FTIR spectroelectrochemitry method, apparatus and computer-readable recording medium
CN105892995B (en) Search the method, apparatus and processor of negative
US20250165265A1 (en) Systems and devices for accessing a state machine
US20170193351A1 (en) Methods and systems for vector length management
WO2016109570A1 (en) Systems and devices for accessing a state machine
CN107851007B (en) Method and apparatus for comparison of wide data types
CN107943756A (en) A kind of computational methods and Related product
US8589661B2 (en) Odd and even start bit vectors
CN108958802A (en) A kind of thread pre-operation method, apparatus and storage medium
CN108062236A (en) A kind of software-hardware synergism branch instruction predictions method and device
CN118445251A (en) Lightweight elliptic curve cipher reconfigurable processor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Patentee after: Loongson Zhongke Technology Co.,Ltd.

Address before: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Patentee before: LOONGSON TECHNOLOGY Corp.,Ltd.

CP01 Change in the name or title of a patent holder