System, device, method, processor, medium and electronic device for processing instructions

By introducing two rounds of SM3 status word update instructions into the processor, the status word update operation of the SM3 hash algorithm is optimized, solving the computationally intensive and complex problems in the existing technology, and achieving more efficient execution of the hash algorithm.

CN112543095BActive Publication Date: 2024-09-24INTEL CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202011038277.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2014-09-04
Filing Date
2015-08-14
Publication Date
2024-09-24
Estimated Expiration
2035-08-14

AI Technical Summary

Technical Problem

The existing technology is computationally intensive when implementing the SM3 hash algorithm in the processor, resulting in poor performance. The traditional method requires a large number of separate instructions to perform XOR operations, rotation operations, etc., and has a large number of rounds, resulting in high implementation complexity.

Method used

A processor is provided, which includes a decoding unit and an execution unit. Through two rounds of SM3 status word update instructions, the status word of the SM3 hash algorithm can be updated in two rounds, thereby reducing the number of instructions and improving performance. The processor includes a decoding unit for decoding instructions and storing the results in designated storage locations through the execution unit, optimizing data operations and reducing the complexity of status word updates between rounds.

Benefits of technology

It significantly improves the speed and efficiency of SM3 message generation, avoids the high number of instructions and complexity in traditional software methods, and improves the performance of hash algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112543095B_ABST
    Figure CN112543095B_ABST
Patent Text Reader

Abstract

The present disclosure relates to systems, devices, methods, processors, media and electronic devices for processing instructions. The processor includes a decoding unit for decoding an SM3 two-round status word update instruction. The instruction is used to indicate one or more source packet data operands. The one or more source packet data operands have eight 32-bit status words A corresponding to the (j)th round of the SM3 hash algorithm. j , B j , C j , D j 、E j 、F j , G j and H j The one or more source packed data operands also have a set of information sufficient to evaluate two rounds of the SM3 hash algorithm. In response to the instruction, the execution unit coupled to the decode unit is operable to store one or more result packed data operands in one or more destination storage locations. The (one or more) result packed data operands have at least four 32-bit status words A corresponding to the (j+2)th round of the SM3 hash algorithm after two rounds of update. j+2 , B j+2 、E j+2 , and F j+2 .
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Description of the case

[0002] This application is a divisional application of an invention patent application with an application date of August 14, 2015, application number 201580040783.9, and titled "System, device, method, processor, medium and electronic device for processing instructions". Technical Field

[0003] Embodiments described herein relate to processors. Specifically, embodiments described herein relate to evaluating a hash algorithm using a processor. Background Art

[0004] A hash function or algorithm is a widely used encryption algorithm in computer systems and other electronic devices. A hash algorithm generally takes a message as input, generates a corresponding hash value or summary by applying a hash function to the message, and outputs the hash value or summary. Typically, if the same hash function is evaluated with the same message, the same hash value should be generated. This hash algorithm is used for various purposes, such as verification (e.g., verifying the integrity of a file, data, or message), identification (e.g., identifying a file, data, or message), authentication (e.g., generating a message authentication code), generating a digital signature, generating a pseudo-random number, etc. As an illustrative example, a hash function can be used to generate a hash value for a given message. Subsequently, the same hash function can be used to recalculate the hash value for the given message. If the hash values ​​are the same, it can be assumed that the message has not been changed. On the contrary, if the hash values ​​are different, it can be assumed that the message has been changed.

[0005] A well-known hash algorithm is the SM3 hash function. The SM3 hash algorithm has been published by the Office of the China Commercial Cryptography Association and recognized by the Chinese government. The SM3 hash algorithm has been designated as a hash algorithm for TCM (Trusted Computing Module) by the China Information Security Standardization Technical Committee (TC260) Act. The English description of the SM3 hash function has been published by S. Shen and X. Lee on October 24, 2011 as an Internet Engineering Task Force (IETF) Internet Draft entitled "SM3 Hash Function". Summary of the invention

[0006] According to one aspect of the present disclosure, a processor is provided, comprising: a decoding unit for decoding an SM3 two-round status word update instruction, the SM3 two-round status word update instruction indicating one or more source packet data operands, the one or more source packet data operands having eight 32-bit status words A corresponding to the (j)th round of the SM3 hash algorithm; j , B j , C j , Dj 、E j 、F j , G j and H j , and the one or more source packed data operands have a set of information sufficient to evaluate two rounds of the SM3 hash algorithm; and an execution unit coupled to the decoding unit, responsive to the SM3 two-round status word update instruction, the execution unit being operable to store one or more result packed data operands at one or more destination storage locations indicated by the SM3 two-round status word update instruction, the one or more result packed data operands having at least four two-round updated 32-bit status words A corresponding to the (j+2)th round of the SM3 hash algorithm j+2 , B j+2 、E j+2 , and F j+2 . BRIEF DESCRIPTION OF THE DRAWINGS

[0007] The present invention may be better understood by referring to the following description and the accompanying drawings which are used to illustrate embodiments. In the drawings:

[0008] Figure 1 is a block diagram of a processor instruction set that includes one or more SM3 hash algorithm acceleration instructions.

[0009] Figure 2 Shows the compression function of the SM3 hash algorithm.

[0010] Figure 3 is a block diagram of an embodiment of a processor operable to execute an embodiment of SM3 two rounds of at least four status words (or in some embodiments at least eight status words) update instructions.

[0011] Figure 4 is a block flow diagram of an embodiment of a method of executing an embodiment of an SM3 two rounds of at least four status words (or in some embodiments at least eight status words) update instructions.

[0012] Figure 5 is a block diagram showing an embodiment of two rounds of eight status word update operations of SM3.

[0013] Figure 6 is a block diagram illustrating an embodiment of two rounds of four remaining status word update operations of SM3.

[0014] Figure 7 is a block diagram illustrating an embodiment of SM3 four message extension initiation operation.

[0015] Figure 8 is a block diagram illustrating an embodiment of SM3 four message extension completion operations.

[0016] Fig.9A is a block diagram illustrating an embodiment of an in-order pipeline and an embodiment of a register renaming out-of-order issue / execution pipeline.

[0017] Fig. 9B is a block diagram of an embodiment of a processor core including a front end unit coupled to an execution engine unit and concurrently coupled to a memory unit.

[0018] Fig. 10A is a block diagram of an embodiment of a single processor core connected to an on-chip interconnect network and having a local subset of a level 2 (L2) cache.

[0019] Fig. 10B yes Fig. 10A A block diagram of an embodiment of an expanded view of a portion of a processor core.

[0020] Fig.11 is a block diagram of an embodiment of a processor that may have more than one core, may have an integrated memory controller, and may have integrated graphics.

[0021] Fig.12 is a block diagram of a first embodiment of a computer architecture.

[0022] Fig.13 is a block diagram of a second embodiment of a computer architecture.

[0023] Fig.14 is a block diagram of a third embodiment of a computer architecture.

[0024] Fig.15 is a block diagram of an embodiment of a system-on-chip architecture.

[0025] Fig.16 is a block diagram of using a software instruction converter to convert binary instructions in a source instruction set to binary instructions in a target instruction set according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] Disclosed herein is an SM3 hash algorithm acceleration instruction, a processor for executing an instruction, a method executed by a processor when processing or executing an instruction, and a system for processing or executing an instruction in conjunction with one or more processors. Many specific details (e.g., specific instruction operations, data formats, arrangement of data elements in operands, processor configuration, microarchitecture details, sequence of operations, etc.) are described below. However, embodiments may be practiced without these specific details. In other examples, known circuits, structures, and techniques are not shown in detail to avoid blurring the understanding of the description.

[0027] Figure 11 is a block diagram of a processor instruction set 100 including one or more SM3 hash algorithm acceleration instructions 102. (One or more) SM3 acceleration instructions can help accelerate the implementation of the SM3 hash algorithm. The instruction set is part of the processor instruction set architecture (ISA) and includes native instructions that the processor can operate to execute. The instructions of the instruction set (e.g., including SM3 acceleration instructions) represent macroinstructions, assembly language instructions, or machine-level instructions provided to the processor for execution. These instructions are in contrast to microinstructions, micro-operations (micro-ops), or other instructions generated by decoding the instructions of the instruction set.

[0028] In some embodiments, the SM3 acceleration instruction(s) 102 may include SM3 two rounds of at least four status words (or in some embodiments, at least eight status words) update instructions 104. When executed, the SM3 two rounds of status word update instructions 103 are operable to cause the processor to perform two rounds of updates on at least four status words (or in some embodiments, at least eight status words) of the SM3 hash algorithm.

[0029] In an embodiment where the instruction 104 is optionally an SM3 two rounds four status word update instruction 104, the instruction 102 optionally includes an SM3 two rounds four remaining status word update instruction 106. When executed, the instruction 106 is operable to cause the processor to update the remaining four of the eight status words (e.g., the four not updated by the instruction 104). Alternatively, these remaining four status words are optionally updated by software instead (e.g., by a conventional instruction sequence).

[0030] In some embodiments, (one or more) instructions 102 optionally include one or more instructions for auxiliary message scheduling, although this is not necessary. For example, in some embodiments, (one or more) instructions 102 optionally include SM3 four message extension start instruction 108. When executed, instruction 108 can operate so that the processor starts and / or partially performs the expansion of four messages. In some embodiments, (one or more) instructions 102 optionally include SM3 four message extension completion instructions 110 designed to cooperate with the start instruction 108. When executed, instruction 110 can operate so that the processor ends or completes the expansion of four messages.

[0031] As shown, in some embodiments, the instruction set 100 may include four different SM3 hash function acceleration instructions 102. However, in other embodiments, the instruction set 100 optionally includes only any one or a subset of any one or more of these instructions 102. While including all four instructions may tend to provide the greatest amount of acceleration, some acceleration may be achieved by including any one or more of these instructions.

[0032] Figure 2 A compression function 212 of the SM3 hash algorithm suitable for an embodiment is shown. The SM3 hash algorithm accepts a message as input. The message can represent a bit string of any length. The SM3 hash algorithm performs multiple operations using the input message and generates a hash value or digest with a length of 256 bits after padding and iterative compression.

[0033] First, the 256-bit state value V(i) is divided into eight 32-bit state words A, B, C, D, E, F, G, and H. The initial state value V(0) used for the first iteration is a constant defined by the SM3 hash algorithm. According to the algorithm, the state words A to H are specified as "high-order first" format, but in embodiments the format of these state words can be changed as needed.

[0034] The iteration process is then performed in the order in the box. The SM3 hash algorithm includes sixty-four iterations or "rounds" (i.e., j ranges from 0 to 63). As shown, a single round 213 includes multiple different operations. The left-pointing arrow symbol (←) indicates that the value or parameter on the right is stored, assigned, or equated to the value or parameter on the left. The symbol "<<<" indicates a rotate operation. The circled plus sign This symbol represents the logical exclusive OR (XOR) operation. j is a constant that depends on the iteration (i.e., the value of j), and the value of this constant is specified in the SM3 hash function. j The variables SS1, SS2, TT1, TT2 are internal intermediate values ​​used in the iterations, with the internal 79cc4519 when 0≤j≤15 and the value 7a879d8a when 16≤j≤63.

[0035] FF j is a Boolean function that varies with the round number (j) according to Equation 1:

[0036] FF j (X, Y, Z) = X XOR Y XOR Z (0≤j≤15); or

[0037] =(X AND Y)OR(X AND Z)OR(Y AND Z)(16≤j≤63) Equation 1

[0038] GGj is a Boolean function that varies with the round number (j) according to Equation 2:

[0039] GG j (X, Y, Z) = X XOR Y XOR Z (0≤j≤15); or

[0040] =(X AND Y)OR(NOT X AND Z)(16≤j≤63) Equation 2

[0041] P0 is the permutation function in the compression function according to Equation 3:

[0042] P0(X)=X XOR(X<<<9)XOR(X<<<17) Equation 3

[0043] Note that the term W j Add to the Boolean function GG j In addition, the term W' j Add to the Boolean function FF j The term W j and W' j Represents a message item, a message input, or just a message. For iterations 0 to 15, items W0 to W are obtained from the 512-bit block being compressed. 15 In particular, the 512-bit message block being compressed is divided or split into sixteen 32-bit words, referenced as W0 through W1 in big-endian format. 15 The remaining message W j and W' j Computed during the message expansion or message extension part of the SM3 hash algorithm.

[0044] For iterations 16 to 67, the message W j It can be calculated according to the following equation 4:

[0045] W j =P i (W j-16 XOR W j-9 XOR(W j-3 <<<15))XOR(W j-13 <<<7) XOR W j-6 Equation 4

[0046] In Equation 4, P1(x) is the permutation function for message expansion defined by the following Equation 5:

[0047] P1(X)=X XOR(X<<<15)XOR(X<<<23) Equation 5

[0048] For iterations 16 to 67, the message W j It can be calculated according to Equation 4, where the permutation function P1 is calculated according to Equation 5. Note that for a given round (e.g., round j), the message W j The calculation of depends on the messages from the previous round. Specifically, as can be easily seen from Equation 4, for a given round (e.g., round j) the message W j Depends on the previous round of message W j-16 , W j-13, W j-9 and W j-3 , where W j-3 is the information from three rounds back relative to round j, W j-16 It is the message from sixteen rounds back relative to round j, and so on.

[0049] Message W' j The message W can be obtained according to the following equation 6 j To calculate or derive:

[0050] W j =W j XOR W j+4 Equation 6

[0051] Note that message W' j Depends on the message W from the same round j And the news after four rounds j+4 Since W0 and W 15 is obtained from the 512-bit message block being compressed, and can be based on the initially known messages W0 to W 15 Use Equation 6 to determine the messages W'0 to W' 11 . According to the message W 16 To W 67 Determine the remaining messages W' 12 To W' 63 , where the message W 16 To W 67 This can be calculated using Equation 4-5. Note that W can be calculated 64 To W 67 , even though they are not directly input to the compression function, they are needed to compute W' 60 To W' 63 .

[0052] One challenge is that implementing the SM3 hash algorithm in a processor generally tends to be computationally intensive. Figure 2As can be easily seen from equations 1-3, a large number of different operations are involved in updating the status word for each round. Specifically, during each round, a large number of XOR operations, rotation operations and other operations are usually required to be performed. In addition, there are many rounds (e.g., 64 rounds). Traditionally, in the absence of the two-round status word update instructions of the SM3 hash algorithm disclosed herein, two rounds of updating the status word of the algorithm usually tend to involve executing a large number of separate instructions. For example, traditionally it is possible to use separate instructions for each XOR operation, each rotation operation, etc. Potentially, additional instructions may also be required to move or rearrange data to prepare for the next round. As a result, the performance of the round in software tends to be poor with separate more general instructions. This fact and the many rounds to be performed usually tend to make the implementation of the SM3 hash algorithm very computationally intensive and / or require a lot of time.

[0053] Figure 3 3 is a block diagram of an embodiment of a processor 320 operable to perform two rounds of at least four state words (or at least eight state words in some embodiments) update instructions 304 of SM3. In some embodiments, the processor may be a general purpose processor (e.g., a general purpose microprocessor used in a desktop computer, laptop computer, or other computer). Alternatively, the processor may be a special purpose processor. Examples of suitable special purpose processors include, but are not limited to, network processors, communication processors, encryption processors, graphics processors, coprocessors, embedded processors, digital signal processors (DSPs), and controllers (e.g., microcontrollers). The processor may be any of the following processors: a complex instruction set computing (CISC) processor, a reduced instruction set computing (RISC) processor, a very long instruction word (VLIW) processor, a mixture of the above processors, other types of processors, or the processor may have a combination of these different processors (e.g., in different cores).

[0054] During operation, processor 320 may receive an embodiment of SM3 two-pass status word update instruction 304. For example, instruction 304 may be received from an instruction fetch unit, an instruction queue, etc. Instruction 304 may represent a macroinstruction, an assembly language instruction, a machine code instruction, or other instruction or control signal of an instruction set of a processor.

[0055] In some embodiments, the instruction 304 may explicitly specify (e.g., via one or more fields or a set of bits) or otherwise indicate (e.g., implicitly, etc.) one or more source packed data operands 330. In some embodiments, the one or more source packed data operands 330 may have eight 32-bit status words (e.g., A, B, C, D, E, E, F ... j , B j , Cj , D j 、E j 、F j , G j , H j ). In some embodiments, one or more source packed data operands 330 may also have message information 335 (e.g., a set of messages) distributed among any desired number of source operands and in any desired order sufficient to evaluate the next two subsequent and consecutive SM3 rounds. As an example, the message information may include four messages W j , W j+1 , W' j , W' j+1 As another example, the message information may include four messages: j , W j+1 , W j+4 , W j+5 . Other message information is also possible, which will be apparent to those skilled in the art and with the benefit of this disclosure. These status words and messages can be distributed between one or more source operands of any desired number and size and can have any desired order. The scope of the present invention is not specifically limited to the number of source package data operands used to provide input data, their size, or the arrangement of data within the operands, although from an overall algorithmic perspective, certain effects and / or benefits can be achieved by certain arrangements of data within the operands (e.g., by reducing operations to rearrange data elements for different iterations), which will be apparent to those skilled in the art and with the benefit of this disclosure. The specific examples disclosed elsewhere herein are considered to be beneficial but are certainly not required.

[0056] In some embodiments, the instruction may also specify or otherwise indicate a round number (e.g., a current round j in the range of 0 to 63), for example, via a data element in one or more source packed data operands, a field of the instruction 304 (e.g., directly), a value in a general register (e.g., specified or implied by the instruction), or otherwise. In some embodiments, the instruction 304 may also explicitly specify (e.g., via one or more fields or a set of bits) or otherwise indicate (e.g., implicitly, etc.) one or more target storage locations where one or more result packed data operands 336 in response to the instruction are to be stored.

[0057] The processor 320 includes a set of packed data registers 328. Each packed data register may represent an on-chip storage location operable to store packed data, vector data, or SIMD data. Packed data registers may be implemented in different ways in different microarchitectures using known techniques, and packed data registers are not limited to any particular type of circuit. Examples of suitable register types include, but are not limited to, dedicated physical registers, dynamically allocated physical registers using register renaming, and combinations thereof.

[0058] As shown, in some embodiments, one or more source packed data operands 330 may optionally be stored in one or more packed data registers 328. Similarly, in some embodiments, one or more result packed data operands 336 may optionally be stored in one or more packed data registers 328. Alternatively, a memory location or other storage location may be used for one or more of these operands. Furthermore, while source operand(s) 330 and result operand(s) 336 are shown as separate in the illustration, in some embodiments, a packed data register or other storage location used for a source operand may be reused for a result operand (e.g., an instruction may implicitly indicate that a result packed data operand is to overwrite a specified source packed data operand).

[0059] When one or more packed data registers are used to store one or more source packed data operands, they generally need to be of sufficient size and / or quantity to store the associated operands. Generally, a relatively large number of smaller packed data registers may be used, or a relatively small number of larger packed data registers, or a combination of larger and smaller registers may be used. As previously described, in some embodiments, one or more source packed data operands 330 may have eight 32-bit status words (e.g., A, B, C, D, E, F ... j , B j , C j , D j 、E j 、F j , G j , H j In an embodiment, one or more source packed data operands 330 may also have message information 335, such as four 32-bit messages (eg, j , W j+1 , W' j , W' j+1 or W j , W j+1 , W j+4 , W j+5). Altogether, this includes a total of twelve 32-bit data elements and / or 384 bits of input data.

[0060] In some embodiments, three 128-bit packed data registers may be used to store the input data. In some embodiments, even if the processor has a larger packed data register (e.g., a 256-bit register), a 128-bit packed data register may be used, for example, to allow instructions to be used on other processors without such a larger register. In other embodiments, one 256-bit register and one 128-bit register may be used to store the input data. In other embodiments, two 128-bit packed data registers and two 64-bit packed data registers may be used to store the input data. In other embodiments, six 64-bit packed data registers may be used to store the input data. In other embodiments, other combinations of 256-bit, 128-bit, 64-bit, or other size registers (e.g., 32-bit, 512-bit, etc.) may be optionally used to store one or more source packed data operands. In the case of using a relatively large number of registers (e.g., four to six or more), one or more registers may be specified and one or more subsequent / next register pair instructions (e.g., opcodes) may be implicit, rather than having the instruction specify all registers (e.g., thereby increasing the instruction length).

[0061] Reference again Figure 3, the processor includes a decode unit or decoder 322. The decode unit may receive and decode the instruction 304 and output one or more microinstructions, microoperations, microcode entry points, decoded instructions or control signals, or other relatively lower level instructions or control signals that reflect, represent, and / or are derived from the instruction 304. One or more lower level instructions or control signals may implement the higher level instruction 304 through one or more lower level (e.g., circuit level or hardware level) operations. In some embodiments, the decode unit may include one or more input structures (e.g., (one or more) ports, (one or more) interconnections, interfaces) for receiving instructions, instruction recognition and decoding logic coupled to the input structure for recognizing and decoding instructions, and one or more output structures (e.g., (one or more) ports, (one or more) interconnections, interfaces) coupled to the instruction recognition and decoding logic for outputting one or more corresponding lower level instructions or control signals. The decode unit may be implemented using a variety of different mechanisms, including (but not limited to) microcode read-only memory (ROM), lookup tables, hardware implementations, programmable logic arrays (PLA), and other mechanisms known in the art for implementing the decode unit. In some embodiments, rather than providing instruction 304 directly to a decode unit, instruction 304 may be provided to an instruction emulator, converter, morpher, interpreter, or other instruction conversion module that may convert an instruction to one or more other instructions to be decoded.

[0062] Reference again Figure 3 , two rounds of at least four status words of the SM3 hash function are updated. An execution unit 324 is coupled to the decoding unit 322 and the packed data register 328. For simplicity, the unit 324 may also be referred to herein as an SM3 execution unit, or simply an execution unit. The execution unit may receive one or more decoded or converted instructions or control signals representing the instruction 304 and / or obtained from the instruction 304. The execution unit may also receive one or more source packed data operands 330 indicated by the instruction 304. The execution unit is operable to store one or more result packed data operands 336 in (one or more) corresponding destination storage locations indicated by the instruction 304 in response to and / or due to the instruction 304 (e.g., in response to one or more instructions or control signals decoded from the instruction).

[0063] In some embodiments, one or more result packed data operands 336 may have at least four two-round updated 32-bit status words corresponding to one or more source packed data operands 330 that are updated by two rounds of SM3 with respect to a given round. For example, in one embodiment, the result operand(s) 336 may include A j+2 , B j+2 、Ej+2 and F j+2 , which can be distributed among any desired number of operands and in any desired order. A j+2 , B j+2 、E j+2 and F j+2 Relative to A j , B j 、E j and F j In some embodiments, the result operand(s) 336 may optionally have at least eight 32-bit status words (e.g., A, B, C, D, E, E, F ... j+2 , B j+2 , C j+2 , D j+2 、E j+2 、F j+2 , G j+2 and H j+2 ), which are distributed among any desired number of operands and in any desired order, although this is not required. In some embodiments, in response to instruction 304, execution unit 324 may store instructions for Figure 5 Any results shown and described, including the described variations and their alternatives, although the scope of the invention is not limited thereto. Advantageously, the SM3 two-round status word update instruction can significantly help improve the speed, efficiency and / or performance of implementing SM3 message generation (e.g., by avoiding the high instruction count and complexity that traditional software methods would otherwise have).

[0064] In some embodiments, for each of the two rounds, the execution unit may perform all operations of one round (e.g., the operations shown for the single round 213). Alternatively, some of these operations may be optionally omitted. For example, in the case of four status word update instructions, some operations required to generate the remaining four status words may be optionally omitted (e.g., the operations for generating C in the second round may be optionally omitted). j+2 , D j+2 , G j+2 , H j+2 As another example, certain operations may be optionally performed outside the limitations of executing instructions / operations. For example, A may be optionally performed by a separate instruction. j <<<12, can optionally be executed by a separate instruction T j<<<j etc. In addition, it should be understood that it is not necessarily required to perform the operations of the specific illustrated operations for round 213 for this round. For example, certain operations can optionally be implemented by one or more computationally equivalent alternative operations. For example, XOR can be implemented by a combination of other Boolean operations, rotation can be implemented by a bit square root operation, and so on. It should be understood that the terms "two rounds", "two-round state word update instruction" and similar terms used herein cover and allow for such possibilities.

[0065] In summary, one or more result packet data operands can include a total of four 32-bit data elements or 128 bits (e.g., in the case of four-state element updates) or eight 32-bit data elements or 256 bits (e.g., in the case of eight-state element updates). In some embodiments, a 128-bit packet data register can be used to store four 32-bit state words updated over two rounds, or two 128-bit packet data registers can be used to store eight 32-bit state words updated over two rounds. In other embodiments, two 64-bit packet data registers can be used to store four 32-bit state words updated over two rounds, or four 64-bit packet data registers can be used to store eight 32-bit state words updated over two rounds. In other embodiments, a 256-bit packet data register can be used to store four or eight 32-bit state words updated over two rounds. In other embodiments, other combinations of 256-bit, 128-bit, 64-bit, or other sized registers (e.g., 32-bit, 512-bit, etc.) can optionally be used to store one or more source packet data operands. Alternatively, in cases where needed, memory locations or other storage locations can optionally be used. The scope of the present invention is not specifically limited to the number of result operands, their size, or the arrangement of data in the result operands, although certain effects and / or benefits can be achieved through certain arrangements of data within the result operands (e.g., by reducing the operations of rearranging data elements for different iterations) from an overall algorithm perspective, which will be obvious to those skilled in the art and are beneficial with the present disclosure. The specific examples disclosed elsewhere herein are considered beneficial but of course not required.

[0066] Referring again to Figure 3 , execution unit 324 and / or processor 320 can include specific or particular logic (e.g., transistors, integrated circuits, or potentially other hardware in combination with firmware (e.g., instructions stored in non-volatile memory) and / or software), which can operate to execute instructions 304 and / or store results in response to and / or due to instructions 304 (e.g., in response to one or more instructions or control signals decoded or otherwise obtained from instructions 304). In some embodiments, the circuit or logic can include SM3 two-round evaluation logic 326 (e.g., XOR logic, rotation logic, AND logic, OR logic, NOT logic, etc.).

[0067] In some embodiments, to help avoid unduly increasing chip area and / or power consumption, some of the hardware or other logic used to implement the SM3 two-round status word update instruction or other instructions disclosed herein may be optionally reused to implement one or more other cryptographic instructions (e.g., those cryptographic instructions used to implement a secure hash algorithm (e.g., SHA-2)). For example, in some embodiments, the hardware or other logic used to implement the Boolean function FF j (for example, when j>15) and GG j (e.g., when j>15) to implement the corresponding majority and choose functions of SHA-2. As another example, in some embodiments, the hardware or logic used to perform addition in SM3 (e.g., one or more adders) can be optionally reused to implement addition in SHA-2. Some XOR and rotation logic can also be optionally reused.

[0068] To avoid an ambiguous description, a relatively simple processor 320 has been shown and described. In other embodiments, the processor may optionally include other well-known processor components. Possible examples of such components include (but are not limited to) an instruction fetch unit, an instruction and / or data L1 cache, a second or higher level cache (e.g., an L2 cache), an instruction scheduling unit, a register renaming unit, a reorder buffer, a retirement unit, a bus interface unit, an instruction and data translation lookaside buffer (TLB), other components included in the processor, and various combinations of the above.

[0069] Figure 4 4 is a block flow diagram of an embodiment of a method 490 for executing two rounds of SM3 at least four status words (or at least eight status words in some embodiments) update instructions. In some embodiments, Figure 4 The operations and / or methods may be performed by Figure 3 The present invention is executed by a processor and / or executed in the processor. Figure 3 The components, features and specific optional details described for the processor may also optionally apply to Figure 4 Alternatively, Figure 4 The operations and / or methods may be performed by and / or within similar or different devices. In addition, Figure 3 The processor can execute Figure 4 The operations and / or methods are the same, similar or different operations and / or methods.

[0070] The method includes receiving an SM3 two-round status word update instruction at box 491. In various aspects, the instruction can be received at a processor, an instruction processing device, or a portion thereof (e.g., an instruction fetch unit, a decode unit, a bus interface unit, etc.). In various aspects, the instruction can be received from an off-chip source (e.g., from a memory, an interconnect, etc.) or from an on-chip source (e.g., from an instruction cache, an instruction queue, etc.). The SM3 two-round status word update instruction can specify or otherwise indicate one or more source package data operands. For the j-th round of the SM3 hash algorithm, the one or more source package data operands may have eight 32-bit status words A. j , B j , C j , D j 、E j 、F j , G j and H j One or more source packet data operands may also have four messages sufficient for two rounds of evaluation of the SM3 hash algorithm.

[0071] At block 492, in response to and / or as a result of the instruction, one or more result packed data operands may be stored in one or more destination storage locations indicated by the instruction. Typically, an execution unit, instruction processing device, or processor may execute the instruction and store the result. In some embodiments, one or more result packed data operands have at least four 32-bit status words A that are updated twice. j+2 , B j+2 、E j+2 and F j+2 , they have been relative to A j , B j 、E j and F j In some embodiments, the method optionally includes receiving any source operands and storing any results (such as Figure 5 ), the method includes its variations and substitutions described, but the scope of the present invention is not limited thereto.

[0072] The illustrated method involves architectural operations (e.g., those operations visible from a software perspective). In other embodiments, the method optionally includes one or more micro-architectural operations. By way of example, instructions may be fetched, decoded, and scheduled out of order, source operands may be accessed, an execution unit may perform micro-architectural operations to implement instructions, etc. Micro-architectural operations for implementing instructions optionally include any operation of an SM3 round (e.g., round 213).

[0073] Figure 5is a block diagram illustrating an embodiment of an SM3 two-round status word update operation 540 that may be performed in response to an embodiment of an SM3 two-round status word update instruction. In the illustrated embodiment, the instruction specifies or otherwise indicates a first 128-bit source packed data operand 530, a second 128-bit source packed data operand 532, and a third 128-bit source packed data operand 534. Using 128-bit operands may provide certain advantages (e.g., allowing instructions to be used in processors with 128-bit packed data registers but not 256-bit packed data registers), but is not required. In other embodiments, different numbers and sizes of operands (e.g., 64-bit operands, 256-bit operands, combinations of different sizes, etc.) may be optionally used.

[0074] In the illustrated embodiment, the first 128-bit source packed data operand 530 has the first four 32-bit status words for input to the current round (j), and the second 128-bit source packed data operand 532 has the second four 32-bit status words for input to the current round (j). Specifically, in the illustrated embodiment, from the least significant bit position on the right to the most significant bit position on the left, the first source operand 530 has the 32-bit status element A in bits [31:0] j , the 32-bit state element B in bits [63:32] j , the 32-bit state element E in bits [95:64] j , and the 32-bit state element F in bits [127:96] j In other embodiments, reverse order is optionally used. Also from the least significant bit position on the right to the most significant bit position on the left, the second source operand 532 has a 32-bit state element C in bits [31:0]. j , the 32-bit state element D in bits [63:32] j , the 32-bit state element G in bits [95:64] j , and the 32-bit status element H in bits [127:96] j In other embodiments, the reverse order is optionally used. The arrangement shown may provide certain advantages, but is not required. In other embodiments, the eight 32-bit status words may be rearranged between the available source operands in different ways.

[0075] The third source packet data operand 534 shown has message information (e.g., a set of four messages) sufficient to evaluate two rounds of SM3. Specifically, the third source packet data operand 534 shown has four messages. j , W j+1 , W j+4 and W j+5 . Message W j+4 and Wj It is sufficient to calculate the message W' according to Equation 6 j . Similarly, the message W j+5 and W j+1 It is sufficient to calculate the message W' according to Equation 6 j+1 In another embodiment, the instructions may indicate providing four messages W j , W j+1 , W' j and W' j+1 In other embodiments, as long as or based on the information provided (e.g., W j , W j+1 , W j+4 , and W j+5 ) calculates or derives the required messages for both rounds, other combinations of messages may be used.

[0076] Reference again Figure 5 In response to the SM3 two-round status word update instruction, a first result packed data operand 536 may be generated (e.g., by the execution unit 524) and stored at a destination storage location. The instruction may specify or otherwise indicate the destination storage location. In various embodiments, the destination storage location may be a packed data register, a memory location, or other storage location. In some embodiments, the first result packed data operand 536 may include four 32-bit status words updated over two SM3 rounds. For example, in the illustrated embodiment, the first result packed data operand 536 has a 32-bit status element A in bits [31:0]. j+2 , B in position [63:32] j+2 , E in position [95:64] j+2 , and F in position [127:96] j+2 In other embodiments, a reverse order may alternatively be used. Furthermore, while the arrangement shown may provide certain advantages, in other embodiments, the status words may be rearranged differently among the operands.

[0077] In some embodiments, in the case of the optional SM3 two-round eight status word update instruction, in response to the instruction, a second result packed data operand 538 may be generated and stored at a second destination storage location. The instruction may specify or otherwise indicate the second destination storage location. In various embodiments, the second destination storage location may be a packed data register, a memory location, or other storage location. In some embodiments, the second result packed data operand 538 may include the remaining four 32-bit status words that were not included in the first result packed data operand 536 that was updated via two rounds of SM3. Specifically, in the illustrated embodiment, the second result packed data operand 538 has a 32-bit status element C in bits [31:0]. j+2 , D in position [63:32] j+2 , G in position [95:64] j+2 , and H in position [127:96] j+2 In other embodiments, a reverse order may alternatively be used. Furthermore, while the arrangement shown may provide certain advantages, various inter-operand and intra-operand rearrangements may be contemplated.

[0078] Note that in some embodiments, first result packed data operand 536 may optionally include corresponding status words of the same type (e.g., A, B, E, F) and in the same order as first source packed data operand 530. Also, in some embodiments, second result packed data operand 538 may optionally include corresponding status words of the same type (e.g., C, D, G, H) and in the same order as second source packed data operand 532. This is not required, but may tend to provide certain efficiencies and / or advantages from an overall algorithmic perspective (e.g., by more efficiently managing status words between rounds).

[0079] Figure 5 The second result packed data operand 538 is optional and not required. In other embodiments, in the case of the optional SM3 two-round four status word update instruction / operation, the first result packed data operand 536 (e.g., A in any desired order) may be stored. j+2 , B j+2 、E j+2 、F j+2 ) instead of the second result packed data operand 538 (eg, instead of C j+2 , D j+2 , G j+2 and H j+2 ). Note that one of the source operands includes A j , B j 、E j 、F j , the other source operand includes Cj , D j , G j and H j When only four status words are updated after two rounds (for example, A is generated j+2 , B j+2 、E j+2 、F j+2 ), the specific grouping of these types of status words within the same operand provides advantages. As will be further explained below (e.g., in conjunction with Figure 6 ), for example, by software or by additional SM3 acceleration instructions (e.g., instructions 106 and / or instructions for Figure 6 The instructions described in this section can be easily obtained from A j , B j 、E j 、F j Generates the other four status words for two rounds of updates (for example, C j+2 , D j+2 , G j+2 and H j+2 ). The specifically shown grouping of different types of status words between operands provides less advantage when all eight status words are updated in two rounds by executing a single instruction. In this case, although some arrangements may tend to provide more efficient management of status words between rounds, rearrangement of different types of status words within and / or between operands is possible for almost any operand. For example, it may still be beneficial to maintain different types of status words in the same order in the source operand and the result operand.

[0080] In some embodiments, for example, when only four status words are updated over two rounds (e.g., A j+2 , B j+2 、E j+2 、F j+2 ), the updated four status words may optionally be used to overwrite four status words of different types in one of the source operands, although this is not required. j+2 , B j+2 、E j+2 、F j+2 Overwrite C j+2 , D j+2 , G j+2 , H j+2 Instead of A j , B j 、E j 、F jFor example, an instruction may have a source / destination operand that was previously explicitly specified but is implicitly understood to be used as a source operand and subsequently as a destination operand. For example, an instruction may be used with an A when it is desired to have no other specified or implicitly indicated operand storage location. j+2 , B j+2 、E j+2 、F j+2 Overwrite C j+2 , D j+2 , G j+2 , H j+2 Instead of A j , B j 、E j 、F j Able to provide reservation j , B j 、E j 、F j The advantages of C make them available for two rounds of updates to the remaining four status words (e.g., C j+2 , D j+2 , G j+2 , H j+2 For example, additional SM3 acceleration instructions may be used (see, for example, Figure 6 ), or this can be implemented in software.

[0081] A specific example embodiment of the SM3 two round four status word update instruction is the following SM3RNDS2 instruction. SRC represents the first 128-bit source operand, DST represents the second 128-bit source / destination operand (the instruction implies that a location is specified and used as the source and again as the destination), <xmm0>represents a third 128-bit source operand, whose location is implied in the instruction rather than explicitly specified, and imm represents an immediate value (e.g., an 8-bit immediate value) used to specify the round number (j). In other embodiments, <xmm0>Can be replaced by another 128-bit register.

[0082] SM3RNDS2 DST, SRC, imm, <xmm0>

[0083] j=imm

[0084] [C j , D j , G j , H j ]=DST

[0085] [A j , B j , E j , F j ]=SRC

[0086] [W j+5 , W j+4 , W j+1 , W j ] = XMM0

[0087] In response to the SM3RNDS2 instruction, the processor and / or execution unit may perform the following operations or their equivalents, or at least generate results consistent with these operations:

[0088] If(j<16), then T j =0x79cc4519, else T j =0x7a879d8a, endif

[0089] SS1=((A j <<<12)+E j +(T j <<<j))<<<7

[0090] SS2=SS1 XOR(A j <<<12)

[0091] TT1=FF j (A j , B j , C j )+D j +SS2+(W j XOR W j+4 )

[0092] TT2=GG j (E j , F j , G j )+H j +SS1+W j

[0093] D j+1 =C j

[0094] C j+1 JB j LOOR9

[0095] B j+1 (A j

[0096] AM j+1 TT1

[0097] H j+1 (G j

[0098] G j+1 J. F j LOVE1

[0099] F j+1 JE j

[0100] E j+1 NPO(TT2)

[0101] SS1((A j+1 LOY12)+E j+1 +(T j 99(j+1)))997

[0102] SS2 / SS1 XOR(A j+1 LOVE12)

[0103] TT1 / FF j+1 (AM j+1 ,B j+1 ,C j+1 )+D j+1 +SS2+(W j+1 XOR W j+5 )

[0104] TT2 / GG j+1 (E j+1 ,F j+1 ,G j+1 )+H j+1 +SS1+W j+1

[0105] B j+2 (A j+1

[0106] AM j+2 TT1

[0107] F j+2 JE j+1

[0108] E j+2 NP0(TT2)

[0109] DST=[A j+2 , B j+2 , E j+2 , F j+2 ]

[0110] Note that for the second round, there is no need to calculate C j+2 , D j+2 , G j+2 , H j+2 And these calculations can optionally be omitted from the second round if desired. Thus, there is no need to perform two full rounds, and it should be understood that references to two rounds herein encompass such operations optionally removed from the second of the two rounds.

[0111] It should be understood that this is only an illustrative example. Other embodiments may use operands of different numbers and sizes, as described above. In addition, other embodiments may rearrange elements differently within the operands. Both inter-operand and intra-operand rearrangements are possible. In addition, the use of implicit reuse of SRC / DST registers or implicit registers (e.g., <xmm0>) is not required. For example, the architecture may allow operands to be specified explicitly, implicit subsequent registers may be used, etc.

[0112] Figure 6 is a block diagram illustrating an embodiment of an SM3 two round four remaining status word update operation 644 that may be performed in response to an embodiment of an SM3 two round four remaining status word update instruction. In the illustrated embodiment, the instruction specifies or otherwise indicates a source packed data operand 646. As shown, in some embodiments, the source packed data operand may be a 128-bit operand. Alternatively, two 64-bit operands, 256-bit operands, or operands of other sizes may optionally be used instead. In some embodiments, the source packed data operand may have four status words to be input to the current round (j) as input. For example, in the illustrated embodiment, from the least significant bit position on the right to the most significant bit position on the left, the source packed data operand has a 32-bit status element A in bits [31:0]. j , B in position [63:32] j , E in position [95:64] j , and F in position [127:96] j In other embodiments, these elements may be distributed among any desired number of source operands and in any desired order within the source operand(s). For example, a reverse order may be optionally used within the operands. Furthermore, in other embodiments, the status words may be optionally rearranged differently within a single source operand or both source operands. In one aspect, source packed data operand 646 may be Figure 5 The first source packed data operand 530 has the same operands / data (eg, the algorithm may reuse operands / data).

[0113] In response to the instruction / operation, a result packed data operand 648 may be generated (e.g., by the execution unit 624) and stored at a destination storage location. The instruction may specify or otherwise indicate the destination storage location. In various embodiments, the destination storage location may be a packed data register, a memory location, or other storage location. As shown, in some embodiments, the result packed data operand may be a 128-bit operand. Alternatively, two 64-bit operands, 256-bit operands, or operands of other sizes may be used. In some embodiments, the result packed data operand 648 may include four remaining status words updated over two rounds. On the one hand, the four remaining status words may represent those status words that are not included in the first result packed data operand 536 that is stored in response to the SM3 two-round four status word update instruction. On the other hand, the four remaining status words may represent four types of status words (e.g., C, D, G, and H types) that are not included in the source packed data operand 646 (e.g., A, B, E, and F types). As shown, in the illustrated embodiment, the result packed data operand 648 has a 32-bit status element C in bits [31:0]. j+2 , D in position [63:32] j+2 , G in position [95:64] j+2 , and H in position [127:96] j+2 In other embodiments, a reverse order may alternatively be used. Furthermore, while the arrangement shown may provide certain advantages, in other embodiments, the status words may alternatively be rearranged differently in the resulting packed data operand.

[0114] In some embodiments, the processor and / or execution unit 624 may execute the following equations to respectively obtain the following from A j , B j 、E j and F j (provided in the source operand) generates C j+2 , D j+2 , G j+2 and H j+2 .

[0115] C j+2 =B j+1 =A j <<<9

[0116] D j+2 =C j+1 =B j <<<9

[0117] G j+2 =F j+1 <<<19=E j <<<19

[0118] H j+2 =G j+1 =F j <<<19

[0119] Through the Figure 2 These relationships can be easily derived by comparing the equations for the two-round SM3 algorithm shown in .

[0120] Recall the following, as mentioned above Figure 2 As discussed in Equations 4-6, the SM3 algorithm uses the message (W j ). Messages W0 to W are obtained from the 512-bit block being compressed. 15 . The remaining message is calculated based on equations 4-6. Traditionally, message expansion generally tends to involve executing a large number of separate instructions. For example, traditionally it is possible to use a separate instruction for each XOR operation, each rotation operation, etc. Potentially, additional instructions may also be required to move or rearrange data to prepare for expanding more messages. In addition, a large number of such W j Messages (e.g., W 16 To W 67 ). As a result, rounds tend to perform poorly and / or take a lot of time to write in software with separate more general instructions.

[0121] In some embodiments, a pair of instructions (e.g., instructions 108, 110) for accelerating SM3 message expansion may be included in the instruction set of the processor. In some embodiments, instructions may be used to generate four new messages (e.g., messages W corresponding to four sequential and consecutive rounds) j+16 , W j+17 , W j+18 , W j+19 ). This pair of instructions may be included regardless of whether the instruction set also includes SM3 two rounds of at least four status word update instructions (eg, instruction 104).

[0122] In some embodiments, the source operands of the pair of instructions may together contain a set of messages sufficient to generate four new messages. The set of input messages required to generate these four new messages is shown in the following four examples of equation 4, as follows:

[0123] W j+16 =P1(W j XOR W j+7 XOR(W j+13 <<<15))XOR(W j+3 <<<7) XOR W j+10

[0124] W j+17 =P1(W j+1 XOR W j+8 XOR(W j+14 <<<15))XOR(W j+4 <<<7) XOR W j+11

[0125] W j+18 =P1(W j+2 XOR W j+9 XOR(W j+15 <<<15))XOR(W j+5 <<<7) XOR W j+12

[0126] W j+19 =P1(W j+3 XOR W j+10 XOR(W j+16 <<<15))XOR(w j+6 <<<7) XOR W j+13

[0127] Sixteen unique messages are required (e.g., W j To W j+15 ) to evaluate these relations to obtain four new messages. In addition, the message W needs to be calculated j+16 To complete the W j+19 Calculation of W j Corresponding to the earliest round to be input into round j, W j+1 Corresponding to the round next to the earliest round to be input into the j+1th round, and so on.

[0128] In one embodiment, all sixteen unique messages (e.g., j To W j+15 ). This single instruction may operate to cause the processor to update all four updated messages (e.g., j+16 To W j+19 ) are stored within the limits of the single instruction executed. In other embodiments, a pair of instructions may be used, and all sixteen unique messages (e.g., j To W j+15 ). This pair of cooperating instructions may operate to cause the processor to update all four updated messages (e.g., j+16 To W j+19 ) are stored within the limits of the pair of instructions executed. Each of the two instructions can provide only a subset of the required input messages through its corresponding (one or more) source operands. The first / initial instruction in the pair of instructions can generate a temporary result, and the second / subsequent instruction further processes the temporary result to generate four new messages. Using a pair of instructions rather than a single instruction can provide certain potential advantages, such as allowing the use of smaller registers and / or fewer source operands than providing all the required input messages in the (one or more) source operands of a single instruction.

[0129] Figure 7-8 The operation of an embodiment of a pair of SM3 message extension instructions is shown. As previously described, instructions can be received and decoded, execution units can be enabled to perform operations, etc. Figure 7 1 is a block diagram illustrating an embodiment of an SM3 four message extension start operation 750 that can be executed in response to an embodiment of an SM3 four message extension start instruction (e.g., the first instruction in a pair of instructions to be executed). In the illustrated embodiment, the instruction specifies or otherwise indicates a first 128-bit source packet data operand 752, a second 128-bit source packet data operand 754, and a third 128-bit source packet data operand 756. As before, using 128-bit operands can provide certain advantages, but is not required. In other embodiments, operands of different numbers and sizes can be optionally used, for example, a combination of 64-bit operands, 256-bit operands, operands of different sizes, etc.

[0130] The first, second, and third source operands may be used to provide only a subset of the sixteen different input messages required to evaluate four new messages. In one aspect, the provided messages may represent those messages sufficient to evaluate a block or portion of each of the four instances of Equation 4 shown above. For example, in the example embodiment shown, the first source operand 752 has the message W at bits [31:0] j , the message W at [63:32] j+1 , the message W at [95:64] j+2 , and the message W at [127:96] j+3 The second source operand 754 has the message W at bits [31:0]. j+13 , the message W at [63:32] j+14 , the message W at [95:64] j+15 , and any value * at bits [127:96]. Any value * may represent various convenient values, such as all zeros, all ones, existing / unchanged bit values, etc. The third source operand 756 has message W at bits [31:0]. j+7 , the message W at [63:32] j+8 , the message W at [95:64] j+9 , and the message W at [127:96] j+10 .

[0131] In the illustrated embodiment, the first source operand 752 optionally has four messages corresponding to four continuous rounds, and the four messages are optionally arranged according to the round sequence (e.g., the ascending round sequence with the increase of the bit effective value). Similarly, the second source operand 754 optionally has three messages corresponding to three continuous rounds, and the three messages are optionally arranged according to the round sequence (e.g., the ascending round sequence). Similarly, the third source operand 756 optionally has four messages corresponding to four continuous rounds, and the four messages are optionally arranged according to the round sequence (e.g., ascending). In another embodiment, if necessary, messages in reverse or reverse order can be optionally used in the operand (e.g., in each operand, messages can be arranged in descending order). The following operations can help improve the efficiency of the rearrangement of management messages between rounds: the messages of adjacent rounds are stored in the same operand, the messages of adjacent rounds are stored in the operand in the round sequence, and the adjacent messages of each operand are stored in the same round sequence (e.g., all arranged in ascending round sequence), but the above operations are not required. In other embodiments, the message may be optionally rearranged by various intra-operand and / or inter-operand rearrangements. In addition, in other embodiments, other numbers and / or sizes of operands may be optionally used as desired.

[0132] Reference again Figure 7 , in response to the SM3 four message extension start instruction / operation, a result packet data operand 758 can be generated (e.g., by the execution unit 724) and stored in the destination storage location. The instruction can specify or otherwise indicate the destination storage location. The destination storage location can be a packet data register, a memory location, or other storage location. In some embodiments, the result packet data operand 758 can include four temporary or intermediate results, for example, each representing a different evaluated block / part of a corresponding one of the four instances of equation 4 shown above. As used herein, the evaluated block / part means a value consistent with the evaluated block / part, but each operation shown in the equation is not necessarily performed or even those equations are not necessarily used in fact. For example, in other embodiments, a computationally equivalent equation or part (e.g., computationally equivalent operations) can be derived and the equation shown herein can be replaced with the equivalent equation or part.

[0133] Reference again Figure 7 In the illustrated embodiment, the result packed data operand 758 has a first 32-bit temporary result (W ) at bits [31:0]. TMP0 ), W in power [63:32] TMP1 , W in power [95:64] TMP2 , and W in office [127:96] TMP3 In some embodiments, W TMP0 -W TMP3 can be equated to the following calculation performed by the processor:

[0134] TO=W j XOR W j+7 XOR(W j+13 <<<15)

[0135] T1=W j+1 XOR W j+8 XOR(W j+14 <<<15)

[0136] T2=W j+2 XOR W j+9 XOR(W j+15 <<<15)

[0137] T3=W j+3 XOR W j+10

[0138] W TMP0 =P1(T0)

[0139] W TMP1 =P1(T1)

[0140] W TMP2 =P1(T2)

[0141] W TMP3 =P1(T3)

[0142] In one particular embodiment, the first source operand 752 may be in an implicitly indicated 128-bit source register, the second source operand 754 may be in an implicitly indicated 128-bit source register, the third source operand 756 may be in an implicitly indicated 128-bit source / destination register, and the result operand 758 may overwrite the third source operand 756 in the source / destination register, but the scope of the present invention is not limited in this regard.

[0143] Figure 8 860 is a block diagram illustrating an embodiment of an SM3 four message extension completion operation 860 that can be performed in response to an embodiment of an SM3 four message extension completion instruction. In the illustrated embodiment, the instruction specifies or otherwise indicates a first 128-bit source packed data operand 862, a second 128-bit source packed data operand 864, and a third 128-bit 128-bit source packed data operand 866. As before, using 128-bit operands can provide certain advantages, such as allowing instructions in a processor with 128-bit packed data registers rather than 256-bit packed data registers, but it is not required. In other embodiments, operands of different numbers and sizes can be optionally used, for example, 64-bit operands, 256-bit operands, combinations of operands of different sizes, etc.

[0144] The first, second, and third source operands may be used to provide the remaining complementary subset of the sixteen different messages required to generate four new messages for four sequential and consecutive rounds. In some embodiments, the message may represent the remaining blocks / portions (not included) of the four instances of Equation 4. Figure 7 For example, in the example embodiment shown, the first source operand 862 has a message W at bits [31:0]. j+10 , the message W at [63:32] j+11 , the message W at [95:64] j+12 , and the message W at [127:96] j+13 The second source operand 864 has the message W at bits [31:0]. j+3 , the message W at [63:32] j+4 , the message W at [95:64] j+5 , and the message W at [127:96] j+6 The third source operand 866 has a first temporary result (W TMP0 ), the second temporary result (W TMP1 ), the third interim result (W TMP2 ), and the fourth provisional result (W TMP3 ). In one aspect, third source packed data operand 866 may optionally be the same operand as result packed data operand 758.

[0145] In the illustrated embodiment, the first source operand 862 optionally has four messages corresponding to four consecutive rounds, and the four messages are optionally arranged according to a round sequence (e.g., an ascending round sequence with increasing bit significance). Similarly, the second source operand 864 optionally has three messages corresponding to three consecutive rounds, and the three messages are optionally arranged according to a round sequence (e.g., an ascending round sequence). The third source operand 866 optionally has four temporary results W TMP1 To W TMP3 In another embodiment, if desired, reverse or inverted order of messages may optionally be used within the operands (e.g., within each operand, messages may be arranged in descending order). The following operations may help improve the efficiency of managing the rearrangement of messages between rounds: storing messages of adjacent rounds within the same operand, storing messages of adjacent rounds within the operands in round order, and storing adjacent messages of each operand in the same round order (e.g., all arranged in ascending round order), but the above operations are not required. In other embodiments, messages and / or temporary results (W) may optionally be rearranged through various intra-operand and / or inter-operand rearrangements. TMP0 To W TMP3 ) are rearranged. In addition, in other embodiments, other numbers and / or sizes of operands may be optionally used as desired.

[0146] Reference again Figure 8 In response to the SM3 four message extension completion instruction / operation, a result packed data operand 868 may be generated (e.g., by the execution unit 824) and stored at a destination storage location. The instruction may specify or otherwise indicate a destination storage location. The destination storage location may be a packed data register, a memory location, or other storage location. In some embodiments, the result packed data operand 868 may include four messages for four sequential and consecutive rounds. As shown, in the illustrated embodiment, the result packed data operand 868 has a first 32-bit message W at bits [31:0] to be input to the compression function of the (j+16)th round SM3 hash function. j+16 , the second 32-bit message W at bits [63:32] is to be input into the (j+17)th round j+17 , the third 32-bit message W to be input to the (j+18)th round at bits [95:64] j+18 , and the fourth 32-bit message W at positions [127:96] to be input to the (j+19)th round j+19 .

[0147] In some embodiments, W may be operated according to the following j+16 To W j+19 To evaluate:

[0148] W j+16 =(W j+3 <<<7) XOR W j+10 XOR W TMP0

[0149] W j+17 =(W j+4 <<<7) XOR W j+11 XOR W TMP1

[0150] W j+18 =(W j+5 <<<7) XOR W j+12 XOR W TMP2

[0151] W j+19 =(W j+6 <<<7) XOR W j+13 XOR W TMP3

[0152] W j+19 =W j+19 XOR(W j+16 <<<6)XOR(W j+16 <<<15)XOR(W j+16 <<<30)

[0153] Note that the calculation of W j+16 , and then use it to complete the W j+19 Advantageously, this pair of SM3 message extension operations / instructions can significantly help improve the speed, efficiency and / or performance of implementing SM3 message generation (e.g., by avoiding the high instruction count and complexity that would otherwise exist with traditional software approaches). It should be understood that this is only one illustrative example of a suitable pair of instructions.

[0154] In other embodiments, the other blocks of the four instances of equation 4 shown above can be optionally obtained by the first instruction in the instruction pair, and the remaining blocks can be evaluated by the second subsequent instruction. Accordingly, the first instruction in the instruction pair and the second instruction in the instruction pair provide different message subsets. That is, messages can be flexibly allocated between the first instruction and the second instruction, as long as the provided messages can be used to evaluate the blocks of the instances of equation 4, the values ​​obtained can be passed from the first instruction to the second subsequent instruction as intermediate results, and the second subsequent instruction can use the intermediate results and the remaining messages that have not yet been provided to complete the evaluation of these instances of equation 4.

[0155] In one particular embodiment, the first source operand 862 may be in an implicitly indicated 128-bit source register, the second source operand 864 may be in an implicitly indicated 128-bit source register, the third source operand 866 may be in an implicitly indicated 128-bit source / destination register, and the result operand 868 may overwrite the third source operand 866 in the source / destination register, but the scope of the present invention is not limited in this regard.

[0156] The instructions and processors described herein are intended to implement the SM3 Chinese cryptographic hash function and obtain values ​​consistent therewith. Any possible contradictions or inconsistencies in the description that may lead to results inconsistent with the SM4 algorithm (e.g., due to typographical errors, translation errors, description errors, or other errors) are unintentional and erroneous. In addition, although the current version of the SM3 algorithm has been described, it should be understood that the embodiments are also applicable to the following that meet the limitations of the claims: extensions of the standard (e.g., SMx Chinese cryptographic hash standards, where SMx represents a future version of SM3), derivations of the standard, modifications of the standard, related standards, and the like. As used herein, SM3 refers to the described and known algorithm, whether called SM3 or some other name.

[0157] Exemplary Core Architectures, Processors, and Computer Architectures

[0158] The processor core can be implemented in different ways, for different purposes, and in different processors. For example, the implementation of such a core may include: 1) a general-purpose in-order core intended for general-purpose computing; 2) a high-performance general-purpose out-of-order core intended for general-purpose computing; 3) a dedicated core for graphics and / or scientific (throughput) computing. The implementation of different processors may include: 1) a CPU including one or more general-purpose in-order cores intended for general-purpose computing and / or one or more general-purpose out-of-order cores intended for general-purpose computing; and 2) a coprocessor including one or more dedicated cores intended primarily for graphics and / or scientific (throughput) computing. Such different processors lead to different computer system architectures, which may include: 1) a coprocessor on a chip separate from the CPU; 2) a coprocessor on a separate chip in the same package as the CPU; 3) a coprocessor on the same chip as the CPU (in this case, such a coprocessor may sometimes be referred to as dedicated logic, such as integrated image and / or scientific (throughput) logic, or a dedicated core); and 4) a system-on-chip that may include the described CPU (sometimes referred to as (one or more) application cores or (one or more) application processors), the above coprocessors, and additional functions on the same chip. An exemplary core architecture is described next, followed by a description of exemplary processor and computer architectures.

[0159] Exemplary Core Architecture

[0160] In-order and out-of-order core block diagram

[0161] Fig.9A is a block diagram illustrating both an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline according to embodiments of the present invention. Fig. 9B is a block diagram illustrating both an exemplary embodiment of an in-order architecture core and an exemplary register renaming, out-of-order dispatch / execution architecture core to be included in a processor according to embodiments of the present invention. Fig.9A -B's solid line boxes show the in-order pipeline and in-order core, while the optionally added dashed line boxes show the register renaming, out-of-order dispatch / execution pipeline and core. Considering that the in-order aspect is a subset of the out-of-order aspect, the out-of-order aspect will be described.

[0162] Exemplary Core Architecture

[0163] Fig.9A , the processor pipeline 900 includes an extraction stage 902, a length decoding stage 904, a decoding stage 906, an allocation stage 908, a renaming stage 910, a scheduling (also called dispatch or distribution) stage 912, a register read / memory read stage 914, an execution stage 916, a write back / memory write stage 918, an exception handling stage 922, and a commit stage 924.

[0164] Fig. 9B A processor core 990 is shown, including a front end unit 930 coupled to an execution engine unit 950, both of which are coupled to a memory unit 970. The core 990 can be a reduced instruction set computing (RISC) core, a complex instruction set computing (CISC) core, a very long instruction word (VLIW) core, or a hybrid or alternative and core type. As another option, the core 990 can be a special-purpose core, for example, a network or communication core, a compression engine, a coprocessor core, a general-purpose computing graphics processing unit (GPGPU) core, a graphics core, or the like.

[0165] The front end unit 930 includes a branch prediction unit 932 coupled to an instruction cache unit 934, which is coupled to an instruction translation lookaside buffer (TLB) 936, which is coupled to an instruction fetch unit 938, which is coupled to a decode unit 940. The decode unit 940 (or decoder) can decode the instruction and generate one or more micro-operations, microcode entry points, microinstructions, other instructions or other control signals as output, which are decoded from the original instruction, or otherwise reflect the original instruction, or are derived from the original instruction. The decode unit 940 can be implemented using a variety of different mechanisms. Suitable mechanisms can include (but are not limited to) lookup tables, hardware implementations, programmable logic arrays (PLA), microcode read-only memories (ROMs), etc. In one embodiment, the core 990 includes a microcode ROM or other medium that stores microcode for certain microinstructions (e.g., in the decode unit 940 or within the front end unit 930). The decode unit 940 is coupled to a rename / allocator unit 952 in the execution engine unit 950.

[0166] The execution engine unit 950 includes a rename / allocator unit 952 coupled to a retirement unit 954 and a set of one or more scheduler units 956. The (one or more) scheduler units 956 represent any number of different schedulers, including reservation stations, central instruction windows, etc. The (one or more) scheduler units 956 are coupled to (one or more) physical register file units 958. Each of the (one or more) physical register file units 958 represents one or more physical register files, and different physical register files store one or more different data types, such as scalar integers, scalar floating points, packed integers, packed floating points, vector integers, vector floating points, status (e.g., instruction pointers, which are the addresses of the next instructions to be executed), etc. In one embodiment, the (one or more) physical register file units 958 include vector register units, write mask register units, and scalar register units. These register units may provide architectural vector registers, vector mask registers, and general purpose registers. The physical register file(s) unit(s) 958 partially overlap with the retirement unit(s) 954 to illustrate various ways in which register renaming and out-of-order execution may be implemented (e.g., using reorder buffer(s) and retirement register file(s), using future file(s), history buffer(s) and retirement register file(s), using register map and register pool, etc.). The retirement unit(s) 954 and the physical register file(s) unit(s) 958 are coupled to execution cluster(s) 960. The execution cluster(s) 960 include a set of one or more execution units 962 and a set of one or more memory access units 964. The execution units 962 may perform various operations (e.g., shift, add, subtract, multiply) on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). While some embodiments may include many execution units dedicated to a specific function or set of functions, other embodiments may include only one execution unit or multiple execution units that perform all functions. Scheduler unit(s) 956, physical register file(s) units 958, and execution cluster(s) 960 are shown as possibly multiple because some embodiments create separate pipelines for different types of data / operations (e.g., scalar integer pipelines, scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipelines, and / or memory access pipelines that each have their own scheduler unit(s), physical register file(s) units, and / or execution clusters - and in the case of separate memory access pipelines, some embodiments are implemented with only the execution cluster of that pipeline having memory access unit(s) 964).It should be understood that where separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution and the rest in-order.

[0167] The set of memory access units 964 is coupled to the memory unit 970, which includes a data TLB unit 972 coupled to a data cache unit 974, wherein the data cache unit 974 is coupled to a level 2 (L2) cache unit 976. In an exemplary embodiment, the memory access unit 964 may include a load unit, a store address unit, and a store data unit, each coupled to the data TLB unit 972 in the memory unit 970. The instruction cache unit 934 is further coupled to a level 2 (L2) cache unit 976 in the memory unit 970. The L2 cache unit 976 is coupled to one or more other levels of cache and ultimately to the main memory.

[0168] By way of example, an exemplary register renaming, out-of-order dispatch / execution core architecture may implement pipeline 900 as follows: 1) instruction fetch 938 performs fetch and length decode stages 902 and 904; 2) decode unit 940 performs decode stage 906; 3) rename / allocator unit 952 performs allocate stage 908 and rename stage 910; 4) (one or more) scheduler units 956 perform schedule stage 912; 5) (one or more) physical register file units 958 and memory units 970 perform register read / memory read stage 914; execution cluster 960 performs said execute stage 916; 6) memory unit 970 and (one or more) physical register file units 958 perform write back / memory write stage 918; 7) various units may be involved in exception handling stage 922; and 8) retirement unit 954 and (one or more) physical register file units 958 perform commit stage 924.

[0169] Core 990 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions that have resulted in newer versions); the MIPS instruction set from MIPS Technologies (Sunnyvale, CA); the ARM instruction set from ARM Holdings (Sunnyvale, CA) (with optional additional extensions, such as NEON), including the instruction(s) described herein). In one embodiment, core 990 includes logic to support instruction set extensions indicating packed data (e.g., AVX1, AVX2), thereby allowing operations used by many multimedia applications to be performed using packed data.

[0170] It should be understood that a core may support multithreading (executing two or more operations or sets of threads in parallel), and may do so in a variety of ways, including time-sliced ​​multithreading, simultaneous multithreading (where a single physical core provides a logical core for each thread, so the physical core is simultaneously multithreaded), or a combination of the above (e.g., time-sliced ​​fetch and decode followed by simultaneous multithreading, such as in Hyper-Threading Technology).

[0171] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming can be used in an in-order architecture. Although the embodiment of the processor shown also includes separate instruction and data cache units 934 / 974 and a shared L2 cache unit 976, alternative embodiments may have a single internal cache for both instructions and data, for example, a level 1 (L1) internal cache, or multiple levels of internal cache. In some embodiments, the system may include a combination of internal caches and external caches external to the core and / or processor. Alternatively, all caches may be external to the core and / or processor.

[0172] Specific Exemplary In-order Core Architecture

[0173] Fig. 10A -B shows a block diagram of a more specific exemplary in-order core architecture, which will be one of several logic blocks in a chip (including other cores of the same type and / or different types). Depending on the application, the logic block communicates with some fixed-function logic, memory I / O interfaces, and other necessary I / O logic through a high-bandwidth interconnect network (e.g., a ring network).

[0174] Fig. 10A 1 is a block diagram of a single processor core according to an embodiment of the present invention, and the connection of the processor core to an on-chip interconnect network 1002 and a local subset of the level 2 (L2) cache 1004 of the processor core. In one embodiment, the instruction decoder 1000 supports the x86 instruction set with a packed data instruction set extension. The L1 cache 1006 allows low latency access to scalar and vector units in cache memory. Although in one embodiment (to simplify the design), the scalar unit 1008 and the vector unit 1010 use separate register sets (e.g., using scalar registers 1012 and vector registers 1014, respectively) and data transferred between the two is written to memory and then read back from the level 1 (L1) cache 1006, alternative embodiments of the present invention may use different approaches (e.g., using a single register set or including a communication path that allows data to be transferred between two register files without being written and read back).

[0175] The local subset of L2 cache 1004 is part of the L2 global cache, where the L2 global cache is divided into different local subsets, each local subset corresponding to a processor core. Each processor core has a direct access path to its own local subset of L2 cache 1004. The data read by the processor core is stored in the L2 cache subset 1004 of the processor core and can be quickly accessed, while other processor cores access their own local L2 cache subsets. The data written by the processor core is stored in its own L2 cache subset 1004 and cleared from other subsets if necessary. The ring network ensures the consistency of shared data. The ring network is bidirectional to allow agents such as processor cores, L2 caches, and other logic blocks to communicate with each other within the chip. In each direction, each ring data path is 1012 bits wide.

[0176] Fig. 10B According to an embodiment of the present invention Fig. 10A An expanded view of a portion of a processor core. Fig. 10B Included are L1 data cache 1006A (which is part of L1 cache 1006), as well as more details about vector unit 1010 and vector registers 1014. Specifically, vector unit 1010 is a 16-bit wide vector processing unit (VPU) (see 16-bit wide ALU 1028) that executes one or more integer, single precision floating point, and double precision floating point instructions. The VPU supports swizzling of register inputs with swizzle unit 1020, digital conversion with digital conversion units 1022A-B, and copying of memory inputs with copy unit 1024. Write mask register 1026 allows predictive result vector writes.

[0177] Processor with integrated memory controller and graphics

[0178] Fig.11 is a block diagram of a processor 1100 that may have more than one core, may have an integrated memory controller, and may have integrated graphics according to an embodiment of the present invention. Fig.11 The solid line box shows a processor 1100 having a single core 1102A, a system agent 1110, a set of one or more bus controller units 1116, while the optionally added dashed line box shows an alternative processor 1100 having multiple cores 1102A-N, a set of one or more integrated memory controller units 1114 in the system agent unit 1110, and dedicated logic 1108.

[0179] Thus, different implementations of processor 1100 may include: 1) the dedicated logic 1108 is a CPU with integrated graphics and / or scientific (throughput) logic (which may include one or more cores) and cores 1102A-N are one or more general purpose cores (e.g., general purpose in-order cores, general purpose out-of-order cores, combinations of the above); 2) cores 1102A-N are coprocessors of a large number of dedicated cores intended primarily for graphics and / or science (throughput); and 3) cores 1102A-N are coprocessors of a large number of general purpose in-order cores. Thus, processor 1100 may be a general purpose processor, a coprocessor, or a special purpose processor, such as a network or communication processor, a compression engine, a graphics processor, a GPGPU (general purpose graphics processing unit), a high throughput integrated many-core (MIC) coprocessor (including 30 or more cores), an embedded processor, or the like. The processor may be implemented on one or more chips. Processor 1100 may be part of and / or implemented on one or more substrates using any of a variety of processing technologies (e.g., BICMOS, CMOS, or NMOS).

[0180] The memory hierarchy includes one or more levels of cache within the core, a set or one or more shared cache units 1106, and external memory (not shown) coupled to a set of integrated memory controller units 1114. The set of shared cache units 1106 may include one or more mid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, a last resort cache (LLC), and / or a combination of the above levels of cache. Although in one embodiment a ring-based interconnect unit 1112 interconnects the integrated graphics logic 1108, the set of shared cache units 1106, and the system agent unit 1110 / (one or more) integrated memory controller units 1114, alternative embodiments may use any number of well-known techniques to interconnect these units. In one embodiment, coherency between the one or more cache units 1106 and the cores 1102A-N is maintained.

[0181] In some embodiments, one or more of the cores 1102A-N can perform multithreading. The system agent 1110 includes those components that coordinate and operate the cores 1102A-N. The system agent unit 1110 may include, for example, a power control unit (PCU) and a display unit. The PCU may be or include logic and components required to adjust the power state of the cores 1102A-N and the integrated graphics logic 1108. The display unit is used to drive one or more externally connected displays.

[0182] The cores 1102A-N may be homogeneous or heterogeneous in terms of architectural instruction sets, that is, two or more of the cores 1102A-N may be capable of executing the same instruction set, while others may be capable of executing only a subset of the instruction set or a different instruction set.

[0183] Exemplary Computer Architecture

[0184] Figure 12-15 is a block diagram of an exemplary computer architecture. Other system designs and configurations known in the art are also applicable to the following: laptop computers, desktop computers, handheld PCs, personal digital assistants, engineering workstations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, cellular phones, portable media players, handheld devices, and various other electronic devices. In general, various systems or electronic devices that can contain processors and / or other execution logic as disclosed herein are generally suitable.

[0185] Reference now Fig.12 , shown is a block diagram of a system 1200 according to one embodiment of the present invention. The system 1200 may include one or more processors 1210, 1215 coupled to a controller hub 1220. In one embodiment, the controller hub 1220 includes a graphics memory controller hub (GMCH) 1290 and an input / output hub (IOH) 1250 (which may be on separate chips); the GMCH 1290 includes memory and a graphics controller to which a memory 1240 and a coprocessor 1245 are coupled; and the IOH 1250 couples an input / output (I / O) device 1260 to the GMCH 1290. Alternatively, one or both of the memory and the graphics controller are integrated within the processor (as described herein), the memory 1240 and the coprocessor 1245 are directly coupled to the processor 1210 and the controller hub 1220 within a single chip with the IOH 1250.

[0186] exist Fig.12 The optional nature of the additional processor 1215 is shown in dashed lines. Each processor 1210, 1215 may include one or more processing cores described herein and may be some version of the processor 1100.

[0187] The memory 1240 may be, for example, a dynamic random access memory (DRAM), a phase change memory (PCM), or a combination of the two. For at least one embodiment, the controller hub 1220 communicates with the processors 1210, 1215 via a multi-drop bus (e.g., a front side bus (FSB), a point-to-point interface such as a QuickPath Interconnect (QPI), or a similar connection 1295).

[0188] In one embodiment, coprocessor 1245 is a special purpose processor, such as a high throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, or the like. In one embodiment, controller hub 1220 may include an integrated graphics accelerator.

[0189] There are various differences between the physical resources 1210, 1215 in terms of a range of metric merits, including architectural, microarchitectural, thermal, power consumption characteristics, or the like.

[0190] In one embodiment, processor 1210 executes instructions that control general types of data processing operations. Coprocessor instructions may be embedded within the instructions. Processor 1210 recognizes these coprocessor instructions as being of a type that should be executed by an attached coprocessor 1245. Therefore, processor 1210 distributes these coprocessor instructions (or control signals representing coprocessor instructions) on a coprocessor bus or other interconnect to coprocessor 1245. Coprocessor(s) 1245 accept and execute the received coprocessor instructions.

[0191] Reference now Fig.13 , shown is a block diagram of a first more specific exemplary system 1300 according to an embodiment of the present invention. Fig.13 As shown in FIG. 1 , multiprocessor system 1300 is a point-to-point interconnect system and includes a first processor 1370 and a second processor 1380 coupled via a point-to-point interconnect 1350. Processors 1370 and 1380 are each a version of processor 1100. In one embodiment of the invention, processors 1370 and 1380 are processors 1210 and 1215, respectively, and coprocessor 1338 is coprocessor 1245. In another embodiment, processors 1370 and 1380 are processor 1210 and coprocessor 1245, respectively.

[0192] Processors 1370 and 1380 are shown as including integrated memory controller (IMC) units 1372 and 1382, respectively. Processor 1370 also includes point-to-point (PP) interfaces 1376 and 1378 as part of its bus controller unit; similarly, second processor 1380 includes PP interfaces 1386 and 1388. Processors 1370, 1380 can exchange information via point-to-point (PP) interface 1350 using PP interface circuits 1378, 1388. Fig.13 As shown in FIG. 1 , IMCs 1372 and 1382 couple the processors to respective memories, namely, memory 1332 and memory 1334 , which may be portions of main memory locally attached to the respective processors.

[0193] Processors 1370, 1380 may each exchange information with a chipset 1390 via separate PP interfaces 1352, 1354 using point-to-point interface circuits 1376, 1394, 1386, 1398. Chipset 1390 may optionally exchange information with a coprocessor 1338 via a high performance interface 1339. In one embodiment, coprocessor 1338 is a special purpose processor, such as a high throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, or the like.

[0194] A shared cache (not shown) may be included in either processor or external to both processors, still connected to the processors via the PP interconnect, so that if the processors are placed in a low power mode, local cache information of one or both processors may be stored in the shared cache.

[0195] Chipset 1390 may be coupled to first bus 1316 via interface 1396. In one embodiment, first bus 1316 may be a peripheral component interconnect (PCI) bus, or a bus such as a PCI Express bus or another third generation I / O interconnect bus, but the scope of the present invention is not limited in this regard.

[0196] like Fig.13 As shown in , various I / O devices 1314 may be coupled to the first bus 1316, while a bus bridge 1318 couples the first bus 1316 to a second bus 1320. In one embodiment, one or more additional processors 1315 (e.g., a coprocessor, a high throughput MIC processor, a GPGPU, an accelerator (e.g., a graphics accelerator or a digital signal processing (DSP) unit), a field programmable gate array, or any other processor) are coupled to the first bus 1316. In one embodiment, the second bus 1320 may be a low pin count (LPC) bus. In one embodiment, various devices may be coupled to the second bus 1320, including, for example, a keyboard and / or mouse 1322, communication devices 1327, and a storage unit 1328 (e.g., a disk drive or other mass storage device) which may include instructions / code and data 1330. In addition, an audio I / O 1324 may be coupled to the second bus 1320. Note that other architectures are possible. For example, a system may implement a multi-drop bus or other such architecture instead of Fig.13 Point-to-point architecture.

[0197] Reference now Fig.14 , shown is a block diagram of a second more specific exemplary system 1400 according to an embodiment of the present invention. Fig.13 and 14 Like elements in the drawings have like reference numerals and are Fig.14 omitted in Fig.13 to avoid blurring certain aspects of Fig.14 other aspects.

[0198] Fig.14 Processors 1370, 1380 are shown to include integrated memory and include I / O control logic ("CL") 1372 and 1382, respectively. Thus, CL 1372, 1382 includes an integrated memory controller unit and includes I / O control logic. Fig.14 Not only are memories 1332, 1334 shown coupled to CL 1372, 1382, but I / O devices 1414 are also shown coupled to control logic 1372, 1382. Legacy I / O devices 1415 are coupled to chipset 1390.

[0199] Reference now Fig.15 , shown is a block diagram of a SoC 1500 according to an embodiment of the present invention. Fig.11 Similar components in the FIG. have similar reference numerals. In addition, dashed boxes are optional features on more advanced SoCs. Fig.15 , the interconnect unit(s) 1502 are coupled to: an application processor 1510, which includes a set of one or more cores 202A-N and a shared cache unit(s) 1106; a system agent unit 1110; a bus controller unit(s) 1116; an integrated memory controller unit(s) 1114; a set of one or more coprocessors 1520, which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 1530; a direct memory access (DMA) unit 1532; and a display unit 1540 for coupling to one or more external displays. In one embodiment, the coprocessor(s) 1520 include a special purpose processor, such as a network or communication processor, a compression engine, a GPGPU, a high throughput MIC processor, an embedded processor, or the like.

[0200] Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementations. Embodiments of the present invention may be implemented as a computer program or program code executed on a programmable system (including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device).

[0201] The program code (e.g. Fig.13 The code 1330 shown in ) is applied to the input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purpose of this application, the processing system includes any system with a processor, such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0202] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. If necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described herein is not limited to the scope of any specific programming language. In any case, language can be a compiled language or an interpreted language.

[0203] One or more aspects of at least one embodiment may be implemented by typical instructions stored on a machine-readable medium, which represent various logics within a processor, which when read by a machine causes the machine to assemble logic to perform the technology described herein. Such typical instructions (referred to as "IP cores") may be stored on a tangible machine-readable medium and provided to various users or manufacturing facilities to be loaded into an assembly machine that actually implements the logic or processor.

[0204] Such machine-readable storage media may include, but are not limited to, a non-transitory tangible arrangement of an article manufactured or formed by a machine or device, including a storage medium such as a hard disk, any other type of magnetic disk (including floppy disks, optical disks, compact disk-read only memory (CD-ROM), compact disk-rewritable (CD-RW), and magneto-optical disks), semiconductor devices (e.g., read-only memory (ROM), random access memory (RAM) (e.g., dynamic random access memory (DRAM), static random access memory (SRAM)), erasable programmable read-only memory (EPROM), flash memory, electrically erasable programmable read-only memory (EEPROM), phase change memory (PCM), magnetic or optical cards), or any other type of medium suitable for storing electronic instructions.

[0205] Therefore, embodiments of the present invention also include non-transitory tangible machine-readable media containing instructions or design data, such as hardware description language (HDL), which define the structures, circuits, devices, processors and / or system features described herein. Such embodiments may also be referred to as program products.

[0206] Emulation (including binary translation, code deformation, etc.)

[0207] In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may translate (e.g., using static binary translation, dynamic binary translation including dynamic compilation), deform, emulate, or otherwise convert instructions to one or more other instructions to be processed by the core. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on the processor, not on the processor, or partially on and partially off the processor.

[0208] Fig.16 1 is a block diagram comparing the use of a software instruction converter for converting binary instructions in a source instruction set into binary instructions in a target instruction set according to an embodiment of the present invention. In the illustrated embodiment, the instruction converter is a software instruction converter, although alternatively the instruction converter may be implemented in software, firmware, hardware, or various combinations thereof. Fig.16 It is shown that a program using a high-level language 1602 can be compiled using an x86 compiler 1604 to generate x86 binary code 1606, which can be executed natively by a processor 1616 having at least one x86 instruction set core. The processor 1616 having at least one x86 instruction set core represents any processor that can perform substantially the same functions as an Intel processor having at least one x86 instruction set core by compatibly executing or otherwise processing both of: (1) a large portion of the instruction set of the Intel x86 instruction set core or (2) an object code version of an application or other software that is targeted to run on an Intel processor having at least one x86 instruction set core to achieve substantially the same results as an Intel processor having at least one x86 instruction set core. The x86 compiler 1604 represents a compiler that can operate to generate x86 binary code 1606 (e.g., object code), which (with or without additional connection processing) can be executed on a processor 1616 having at least one x86 instruction set core. Similarly, Fig.16 It is shown that an alternative instruction set compiler 1608 can be used to compile a program using a high-level language 1602 to generate an alternative instruction set binary code 1610 that can be executed natively by a processor 1614 that does not have at least one x86 instruction set core (e.g., a processor that has a core that executes the MIPS instruction set of MIPS Technologies (Sunnyvale, CA) and / or executes the ARM instruction set of ARM Holdings (Sunnyvale, CA). An instruction converter 1612 is used to convert the x86 binary code 1606 into code that can be executed natively by a processor 1614 that does not have an x86 instruction set core. The converted code is unlikely to be the same as the alternative instruction set binary code 1610 because it is difficult to make an instruction converter that can do so; however, the converted code will perform general operations and be composed of instructions from the alternative instruction set. Therefore, the instruction converter 1612 represents software, firmware, hardware, or a combination thereof that allows a processor or other electronic device that does not have an x86 instruction set processor or core to execute the x86 binary code 1606 through simulation, emulation, or any other process.

[0209] exist Figure 3-4 Optionally, you can also use Figure 1-2 and 5-8 any one of the components, features and details described. In addition, the components, features and details described for any device described herein may also be optionally used in any method described herein and / or applied to any method described herein, and the above method may be performed by such a device and / or with such a device in an embodiment. Any processor described herein may be included in a computer system, system on chip (SoC) or other system disclosed herein. In some embodiments, the instruction may have the features or details of the instruction format disclosed herein, but this is not required.

[0210] In the description and claims, the terms "coupled" and / or "connected" and their derivatives may be used. These terms are not intended to be synonymous with each other. On the contrary, in an embodiment, "connected" may be used to indicate that two or more elements are in direct physical and / or electrical contact with each other. "Coupled" may refer to two or more elements being in direct physical and / or electrical contact with each other. However, "coupled" may also refer to two or more elements not being in direct contact with each other, but still cooperating or interacting with each other. For example, an execution unit may be coupled to a register and / or a decoding unit through one or more intermediate components. In the accompanying drawings, arrows are used to illustrate connections and couplings.

[0211] The term "and / or" may have been used. As used herein, the term "and / or" refers to one or the other or both (eg, A and / or B refers to A or B or both A and B).

[0212] In the foregoing description, specific details have been set forth to provide a thorough understanding of the embodiments. However, other embodiments may be implemented without these specific details. The scope of the present invention is not determined by the specific examples provided above, but rather by the claims that follow. In other instances, well-known circuits, structures, devices, and operations have been illustrated in block diagram form and / or without detail to avoid obscuring the understanding of the description. Where deemed appropriate, reference numerals or the ends of reference numerals are repeated between the drawings to indicate corresponding or similar elements, which may optionally have similar or identical characteristics, unless otherwise specified or clearly apparent.

[0213] Certain operations may be implemented using hardware components, or may be embodied as machine-executable or circuit-executable instructions that may be used to cause and / or result in a machine, circuit, or hardware component (e.g., a processor, a portion of a processor, a circuit, etc.) being programmed to perform the instructions for the operation. Operations may also be optionally performed by a combination of hardware and software. A processor, machine, circuit, or hardware may include specific or particular circuitry or other logic (e.g., hardware that may be combined with firmware and / or software) that is operable to execute and / or process instructions and store results in response to the instructions.

[0214] Some embodiments include articles (e.g., computer program products) containing machine-readable media. The medium may include mechanisms for providing (e.g., storing) machine-readable information. The machine-readable medium may provide (or have stored thereon) instructions or sequences of instructions that, if and / or when executed by a machine, are operable to cause the machine to perform and / or cause the machine to perform one or more operations, methods, or techniques disclosed herein. The machine-readable medium may store or otherwise provide one or more embodiments of the instructions disclosed herein.

[0215] In some embodiments, the machine-readable medium may include a tangible and / or non-transient machine-readable storage medium. For example, a tangible and / or non-transient machine-readable storage medium may include a floppy disk, an optical storage medium, an optical disc, an optical data storage device, a CD-ROM, a magnetic disk, a magneto-optical disk, a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), a random access memory (RAM), a static RAM (SRAM), a dynamic RAM (DRAM), a flash memory, a phase change memory, a phase change data storage material, a non-volatile memory, a non-volatile data storage device, a non-transient memory, a non-transient data storage device, or the like. A non-transient machine-readable storage medium does not contain a transient propagation signal.

[0216] Examples of suitable machines include, but are not limited to, general purpose processors, special purpose processors, instruction processing apparatus, digital logic circuits, integrated circuits, or the like. Other examples of suitable machines include computing devices or other electronic devices including processors, instruction processing apparatus, digital logic circuits, or integrated circuits. Examples of such computing devices and electronic devices include, but are not limited to, desktop computers, laptop computers, notebook computers, tablet computers, netbooks, smart phones, cellular phones, servers, network devices (e.g., routers and switches), mobile Internet devices (MIDs), media players, smart televisions, nettops, set-top boxes, and video game controllers.

[0217] References in this specification to "one embodiment," "an embodiment," "one or more embodiments," "some embodiments," for example, indicate that a particular feature may be included in the practice of the invention, but is not necessarily required. Similarly, in the description, various features are sometimes grouped together into a single embodiment, illustration, or description thereof to streamline the disclosure and aid in understanding the various inventive aspects. However, the method of the present disclosure should not be interpreted as reflecting an intention that the present invention requires more features than are expressly recited in each claim. On the contrary, as reflected in the following claims, inventive aspects lie in less than all features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are expressly incorporated into the specific embodiment, with each claim independently serving as a separate embodiment of the present invention.

[0218] Example Embodiments

[0219] The following examples are applicable to further embodiments. The specific contents in the examples can be used anywhere in one or more embodiments.

[0220] Example 1 is a processor or other device including a decoding unit. The decoding unit is used to decode an SM3 two-round status word update instruction. The SM3 two-round status word update instruction indicates one or more source packet data operands. The one or more source packet data operands have eight 32-bit status words A corresponding to the (j)th round of the SM3 hash algorithm. j , B j , C j , D j 、E j 、F j , G j and H j The one or more source packaged data operands have a set of information sufficient to evaluate two rounds of the SM3 hash algorithm. The processor also includes an execution unit coupled to the decoding unit. In response to the SM3 two-round status word update instruction, the execution unit is operable to store one or more result packaged data operands at one or more destination storage locations indicated by the SM3 two-round status word update instruction. The one or more result packaged data operands have at least four two-round updated 32-bit status words A corresponding to the (j+2)th round of the SM3 hash algorithm. j+2 , B j+2 、E j+2 , and F j+2 .

[0221] Example 2 includes the processor of Example 1, wherein, in response to the instruction, the execution unit is operable to store only four 32-bit status words A after two rounds of updating j+2 , B j+2 、E j+2 , and F j+2 The result of one or more packed data operands.

[0222] Example 3 includes the processor of Example 1, wherein, in response to the instruction, the execution unit is operable to store a 32-bit status word A having eight two-round updates. j+2 , B j+2 , C +2 , D j+2 、E j+2 、F j+2 , G j+2 , and H j+2 One or more result packed data operands, wherein the eight 32-bit status words A updated twice j+2 , B j+2 , C +2 , D j+2 、E j+2 、F j+2 , G j+2 , and H j+2 Corresponding to the (j+2)th round of SM3 hash algorithm.

[0223] Example 4 includes the processor of Example 1, wherein the decode unit is to decode an instruction indicating a first source packed data operand and a second source packed data operand, wherein the first source packed data operand has a 32-bit status word A j , B j 、E j , and F j , the second source packed data operand has a 32-bit status word C j , D j , G j and H j .

[0224] Example 5 includes the processor of Example 4, wherein, in response to the instruction, the execution unit is operable to store a single result packed data operand having only four 32-bit status words A that are updated twice. j+2 , B j+2 、E j+2 , and F j+2 .

[0225] Example 6 includes the processor of Example 5, wherein, in response to the SM3 two pass status word update instruction, the execution unit is operable to store the single result packed data operand in a storage location implicitly used for both the single result packed data operand and the second source packed data operand.

[0226] Example 7 includes the processor of Example 5, wherein the decoding unit is to decode a second instruction indicating a source packed data operand, the source packed data operand having a 32-bit status word A j , B j 、E j , and F j In response to the second instruction, the processor is operable to store the result packed data operand in the destination storage location indicated by the second instruction. The result packed data operand has four 32-bit status words C corresponding to the (j+2)th round of the SM3 hash algorithm after two rounds of updating. j+2 , D j+2 , G j+2 , and H j+2 .

[0227] Example 8 includes the processor of any of Examples 1-7, wherein the decode unit is to decode an instruction indicating one or more source packed data operands, wherein the one or more source packed data operands have one of: four 32-bit messages W j , W j+1 , W j+4 , and W j+5 ; and four 32-bit messages W j , W j+1 , W' j , and W' j+1 .

[0228] Example 9 includes the processor of any of Examples 1-7, wherein the decoding unit is to decode an instruction indicating a round number.

[0229] Example 10 includes the processor of Example 9, wherein the decoding unit is to decode an instruction having an immediate number, wherein the immediate number indicates a round number.

[0230] Example 11 includes the processor of any of Examples 1-7, wherein the decode unit is to decode an instruction indicating three 128-bit source packed data operands, wherein the three 128-bit source packed data operands have eight 32-bit status words A. j , B j , C j , D j 、E j 、F j , G j and H j and a set of messages sufficient to evaluate two rounds of the SM3 hash algorithm.

[0231] Example 12 includes the processor of Example 11, wherein the decode unit is to decode an instruction that explicitly specifies two of the three 128-bit source packed data operands and implicitly indicates one of the three 128-bit source packed data operands. In addition, use of a storage location for both the one of the three 128-bit source packed data operands and also for storing a result packed data operand is implicit, and wherein the processor has a plurality of 256-bit packed data registers.

[0232] Example 13 includes the processor of any of Examples 1-7, wherein the FF of the execution unit for implementing the SM3 hash algorithm j Functions and GG j The logic of at least one of the functions is also used to implement at least one of the Maj functions Ch functions of the secure hash algorithm.

[0233] Example 14 includes the processor of any of Examples 1-7, wherein, in response to the instruction, the execution unit is operable to perform the following operations during each of the two rounds: j Boolean function is evaluated; GG j Boolean functions are evaluated; and P0 permutation functions are evaluated.

[0234] Example 15 is a method in a processor, the method comprising receiving an SM3 two-round status word update instruction indicating one or more source packet data operands. The one or more source packet data operands have eight 32-bit status words A for a (j)th round of the SM3 hash algorithm. j , B j , C j , D j 、E j 、F j , G j and H j , and the one or more source packed data operands have four messages for evaluating two rounds of the SM3 hash algorithm. The method also includes, in response to the SM3 two-round status word update instruction, storing one or more result packed data operands at one or more destination storage locations indicated by the SM3 two-round status word update instruction. The one or more result packed data operands have at least four 32-bit status words A updated by two rounds. j+2 , B j+2 、E j+2 , and F j+2 , the A j+2 , B j+2 、E j+2 , and F j+2 Already relative to A j , B j 、E j , and F j Updated by two rounds of SM3 hashing algorithm.

[0235] Example 16 includes the method of Example 15, wherein the receiving step includes receiving an instruction indicating a round number and indicating one or more source packed data operands, wherein the one or more source packed data operands have one of: four 32-bit messages W j , W j+1 , W j+4 , and W j+5 ; and four 32-bit messages W j , W j+1 , W' j , and W' j+1 .

[0236] Example 17 includes the method of any of Examples 15 and 16, wherein the storing step includes storing a 32-bit status word A having eight updated two rounds. j+2 , B j+2 , C +2 , D j+2 、E j+2 、F j+2 , G j+2 , and H j+2 The result of one or more packed data operands, the A j+2 , B j+2 , C +2 , D j+2 、E j+2 、F j+2 , G j+2 , and H j+2 Has been updated by two rounds of SM3 hashing algorithm.

[0237] Example 18 includes the method of any of Examples 15 and 16, wherein the receiving step includes receiving an instruction indicating a first source packed data operand and indicating a second source packed data operand, wherein the first source packed data operand has a 32-bit status word A. j , B j 、E j , and F j , the second source packed data operand has a 32-bit status word C j , D j , G j and H j .

[0238] Example 19 includes the method of any of Examples 15 and 18, wherein storing comprises storing only four 32-bit status words A that have been updated twice. j+2 , B j+2 、E j+2 , and F j+2 A single result packed data operand.

[0239] Example 20 includes the method of any of Examples 15, 18, and 19, further comprising receiving an indication having a 32-bit status word A j , B j 、E j , and F j The method further includes, in response to the second instruction, storing the resultant packed data operand at the destination storage location indicated by the second instruction. The resultant packed data operand has four 32-bit status words C corresponding to the (j+2)th round of the SM3 hash algorithm and updated by two rounds. j+2 , D j+2 , G j+2 , and H j+2 .

[0240] Example 21 is a system for processing instructions, the system comprising an interconnect and a processor coupled to the interconnect. The processor is configured to receive two round status word update instructions for a hash algorithm. The hash algorithm utilizes a parameter T having a hexadecimal value of 79cc4519 for a first round set and a hexadecimal value of 79cc4519 for a second round set. j The two-round status word update instruction indicates one or more source packet data operands. The one or more source packet data operands have eight 32-bit status words A corresponding to the (j)th round of the hash algorithm. j , B j , C j , D j 、E j 、F j , G j and H j , and the one or more source packed data operands have a set of messages sufficient to evaluate the two-round hash algorithm. In response to the two-round status word update instruction, the processor stores the one or more result packed data operands at one or more destination storage locations indicated by the two-round status word update instruction. The one or more result packed data operands have at least four status words A j+2 , B j+2 、E j+2 , and F j+2 , the A j+2 , B j+2 、E j+2 , and F j+2 The four 32-bit status words A j , B j 、E j , and F j The system further includes a dynamic random access memory (DRAM) coupled to the interconnect. The DRAM stores a set of instructions for implementing the hash algorithm. When the set of instructions is executed by the processor, the processor performs the following operations: using A j , B j 、E j , and F j To generate C j+2 , D j+2 , G j+2 , and H j+2 , the C j+2 , D j+2 , G j+2 , and H j+2 Relative to C j , D j , G j , and H j Updated by two rounds of hashing.

[0241] Example 22 includes the system of Example 21, wherein using A j , B j 、E j , and F j Generate C j+2 , D j+2 , G j+2 , and H j+2 Is the response to a single command.

[0242] Example 23 is an article of manufacture comprising a non-transitory machine-readable storage medium. The non-transitory machine-readable storage medium stores an SM3 two-round status word update instruction. The SM3 two-round status word update instruction indicates one or more source packet data operands. The one or more source packet data operands have eight 32-bit status words A for the (j)th round of the SM3 hash algorithm. j , B j , C j , D j 、E j 、F j , G j and H j , and the one or more source packet data operands have four messages sufficient to evaluate two rounds of the SM3 hash algorithm. When the SM3 two-round status word update instruction is executed by the machine, the machine performs operations including: generating at least four 32-bit status words A after two rounds of update j+2 , B j+2 、E j+2 , and F j+2 , which have been respectively relative to A j , B j 、E j , and F j The operation also includes updating the at least four 32-bit status words A j+2 , B j+2 、E j+2 , and F j+2 Stored in one or more destination storage locations indicated by the SM3 two-round status word update instruction.

[0243] Example 24 includes the article of Example 23, wherein storing comprises storing at least four 32-bit status words A j+2 , B j+2 、E j+2 , and F j+2 stored in a 128-bit register, and wherein the storage medium further includes instructions that, when executed by a machine, cause the machine to perform the following operations: j , B j 、E j , and F j Generates four 32-bit status words C that are updated in two rounds j+2 , D j+2 , G j+2 , and H j+2 .

[0244] Example 25 includes a processor or other apparatus operable to perform the method of any of Examples 15-20.

[0245] Example 26 includes a processor or other device of a device operable to perform the method of any of Examples 15-20.

[0246] Example 27 includes a processor comprising any combination of method modules, units, logic, circuits, and means for performing any of Examples 15-20.

[0247] Example 28 includes an article of manufacture comprising an optional non-transitory machine-readable medium that optionally stores or otherwise provides instructions that, if and / or when executed by a processor, computer system, or other machine, are operable to cause the machine to perform the method of any of Examples 15-20.

[0248] Example 29 includes a computer system or other electronic device comprising an interconnect, a processor such as any of Examples 1-14 coupled to the interconnect, and at least one component selected from the following coupled to the interconnect: dynamic random access memory (DRAM), a network interface, a graphics chip, a wireless communication chip, a Global System for Mobile Communications (GSM) antenna, a phase change memory, and a video camera.

[0249] Example 30 comprises a processor or other apparatus substantially as described herein.

[0250] Example 31 includes a processor or other apparatus operable to perform any method substantially as described herein.

[0251] Example 32 includes a processor or other apparatus comprising means for performing any method substantially as described herein.

[0252] Example 33 includes a processor or other device operable to execute any SM3 hash function acceleration instructions substantially as described herein.

[0253] Example 34 includes a processor or other device comprising means for executing any SM3 hash function acceleration instructions substantially as described herein.

[0254] Example 35 includes a processor or other device containing a decoding unit, wherein the decoding unit is operable to decode instructions of a first instruction set. The decoding unit receives one or more instructions that simulate a first instruction, which can be any SM3 hash algorithm acceleration instruction substantially as disclosed herein, and it will be of a second instruction set. The processor or other device also includes one or more execution units coupled to the decoding unit for executing one or more instructions of the first instruction set. In response to one or more instructions of the first instruction set, the one or more execution units are operable to store the result in a destination. The result may include any result for the first instruction substantially as disclosed herein.

[0255] Example 36 includes a computer system or other electronic device containing a processor, wherein the processor has a decoding unit operable to decode instructions of a first instruction set and has one or more execution units. The computer system also includes a storage device coupled to the processor. The storage device stores a first instruction, which can be any SM3 hash algorithm acceleration instruction substantially as disclosed herein, and it will be of a second instruction set. The storage device also stores instructions for converting the first instruction into one or more instructions of the first instruction set. When the one or more instructions of the first instruction set are executed by the processor, it is operable to cause the processor to store the result in a destination. The result may include any result for the first instruction substantially as disclosed herein.

Claims

1. A processor for processing instructions, comprising: a decoding unit, configured to decode an instruction, wherein the instruction includes a first SM3 message extension instruction and a second SM3 message extension instruction, wherein the first SM3 message extension instruction is used to execute a first part of the SM3 message extension, and the second SM3 message extension instruction is used to execute a subsequent second part of the SM3 message extension, The first SM3 message extension instruction has a first field, a second field and a third field, the first field is used to specify a first 128-bit SIMD source register, the second field is used to specify a second 128-bit SIMD source register, and the third field is used to specify a third 128-bit SIMD source register. The first 128-bit SIMD source register is used to store a first operand, the first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register is used to store a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and The third 128-bit SIMD source register is used to store a third operand, the third operand having a ninth 32-bit data element, a tenth 32-bit data element and an eleventh 32-bit data element, and an execution unit coupled to the decoding unit, the execution unit being configured to execute the first SM3 message extension instruction to: Generates results with the following items: a first 32-bit result data element in bits [31:0], equivalent to evaluating the permutation function with a first value, the first value being equivalent to the first 32-bit data element being XORed with the fifth 32-bit data element and XORed with the ninth 32-bit data element rotated left by 15 bits, the first value being equivalent to evaluating the permutation function with the first value being XORed with the first value rotated left by 15 bits and XORed with the first value rotated left by 23 bits; the second 32-bit result data element in bits [63:32] is equivalent to evaluating the permutation function with a second value, which is equivalent to the second 32-bit data element XORed with the sixth 32-bit data element and XORed with the tenth 32-bit data element rotated left by 15 bits, which is equivalent to evaluating the permutation function with the second value XORed with the second value rotated left by 15 bits and XORed with the second value rotated left by 23 bits; a third 32-bit result data element in bits [95:64] being equivalent to evaluating the permutation function with a third value, the third value being equivalent to the third 32-bit data element being XORed with the seventh 32-bit data element and with the eleventh 32-bit data element rotated left by 15 bits, the third value being equivalent to evaluating the permutation function with the third value being XORed with the third value rotated left by 15 bits and with the third value rotated left by 23 bits; and a fourth 32-bit result data element in bits [127:96] is equivalent to evaluating the permutation function with a fourth value, the fourth value being evaluated based on the fourth 32-bit data element XORed with the eighth 32-bit data element, the fourth value being equivalent to evaluating the permutation function with the fourth value XORed with the fourth value rotated left by 15 bits and XORed with the fourth value rotated left by 23 bits; and The results are stored at the destination.

2. The processor of claim 1, wherein: The first part of the SM3 message extension is to generate the first parts of four SM3 messages for four consecutive rounds.

3. The processor of claim 1, wherein: The decoding unit is also used to decode multiple instructions to speed up the SM3 hash round.

4. The processor of claim 1, wherein: The destination is one of the first 128-bit SIMD source register, the second 128-bit SIMD source register, and the third 128-bit SIMD source register.

5. The processor according to any one of claims 1 to 4, wherein: The processor is a Reduced Instruction Set Computing (RISC) processor.

6. The processor according to any one of claims 1 to 4, further comprising: Register renaming logic; as well as Instruction Translation Lookaside Buffer (TLB).

7. The processor according to any one of claims 1 to 4, further comprising: Data caching; Instruction cache; as well as A level 2 (L2) cache is coupled to the data cache and to the instruction cache.

8. A system for processing instructions, comprising: Processor, including: a decoding unit, configured to decode an instruction, wherein the instruction includes a first SM3 message extension instruction and a second SM3 message extension instruction, wherein the first SM3 message extension instruction is used to execute a first part of the SM3 message extension, and the second SM3 message extension instruction is used to execute a subsequent second part of the SM3 message extension, The first SM3 message extension instruction has a first field, a second field and a third field, the first field is used to specify a first 128-bit SIMD source register, the second field is used to specify a second 128-bit SIMD source register, and the third field is used to specify a third 128-bit SIMD source register. The first 128-bit SIMD source register is used to store a first operand, the first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register is used to store a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and The third 128-bit SIMD source register is used to store a third operand, the third operand having a ninth 32-bit data element, a tenth 32-bit data element and an eleventh 32-bit data element, and an execution unit coupled to the decoding unit, the execution unit being configured to execute the first SM3 message extension instruction to: Generates results with the following items: a first 32-bit result data element in bits [31:0], equivalent to evaluating the permutation function with a first value, the first value being equivalent to the first 32-bit data element being XORed with the fifth 32-bit data element and XORed with the ninth 32-bit data element rotated left by 15 bits, the first value being equivalent to evaluating the permutation function with the first value being XORed with the first value rotated left by 15 bits and XORed with the first value rotated left by 23 bits; the second 32-bit result data element in bits [63:32] is equivalent to evaluating the permutation function with a second value, which is equivalent to the second 32-bit data element XORed with the sixth 32-bit data element and XORed with the tenth 32-bit data element rotated left by 15 bits, which is equivalent to evaluating the permutation function with the second value XORed with the second value rotated left by 15 bits and XORed with the second value rotated left by 23 bits; a third 32-bit result data element in bits [95:64] being equivalent to evaluating the permutation function with a third value, the third value being equivalent to the third 32-bit data element being XORed with the seventh 32-bit data element and with the eleventh 32-bit data element rotated left by 15 bits, the third value being equivalent to evaluating the permutation function with the third value being XORed with the third value rotated left by 15 bits and with the third value rotated left by 23 bits; and a fourth 32-bit result data element in bits [127:96] is equivalent to evaluating the permutation function with a fourth value, the fourth value being evaluated based on the fourth 32-bit data element XORed with the eighth 32-bit data element, the fourth value being equivalent to evaluating the permutation function with the fourth value XORed with the fourth value rotated left by 15 bits and XORed with the fourth value rotated left by 23 bits; and storing the results at a destination; and A memory controller is coupled to the processor.

9. The system of claim 8, wherein: The first part of the SM3 message extension is to generate the first parts of four SM3 messages for four consecutive rounds.

10. The system of claim 8, wherein: The decoding unit is also used to decode multiple instructions to speed up the SM3 hash round.

11. The system of claim 8, wherein: The destination is one of the first 128-bit SIMD source register, the second 128-bit SIMD source register, and the third 128-bit SIMD source register.

12. The system of claim 8, wherein: The processor is a Reduced Instruction Set Computing (RISC) processor.

13. The system of any one of claims 8 to 12, further comprising a graphics processor coupled to the processor.

14. The system of any one of claims 8 to 12, further comprising a system memory coupled to the memory controller, wherein: The system memory includes dynamic random access memory (DRAM).

15. The system of any one of claims 8 to 12, further comprising a Peripheral Component Interconnect (PCI) Express bus coupled to the processor.

16. The system of any one of claims 8 to 12, further comprising a mass storage device coupled to the processor.

17. The system of any one of claims 8 to 12, further comprising a communication device coupled to the processor.

18. A method for processing an instruction, comprising: Decoding an instruction, the instruction comprising a first SM3 message extension instruction and a second SM3 message extension instruction, the first SM3 message extension instruction being used to execute a first part of the SM3 message extension, the second SM3 message extension instruction being used to execute a subsequent second part of the SM3 message extension, The first SM3 message extension instruction has a first field, a second field and a third field, the first field specifies a first 128-bit SIMD source register, the second field specifies a second 128-bit SIMD source register, and the third field specifies a third 128-bit SIMD source register. The first 128-bit SIMD source register stores a first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register stores a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and The third 128-bit SIMD source register stores a third operand, the third operand having a ninth 32-bit data element, a tenth 32-bit data element, and an eleventh 32-bit data element, and Executing the first SM3 message extension instruction includes: Generates results with the following items: a first 32-bit result data element in bits [31:0], equivalent to evaluating the permutation function with a first value, the first value being equivalent to the first 32-bit data element being XORed with the fifth 32-bit data element and XORed with the ninth 32-bit data element rotated left by 15 bits, the first value being equivalent to evaluating the permutation function with the first value being XORed with the first value rotated left by 15 bits and XORed with the first value rotated left by 23 bits; the second 32-bit result data element in bits [63:32] is equivalent to evaluating the permutation function with a second value, which is equivalent to the second 32-bit data element XORed with the sixth 32-bit data element and XORed with the tenth 32-bit data element rotated left by 15 bits, which is equivalent to evaluating the permutation function with the second value XORed with the second value rotated left by 15 bits and XORed with the second value rotated left by 23 bits; a third 32-bit result data element in bits [95:64] being equivalent to evaluating the permutation function with a third value, the third value being equivalent to the third 32-bit data element being XORed with the seventh 32-bit data element and with the eleventh 32-bit data element rotated left by 15 bits, the third value being equivalent to evaluating the permutation function with the third value being XORed with the third value rotated left by 15 bits and with the third value rotated left by 23 bits; and a fourth 32-bit result data element in bits [127:96] is equivalent to evaluating the permutation function with a fourth value, the fourth value being evaluated based on the fourth 32-bit data element XORed with the eighth 32-bit data element, the fourth value being equivalent to evaluating the permutation function with the fourth value XORed with the fourth value rotated left by 15 bits and XORed with the fourth value rotated left by 23 bits; and The results are stored at the destination.

19. The method of claim 18, wherein: The first part of the SM3 message extension is to generate the first parts of four SM3 messages for four consecutive rounds.

20. The method of claim 18, further comprising: Decode multiple instructions to speed up the SM3 hash round.

21. The method according to any one of claims 18 to 20, wherein: Storing the result at the destination comprises storing the result in one of the first 128-bit SIMD source register, the second 128-bit SIMD source register, and the third 128-bit SIMD source register, and the method further comprises: renaming registers using register renaming logic; and Access the instruction translation lookaside buffer (TLB).

22. A processor for processing an instruction, comprising: a decoding unit, configured to decode an instruction, wherein the instruction includes a first SM3 message extension instruction and a second SM3 message extension instruction, wherein the first SM3 message extension instruction is used to execute a first part of the SM3 message extension, and the second SM3 message extension instruction is used to execute a subsequent second part of the SM3 message extension, The second SM3 message extension instruction has a first field, a second field and a third field, the first field is used to specify a first 128-bit SIMD source register, the second field is used to specify a second 128-bit SIMD source register, and the third field is used to specify a third 128-bit SIMD source register. The first 128-bit SIMD source register is used to store a first operand, the first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register is used to store a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and the third 128-bit SIMD source register being used to store a third operand having a ninth 32-bit data element in bits [31:0], a tenth 32-bit data element in bits [63:32], an eleventh 32-bit data element in bits [95:64], and a twelfth 32-bit data element in bits [127:96], and an execution unit coupled to the decoding unit, the execution unit being configured to execute the second SM3 message extension instruction to: Generates results with the following items: a first 32-bit result data element in bits [31:0], which is equivalent to the fifth 32-bit data element rotated left by 7 bits, XORed with the ninth 32-bit data element and XORed with the first 32-bit data element; The second 32-bit result data element in bits [63:32] is equivalent to the sixth 32-bit data element rotated left by 7 bits XORed with the tenth 32-bit data element and XORed with the second 32-bit data element; a third 32-bit resultant data element in bits [95:64], which is equivalent to the seventh 32-bit data element rotated left by 7 bits XORed with the eleventh 32-bit data element and XORed with the third 32-bit data element; and the fourth 32-bit result data element in bits [127:96] is equivalent to the eighth 32-bit data element rotated left by 7 bits XORed with the twelfth 32-bit data element, XORed with the fourth 32-bit data element, XORed with a value rotated left by 6 bits, XORed with the value rotated left by 15 bits, and XORed with the value rotated left by 30 bits, wherein the values ​​are evaluated based on at least the XORed of the fifth 32-bit data element rotated left by 7 bits and the ninth 32-bit data element; and The results are stored at the destination.

23. The processor of claim 22, wherein: The second part of the SM3 message extension is to generate the second parts of four SM3 messages for four consecutive rounds.

24. The processor of claim 22, wherein: The decoding unit is also used to decode multiple instructions to speed up the SM3 hash round.

25. The processor of claim 22, wherein: The destination is the first 128-bit SIMD source register.

26. A processor as claimed in any one of claims 22 to 25, wherein: The processor is a Reduced Instruction Set Computing (RISC) processor.

27. The processor of any one of claims 22 to 25, further comprising: Register renaming logic; as well as Instruction Translation Lookaside Buffer (TLB).

28. The processor of any one of claims 22 to 25, further comprising: Data caching; Instruction cache; as well as A level 2 (L2) cache is coupled to the data cache and to the instruction cache.

29. A method for processing an instruction, comprising: Decoding an instruction, the instruction comprising a first SM3 message extension instruction and a second SM3 message extension instruction, the first SM3 message extension instruction being used to execute a first part of the SM3 message extension, the second SM3 message extension instruction being used to execute a subsequent second part of the SM3 message extension, The second SM3 message extension instruction has a first field, a second field and a third field, the first field specifies a first 128-bit SIMD source register, the second field specifies a second 128-bit SIMD source register, and the third field specifies a third 128-bit SIMD source register. The first 128-bit SIMD source register stores a first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register stores a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and The third 128-bit SIMD source register stores a third operand having a ninth 32-bit data element in bits [31:0], a tenth 32-bit data element in bits [63:32], an eleventh 32-bit data element in bits [95:64], and a twelfth 32-bit data element in bits [127:96], and Executing the second SM3 message extension instruction includes: Generates results with the following items: a first 32-bit result data element in bits [31:0], which is equivalent to the fifth 32-bit data element rotated left by 7 bits, XORed with the ninth 32-bit data element and XORed with the first 32-bit data element; The second 32-bit result data element in bits [63:32] is equivalent to the sixth 32-bit data element rotated left by 7 bits XORed with the tenth 32-bit data element and XORed with the second 32-bit data element; a third 32-bit resultant data element in bits [95:64], which is equivalent to the seventh 32-bit data element rotated left by 7 bits XORed with the eleventh 32-bit data element and XORed with the third 32-bit data element; and the fourth 32-bit result data element in bits [127:96] is equivalent to the eighth 32-bit data element rotated left by 7 bits XORed with the twelfth 32-bit data element, XORed with the fourth 32-bit data element, XORed with a value rotated left by 6 bits, XORed with the value rotated left by 15 bits, and XORed with the value rotated left by 30 bits, wherein the values ​​are evaluated based on at least the XORed of the fifth 32-bit data element rotated left by 7 bits and the ninth 32-bit data element; and The results are stored at the destination.

30. The method of claim 29, wherein: Generating the result includes generating four SM3 messages for four consecutive rounds.

31. The method of claim 29, further comprising: Decode multiple instructions to speed up the SM3 hash round.

32. The method of any one of claims 29 to 31, wherein: Storing the result at the destination includes storing the result in the first 128-bit SIMD source register.

33. The method of any one of claims 29 to 31, further comprising: renaming registers using register renaming logic; and The translations are stored in the instruction translation lookaside buffer (TLB).

34. A system for processing instructions, comprising: Processor, including: a decoding unit, configured to decode an instruction, wherein the instruction includes a first SM3 message extension instruction and a second SM3 message extension instruction, wherein the first SM3 message extension instruction is used to execute a first part of the SM3 message extension, and the second SM3 message extension instruction is used to execute a subsequent second part of the SM3 message extension, The second SM3 message extension instruction has a first field, a second field and a third field, the first field is used to specify a first 128-bit SIMD source register, the second field is used to specify a second 128-bit SIMD source register, and the third field is used to specify a third 128-bit SIMD source register. The first 128-bit SIMD source register is used to store a first operand, the first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register is used to store a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and the third 128-bit SIMD source register being used to store a third operand having a ninth 32-bit data element in bits [31:0], a tenth 32-bit data element in bits [63:32], an eleventh 32-bit data element in bits [95:64], and a twelfth 32-bit data element in bits [127:96], and an execution unit coupled to the decoding unit, the execution unit being configured to execute the second SM3 message extension instruction to: Generates results with the following items: a first 32-bit result data element in bits [31:0], which is equivalent to the fifth 32-bit data element rotated left by 7 bits, XORed with the ninth 32-bit data element and XORed with the first 32-bit data element; The second 32-bit result data element in bits [63:32] is equivalent to the sixth 32-bit data element rotated left by 7 bits XORed with the tenth 32-bit data element and XORed with the second 32-bit data element; a third 32-bit resultant data element in bits [95:64], which is equivalent to the seventh 32-bit data element rotated left by 7 bits XORed with the eleventh 32-bit data element and XORed with the third 32-bit data element; and the fourth 32-bit result data element in bits [127:96] is equivalent to the eighth 32-bit data element rotated left by 7 bits XORed with the twelfth 32-bit data element, XORed with the fourth 32-bit data element, XORed with a value rotated left by 6 bits, XORed with the value rotated left by 15 bits, and XORed with the value rotated left by 30 bits, wherein the values ​​are evaluated based on at least the XORed of the fifth 32-bit data element rotated left by 7 bits and the ninth 32-bit data element; and storing the results at a destination; and A memory controller is coupled to the processor.

35. The system of claim 34, wherein: The second part of the SM3 message extension is to generate the second parts of four SM3 messages for four consecutive rounds.

36. The system of claim 34, wherein: The decoding unit is also used to decode multiple instructions to speed up the SM3 hash round.

37. The system of claim 34, wherein: The destination is the first 128-bit SIMD source register.

38. The system of claim 34, wherein: The processor is a Reduced Instruction Set Computing (RISC) processor.

39. The system of claim 34, wherein: The processor further comprises: Register renaming logic; and Instruction Translation Lookaside Buffer (TLB).

40. The system of any one of claims 34 to 39, further comprising a graphics processor coupled to the processor.

41. The system of any one of claims 34 to 39, further comprising a system memory coupled to the memory controller, wherein: The system memory includes dynamic random access memory (DRAM).

42. The system of any one of claims 34 to 39, further comprising a Peripheral Component Interconnect (PCI) Express bus coupled to the processor.

43. The system of any one of claims 34 to 39, further comprising a mass storage device coupled to the processor.

44. The system of any one of claims 34 to 39, further comprising a communication device coupled to the processor.

45. A machine-readable medium storing instructions, which, when executed by a processor, cause the processor to perform the method according to any one of claims 18-21, 29-33.

46. ​​An apparatus for processing an instruction, comprising: means for decoding an instruction, the instruction comprising a first SM3 message extension instruction and a second SM3 message extension instruction, the first SM3 message extension instruction being used to execute a first part of the SM3 message extension, the second SM3 message extension instruction being used to execute a subsequent second part of the SM3 message extension, The first SM3 message extension instruction has a first field, a second field and a third field, the first field specifies a first 128-bit SIMD source register, the second field specifies a second 128-bit SIMD source register, and the third field specifies a third 128-bit SIMD source register. The first 128-bit SIMD source register stores a first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register stores a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and The third 128-bit SIMD source register stores a third operand, the third operand having a ninth 32-bit data element, a tenth 32-bit data element, and an eleventh 32-bit data element, and The device for executing the first SM3 message extension instruction includes: Means for generating a result having: a first 32-bit result data element in bits [31:0], equivalent to evaluating the permutation function with a first value, the first value being equivalent to the first 32-bit data element being XORed with the fifth 32-bit data element and XORed with the ninth 32-bit data element rotated left by 15 bits, the first value being equivalent to evaluating the permutation function with the first value being XORed with the first value rotated left by 15 bits and XORed with the first value rotated left by 23 bits; the second 32-bit result data element in bits [63:32] is equivalent to evaluating the permutation function with a second value, which is equivalent to the second 32-bit data element XORed with the sixth 32-bit data element and XORed with the tenth 32-bit data element rotated left by 15 bits, which is equivalent to evaluating the permutation function with the second value XORed with the second value rotated left by 15 bits and XORed with the second value rotated left by 23 bits; a third 32-bit result data element in bits [95:64] being equivalent to evaluating the permutation function with a third value, the third value being equivalent to the third 32-bit data element being XORed with the seventh 32-bit data element and with the eleventh 32-bit data element rotated left by 15 bits, the third value being equivalent to evaluating the permutation function with the third value being XORed with the third value rotated left by 15 bits and with the third value rotated left by 23 bits; and a fourth 32-bit result data element in bits [127:96], equivalent to evaluating the permutation function with a fourth value, the fourth value being evaluated based on the fourth 32-bit data element XORed with the eighth 32-bit data element, the fourth value being equivalent to evaluating the permutation function with the fourth value XORed with the fourth value rotated left by 15 bits and XORed with the fourth value rotated left by 23 bits; and means for storing said results at a destination.

47. The apparatus of claim 46, wherein: The first part of the SM3 message extension is to generate the first parts of four SM3 messages for four consecutive rounds.

48. The apparatus of claim 46, further comprising: Device for decoding multiple instructions to speed up the SM3 hash wheel.

49. Apparatus as claimed in any one of claims 46 to 48, wherein Storing the result at the destination comprises storing the result in one of the first 128-bit SIMD source register, the second 128-bit SIMD source register, and the third 128-bit SIMD source register, and the apparatus further comprises: means for renaming registers; and Means for accessing an instruction translation lookaside buffer (TLB).

50. An apparatus for processing an instruction, comprising: means for decoding an instruction, the instruction comprising a first SM3 message extension instruction and a second SM3 message extension instruction, the first SM3 message extension instruction being used to execute a first part of the SM3 message extension, the second SM3 message extension instruction being used to execute a subsequent second part of the SM3 message extension, The second SM3 message extension instruction has a first field, a second field and a third field, the first field specifies a first 128-bit SIMD source register, the second field specifies a second 128-bit SIMD source register, and the third field specifies a third 128-bit SIMD source register. The first 128-bit SIMD source register stores a first operand having a first 32-bit data element in bits [31:0], a second 32-bit data element in bits [63:32], a third 32-bit data element in bits [95:64], and a fourth 32-bit data element in bits [127:96], The second 128-bit SIMD source register stores a second operand having a fifth 32-bit data element in bits [31:0], a sixth 32-bit data element in bits [63:32], a seventh 32-bit data element in bits [95:64], and an eighth 32-bit data element in bits [127:96], and The third 128-bit SIMD source register stores a third operand having a ninth 32-bit data element in bits [31:0], a tenth 32-bit data element in bits [63:32], an eleventh 32-bit data element in bits [95:64], and a twelfth 32-bit data element in bits [127:96], and The device for executing the second SM3 message extension instruction includes: Means for generating a result having: a first 32-bit result data element in bits [31:0], which is equivalent to the fifth 32-bit data element rotated left by 7 bits, XORed with the ninth 32-bit data element and XORed with the first 32-bit data element; The second 32-bit result data element in bits [63:32] is equivalent to the sixth 32-bit data element rotated left by 7 bits XORed with the tenth 32-bit data element and XORed with the second 32-bit data element; a third 32-bit resultant data element in bits [95:64], which is equivalent to the seventh 32-bit data element rotated left by 7 bits XORed with the eleventh 32-bit data element and XORed with the third 32-bit data element; and a fourth 32-bit result data element in bits [127:96] being equivalent to the eighth 32-bit data element rotated left by 7 bits XORed with the twelfth 32-bit data element, XORed with the fourth 32-bit data element, XORed with a value rotated left by 6 bits, XORed with the value rotated left by 15 bits, and XORed with the value rotated left by 30 bits, wherein the values ​​are evaluated based on at least the XORed of the fifth 32-bit data element rotated left by 7 bits and the ninth 32-bit data element; and means for storing said results at a destination.

51. The apparatus of claim 50, wherein: Generating the result includes generating four SM3 messages for four consecutive rounds.

52. The apparatus of claim 50, further comprising: Device for decoding multiple instructions to speed up the SM3 hash wheel.

53. Apparatus as claimed in any one of claims 50 to 52, wherein: Storing the result at the destination includes storing the result in the first 128-bit SIMD source register.

54. The apparatus of any one of claims 50 to 52, further comprising: A facility for renaming registers; as well as A device used to store translations in the instruction translation lookaside buffer (TLB).

Citation Information

Patent Citations

  • Rotate then operate on selected bits facility and instructions therefore

    CN101911015A

  • Method and apparatus to process KECCAK secure hashing algorithm

    CN103946796A

  • Packed Rotate Processors, Methods, Systems, And Instructions

    CN104011652A

  • Method and apparatus to process sha-1 secure hashing algorithm

    CN104012032A

  • Processor and method for implementing instruction support for hash algorithms

    US20100250966A1