TWI599953B - Method and apparatus for performing big-integer arithmetic operations - Google Patents

Method and apparatus for performing big-integer arithmetic operations Download PDF

Info

Publication number
TWI599953B
TWI599953B TW104138329A TW104138329A TWI599953B TW I599953 B TWI599953 B TW I599953B TW 104138329 A TW104138329 A TW 104138329A TW 104138329 A TW104138329 A TW 104138329A TW I599953 B TWI599953 B TW I599953B
Authority
TW
Taiwan
Prior art keywords
bit
processor
field
instruction
register
Prior art date
Application number
TW104138329A
Other languages
Chinese (zh)
Other versions
TW201719388A (en
Inventor
夏 葛隆
弗拉德 卡司諾
Original Assignee
英特爾股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 英特爾股份有限公司 filed Critical 英特爾股份有限公司
Priority to TW104138329A priority Critical patent/TWI599953B/en
Publication of TW201719388A publication Critical patent/TW201719388A/en
Application granted granted Critical
Publication of TWI599953B publication Critical patent/TWI599953B/en

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

用以執行大整數算數運算之方法及裝置 Method and apparatus for performing large integer arithmetic operations

本發明大致關於電腦處理器領域。更特別地,本發明關於用於執行大整數算數運算之方法及裝置。 The present invention generally relates to the field of computer processors. More particularly, the present invention relates to methods and apparatus for performing large integer arithmetic operations.

指令集、或是指令集架構(ISA)是電腦架構的一部份,所述電腦架構的一部份是與程式化有關、包含本體資料型式、指令、暫存器架構、定址模式、記憶體架構、中斷及例外處理、以及外部輸入及輸出(I/O)。應注意,指令一詞於此大致上意指巨集指令,其是提供給處理器用於執行的指令,巨集指令係與微指令或微作業(微op)相反的,微指令或微作業是將巨集指令解碼之處理器的解碼器的結果。微指令或微作業可以配置成指令處理器上的執行單元執行作業以實施與巨集指令相關的邏輯。 An instruction set, or an instruction set architecture (ISA), is part of a computer architecture. Part of the computer architecture is related to stylization, including ontology data types, instructions, scratchpad architecture, addressing mode, and memory. Architecture, interrupt and exception handling, and external input and output (I/O). It should be noted that the term instruction generally refers to a macro instruction, which is an instruction provided to the processor for execution. The macro instruction is opposite to the micro instruction or micro-op (micro-op), and the micro-instruction or micro-job is The result of the decoder of the processor that decodes the macro instruction. A microinstruction or microjob may be configured to execute an operation on an execution unit on an instruction processor to implement logic associated with the macro instruction.

ISA與用以實施指令集的處理器的處理器設計技術集之微架構有所區別。設有不同微架構的處理器共用共同的指令集。舉例而言,Intel® Pentium 4處理器、Intel® CoreTM處理器、及來自加州太陽谷的超微公司的處理器實 施幾乎相同版本的x86指令集(某些程度上增加更新的版本),但具有不同的內部設計。舉例而言,在使用習知的技術之不同微架構中,以不同方式實施相同的ISA暫存器架構,其包含專用的實體暫存器、使用暫存器重命名機制(例如使用暫存器別名表(RAT)、重排序緩衝器(ROB)及退出暫存器檔案。除非另外指明,否則,此處使用暫存器架構、暫存器檔案、及暫存器之文句以表示軟體/程式人員可看到者、及指令指明暫存器的方式。在需要明確性的情形中,將使用形容詞「邏輯的」、「架構的」、或「軟體可看見的」來表示暫存器架構中的暫存器/檔案,而不同的形容詞會被用以指明給定的微架構中的目的地暫存器(例如,實體暫存器、重排序緩衝器、退出暫存器、暫存器池)。 The ISA differs from the microarchitecture of the processor design technology set of the processor used to implement the instruction set. Processors with different microarchitectures share a common instruction set. For example, almost the same version of the Intel ® Pentium 4 processor embodiment processor, Intel ® Core TM processors, and Advanced Micro Devices Inc. of Sun Valley, California from the x86 instruction set (updated version increased to some extent), but Has a different internal design. For example, in different microarchitectures using conventional techniques, the same ISA scratchpad architecture is implemented in different ways, including a dedicated physical scratchpad, using a scratchpad renaming mechanism (eg, using a scratchpad alias) Table (RAT), reorder buffer (ROB), and exit register file. Unless otherwise specified, the scratchpad architecture, scratchpad file, and scratchpad statements are used here to represent software/programmers. The way the viewer can be seen and the instructions indicate the scratchpad. In cases where clarity is required, the adjectives "logical", "architectural", or "software visible" will be used to represent the scratchpad architecture. A scratchpad/file, and different adjectives are used to indicate the destination scratchpad in a given microarchitecture (eg, physical scratchpad, reorder buffer, exit scratchpad, scratchpad pool) .

指令集包含一或更多指令格式。給定的指令格式界定不同的欄位(位元數目、位元位置)以特別指明要被執行的作業(作業碼)以及作業要於其上執行的運算元。某些指令格式可以經由指令樣板(或副子令格式)的界定而進一步分解。舉例而言,給定的指令格式的指令樣板可以被界定為具有不同子集合的指令格式欄位(所包含的多個欄位典型上是相同次序,但是,因為有較少的欄位被包含,所以,至少某些欄位具有不同的位元位置)及/或被界定為具有被不同解譯的給定欄位。使用給定的指令格式(以及,假使被界定時,在該指令格式的多個指令樣板中的給定之一中)以表示給定的指令,以及,指明作業及運算 元。指令串是特定的指令序列,其中,在序列中的各指令是依指令格式的指令之存在(以及,假使被界定時,是該指令格式的多個指令樣板中的給定之一)。 The instruction set contains one or more instruction formats. A given instruction format defines different fields (number of bits, bit positions) to specify the job (job code) to be executed and the operand on which the job is to be executed. Some instruction formats can be further decomposed by the definition of the instruction template (or the sub-context format). For example, a command template for a given instruction format can be defined as an instruction format field with a different subset (the multiple fields included are typically in the same order, but because there are fewer fields to include So, at least some of the fields have different bit positions) and/or are defined as having a given field that is interpreted differently. Use the given instruction format (and, if specified, in one of a given number of instruction templates in the instruction format) to represent the given instruction, and to specify the job and operation yuan. An instruction string is a specific sequence of instructions in which each instruction in the sequence is an instruction in the instruction format (and, if defined, one of a given number of instruction templates in the instruction format).

300‧‧‧暫存器架構 300‧‧‧Scratchpad Architecture

310‧‧‧向量暫存器 310‧‧‧Vector register

315‧‧‧寫入遮罩暫存器 315‧‧‧Write mask register

325‧‧‧一般用途暫存器 325‧‧‧General Purpose Register

345‧‧‧純量浮點堆疊暫存器檔案 345‧‧‧Simplified floating point stack register file

350‧‧‧MMX緊縮整數平坦暫存器檔案 350‧‧‧MMX Compact Integer Flat Register File

400‧‧‧管線 400‧‧‧ pipeline

490‧‧‧核心 490‧‧‧ core

600‧‧‧處理器 600‧‧‧ processor

700‧‧‧系統 700‧‧‧ system

800‧‧‧系統 800‧‧‧ system

900‧‧‧系統 900‧‧‧ system

1000‧‧‧系統晶片 1000‧‧‧System Chip

1200‧‧‧主記憶體 1200‧‧‧ main memory

1231‧‧‧256位元乘法指令解碼邏輯 1231‧‧‧256-bit multiplication instruction decoding logic

1241‧‧‧256位元乘法指令執行邏輯 1241‧‧‧256-bit multiplication instruction execution logic

1255‧‧‧處理器 1255‧‧‧ processor

1300‧‧‧256位元乘法邏輯 1300‧‧‧256 bit multiplication logic

1303‧‧‧目的地暫存器 1303‧‧‧ Destination Register

從配合下述附圖的詳細說明,將可以更佳地瞭解本發明。 The invention will be better understood from the following detailed description of the drawings.

圖1A及1B是方塊圖,顯示根據本發明的實施例之泛型向量友善指令格式及其指令樣板;圖2A-D是方塊圖,顯示根據本發明的實施例之舉例說明的特定向量友善指令格式;圖3是根據本發明的一實施例之暫存器架構的方塊圖;圖4A是方塊圖,顯示根據本發明的實施例之舉例說明的有序提取、解碼、退出管線及舉例說明的暫存器重命名、亂序議題/執行管線;圖4B是方塊圖,顯示根據本發明的實施例之包含在處理器中的有序提取、解碼、退出核心及舉例說明的暫存器重命名、亂序議題/執行架構核心;圖5A是方塊圖,顯示單一核心、與其與晶粒上互連網路的連接;圖5B顯示根據本發明的實施例之圖5A的部份處理器核心的放大視圖;圖6是方塊圖,顯示根據本發明的實施例之單核心處 理器及具有集成的圖形和記憶體控制器之多核心處理器;圖7顯示根據本發明的一實施例之系統的方塊圖;圖8顯示根據本發明的實施例之第二系統的方塊圖;圖9顯示根據本發明的實施例之第三系統的方塊圖;圖10顯示根據本發明的實施例之系統晶片的方塊圖;圖11是方塊圖,對比根據本發明的實施例之將源指令集中的二進位指令轉換成目標指令集中的二進位指令之軟體指令轉換器的使用;圖12顯示本發明的實施例實施於其上的舉例說明的處理器;圖13顯示包含256位元乘法邏輯的本發明的一實施例;圖14顯示包含256位元乘法邏輯的本發明的另一實施例;圖15顯示包含利用立即值以辨識源運算元之256位元乘法邏輯的本發明的另一實施例;圖16顯示用以實施本發明的一實施例之乘法器及加法器組;以及圖17顯示根據本發明的一實施例之方法。 1A and 1B are block diagrams showing a generic vector friendly instruction format and a command template thereof in accordance with an embodiment of the present invention; and FIGS. 2A-D are block diagrams showing specific vector friendly instructions exemplified in accordance with an embodiment of the present invention; FIG. 3 is a block diagram of a scratchpad architecture in accordance with an embodiment of the present invention; FIG. 4A is a block diagram showing an ordered extraction, decoding, exit pipeline, and illustrations, exemplified in accordance with an embodiment of the present invention. a register rename, an out-of-order issue/execution pipeline; FIG. 4B is a block diagram showing an in-order extraction, decoding, exit core, and an exemplary register rename, mess, included in the processor in accordance with an embodiment of the present invention FIG. 5A is a block diagram showing a single core connected to the interconnect network on the die; FIG. 5B is an enlarged view of a portion of the processor core of FIG. 5A in accordance with an embodiment of the present invention; 6 is a block diagram showing a single core at an embodiment in accordance with the present invention A multi-core processor with integrated graphics and memory controller; FIG. 7 shows a block diagram of a system in accordance with an embodiment of the present invention; and FIG. 8 shows a block diagram of a second system in accordance with an embodiment of the present invention. Figure 9 shows a block diagram of a third system in accordance with an embodiment of the present invention; Figure 10 shows a block diagram of a system wafer in accordance with an embodiment of the present invention; and Figure 11 is a block diagram comparing sources in accordance with an embodiment of the present invention The use of a binary instruction in the instruction set to convert to a software instruction converter of a binary instruction in the target instruction set; FIG. 12 shows an exemplary processor on which embodiments of the present invention are implemented; FIG. 13 shows a 256-bit multiplication An embodiment of the invention of logic; Figure 14 shows another embodiment of the invention comprising 256-bit multiplication logic; Figure 15 shows another embodiment of the invention comprising 256-bit multiplication logic utilizing immediate values to identify source operands An embodiment; Figure 16 shows a multiplier and adder set for implementing an embodiment of the present invention; and Figure 17 shows a method in accordance with an embodiment of the present invention.

【發明內容及實施方式】 SUMMARY OF THE INVENTION AND EMBODIMENT

在下述說明中,為了說明之目的,揭示眾多特定細節以助於更完整瞭解下述的本發明的實施例。但是,習於此 技藝者顯然清楚知道,沒有這些特定細節中的某些細節,仍可實施本發明的實施例。在其它情形中,未詳細顯示習知的結構及裝置,以免模糊本發明的實施例之基本原理。 In the following description, for the purposes of illustration However, I am in this It will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without some of these specific details. In other instances, well-known structures and devices are not shown in detail to avoid obscuring the basic principles of the embodiments of the invention.

舉例說明的處理器架構及資料型式Illustrated processor architecture and data type

指令集包含一或更多指令格式。給定的指令格式界定不同的欄位(位元數目、位元位置)以特別指明要被執行的作業(作業碼)以及作業要對其執行的運算元。某些指令格式可以經由指令樣板(或副子令格式)的界定而進一步分解。舉例而言,給定的指令格式的指令樣板可以被界定為具有不同子集合的指令格式欄位(所包含的多個欄位典型上是相同次序,但是,因為有較少的欄位被包含,所以,至少某些欄位具有不同的位元位置)及/或被界定為具有被不同解譯的給定欄位。因此,使用給定的指令格式(以及,假使被界定時,在該指令格式的多個指令樣板中的給定之一中)以表示ISA的各指令,以及,包含用於指明作業及運算元。舉例而言,舉例說明的ADD指令具有特定作業碼及指令格式,指令格式包含作業碼欄位以指定該作業碼及運算元欄位以選取運算元的運算元(源1/目的地及源2);以及,在指令串中此ADD指令的存在將在選取特定運算元的運算元欄位中具有特定內容。稱為進階向量擴充(AVX)(AVX1及AVX2)以及使用向量擴充(VEX)碼化設計的SIMD擴充集已經發行及/或公開(舉例而言,請參照2011年10月之Intel® 64和IA-32架 構軟體開發者手冊;以及,2011年6月之Intel®進階向量擴充程式參考)。 The instruction set contains one or more instruction formats. A given instruction format defines different fields (number of bits, bit position) to specify the job (job code) to be executed and the operand for which the job is to be executed. Some instruction formats can be further decomposed by the definition of the instruction template (or the sub-context format). For example, a command template for a given instruction format can be defined as an instruction format field with a different subset (the multiple fields included are typically in the same order, but because there are fewer fields to include So, at least some of the fields have different bit positions) and/or are defined as having a given field that is interpreted differently. Thus, a given instruction format (and, if defined, in a given one of a plurality of instruction templates of the instruction format) is used to represent the instructions of the ISA, and includes instructions for specifying jobs and operands. For example, the illustrated ADD instruction has a specific job code and an instruction format, and the instruction format includes a job code field to specify the job code and the operation element field to select an operation element of the operation element (source 1 / destination and source 2 And; the presence of this ADD instruction in the instruction string will have specific content in the operand field of the particular operand selected. SIMD extensions called Advanced Vector Extension (AVX) (AVX1 and AVX2) and vector extension (VEX) coded designs have been released and/or published (for example, please refer to Intel® 64 and October 2011). IA-32 Architecture Software Developer's Manual; and, June 2011, Intel® Advanced Vector Extensions Reference).

舉例說明的指令格式 Illustrated instruction format

此處所述的指令實施例可以以不同格式具體實施。此外,於下詳述舉例說明的系統、架構、及管線。在些系統、架構、及管線上執行指令的實施例,但是不限於詳述的實施例。 The instruction embodiments described herein may be embodied in different formats. In addition, the systems, architectures, and pipelines illustrated are detailed below. Embodiments of the instructions are executed on these systems, architectures, and pipelines, but are not limited to the detailed embodiments.

A.泛型向量友善指令格式A. Generic vector friendly instruction format

向量友善指令格式是適用於向量指令的指令格式(例如,有某些欄位特定用於向量運算)。雖然說明經由向量友善指令格式而支援向量及純量運算之實施例,但是,替代的實施例可以僅使用向量友善指令格式向量運算。 The vector friendly instruction format is an instruction format suitable for vector instructions (for example, some fields are specific to vector operations). While an embodiment of vector and scalar operations is supported via a vector friendly instruction format, alternative embodiments may use only vector friendly instruction format vector operations.

圖1A-1B是方塊圖,顯示根據本發明的實施例之泛型向量友善指令格式及其指令樣板。圖1A是方塊圖,顯示根據本發明的實施例之泛型向量友善指令格式及其等級A指令樣板;而圖1B是方塊圖,顯示根據本發明的實施例之泛型向量友善指令格式及其等級B指令樣板。具體而言,等級A及等級B指令樣板被界定用於泛型向量友善指令格式100,等級A及等級B指令樣板都未包含記憶體存取105指令樣板及記憶體存取120指令樣板。在向量友善指令格式的內容中泛型一詞係指指令格式未被束縛於任何特定的指令集。 1A-1B are block diagrams showing a generic vector friendly instruction format and its instruction templates in accordance with an embodiment of the present invention. 1A is a block diagram showing a generic vector friendly instruction format and its level A instruction template according to an embodiment of the present invention; and FIG. 1B is a block diagram showing a generic vector friendly instruction format and an embodiment thereof according to an embodiment of the present invention; Level B instruction template. Specifically, the level A and level B command templates are defined for the generic vector friendly instruction format 100, and the level A and level B command templates do not include the memory access 105 command template and the memory access 120 command template. The term generic in the content of the vector friendly instruction format means that the instruction format is not tied to any particular instruction set.

將說明本發明的實施例,其中,向量友善指令格式支援下述:具有32位元(4位元組)或是64位元(8位元組)資料元寬度(或尺寸)之64位元組向量運算元長度(或尺寸)(因此,64位元組向量由16個雙倍字尺寸元或是替代地由8個四倍字尺寸元組成);具有16位元(2位元組)或是8位元(1位元組)資料元寬度(或尺寸)之64位元組向量運算元長度(或尺寸);具有32位元(4位元組)、64位元(8位元組)、16位元(2位元組)或是8位元(1位元組)資料元寬度(或尺寸)之32位元組向量運算元長度(或尺寸);以及,具有32位元(4位元組)、64位元(8位元組)、16位元(2位元組)或是8位元(1位元組)資料元寬度(或尺寸)之16位元組向量運算元長度(或尺寸);替代實施例以更多、更少或是不同的資料元寬度(例如,128位元(16位元組)資料元寬度)來支援更多、更少及/或不同的向量運算元尺寸(例如,256位元組向量運算元)。 An embodiment of the present invention will be described in which the vector friendly instruction format supports the following: 64-bit with 32-bit (4-byte) or 64-bit (8-byte) data element width (or size) Group vector operation element length (or size) (hence, 64-bit tuple vector consists of 16 double word size elements or alternatively 8 quad-word size elements); has 16 bits (2 bytes) Or 8-bit (1-byte) data element width (or size) of 64-bit vector operation element length (or size); with 32-bit (4-byte), 64-bit (8-bit) Group), 16-bit (2-byte) or 8-bit (1-byte) data element width (or size) 32-bit vector operation element length (or size); and, with 32 bits 16-bit vector of (4 bytes), 64-bit (8-bit), 16-bit (2-byte), or 8-bit (1-byte) data element width (or size) The length (or size) of the operand; alternative embodiments support more, less, and/or with more, less, or different data element widths (eg, 128-bit (16-byte) data element width) Different vector operand sizes (for example, 256 octet vector operands).

在圖1A中的等級A指令樣板包含:1)在無記憶體存取105指令樣板之內,顯示無記憶體存取、完全捨入控制型作業110指令樣板及無記憶體存取、資料轉換型式作業115指令樣板;以及,2)在記憶體存取120指令樣板之內,有顯示記憶體存取、暫時125指令樣板及記憶體存取、非暫時130指令樣板。圖1B中的等級B指令樣板包含:1)在無記憶體存取105指令樣板之內,顯示無記憶體存取、寫入遮罩控制、部份捨入控制型作業112指令樣 板及無記憶體存取、寫入遮罩控制、向量長度型式作業117指令樣板;以及,2)在記憶體存取120指令樣板之內,顯示有記憶體存取、寫入遮罩控制127指令樣板。 The level A command template in FIG. 1A includes: 1) display no memory access, full round control type operation command instruction template, no memory access, data conversion in the no memory access 105 command template. The type operation 115 command template; and 2) within the memory access 120 command template, there are display memory access, temporary 125 command template and memory access, non-transitory 130 command template. The level B command template in FIG. 1B includes: 1) display no memory access, write mask control, partial round control type operation 112 command sample in the no memory access 105 command template. Board and memoryless access, write mask control, vector length type operation 117 command template; and 2) memory access, write mask control 127 displayed within the memory access 120 command template Command template.

泛型向量友善指令格式100包含以圖1A-1B中所示的次序列出的下述欄位。 The generic vector friendly instruction format 100 contains the following fields listed in the order shown in Figures 1A-1B.

格式欄位140-在此欄位中的特定值(指令格式識別符值)獨特地識別向量友善指令格式,並因而識別指令串中向量友善指令格式的指令發生。確切而言,以此欄位對於僅有泛型向量友善指令格式之指令集並非所需的觀點而言,此欄位是選加的。 Format field 140 - A particular value (instruction format identifier value) in this field uniquely identifies the vector friendly instruction format and thus identifies an instruction in the vector friendly instruction format in the instruction string. Rather, this field is optional for the view that this field is not required for an instruction set that only has a generic vector friendly instruction format.

基礎作業欄位142-其內容區別不同的基礎作業。 The basic job field 142 - the basic job whose content is different.

暫存器索引欄位144-其內容直接或是經由位址產生而指明源及目的地運算元在暫存器或在記憶體中的位置。這些包含足夠數目的位元以從PxQ(例如32x512、16x128、32x1024、64x1024)暫存器檔案中選取N個暫存器。雖然在一實施例中,N可以高達三個源及一個目的地暫存器,但是,替代實施例可以支援更多或是更少的源及目的地暫存器(例如,可以支援高達二個源,其中,這些源中之一也作為目的地,可以支援高達三個源,其中,這些源中之一也作為目的地,可以支援高達二個源及一個目的地)。 Register index field 144 - its content is directly or via address generation indicating the location of the source and destination operands in the scratchpad or in memory. These contain a sufficient number of bits to select N scratchpads from PxQ (eg, 32x512, 16x128, 32x1024, 64x1024) scratchpad files. Although in one embodiment, N can be as high as three sources and one destination register, alternative embodiments can support more or fewer source and destination registers (eg, can support up to two The source, in which one of these sources also serves as a destination, can support up to three sources, one of which also serves as a destination, and can support up to two sources and one destination).

修飾符欄位146-其內容區別指定(如146B所示)及未指定(如146A所示)記憶體存取的泛型向量指令格式中指令的發生;亦即,在無記憶體存取105指令樣板與記憶體存取120指令樣板之間作區分。 記憶體存取作業對記憶體層級結構讀取及/或寫入(在某些情形中,使用暫存器中的值指定源及/或目的地位址),而非記憶體存取作業未如此作(例如,源及目的地是暫存器)。雖然在一實施例中,此欄位也在三不同方式之間選取以執行記憶體位址計算,但是,替代的實施例可以支援更多、更少、或是不同的方式以執行記憶體位址計算。 Modifier field 146 - its content distinction specifies (as indicated by 146B) and unspecified (as indicated by 146A) the occurrence of instructions in the generic vector instruction format of memory access; that is, in memoryless access 105 The command template is distinguished from the memory access 120 command template. Memory access operations read and/or write to the memory hierarchy (in some cases, use source values in the scratchpad to specify source and/or destination addresses), rather than memory access operations. (for example, the source and destination are scratchpads). Although in one embodiment, this field is also selected between three different modes to perform memory address calculations, alternative embodiments may support more, less, or different ways to perform memory address calculations. .

擴增作業欄位150-其內容區別多種不同作業中那一作業要加上基礎作業被執行。此欄位是內容特定的。在本發明的一實施例中,此欄位分成等級欄位168、阿爾發欄位152、貝它欄位154。擴增作業欄位150允許共同的作業組以單一指令而非2、3或4指令執行。 Augmentation Work Field 150 - The content distinguishes which of the many different jobs to be added plus the base job is executed. This field is content specific. In an embodiment of the invention, the field is divided into a rank field 168, an alpha field 152, and a beta field 154. Augmentation job field 150 allows a common job group to be executed with a single instruction instead of 2, 3, or 4 instructions.

比例欄位160-其內容允許索引欄位的內容的比例用於記憶體位址產生(例如,用於使用2scale*索引+基礎之位址產生)。 The proportion of which field content is allowed 160- index field for a ratio of generating memory addresses (e.g., using base 2 scale * index + the address generation).

位移欄位162A-其內容作為記憶體位址產生的一部份(例如,用於使用2scale*索引+基礎+位移之位址產生)。 Displacement field 162A - its content is generated as part of the memory address (eg, for use with 2 scale * index + base + displacement address).

位移因數欄位162B(注意,位移欄位162A直接在位移因數欄位162B上方並列係表示一或另一者被使用)-其內容作為位址產生的一部份;其指明要依記憶體存取(N)的尺寸而比例化之位移因數,其中,N是記憶體存取中的位元組數目(例如,用於使用2scale*索引+基礎+比例化位移的位址產生)。冗餘的低階位元被忽略,因此,位移因數欄的內容乘以記憶體運算元全部尺寸(N) 以產生計算有效位址時使用的最後位移。根據全作業碼欄位174(稍後說明)及資料操縱欄位154C,在運行時間時由處理器硬體決定N的值。在位移欄位162A及位移因數欄位162B不用於無記憶體存取105指令樣板及/或不同實施例僅實施二者中之一或不實施二者的情形中,它們是選加的。 Displacement factor field 162B (note that displacement field 162A directly above the displacement factor field 162B indicates that one or the other is used) - its content is part of the address generation; it indicates that it depends on the memory A displacement factor that is scaled by the size of (N), where N is the number of bytes in the memory access (eg, for address generation using 2 scale * index + base + scaled displacement). Redundant low-order bits are ignored, so the content of the displacement factor column is multiplied by the full size (N) of the memory operand to produce the last displacement used to calculate the valid address. Based on the full job code field 174 (described later) and the data manipulation field 154C, the value of N is determined by the processor hardware at runtime. In the case where the displacement field 162A and the displacement factor field 162B are not used for the no-memory access 105 command template and/or the different embodiments only implement either or both, they are optional.

資料元寬度欄位164-其內容區別一些資料元寬度中的那一寬度是要被使用(在某些實施例中對所有指令;在其它實施例中僅對某些指令)。在假使使用作業碼的某些態樣而僅有一資料元寬度被支援及/或資料元寬度被支援時不需要此欄位的情形中,此欄位是選加的。 The data element width field 164 - whose content differs from the width of some of the data element widths is to be used (in some embodiments for all instructions; in other embodiments only for certain instructions). This field is optional if some fields of the job code are used and only one data element width is supported and/or the data element width is supported.

寫入遮罩欄位170-其內容以每一資料元位置為基礎而控制目的地向量運算元中的資料元位置是否反應基礎作業及擴增作業的結果。等級A指令樣板支援合併寫入遮罩,而等級B指令樣板支援合併及零化寫入遮罩。當合併時,向量遮罩允許目的地中任何組的元在任何作業的執行期間受保護(由基礎作業及擴增作業指明)而免於更新;在其它的一實施例中,保留對應的遮罩位元具有0之目的地的各元的舊值。相反地,當零化向量遮罩時允許目的地中的任何組的元在任何作業(由基礎作業及擴增作業指定)執行期間被零化;在一實施例中,當對應的遮罩位元具有0值時,目的地的元被設定為0。此功能的子集合是控制執行的作業的向量長度之能力(亦即,被修改的元的展幅,從第一至最後一個);但是,被修改的元不必是連續的。 如此,寫入遮罩欄170允許部份向量作業,包含載入、儲存、算數、邏輯、等等。雖然說明本發明的實施例,其中,寫入遮罩欄位170的內容選取一些含有要被使用的寫入遮罩之寫入遮罩暫存器中之一(因此,寫入遮罩欄位170的內容間接地識別要被執行的遮罩),但是,替代實施例取代地或增加地允許遮罩寫入欄位170的內容直接指定要被執行的遮罩。 Write mask field 170 - its content controls whether the data element position in the destination vector operand reflects the result of the base job and the augmentation operation based on each data element position. The Level A command template supports merged write masks, while the Level B command template supports merge and zero write masks. When merging, the vector mask allows elements of any group in the destination to be protected (as indicated by the underlying job and the augmentation job) from being updated during execution of any job; in other embodiments, the corresponding mask is retained The mask bit has the old value of each element of the destination of 0. Conversely, when the vectorization mask is zeroed, the elements of any group in the destination are allowed to be zeroed during execution of any job (specified by the base job and the augmentation job); in an embodiment, when the corresponding mask bit is When the element has a value of 0, the element of the destination is set to 0. A subset of this function is the ability to control the vector length of the executed job (i.e., the spread of the modified element, from first to last); however, the modified elements need not be contiguous. As such, the write mask field 170 allows for partial vector jobs, including load, store, arithmetic, logic, and the like. Although an embodiment of the invention is illustrated in which the contents of the write mask field 170 are selected to be one of the write mask registers containing the write mask to be used (hence, the write mask field is written) The content of 170 indirectly identifies the mask to be executed), however, an alternate embodiment instead or additionally allows the content of the mask write field 170 to directly specify the mask to be executed.

立即欄位172-其內容允許立即性的規格。在此欄位未出現在未支援立即性的泛型向量友善格式實施中以及其未出現在未使用立即性的指令中之情形中,此欄位是選加的。 Immediate field 172 - its content allows for immediate specifications. This field is optional if this field does not appear in a generic vector friendly format implementation that does not support immediateity and if it does not appear in an instruction that does not use immediateness.

等級欄位168-其內容區別不同等級的指令。參考圖1A-B,此欄位的內容在等級A與等級B指令之間選取。在圖1A-B中,四角圓化的方形被用以標示特定值存在於欄位中(例如,分別在圖1A-B中用於等級欄位168的等級A 168A及等級B 168B)。 Level field 168 - instructions whose content distinguishes different levels. Referring to Figures 1A-B, the contents of this field are selected between Level A and Level B instructions. In Figures 1A-B, a squared square is used to indicate that a particular value is present in the field (e.g., level A 168A and level B 168B for level field 168, respectively, in Figures 1A-B).

等級A的指令樣板 Level A command template

在等級A的非記憶體存取105指令樣板的情形中,阿爾發欄位152被解譯為RS欄位152A,其內容區別不同的擴增作業型式中那一型式是要被執行(例如,捨入152A.1及資料轉換152A.2分別被指定用於無記憶體存取、捨入型式作業110及無記憶體存取、資料轉換型式作業115指令樣板),而貝他欄位154區別被指定的型式的 作業中那一作業是要被執行。在無記憶體存取105指令樣板中,比例欄位160、位移比例欄位162A、及位移比例欄位162B未出現。 In the case of the non-memory access 105 command template of level A, the Alpha field 152 is interpreted as the RS field 152A, and the type of the different augmentation operation type is to be executed (for example, Rounding 152A.1 and data conversion 152A.2 are designated for memoryless access, rounding type operation 110 and no memory access, data conversion type operation 115 command template), while the beta field 154 difference Specified type The job in the job is to be executed. In the no-memory access 105 command template, the proportional field 160, the displacement ratio field 162A, and the displacement ratio field 162B do not appear.

無記憶體存取指令樣板-完全捨入控制型作業 No memory access command template - fully rounded control type

在無記憶體存取完全捨入控制型作業110指令樣板中,貝他欄位154被解譯為捨入控制欄位154A,其內容提供靜態捨入。雖然在上述的發明實施例中,捨入控制欄位154A包含抑制所有浮點例外(SAE)欄位156及捨入作業控制欄位158,但是,替代實施例可以支援將這二概念編碼成相同欄位或是僅具有這些概念/欄位中之一或另一者(例如,可以僅具有捨入作業控制欄位158)。 In the No Memory Access Full Round Control Type Job 110 command template, the beta field 154 is interpreted as a rounding control field 154A whose content provides static rounding. Although in the above described embodiment of the invention, rounding control field 154A includes suppression of all floating point exception (SAE) field 156 and rounding job control field 158, alternative embodiments may support encoding the two concepts to be the same The field may have only one or the other of these concepts/fields (eg, may have only rounded job control field 158).

SAE欄位156-其內容區別是否將例外事件報告禁能;當SAE欄位的156內容標示抑制被賦能時,給定的指令不報告任何種類的浮點例外旗標及不喚起任何浮點例外處理器。 SAE field 156 - whether the content difference disables the exception event report; when the 156 content flag suppression of the SAE field is enabled, the given instruction does not report any kind of floating point exception flag and does not evoke any floating point Exception processor.

捨入作業控制欄位158-其內容區別捨入作業組中何者要執行(例如,捨進、捨去、捨入至零、及捨入至最接近的)。因此,捨入作業控制欄位158允許以每一指令為基礎之捨入模式的改變。在處理器包含用於指明捨入模式的控制暫存器之發明的一實施例中,捨入作業控制欄位158的內容置換該暫存器值。 The rounding job control field 158 - its content distinguishes which of the rounded job groups are to be executed (eg rounding, rounding, rounding to zero, and rounding to the nearest). Thus, the rounding job control field 158 allows for a change in the rounding mode based on each instruction. In an embodiment of the invention in which the processor includes a control register for indicating a rounding mode, the contents of the round job control field 158 replace the register value.

無記憶體存取指令樣板-資料轉換型式作業 No memory access instruction template - data conversion type operation

在無記憶體存取資料轉換型式作業115指令樣板中,貝他欄位154被解譯為資料轉換欄位154B,其內容區別多個資料轉換中何者要被執行(例如,無資料轉換、調和、廣播)。 In the no-memory access data conversion type job 115 instruction template, the beta field 154 is interpreted as a data conversion field 154B, the content of which distinguishes between the multiple data conversions to be performed (eg, no data conversion, reconciliation ,broadcast).

在等級A的記憶體存取120指令樣板的情形中,阿爾發欄位152被解譯為逐出暗示欄位152B,其內容區別逐出暗示中那一者是要被使用(在圖1A中,暫時152B.1及非暫時152B.2分別被指定用於記憶體存取、暫時125指令樣板以及記憶體存取、非暫時130指令樣板),而貝他欄位154被解譯為資料操縱欄位154C,其內容區別多個資料操縱作業(也稱為基元)中何者是要被執行(例如,無操縱;廣播;源的上轉;及目的地的下轉)。記憶體存取120指令樣板包含比例欄位160,且選加地包含位移欄位162A或位移比例欄位162B。 In the case of the memory access 120 command template of level A, the Alpha field 152 is interpreted as a eviction hint field 152B whose content difference eviction suggestion that one is to be used (in Figure 1A) Temporary 152B.1 and non-transient 152B.2 are designated for memory access, temporary 125 command templates and memory access, non-transitory 130 command templates, respectively, while the beta field 154 is interpreted as data manipulation. Field 154C, whose content distinguishes between which of a plurality of data manipulation jobs (also referred to as primitives) is to be executed (eg, no manipulation; broadcast; source up; and destination down). The memory access 120 instruction template includes a scale field 160 and optionally includes a displacement field 162A or a displacement ratio field 162B.

藉由轉換支援,向量記憶體指令對記憶體執行向量載入及向量儲存。如正常的向量指令般,向量記憶體指令以像資料元方式對記憶體傳輸資料,而真正被傳送的元是由被選為寫入遮罩的向量遮罩的內容所指定。 With conversion support, the vector memory instruction performs vector loading and vector storage on the memory. Like a normal vector instruction, a vector memory instruction transfers data to the memory in the form of a data element, and the actually transmitted element is specified by the content of the vector mask selected as the write mask.

記憶體存取指令樣板-暫時 Memory access command template - temporary

暫時資料是很可能足夠快再被使用而從快取獲利之資料。但是,這是暗示,以及,不同的處理器可以以不同方式實施它,包含完全忽略暗示。 Temporary information is information that is likely to be used quickly enough to be profitable from the cache. However, this is a hint, as well, that different processors can implement it in different ways, including completely ignoring hints.

記憶體存取指令樣板-非暫時 Memory access command template - not temporary

非暫時資料是不太可能足夠快再被使用以從第一層快取記憶體中的快取獲利之資料,且應被授予逐出優先權。但是,這是暗示,以及,不同的處理器可以以不同方式實施它,包含完全忽略暗示。 Non-transitory data is material that is unlikely to be used quickly enough to be profitable from the cache in the first layer of cache memory and should be granted eviction priority. However, this is a hint, as well, that different processors can implement it in different ways, including completely ignoring hints.

等級B的指令樣板Level B command template

在等級B的指令樣板的情形中,阿爾發欄位152被解譯為寫入遮罩控制(Z)欄位152C,其內容區別由寫入遮罩欄位170控制的寫入遮罩是否應為合併或零化。 In the case of the level B command template, the Alpha field 152 is interpreted as a write mask control (Z) field 152C whose content distinguishes whether the write mask controlled by the write mask field 170 should be For merging or zeroing.

在等級B的非記憶體存取105指令樣板的情形中,貝他欄位154的部份是被解譯為RL欄位157A,其內容區別不同的擴增作業型式中那一作業型式是要被執行(例如,拾入157A.1以及向量長度(VSIZE)157A.2分別被指定用於無記憶體存取、寫入遮罩控制、部份捨入控制型作業112指令樣板以及無記憶體存取、寫入遮罩控制、VSIZE型式作業117指令樣板),而貝他欄位154的其餘部份區別具有指定型式的作業中何者是要被執行。在無記憶體存取105指令樣板中,比例欄位160、位移欄位162A、及位移比例欄位162B不存在。 In the case of the non-memory access 105 command template of level B, the portion of the beta field 154 is interpreted as the RL field 157A, and the job type in the augmentation operation type in which the content is different is Executed (for example, Pickup 157A.1 and Vector Length (VSIZE) 157A.2 are specified for memoryless access, write mask control, partial rounding control type job 112 command template, and no memory, respectively. The access, write mask control, VSIZE type job 117 command template), while the rest of the beta field 154 distinguishes which of the specified types of jobs are to be executed. In the no memory access 105 command template, the proportional field 160, the displacement field 162A, and the displacement ratio field 162B do not exist.

在無記憶體存取中,寫入遮罩控制、部份捨入控制型作業110指令樣板、貝他欄位154的其它部份被解譯為捨入作業欄位159A且例外事件報告被禁能(被給定的指令不報告任何種類的浮點例外旗標及不喚起任何浮點例外處 理器)。 In the no-memory access, the write mask control, the partial rounding control type job instruction template, and the other portions of the beta field 154 are interpreted as the rounding job field 159A and the exception event report is banned. Can (the given instruction does not report any kind of floating point exception flag and does not evoke any floating point exceptions Processor).

捨入作業控制欄位159A-正如同捨入作業控制欄位158般,其內容區別捨入作業組中何者要執行(例如,捨進、捨去、捨入至零、及捨入至最接近的)。因此,捨入作業控制欄位159A允許以每一指令為基礎之捨入模式的改變。在處理器包含用於指明捨入模式的控制暫存器之發明的一實施例中,捨入作業控制欄159A的內容置換該暫存器值。 Rounding job control field 159A - just like the rounding job control field 158, the content of which is different from the rounding job group (for example, rounding, rounding, rounding to zero, and rounding to the nearest of). Thus, rounding job control field 159A allows for a change in the rounding mode based on each instruction. In an embodiment of the invention in which the processor includes a control register for indicating a rounding mode, the contents of the round job control field 159A replace the register value.

在無記憶體存取、寫入遮罩控制,VSIZE型式作業117指令樣板中,貝他欄位154的其餘部份被解譯為向量長度欄位159B,其內容區別要對多個資料向量長度中的那一資料向量長度執行(例如,128、256、或512位元組)。 In the no-memory access, write mask control, VSIZE type job 117 command template, the rest of the beta field 154 is interpreted as a vector length field 159B, the content of which is different for multiple data vector lengths. The data vector length in the execution (for example, 128, 256, or 512 bytes).

在等級B的記憶體存取120指令樣板的情形中,貝它欄位154的一部份被解譯為廣播欄位157B,其內容區別廣播型資料操縱作業是否要被執行,而貝它欄位154中的其它部份被解譯為向量長度欄位159B。記憶體存取120指令樣板包含比例欄位160,以及,選加地包含位移欄位162A或是位移比例欄位162B。 In the case of the level B memory access 120 command template, a portion of the beta field 154 is interpreted as a broadcast field 157B, the content of which distinguishes whether the broadcast type data manipulation job is to be executed, and the beta column The other portion of bit 154 is interpreted as vector length field 159B. The memory access 120 command template includes a scale field 160 and, optionally, a displacement field 162A or a displacement scale field 162B.

關於泛型向量友善指令格式100,完全作業碼欄位174顯示為包含格式欄位140、基礎作業欄位142、及資料元寬度欄位164。雖然顯示完全作業碼欄位174包含所有這些欄位的一實施例,但是,在未支援它們全部的實施例中,完全作業碼欄位174包含小於所有這些欄位的欄 位。完全作業碼欄位174提供作業碼(opcode)。 Regarding the generic vector friendly instruction format 100, the full job code field 174 is displayed to include the format field 140, the base job field 142, and the data element width field 164. Although the display full job code field 174 includes an embodiment of all of these fields, in embodiments where none of them are supported, the full job code field 174 contains columns that are smaller than all of these fields. Bit. The full job code field 174 provides an opcode.

擴增作業欄位150、資料元寬度欄位164、及寫入遮罩欄位170允許以泛型向量友善指令格式的指令為基礎來指明這些特點。 The augmentation work field 150, the data element width field 164, and the write mask field 170 allow these features to be specified based on instructions in the generic vector friendly instruction format.

寫入遮罩欄位及資料元寬度欄位的結合會產生型式化的指令,其中,它們允許根據不同的資料元寬度來施加遮罩。 The combination of the write mask field and the data element width field produces a typed instruction in which they allow masks to be applied according to different material element widths.

等級A及等級B之內發現的各種指令樣板在不同的情形中是有利的。在本發明的某些實施例中,不同的處理器或是處理器之內不同的核心可以僅支援等級A、僅支援等級B、或支援這二等級。舉例而言,要用於一般目的之計算的高性能目的之亂序核心僅支援等級B,主要用於圖形及/或科學(通量)計算的核心僅支援等級A,以及用於支援二等級的核心可以支援二等級(當然,具有來自二等級的樣板及指令的某些混合,但非來自二等級的所有樣板及指令是在本發明的範圍之內)。而且,單一處理器包含多核心,所有這些核心支援相同等級,或者,其中,不同的核心支援不同的等級。舉例而言,在設有分別的圖形及一般用途核心的處理器中,主要用於圖形及/或科學計算的複數個圖形核心中之一僅支援等級A,而一或更多一般用途核心可為具有用於僅支援等級B的一般用途計算之亂序執行及暫存器重命名之高性能一般用途核心。不具有分別的圖形核心之另一處理器可以包含支援等級A和等級B的一或更多一般用途有序或亂序核心。當然,在本發明 的不同實施例中,來自一等級的特點也可在其它等級中實施。以高階語言撰寫的程式將被置於(舉例而言,僅即時被編譯或是靜態地被編譯成)各式各樣之不同的可執行形式中,包含:1)僅具有由用於執行的標的處理器所支援的等級的指令之形式;或是,2)具有使用所有等級的指令之不同組合撰寫的替代常式以及具有控制流程碼之形式,控制流程碼係根據由目前正執行碼的處理器所支援的指令而選取要執行的常式。 The various command templates found within Level A and Level B are advantageous in different situations. In some embodiments of the invention, different processors or different cores within the processor may only support level A, only level B, or support the two levels. For example, the out-of-order core for high performance purposes for general purpose calculations only supports level B, and the core for graphics and/or scientific (flux) calculations only supports level A and is used to support level two. The core can support two levels (of course, with some mix of templates and instructions from the second level, but not all templates and instructions from the second level are within the scope of the present invention). Moreover, a single processor contains multiple cores, all of which support the same level, or where different cores support different levels. For example, in a processor with separate graphics and general purpose cores, one of the plurality of graphics cores primarily used for graphics and/or scientific computing supports only level A, while one or more general purpose cores are available. A high-performance general-purpose core with out-of-order execution and register renaming for general purpose computing that only supports Level B. Another processor that does not have a separate graphics core may include one or more general purpose ordered or out-of-order cores that support Level A and Level B. Of course, in the present invention In different embodiments, features from one level may also be implemented in other levels. Programs written in higher-level languages will be placed (for example, only compiled or statically compiled into a variety of different executable forms), including: 1) only for execution The form of the instruction supported by the target processor; or, 2) an alternative routine written with a different combination of instructions of all levels and a form having a control flow code based on the currently executing code The routine to be executed is selected by the instructions supported by the processor.

B.舉例說明的特定向量友善指令格式B. Example specific vector friendly instruction format

圖2是方塊圖,顯示根據本發明的實施例之舉例說明的特定向量友善指令格式。圖2顯示特定向量友善指令格式200,其在指定欄位的位置、大小、解譯、及次序、以及用於那些欄位中的某些欄位之值的情形中是特定的。特定向量友善指令格式200可以被用以擴充x86指令集,因而某些欄位類似於或同於現有的x86指令集中使用的欄位以及其擴充(例如,AVX)。此格式維持與具有延伸的現有x86指令集的前置編碼欄位、實數運算碼位元組欄位、MOD R/M欄位、SIB欄位、位移欄位、及立即欄位一致。顯示來自圖2的欄位映射至來自圖1的欄位。 2 is a block diagram showing a particular vector friendly instruction format exemplified in accordance with an embodiment of the present invention. 2 shows a particular vector friendly instruction format 200 that is specific in the context of the location, size, interpretation, and order of the specified fields, as well as the values for certain fields in those fields. The particular vector friendly instruction format 200 can be used to augment the x86 instruction set, and thus certain fields are similar or identical to the fields used in existing x86 instruction sets and their extensions (eg, AVX). This format maintains the precoding field, the real opcode byte field, the MOD R/M field, the SIB field, the displacement field, and the immediate field with the extended existing x86 instruction set. The fields from Figure 2 are shown mapped to the fields from Figure 1.

應瞭解,雖然為了說明而在泛型向量友善指令格式100的脈絡中參考特定向量友善指令格式200,以說明本發明的實施例,但是,除非特別申明,否則本發明不侷限於特定向量友善指令格式200。舉例而言,泛型向量友善 指令格式100慮及用於各種欄位的各種可能大小,而特定向量友善指令格式200顯示為具有特定大小的欄位。具體舉例而言,雖然資料元寬度欄位164顯示為特定向量友善指令格式200中的一位元欄位,但是,本發明不限於此(亦即,泛型向量友善指令格式100慮及資料元寬度欄位164的其它大小)。 It should be appreciated that although a particular vector friendly instruction format 200 is referenced in the context of the generic vector friendly instruction format 100 for purposes of illustration to illustrate embodiments of the present invention, the invention is not limited to particular vector friendly instructions unless specifically stated otherwise. Format 200. For example, generic vector friendly The instruction format 100 allows for various possible sizes for various fields, while the particular vector friendly instruction format 200 is displayed as a field of a particular size. For example, although the data element width field 164 is displayed as a one-digit field in the specific vector friendly instruction format 200, the present invention is not limited thereto (that is, the generic vector friendly instruction format 100 takes into account the data element. The other size of the width field 164).

泛型向量友善指令格式100包含依圖2A中所示的次序而於下列出的下述欄位。 The generic vector friendly instruction format 100 contains the following fields listed below in the order shown in Figure 2A.

EVEX前置(位元組0-3)202-以四位元組形式編碼。 The EVEX preamble (bytes 0-3) 202 is encoded in a four-byte form.

格式欄位140(EVEX位元組0,位元[7:0])-第一位元組(EVEX位元組0)是格式欄位140以及其含有0x62(用於區別發明的一實施例中向量友善指令格式的獨特值)。 Format field 140 (EVEX byte 0, bit [7:0]) - first byte (EVEX byte 0) is format field 140 and contains 0x62 (an embodiment for distinguishing inventions) The unique value of the vector friendly instruction format).

第二-第四位元組(EVEX位元組1-3)包含提供特定能力的一些位元欄位。 The second-fourth byte (EVEX bytes 1-3) contains some bit fields that provide specific capabilities.

REX欄位205(EVEX位元組1,位元[7-5])由EVEX.R位元欄位(EVEX位元組1,位元[7]-R)、EVEX.X位元欄位(EVEX位元組1,位元[6]-X)、及157BEX位元組1,位元[5]-B)組成。EVEX.R、EVEX.X及EVEX.B位元欄位提供與對應的VEX位元欄位相同的功能性,且使用1s互補形式來編碼,亦即,ZMM0被編碼為1111B,ZMM15被編碼為0000B。如同此技藝中所知般,指令的其它欄位將暫存器索引的較低的三個位元編 碼(rrr,xxx,及bbb),以致於藉由加上EVEX.R、EVEX.X、及EVEX.B,可以形成Rrrr、Xxxx、及Bbbb。 REX field 205 (EVEX byte 1, bit [7-5]) consists of EVEX.R bit field (EVEX byte 1, bit [7]-R), EVEX.X bit field (EVEX byte 1, bit [6]-X), and 157BEX byte 1, bit [5]-B). The EVEX.R, EVEX.X, and EVEX.B bit fields provide the same functionality as the corresponding VEX bit field and are encoded using a 1s complementary form, ie, ZMM0 is encoded as 1111B and ZMM15 is encoded as 0000B. As is known in the art, the other fields of the instruction encode the lower three bits of the scratchpad index. The codes (rrr, xxx, and bbb) are such that Rrrr, Xxxx, and Bbbb can be formed by adding EVEX.R, EVEX.X, and EVEX.B.

REX’欄位210-這是REX’欄位210的第一部份且是用以將擴充的32暫存器組的上16或下16編碼之EVEX.R’位元欄位(EVEX位元組1,位元[4]-R’)。在本發明的一實施例中,此位元與如下標示的其它位元以位元反轉格式儲存,以與BOUND指令區別(在已知的x86 32位元模式中),BOUND指令的實數作業碼位元組是62,但是,在MOD R/M欄位(下述)中未接受MOD欄位中11的值;本發明的替代實施例未以反轉格式儲存此位元及下述其它標示的位元。1的值用以將下16暫存器編碼。換言之,藉由結合來自其它欄位的EVEX.R’、EVEX.R、及其它RRR以形成R’Rrrr。 REX' field 210 - This is the first part of the REX' field 210 and is the EVEX.R' bit field (EVEX bit) used to encode the upper 16 or lower 16 of the extended 32 register set. Group 1, bit [4]-R'). In an embodiment of the invention, the bit is stored in a bit-reversed format with other bits as indicated below to distinguish it from the BOUND instruction (in the known x86 32-bit mode), the real operation of the BOUND instruction The code byte is 62, however, the value of 11 in the MOD field is not accepted in the MOD R/M field (described below); an alternative embodiment of the present invention does not store this bit in an inverted format and other The marked bit. A value of 1 is used to encode the lower 16 registers. In other words, R'Rrrr is formed by combining EVEX.R', EVEX.R, and other RRRs from other fields.

作業碼映射欄位215(EVEX位元組1,位元[3:0]-mmmm)-它的內容將暗指的領先作業碼位元組(0F,0F38,或0F3)編碼。 The job code mapping field 215 (EVEX byte 1, bit [3:0]-mmmm) - its content encodes the implied leading job code byte (0F, 0F38, or 0F3).

資料元寬度欄位164(EVEX位元組2,位元[7]-W)-由記號EVEX.W表示。EVEX.W用以界定資料型式的粒度(大小)(32位元資料元或64位元資料元)。 The data element width field 164 (EVEX byte 2, bit [7]-W) - is represented by the notation EVEX.W. EVEX.W is used to define the granularity (size) of the data type (32-bit data element or 64-bit data element).

EVEX.vvvv 220(EVEX位元組2,位元[6:3]-vvvv)-EVEX.vvvv的角色可以包含下述:1)EVEX.vvvv將以反轉(1s互補)形式指定的第一源暫存器運算元編碼,且對於具有2或更多源運算元的指令是有效的;2)EVEX.vvvv將對某些向量偏移以1s互補形式指定的目的 地暫存器運算元編碼;或者3)EVEX.vvvv未將任何運算元編碼,欄位被保留且應含有1111b。因此,EVEX.vvvv欄位220將依反轉(1s互補)形式儲存的第一源暫存器指定符的4低階位元編碼。取決於指令,額外的不同EVEX位元欄位被用以擴充指定符尺寸至32暫存器。 EVEX.vvvv 220 (EVEX byte 2, bit [6:3]-vvvv) - The role of EVEX.vvvv can include the following: 1) EVEX.vvvv will be specified in reverse (1s complementary) form first Source register operand encoding, and is valid for instructions with 2 or more source operands; 2) EVEX.vvvv will specify some vector offsets in 1s complementary form The local register operand encoding; or 3) EVEX.vvvv does not encode any operands, the field is reserved and should contain 1111b. Thus, the EVEX.vvvv field 220 will encode the 4th order bits of the first source register identifier stored in inverted (1s complementary) form. Depending on the instruction, additional different EVEX bit fields are used to extend the specifier size to the 32 scratchpad.

EVEX.U 168等級欄位(EVEX位元組2,位元[2]-U)-假使EVEX.U=0,則其標示等級A或EVEX.U0;假使EVEX.U=1,則其標示等級B或EVEX.U1。 EVEX.U 168 level field (EVEX byte 2, bit [2]-U) - if EVEX.U=0, it indicates level A or EVEX.U0; if EVEX.U=1, it is marked Level B or EVEX.U1.

前置編碼欄位225(EVEX位元組2,位元[1:0]-pp)-提供增加的位元用於基礎作業欄位。除了提供支援給EVEX前置格式的舊有SSE指令,這也具有使SIMD前置小巧化(而非要求位元組來表示SIMD前置,EVEX前置僅要求2位元)的優點。在一實施例中,為了支援以舊有格式及EVEX前置格式等二各式使用SIMD前置(66H、F2H、F3H)之舊有SSE指令,這些舊有SIMD前置被編碼成SIMD前置編碼欄位;以及,在被提供給解碼器的PLA(以致於PLA可以執行這些舊有指令的舊有及EVEX等二格式而不用修改)之前,在運行時間時被擴展成舊有SIMD前置。雖然較新的指令可以直接使用EVEX前置編碼欄位的內容作為運算碼擴充,但是,某些實施例為了一致性而以類似方式擴展但允許不同的意義由這些舊有SIMD前置規定。替代實施例可以重新設計PLA以支援2位元SIMD前置編碼,因而不要求擴展。 The precoding field 225 (EVEX byte 2, bit [1:0]-pp) - provides the added bit for the base job field. In addition to providing legacy SSE instructions that support the EVEX pre-format, this also has the advantage of making the SIMD pre-small (rather than requiring a byte to represent the SIMD preamble and the EVEX preamble only requiring 2 bits). In an embodiment, in order to support legacy SSE instructions using SIMD pre- (66H, F2H, F3H) in both legacy format and EVEX pre-format, these legacy SIMD preambles are encoded into SIMD preambles. Encoding field; and, before being served to the PLA of the decoder (so that the PLA can execute the legacy of these legacy instructions and the EVEX et al. without modification), it is expanded to the old SIMD preamble at runtime . While newer instructions may directly use the contents of the EVEX precoding field as an opcode extension, some embodiments extend in a similar manner for consistency but allow different meanings to be specified by these legacy SIMD preambles. Alternate embodiments may redesign the PLA to support 2-bit SIMD preamble and thus do not require extension.

阿爾發欄位152(EVEX位元組3,位元[7]-EH;也稱 為EVEX.EH、EXEX.rs、EVEX.RL、EVEX.寫入遮罩控制、及EVEX.N;也以α顯示)-如以往所述般,此欄位是內容特定的。 Alfa Field 152 (EVEX byte 3, bit [7]-EH; also known as Write mask control for EVEX.EH, EXEX.rs, EVEX.RL, EVEX., and EVEX.N; also shown as a) - as described previously, this field is content specific.

貝他欄位154(EVEX位元組3,位元[6:4]-SSS;也稱為EVEX.s2-0、EVEX.r2-0、EVEX.rr1、EVEX.LL0、EVEX.LLB;也以β β β顯示)-如以往所述般,此欄位是內容特定的。 Beta field 154 (EVEX byte 3, bit [6:4]-SSS; also known as EVEX.s 2-0 , EVEX.r 2-0 , EVEX.rr1, EVEX.LL0, EVEX.LLB ; also shown as β β β) - as described previously, this field is content specific.

REX’欄位210-這是REX’欄位的餘部且是可被用以將擴充的32暫存器組的上16或下16編碼之EVEX.V’位元欄位(EVEX位元組3,位元[3]-V’)。此位元以位元反轉格式儲存。1的值被用以將下16暫存器編碼。換言之,藉由結合EVEX.V’、EVEX.vvvv以形成V’VVVV。 REX' field 210 - This is the remainder of the REX' field and is the EVEX.V' bit field (EVEX byte 3) that can be used to encode the upper 16 or lower 16 of the extended 32 register set. , bit [3]-V'). This bit is stored in a bit reverse format. A value of 1 is used to encode the lower 16 registers. In other words, V'VVVV is formed by combining EVEX.V', EVEX.vvvv.

寫入遮罩欄位170(EVEX位元組3,位元[2:0]-kkk)-如同先前所述般,其內容指定寫入罩暫存器中的暫存器索引。在發明的一實施例中,特定值EVEX.kkk=000具有特別的表現,暗指無寫入遮罩用於特定的指令(這可以以各種方式實施,包含使用實體接線至所有或硬體之寫入遮罩,所述硬體是繞過遮罩硬體)。 Write mask field 170 (EVEX byte 3, bit [2:0]-kkk) - as previously described, its contents specify the scratchpad index written into the hood register. In an embodiment of the invention, the specific value EVEX.kkk=000 has a special representation, implying that there is no write mask for a particular instruction (this can be implemented in various ways, including using physical wiring to all or hardware) Write to the mask, the hardware is bypassing the mask hardware).

實數作業碼欄位230(位元組4)也稱為作業碼位元組。在此欄位中指定作業碼的一部份。 The real job code field 230 (bytes 4) is also referred to as a job code byte. Specify a part of the job code in this field.

MOD R/M欄位240(位元組5)包含MOD欄位242、Reg欄位244、及R/M欄位246。如同先前所述般,MOD欄位242的內容區別記憶體存取與非記憶體存取作業。Reg欄位244的角色可以總合為二情形:將目的地暫 存器運算元或源暫存器運算元編碼,或是被當作作業碼擴充來處理且不被用以將任何指令運算元編碼。R/M欄位246的角色可以包含下述:將參考記憶體位址的指令運算元編碼,或者,將目的地暫存器運算元或源暫存器運算元編碼。 The MOD R/M field 240 (byte 5) contains the MOD field 242, the Reg field 244, and the R/M field 246. As previously described, the contents of MOD field 242 distinguish between memory access and non-memory access operations. The role of Reg field 244 can be summed up in two cases: the destination is temporarily The register operand or source register operand code is either processed as a job code extension and is not used to encode any instruction operands. The role of the R/M field 246 may include the following: encoding the instruction operand of the reference memory address, or encoding the destination register operand or source register operand.

比例、索引、基礎(SIB)位元組(位元組6)-如同先前所述般,包括ss欄位252的比例欄位250的內容是用於記憶體位址產生。SIB.xxx 254及SIB.bbb 256-這些欄位的內容先前已被述及與暫存器索引Xxxx及Bbbb有關。 Proportional, Index, Base (SIB) Bytes (Bytes 6) - As previously described, the content of the proportional field 250, including the ss field 252, is used for memory address generation. SIB.xxx 254 and SIB.bbb 256 - The contents of these fields have been previously described in relation to the scratchpad indices Xxxx and Bbbb.

位移欄位162A(位元組7-10)-當MOD欄位242含有10時,位元組7-10是位移欄位162A,且其與舊有32位元位移(disp32)相同工作並以位元組粒度工作。 Displacement field 162A (bytes 7-10) - When MOD field 242 contains 10, byte 7-10 is displacement field 162A, and it works the same as the old 32 bit displacement (disp32) and The byte size works.

位移因數欄位162B(位元組7)-當MOD欄位242含有01時,位元組7是位移因數欄位162B。此欄位的位置與以位元組粒度工作的舊有x86指令集8位元位移(disp8)的位置相同。由於disp8是正負號擴充,所以,其僅可以在-128與127位元組差距之間定址;以64位元組快取線的觀點而言,disp8使用可以被設定為僅四個真正有用的值-128、-64、0、及64之8位元;由於通常需要更大的範圍,所以,使用disp32;但是,disp32要求4位元組。與disp8和disp32相反,位移因數欄位162B是disp8的再解譯;當使用位移因數欄位162B時,真實的位移由位移因數欄位的內容乘以記憶體運算元存取(N)所決定。此型式的位移被稱為disp8*N。這降低平均的指令 長度(用於位移但是具有更大範圍的單一位元組)。此被壓縮的位移是根據有效的位移是記憶體存取的粒度之倍數的假設,因此,位址差距的冗餘低階位元不需被編碼。換言之,位移因數欄位162B替代舊有x86指令集8位元位移。因此,位移因數欄位162B以同於x86指令集8位元位移的方式編碼(以致於ModRM/SIM編碼規則不變),僅有的例外是disp8被過載至disp8*N。換言之,編碼規則或編碼長度沒有變化,但是僅有硬體對位移值的解譯有變化(這需要將位移依記憶體運算元的大小來比例化以取得位元組方式的位址差距)。 Displacement Factor Field 162B (Bytes 7) - When MOD field 242 contains 01, byte 7 is the displacement factor field 162B. The location of this field is the same as the position of the old x86 instruction set 8-bit displacement (disp8) that works at byte granularity. Since disp8 is a sign extension, it can only be addressed between the -128 and 127 byte gaps; from the point of view of the 64-bit cache line, disp8 usage can be set to only four really useful The values are -128, -64, 0, and 64 octets; since a larger range is usually required, disp32 is used; however, disp32 requires 4 bytes. In contrast to disp8 and disp32, the displacement factor field 162B is a reinterpretation of disp8; when the displacement factor field 162B is used, the true displacement is determined by multiplying the content of the displacement factor field by the memory operand access (N). . This type of displacement is called disp8*N. This lowers the average instruction Length (a single byte for displacement but with a larger range). This compressed displacement is based on the assumption that the effective displacement is a multiple of the granularity of memory access, so redundant low-order bits of the address gap need not be encoded. In other words, the displacement factor field 162B replaces the old x86 instruction set 8-bit displacement. Thus, the displacement factor field 162B is encoded in the same manner as the x86 instruction set 8-bit displacement (so that the ModRM/SIM encoding rules are unchanged), with the only exception that disp8 is overloaded to disp8*N. In other words, there is no change in the encoding rule or the length of the code, but only the interpretation of the displacement value by the hardware has changed (this requires the displacement to be scaled according to the size of the memory operand to obtain the bit gap of the byte mode).

如IMM8所示之立即欄位172如先前所述地操作。 The immediate field 172 as shown by IMM 8 operates as previously described.

完全作業碼欄位Full job code field

圖2B是方塊圖,顯示根據本發明的一實施例之構成完全作業碼欄位174之特定的向量友善指令格式200的欄位。具體而言,完全作業碼欄位174包含格式欄位140、基礎作業欄位142、及資料元寬度(W)欄位164。基礎作業欄位142包含前置編碼欄位225、作業碼映射欄位215、及實數作業碼欄位230。 2B is a block diagram showing the fields of a particular vector friendly instruction format 200 that constitutes a full job code field 174, in accordance with an embodiment of the present invention. Specifically, the full job code field 174 includes a format field 140, a base job field 142, and a data element width (W) field 164. The base job field 142 includes a pre-coded field 225, a job code mapping field 215, and a real job code field 230.

暫存器索引欄位Scratchpad index field

圖2C是方塊圖,顯示根據本發明的一實施例之構成暫存器索引欄位144之特定的向量友善指令格式200的欄位。具體而言,暫存器索引欄位144包含REX欄位205、 REX’欄位210、REG欄位244、R/M欄位246、VVVV欄位220、xxx欄位254、及bbb欄位256。 2C is a block diagram showing the fields of a particular vector friendly instruction format 200 that constitutes the scratchpad index field 144 in accordance with an embodiment of the present invention. Specifically, the register index field 144 includes the REX field 205, REX' field 210, REG field 244, R/M field 246, VVVV field 220, xxx field 254, and bbb field 256.

擴增作業欄位Augmentation work field

圖2D是方塊圖,顯示根據本發明的一實施例之構成擴增作業欄位150之特定向量友善指令格式200的欄位。當等級(U)欄位168含有0時,其意謂EVEX.U0(等級A 168A);當其含有1時,其表示EVEX.U1(等級B 168B)。當U=0及MOD欄位242含有11時(表示無記憶體存取作業),阿爾發欄位152(EVEX位元組3,位元[7]-EH)被解譯為rs欄位152A。當rs欄位152A含有1(捨入152A.1)時,貝它欄位154(EVEX位元組3,位元[6:4]-SSS)被解譯為捨入控制欄位154A。捨入控制欄位154A包含一位元SAE欄位156及二位元捨入作業欄位158。當rs欄位152A含有0(資料轉換152A.2)時,貝它欄位154(EVEX位元組3,位元[6:4]-SSS)被解譯為三位元資料轉換欄位154B。當U=0及MOD欄位242含有00、01、或10(表示記憶體存取作業)時,阿爾發欄位152(EVEX位元組3,位元[7]-EH)被解譯為逐出暗示(EH)欄位152B及貝它欄位154(EVEX位元組3,位元[6:4]-SSS)被解譯為三位元資料操縱欄位154C。 2D is a block diagram showing the fields of a particular vector friendly instruction format 200 that constitutes an augmentation work field 150, in accordance with an embodiment of the present invention. When level (U) field 168 contains 0, it means EVEX.U0 (level A 168A); when it contains 1, it represents EVEX.U1 (level B 168B). When U=0 and MOD field 242 contain 11 (indicating no memory access operation), Alfa field 152 (EVEX byte 3, bit [7]-EH) is interpreted as rs field 152A . When rs field 152A contains 1 (rounded 152A.1), beta field 154 (EVEX byte 3, bit [6:4]-SSS) is interpreted as rounding control field 154A. The rounding control field 154A includes a one-bit SAE field 156 and a two-bit rounding job field 158. When rs field 152A contains 0 (data conversion 152A.2), beta field 154 (EVEX byte 3, bit [6:4]-SSS) is interpreted as three-bit data conversion field 154B . When U=0 and MOD field 242 contain 00, 01, or 10 (representing a memory access job), Alfa field 152 (EVEX byte 3, bit [7]-EH) is interpreted as The eviction hint (EH) field 152B and the beta field 154 (EVEX byte 3, bit [6:4]-SSS) are interpreted as a three-bit data manipulation field 154C.

當U=1時,阿爾發欄位152(EVEX位元組3,位元[7]-EH)被解譯為寫入遮罩控制(Z)欄位152C。當U=1及MOD欄位242含有11(表示無記憶體存取作業)時, 貝它欄位154的一部份(EVEX位元組3,位元[4]-S0)被解譯為RL欄位157A;當其含有1(捨入157A.1)時,貝它欄位154的其餘部份(EVEX位元組3,位元[6-5]-S2-1)被解譯為捨入作業欄位159A,而當RL欄位157A含有0(VSIZE 157.A2)時,貝它欄位154的其餘部份(EVEX位元組3,位元[6-5]-S2-1)被解譯為向量長度欄位159B(EVEX位元組3,位元[6-5]-L1-0)。當U=1及MOD欄位242含有00、01或10(表示記憶體存取作業)時,貝它欄位154(EVEX位元組3,位元[6:4]-SSS)被解譯為向量長度欄位159B(EVEX位元組3,位元[6-5]-L1-0)及廣播欄位157B(EVEX位元組3,位元[4]-B)。 When U = 1, Alpha field 152 (EVEX byte 3, bit [7] - EH) is interpreted as write mask control (Z) field 152C. When U=1 and MOD field 242 contain 11 (indicating no memory access operation), a portion of the beta field 154 (EVEX byte 3, bit [4]-S 0 ) is interpreted. Is the RL field 157A; when it contains 1 (rounded 157A.1), the rest of the beta field 154 (EVEX byte 3, bit [6-5]-S 2-1 ) is solved Translated as rounding field 159A, and when RL field 157A contains 0 (VSIZE 157.A2), the rest of the beta field 154 (EVEX byte 3, bit [6-5]-S 2-1 ) is interpreted as vector length field 159B (EVEX byte 3, bit [6-5]-L 1-0 ). When U=1 and MOD field 242 contain 00, 01 or 10 (representing a memory access job), the beta field 154 (EVEX byte 3, bit [6:4]-SSS) is interpreted. It is a vector length field 159B (EVEX byte 3, bit [6-5]-L 1-0 ) and a broadcast field 157B (EVEX byte 3, bit [4]-B).

C.舉例說明的暫存器架構 C. An example of a scratchpad architecture

圖3是根據本發明的一實施例之暫存器架構300的方塊圖。在所示的實施例中,有512位元寬的32個向量暫存器310;這些暫存器稱為zmm0至zmm31。較低的16zmm暫存器的低階256位元覆蓋於暫存器ymm0-15之上。較低的16-zmm暫存器的低階128位元(ymm暫存器的低階128位元)覆蓋於暫存器xmm0-15之上。如下述表格中所示般,特定向量友善指令格式200對這些被覆蓋的暫存器檔案操作。 FIG. 3 is a block diagram of a scratchpad architecture 300 in accordance with an embodiment of the present invention. In the illustrated embodiment, there are 32 vector scratchpads 310 of 512 bit width; these registers are referred to as zmm0 to zmm31. The lower order 256 bits of the lower 16zmm register are overlaid on the scratchpad ymm0-15. The lower order 128 bits of the lower 16-zmm scratchpad (the lower order 128 bits of the ymm register) are overlaid on the scratchpad xmm0-15. As shown in the table below, a particular vector friendly instruction format 200 operates on these overwritten scratchpad files.

換言之,向量長度欄位159B在最大長度與一或更多其它較短的長度之間選取,其中,每一此較短長度是先前長度的長度之一半;以及,不具向量長度欄位159B的指令樣板對最大向量長度作業。此外,在一實施例中,特定向量友善指令格式200的等級B指令樣板對緊縮的或純量的單一/雙倍精度浮點資料及緊縮的或純量的整數資料作業。純量作業是對zmm/ymm/xmm暫存器中最低階資料元位置執行的作業;更高階的資料元位置視實施例而保留成與它們在指令之前相同或者零化。 In other words, the vector length field 159B is selected between a maximum length and one or more other shorter lengths, wherein each such shorter length is one-half the length of the previous length; and an instruction without the vector length field 159B The template works for the maximum vector length. Moreover, in one embodiment, the level B command template of the particular vector friendly instruction format 200 is for compact or scalar single/double precision floating point data and compact or scalar integer data jobs. A scalar job is a job performed on the lowest order data element position in the zmm/ymm/xmm register; higher order data element positions are left as they are or zeroed before the instruction, depending on the embodiment.

寫入罩暫存器315-在所示的實施例中,有8個大小均為64位元之寫入罩暫存器(k0至k7)。在替代實施例中,寫入罩暫存器315大小為16位元。如同先前所述般,在本發明的一實施例中,向量罩暫存器k0無法作為寫入遮罩;當正常標示k0的編碼用於寫入遮罩時,其選取0xFFFF的實體接線的寫入遮罩,有效地使用於該指令 的寫入遮罩禁能。 Write hood register 315 - In the illustrated embodiment, there are eight write mask registers (k0 through k7) of size 64 bits. In an alternate embodiment, the write hood register 315 is 16 bits in size. As previously described, in an embodiment of the invention, the vector mask register k0 cannot be used as a write mask; when the code normally labeled k0 is used to write a mask, it selects the write of the physical wiring of 0xFFFF. Into the mask, effectively used in the instruction The write mask is disabled.

一般用途暫存器325-在所示的實施例中,有十六個64位元一般用途暫存器,它們與現有的x86定址模式一起用以將記憶體運算元定址。這些暫存器以名稱RAX、RBX、RCX、RDX、RBP、RSI、RDI、RSP、及R8至R15表示。 General Purpose Register 325 - In the illustrated embodiment, there are sixteen 64-bit general purpose registers that are used with existing x86 addressing modes to address memory operands. These registers are represented by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI, RSP, and R8 to R15.

純量浮點堆疊暫存器檔案(x87堆疊)345,MMX緊縮整數平坦暫存器檔案350疊於其上-在所示的實施例中,x87堆疊是八元堆疊,用以使用x87指令集延伸,對32/64/80位元浮點資料執行純量浮點作業;而MMX暫存器被用以對64位元緊縮暫存器資料執行作業,以及為了某些在MMX及XMM暫存器之間執行的作業而固持運算元。 A scalar floating point stack register file (x87 stack) 345, MMX packed integer flat register file 350 is stacked thereon - in the illustrated embodiment, the x87 stack is an octal stack for use with the x87 instruction set Extends, performs scalar floating point operations on 32/64/80-bit floating-point data; the MMX register is used to perform operations on 64-bit compacted scratchpad data, and for some temporary storage in MMX and XMM The operand is held by the job executed between the devices.

本發明的替代實施例可以使用更寬或更窄的暫存器。此外,本發明的替代實施例可以使用更多、更少、或不同的暫存器檔案及暫存器。 Alternative embodiments of the invention may use a wider or narrower register. Moreover, alternative embodiments of the present invention may use more, fewer, or different register files and registers.

D.舉例說明的核心架構、處理器、及電腦架構D. An illustration of the core architecture, processor, and computer architecture

為了不同目的而以不同方式、及在不同處理器中,實施處理器核心。舉例而言,這些核心的實施包含:1)要用於一般用途計算的一般用途有序核心;2)要用於一般用途計算的高性能一般用途亂序核心;3)主要用於圖形及/或科學(輸貫量)計算的特定用途的核心。不同處理器的實施包含:1)CPU,包含要用於一般用途計算的一 或更多一般用途有序核心及/或要用於一般用途計算的一或更多一般用途亂序核心;及2)副處理器,包含主要用於圖形及/或科學(輸貫量)計算的一或更多特定用途核心。這些不同的處理器導致不同的電腦系統架構,包含:1)在與CPU分別的晶片上的副處理器;2)在與CPU相同的封裝中在分別的晶粒上的副處理器;3)在與CPU相同的晶粒上的副處理器(在此情形中,此副處理器有時被稱為特定用途邏輯,例如集成的圖形及/或科學(輸貫量)邏輯,或是作為特定用途核心);及4)系統晶片,在相同晶粒上包含所述CPU(有時稱為應用核心或應用處理器)、上述副處理器、及其它功能。於下說明舉例說明的核心架構,接著是舉例說明的處理器及電腦架構的說明。 The processor core is implemented in different ways and in different processors for different purposes. For example, the implementation of these cores includes: 1) a general-purpose ordered core to be used for general-purpose computing; 2) a high-performance general-purpose out-of-order core to be used for general-purpose computing; and 3) mainly for graphics and/or Or the core of a specific use of scientific (transportation) calculations. Implementations of different processors include: 1) CPU, containing one to be used for general purpose computing Or more general-purpose ordered cores and/or one or more general purpose out-of-order cores to be used for general-purpose computing; and 2) secondary processors, including primarily for graphical and/or scientific (transport) calculations One or more specific use cores. These different processors lead to different computer system architectures, including: 1) a sub-processor on a separate wafer from the CPU; 2) a sub-processor on separate dies in the same package as the CPU; 3) A sub-processor on the same die as the CPU (in this case, this sub-processor is sometimes referred to as a special-purpose logic, such as integrated graphics and/or science (transmission) logic, or as specific Use core); and 4) system chips containing the CPU (sometimes referred to as an application core or application processor), the aforementioned sub-processors, and other functions on the same die. The core architecture illustrated by the following is illustrated below, followed by an illustration of the illustrated processor and computer architecture.

圖4A是方塊圖,顯示根據本發明的實施例之舉例說明的有序管線及舉例說明的暫存器重命名、亂序議題/執行管線。圖4B是方塊圖,顯示根據本發明的實施例之要包含於處理器中之舉例說明的暫存器重命名、亂序議題/執行架構核心以及有序架構核心之舉例說明的實施例。圖4A-B中的實線方塊顯示有序管線及有序核心,而選加的虛線方塊顯示暫存器重命名、亂序議題/執行管線及核心。在有序態樣是亂序態樣的子集合之假設下,說明亂序態樣。 4A is a block diagram showing an ordered pipeline and an exemplary scratchpad rename, out of order issue/execution pipeline, exemplified in accordance with an embodiment of the present invention. 4B is a block diagram showing an exemplary embodiment of an exemplary register renaming, out-of-order issue/execution architecture core, and an ordered architecture core to be included in a processor in accordance with an embodiment of the present invention. The solid lines in Figures 4A-B show the ordered pipeline and the ordered core, while the selected dashed squares show the register rename, the out-of-order issue/execution pipeline, and the core. Under the assumption that the ordered pattern is a sub-set of disordered states, the disordered state is explained.

在圖4A中,處理器管線400包含提取級402、長度解碼級404、解碼級406、分配級408、重命名級410、排 程(也稱為派遣或核發)級412、暫存器讀取/記憶體讀取級414、執行級416、寫回/記憶體寫入級418、例外處理級422、及提交級424。 In FIG. 4A, processor pipeline 400 includes an extraction stage 402, a length decoding stage 404, a decoding stage 406, an allocation stage 408, a rename stage 410, and a row. The process (also referred to as dispatch or issue) stage 412, scratchpad read/memory read stage 414, execution stage 416, write back/memory write stage 418, exception processing stage 422, and commit stage 424.

圖4B顯示處理器核心490,處理器核心490包含耦合至執行引擎單元450之前端單元430,引擎單元450及前端單元430都耦合至記憶體單元470。核心490可為精簡指令集計算(RISC)核心、複雜指令集計算(CISC)核心、很長指令字(VLIW)核心、或是混合或替代核心型式。關於又另一選項,核心490可為特別用途的核心,舉例而言,例如網路或通訊核心、壓縮引擎、副處理器核心、一般用途計算圖形處理單元(GPGPU)核心、圖形核心等等。 4B shows a processor core 490 that includes a front end unit 430 coupled to an execution engine unit 450, both of which are coupled to a memory unit 470. The core 490 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 core pattern. With respect to yet another option, core 490 can be a core for special purposes, such as, for example, a network or communication core, a compression engine, a secondary processor core, a general purpose computing graphics processing unit (GPGPU) core, a graphics core, and the like.

前端單元430包含分支預測單元432,分支預測單元432耦合至指令快取單元434,指令快取單元434耦合至指令轉譯旁看緩衝器(TLB)436,指令轉譯旁看緩衝器(TLB)436耦合至指令提取單元438,指令提取單元438耦合至解碼單元440。解碼單元440(或解碼器)將指令解碼,以及產生微碼進入點、微指令、其它指令、或是從原始指令解碼、或是從原始指令以其它方式反應、或是從原始指令導出的其它控制訊號,以作為輸出的一或更多微作業。使用各種不同的機構,以實施解碼單元440。適當的機構實例包含但不限於查詢表、硬體實施、可編程邏輯陣列(PLA)、微碼唯讀記憶體(ROM)、等等。在一實施例中,核心490包含儲存用於某些巨集指令的微碼(例 如,在解碼單元440中或是在前端單元430之內)之微碼ROM或是其它媒體。解碼單元440耦合至執行引擎單元450中的重命名/分配器單元452。 The front end unit 430 includes a branch prediction unit 432 coupled to an instruction cache unit 434, the instruction cache unit 434 is coupled to an instruction translation lookaside buffer (TLB) 436, and the instruction translation lookaside buffer (TLB) 436 is coupled. To instruction fetch unit 438, instruction fetch unit 438 is coupled to decode unit 440. Decoding unit 440 (or decoder) decodes the instructions and generates microcode entry points, microinstructions, other instructions, or decodes from the original instructions, or otherwise reacts from the original instructions, or other derived from the original instructions. Control the signal to one or more micro-jobs as an output. A variety of different mechanisms are used to implement decoding unit 440. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLAs), microcode read only memory (ROM), and the like. In an embodiment, core 490 includes microcode for storing certain macro instructions (eg, For example, in the decoding unit 440 or in the front end unit 430, the microcode ROM or other media. Decoding unit 440 is coupled to renaming/allocator unit 452 in execution engine unit 450.

執行引擎單元450包含重命名/分配器單元452,命名/分配器單元452耦合至退出單元454及一或更多排程器單元456的集合。排程器單元456代表任何數目的不同排程器,包含保留站、中央指令窗等等。排程器單元456耦合至實體暫存器檔案單元458。各實體暫存器檔案單元458代表一或更多實體暫存器檔案,不同的實體暫存器檔案儲存例如純量整數、純量浮點、緊縮整數、緊縮浮點、向量整數、向量浮點、等等一或更多不同的資料型式、狀態(例如,指令指標,指令指標是要被執行的下一指令的位址)等等。在一實施例中,實體暫存器檔案單元458包括向量暫存器單元、寫入罩暫存器單元、及純量暫存器單元。這些暫存器單元提供架構向量暫存器、向量罩暫存器、及一般用途暫存器。實體暫存器檔案單元458由退出單元454重疊,以顯示實施暫存器重命名及失序執行的各種方式(例如,使用重排序緩衝器及退出暫存器檔案;使用未來檔案、歷史緩衝器、及退出暫存器檔案;使用暫存器映射及暫存器池等等)。退出單元454及實體暫存器檔案單元458耦合至執行叢集460。執行叢集460包含一或更多執行單元462的集合以及一或更多記憶體存取單元464的集合。執行單元462執行不同的作業(例如,偏移、加法、減法、乘法)以及對不同型式的資料(例如, 純量浮點、緊縮整數、緊縮浮點、向量整數、向量浮點)執行作業。雖然某些實施例包含專用於特定功能或功能集的一些執行單元,但是,其它實施例可以僅包含一執行單元或是多個都執行所有功能的執行單元。由於某些實施例產生用於某些型式的資料/作業之分別的管線,所以,排程器單元456、實體暫存器檔案458、及執行叢集460顯示為可能為複數的(例如,均具有它們自己的排程器單元、實體暫存器檔案單元、及/或執行叢集的純量整數管線、純量浮點/緊縮整數/緊縮浮點/向量整數/向量浮點管線及/或記憶體存取管理,以及,在分別的記憶體存取管線的情形中,實施某些實施例,其中,僅有此管線的執行叢集具有記憶體存取單元464)。也應瞭解,在使用分別的管線時,這些管線中之一或更多可以是亂序核發/執行,而其它是有序的。 Execution engine unit 450 includes a rename/allocator unit 452 that is coupled to a collection of exit unit 454 and one or more scheduler units 456. Scheduler unit 456 represents any number of different schedulers, including reservation stations, central command windows, and the like. Scheduler unit 456 is coupled to physical register file unit 458. Each physical register file unit 458 represents one or more physical register files, and different physical register files store, for example, scalar integers, scalar floating points, compact integers, compact floating points, vector integers, vector floating points. , etc. One or more different data types, states (eg, instruction indicators, instruction indicators are the addresses of the next instruction to be executed), and so on. In one embodiment, the physical scratchpad file unit 458 includes a vector register unit, a write hood register unit, and a scalar register unit. These register units provide an architectural vector register, a vector mask register, and a general purpose register. The physical scratchpad file unit 458 is overlapped by the exit unit 454 to display various ways of implementing register rename and out-of-order execution (eg, using a reorder buffer and exiting the scratchpad file; using future files, history buffers, and Exit the scratchpad file; use the scratchpad map and the scratchpad pool, etc.). Exit unit 454 and physical register file unit 458 are coupled to execution cluster 460. Execution cluster 460 includes a collection of one or more execution units 462 and a collection of one or more memory access units 464. Execution unit 462 performs different jobs (eg, offset, addition, subtraction, multiplication) as well as information on different types (eg, Scalar floating point, compact integer, compact floating point, vector integer, vector floating point) execute the job. While some embodiments include some execution units that are specific to a particular function or set of functions, other embodiments may include only one execution unit or multiple execution units that perform all functions. Since some embodiments generate separate pipelines for certain types of data/jobs, scheduler unit 456, physical register file 458, and execution cluster 460 are shown as likely to be plural (eg, both have Their own scheduler unit, physical register file unit, and/or scalar integer pipeline that performs clustering, scalar floating/compact integer/tight floating point/vector integer/vector floating point pipeline and/or memory Access management, and in the case of separate memory access pipelines, implements certain embodiments in which only the execution cluster of this pipeline has a memory access unit 464). It should also be appreciated that when separate pipelines are used, one or more of these pipelines may be out of order issue/execution, while others are ordered.

記憶體存取單元464的集合耦合至記憶體單元470,記憶體單元470包含耦合至資料快取單元474的資料TLB單元472,資料快取單元474耦合至階層2(L2)快取單元476。在一舉例說明的實施例中,記憶體存取單元464包含載入單元、儲存位址單元、及儲存資料單元,各單元耦合至記憶體單元470中的資料TLB單元472。指令快取單元434又耦合至記憶體單元470中的階層2(L2)快取單元476。L2快取單元476耦合至一或更多其它階層的快取記憶體以及最後耦合至主記憶體。 The set of memory access units 464 are coupled to a memory unit 470 that includes a data TLB unit 472 coupled to a data cache unit 474 that is coupled to a level 2 (L2) cache unit 476. In an illustrative embodiment, memory access unit 464 includes a load unit, a store address unit, and a store data unit, each unit being coupled to a data TLB unit 472 in memory unit 470. Instruction cache unit 434 is in turn coupled to level 2 (L2) cache unit 476 in memory unit 470. L2 cache unit 476 is coupled to one or more other levels of cache memory and finally to the main memory.

舉例而言,舉例說明的暫存器重命名、亂序核發/執 行核心架構如下所述地實施管線400:1)指令提取438執行提取及長度解碼級402和404;2)解碼單元440執行解碼級406;3)重命名/分配器單元452執行分配級408及重命名級410;4)排程器單元456執行排程級412;5)實體暫存器檔案單元458及記憶體單元470執行暫存器讀取/記憶體讀取級414;執行叢集460執行執行級416;6)記憶體單元470及實體暫存器檔案單元458執行寫回/記憶體寫入級418;7)各種單元涉及例外處理級422;以及,8)退出單元454及實體暫存器檔案單元458執行提交級424。 For example, an example of register renaming, out-of-order issuing/executing The row core architecture implements pipeline 400 as follows: 1) instruction fetch 438 performs fetch and length decode stages 402 and 404; 2) decode unit 440 performs decode stage 406; 3) rename/allocator unit 452 performs allocation stage 408 and Renaming stage 410; 4) scheduler unit 456 performs scheduling stage 412; 5) physical register file unit 458 and memory unit 470 executing register read/memory read stage 414; execution cluster 460 execution Execution stage 416; 6) memory unit 470 and physical register file unit 458 perform write back/memory write stage 418; 7) various units involve exception processing stage 422; and, 8) exit unit 454 and entity temporary storage The file archive unit 458 executes the commit stage 424.

核心490支援一或更多指令集(例如,x86指令集(增加較新版本的某些擴充);加州太陽谷的MIPS Technologies的MIPS指令集;加州太陽谷的ARM Holdings的ARM指令集(加上選加的例如NEON等增加擴充)),包含此處所述的指令。在一實施例中,核心490包含邏輯以支援緊縮資料指令集擴充(例如AVX1、AVX2),藉以允許由很多多媒體應用所使用的作業使用緊縮資料而執行。 Core 490 supports one or more instruction sets (for example, the x86 instruction set (which adds some extensions to newer versions); MIPS Technologies' MIPS instruction set from California Sun Valley; ARM Holdings' ARM instruction set from Sun Valley, California (plus Optional additions such as NEON add extensions)), including the instructions described herein. In one embodiment, core 490 includes logic to support a compact data instruction set extension (eg, AVX1, AVX2) to allow jobs used by many multimedia applications to be executed using compacted material.

應瞭解,核心支援多緒(執行二或更多平行的作業或緒組),以及,以各種方式如此執行,這些方式包含時間切割多緒、同時多緒(其中,單一實體核心提供用於實體核心同時正多緒化的多個緒中的各緒之邏輯核心)、或是其組合(例如,時間切割提取及解碼以及其後的同時多緒,例如Intel® Hyperthreading技術中所示)。 It should be understood that the core support is multi-threaded (executing two or more parallel jobs or groups), and is performed in various ways, including time-cutting and multi-threading (where a single entity core is provided for the entity) The core is a logical core of multiple threads that are simultaneously multi-threaded, or a combination thereof (for example, time-cut extraction and decoding, and subsequent multi-threading, such as shown in Intel ® Hyperthreading technology).

雖然在亂序執行的環境中說明暫存器重命名,但是,應瞭解,暫存器重命名可用於有序架構中。雖然所示的處理器的實施例也包含分別的指令及資料快取單元434/474以及共用的L2快取單元476,但是,替代實施例具有用於指令及資料之單一內部快取,例如階層1(L1)內部快取、或是多階層的內部快取。在某些實施例中,系統包含內部快取及外部快取的組合,外部快取是核心及/或處理器的外部。替代地,所有的快取可以是核心及/或處理器的外部。 Although register renaming is described in an out-of-order execution environment, it should be understood that register renaming can be used in an ordered architecture. Although the illustrated embodiment of the processor also includes separate instruction and data cache units 434/474 and a shared L2 cache unit 476, alternative embodiments have a single internal cache for instructions and data, such as a hierarchy. 1 (L1) internal cache, or multi-level internal cache. In some embodiments, the system includes a combination of internal caches and external caches, the external cache being external to the core and/or processor. Alternatively, all caches may be external to the core and/or processor.

圖5A-B顯示更特定之舉例說明的有序核心架構的方塊圖,其中,核心是晶片中數個邏輯區塊(包含相同型式及/或不同型式的其它核心)中之一。這些邏輯區塊視應用而經由設有某些固定功能邏輯之高頻寬互連網路(例如,環式網路)、記憶體I/O介面、及其它所需I/O邏輯而通訊。 5A-B show block diagrams of a more specific illustrated ordered core architecture in which the core is one of several logical blocks (including other cores of the same type and/or different types) in the wafer. These logic blocks are communicated depending on the application via a high frequency wide interconnect network (eg, a ring network), a memory I/O interface, and other required I/O logic with certain fixed function logic.

圖5A是根據本發明的實施例之單一處理器核心、以及其對實作為環式網路的晶粒上互連網路502的連接及其本地子集合的階級2(L2)快取記憶體504之方塊圖。在一實施例中,指令解碼器500支援設有緊縮資料指令集擴充的x86指令集。L1快取記憶體506允許對快取記憶體低潛時存取至純量及向量單元。雖然在一實施例中(為了簡化設計),純量單元508和向量單元510使用分開的暫存器集(分別為純量暫存器512和向量暫存器514)及在它們之間傳送的資料被寫至記憶體,然後從階層1(L1) 快取記憶體506讀回,但是,本發明的替代實施例可以使用不同的方式(例如,使用單一暫存器集或是包含通訊路徑,允許資料在二暫存器檔案之間傳送而不用寫入及讀回)。 5A is a diagram of a single processor core, and its connection to its intra-die interconnect network 502 and its local subset of class 2 (L2) caches 504, in accordance with an embodiment of the present invention. Block diagram. In one embodiment, the instruction decoder 500 supports an x86 instruction set with an expansion of the compact data instruction set. The L1 cache memory 506 allows access to scalar and vector units for cache memory low latency. Although in one embodiment (to simplify the design), scalar unit 508 and vector unit 510 use separate sets of registers (both scalar registers 512 and vector registers 514, respectively) and are transferred between them. Data is written to memory and then from level 1 (L1) The cache memory 506 is read back, however, alternative embodiments of the present invention may use different methods (eg, using a single scratchpad set or containing a communication path, allowing data to be transferred between the two scratchpad files without writing Enter and read back).

L2快取記憶體504的本地子集合是被分割成多個分別的本地子集合之通用L2快取的部份,每一處理器核心有一分別的本地子集合。各處理器核心對於它自己的L2快取記憶體504的本地子集合具有直接存取路徑。與存取它們自己的本地L2快取記憶體子集合之其它處理器核心相平行地,由處理器核心讀取的資料被儲存在L2快取子集合504中且可以被快速地存取。由處理器核心寫入的資料儲存在它自己的L2快取子集合504中,且假使需要時從其它子集合湧入。環式網路確保共用資料的同調性。環式網路是雙向的以允許例如處理器核心、L2快取記憶體及其它邏輯區塊以在晶片之內彼此通訊。各環式資料路徑是每一方向1012位元寬。 The local subset of L2 cache memory 504 is the portion of the general L2 cache that is partitioned into a plurality of respective local subsets, each processor core having a separate local subset. Each processor core has a direct access path to its own local subset of L2 cache memory 504. Parallel to the other processor cores accessing their own local L2 cache memory subset, the data read by the processor core is stored in the L2 cache subset 504 and can be accessed quickly. The data written by the processor core is stored in its own L2 cache sub-set 504 and flooded from other subsets if needed. The ring network ensures the homology of shared data. The ring network is bidirectional to allow, for example, processor cores, L2 caches, and other logic blocks to communicate with each other within the wafer. Each ring data path is 1012 bits wide in each direction.

圖5B是根據本發明的實施例的圖5A中的處理器核心的部份之放大視圖。圖5B包含L1快取記憶體506的L1資料快取記憶體506A部份、以及關於向量單元510和向量暫存器514的更多細節。具體而言,向量單元510是16-寬的向量處理單元(VPU)(請參見16-寬的ALU 528),其執行整數、單精準浮點、及雙倍精準浮點指令中之一或更多。VPU以調和單元520支援調和暫存器輸入、以數字轉換單元522A-B支援數字轉換、以及以記憶體輸入上的複製單元524支援複製。寫入遮罩暫存器526 允許預測造成的向量寫入。 Figure 5B is an enlarged view of a portion of the processor core of Figure 5A, in accordance with an embodiment of the present invention. FIG. 5B includes the L1 data cache 506A portion of L1 cache 506, and more details regarding vector unit 510 and vector register 514. In particular, vector unit 510 is a 16-wide vector processing unit (VPU) (see 16-wide ALU 528) that performs one of integer, single precision floating point, and double precision floating point instructions or more many. The VPU supports the buffer register input by the blending unit 520, the digital conversion by the digital conversion unit 522A-B, and the copying by the copy unit 524 on the memory input. Write mask register 526 Allows vector writes caused by predictions.

圖6是根據本發明的實施例之具有一個以上的核心、具有集成的記憶體控制器、及具有集成的圖形的處理器600的方塊圖。圖6中的粗線框顯示具有單核心602A、系統代理器610、一或更多匯流排控制器單元616的組之處理器600,而選加的虛線框顯示設有多核心602A-N、系統代理器單元610中一或更多整合的記憶體控制器元614的組、以及特定用途邏輯608的替代處理器600。 6 is a block diagram of a processor 600 having more than one core, having an integrated memory controller, and having integrated graphics, in accordance with an embodiment of the present invention. The thick lined box in FIG. 6 shows processor 600 having a single core 602A, system agent 610, one or more bus controller unit 616, and the selected dashed box shows multi-core 602A-N, A set of one or more integrated memory controller elements 614 in system agent unit 610, and an alternate processor 600 of special purpose logic 608.

因此,處理器600的不同實施包含:1)CPU,設有特定用途邏輯608及核心602A-N,特定用途邏輯608是集成的圖形及/或科學(通量)邏輯(包含一或更多核心),核心602A-N是一或更多一般用途核心(例如,一般用途有序核心、一般用途亂序核心、二者之組合);2)副處理器,設有核心602A-N,核心602A-N是大量主要用於圖形及/或科學(通量)的特定用途核心;以及,3)副處理器,設有核心602A-N,核心602A-N是大量一般用途的有序核心。因此,處理器600可為一般用途處理器、副處理器或特定用途處理,舉例而言,網路或通訊處理器、壓縮引擎、圖形處理器GPGPU(一般用途圖形處理單元),高通量多集成核心(MIC)副處理器(包含30或更多核心)、嵌入式處理器、等等。處理器可以實施在一或更多晶片上。使用例如BiCMOS、CMOS、或NMOS等多種製程技術,處理器600可以實施在一或更多基底上及/或其一部份。 Thus, different implementations of processor 600 include: 1) a CPU with special purpose logic 608 and cores 602A-N, and application specific logic 608 is integrated graphics and/or scientific (flux) logic (including one or more cores) Core 602A-N is one or more general purpose cores (eg, general purpose ordered core, general purpose out-of-order core, a combination of the two); 2) secondary processor with core 602A-N, core 602A -N is a large number of specific use cores primarily for graphics and/or science (flux); and, 3) a sub-processor with cores 602A-N, core 602A-N is a large number of general purpose ordered cores. Therefore, the processor 600 can be a general-purpose processor, a sub-processor, or a specific purpose processing, for example, a network or communication processor, a compression engine, a graphics processor GPGPU (general purpose graphics processing unit), and a high throughput. Integrated core (MIC) sub-processor (including 30 or more cores), embedded processor, and more. The processor can be implemented on one or more wafers. Processor 600 can be implemented on one or more substrates and/or portions thereof using a variety of process technologies such as BiCMOS, CMOS, or NMOS.

記憶體階層架構包含在核心內的一或更多階層的快取記憶體、一組或一或更多共用快取單元606、及耦合至集成的記憶體控制器單元614組之外部記憶體(未顯示)。共用快取單元606組可以包含例如階層2(L2)、階層3(L3)、階層4(L4)、或其它階層快取記憶體等一或更多中級快取、最後階層快取記憶體(LLC)、及/或其組合。雖然在一實施例中,環式基礎互連單元612將整合圖形邏輯608、共用快取單元606的組、及系統代理器單元610/集成的記憶體控制器單元614互連,但是,替代實施例可以使用任何數目的已知技術來互連這些單元。在一實施例中,在一或更多快取單元606與核心602-A-N之間維持同調性。 The memory hierarchy includes one or more levels of cache memory within the core, a set or one or more shared cache units 606, and external memory coupled to the integrated memory controller unit 614 group ( Not shown). The shared cache unit 606 group may include one or more intermediate caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other hierarchical cache memory, and the last level cache memory ( LLC), and/or combinations thereof. Although in an embodiment, the ring basic interconnect unit 612 interconnects the integrated graphics logic 608, the set of shared cache units 606, and the system agent unit 610 / integrated memory controller unit 614, alternative implementations Examples Any number of known techniques can be used to interconnect these units. In an embodiment, one or more cache units 606 maintain coherence between cores 602-A-N.

在某些實施例中,核心602A-N中之一或更多核心能夠多緒化。系統代理器610包含協調及操作核心602A-N之那些組件。系統代理器單元610可以包含例如電力控制單元(PCU)及顯示單元。PCU可以是或包含調節核心602A-N及集成的圖形邏輯608的電力狀態所需的邏輯及組件。顯示單元是用於驅動一或更多外部連接的顯示器。 In some embodiments, one or more of the cores 602A-N can be multi-threaded. System agent 610 includes those components that coordinate and operate cores 602A-N. System agent unit 610 can include, for example, a power control unit (PCU) and a display unit. The PCU can be or contain the logic and components needed to adjust the power states of cores 602A-N and integrated graphics logic 608. The display unit is a display for driving one or more external connections.

以架構指令集的觀點而言,核心602A-N可以是同質的或異質的;亦即,核心602A-N中之二或更多能夠執行相同的指令集,而其它核心能夠僅執行該指令集的子集合或不同的指令集。 From the perspective of the architectural instruction set, cores 602A-N may be homogeneous or heterogeneous; that is, two or more of cores 602A-N can execute the same set of instructions, while other cores can execute only the set of instructions. Subsets or different instruction sets.

圖7-10是舉例說明的電腦架構的方塊圖。用於膝上型電腦、桌上型電腦、手持PC、個人數位助理、工程工 作站、伺服器、網路裝置、網路集線器、交換器、嵌入式處理器、數位訊號處理器(DSP)、圖形裝置、電動遊戲裝置、機上盒、微控制器、行動電話、可攜式媒體播放器、手持裝置、及各式各樣的其它電子裝置之此領域中熟知的其它系統設計及配置也是適合的。一般而言,能夠併有此處所揭示的處理器及/或其它執行邏輯的眾多種類的系統或電子裝置通常是適合的。 7-10 are block diagrams of an exemplary computer architecture. For laptops, desktops, handheld PCs, personal digital assistants, engineering workers Stations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, mobile phones, portable Other system designs and configurations well known in the art for media players, handheld devices, and a wide variety of other electronic devices are also suitable. In general, a wide variety of systems or electronic devices capable of having the processors and/or other execution logic disclosed herein are generally suitable.

現在參考圖7,其顯示根據本發明的一實施例之系統700的方塊圖。系統700可以包含耦合至控制器集線器720之一或更多處理器710、715。在一實施例中,控制器集線器720包含圖形記憶體控制器集線器(GMCH)790及輸入/輸出集線器(IOH)750(可以在分別的晶片上);GMCH 790包含記憶體及圖形控制器,記憶體740及副處理器745耦合至記憶體及圖形控制器;IOH 750將輸入/輸出(I/O)裝置760耦合至GMCH 790。替代地,記憶體及圖形控制器中之一或二者集成於處理器之內(如上所述),記憶體740及副處理器745直接耦合至處理器710、及設有IOH 750之單晶片中的控制器集線器720。 Referring now to Figure 7, a block diagram of a system 700 in accordance with an embodiment of the present invention is shown. System 700 can include one or more processors 710, 715 coupled to controller hub 720. In one embodiment, controller hub 720 includes a graphics memory controller hub (GMCH) 790 and an input/output hub (IOH) 750 (which may be on separate wafers); GMCH 790 includes memory and graphics controllers, memory Body 740 and sub-processor 745 are coupled to a memory and graphics controller; IOR 750 couples input/output (I/O) device 760 to GMCH 790. Alternatively, one or both of the memory and graphics controller are integrated within the processor (as described above), the memory 740 and the secondary processor 745 are directly coupled to the processor 710, and the single chip with the IOH 750 Controller hub 720.

在圖7中以虛線標示增加的處理器715的選加本質。每一處理器710、715包含此處所述的一或更多處理核心以及可以是某些版本的處理器600。 The added nature of the added processor 715 is indicated by dashed lines in FIG. Each processor 710, 715 includes one or more processing cores as described herein and may be a processor 600 of some versions.

舉例而言,記憶體740可以是動態隨機存取記憶體(DRAM)、相位改變記憶體(PCM)、或是二者的組合。對於至少一實施例,控制器集線器720經由多接點匯 流排而與處理器710、715通訊,多接匯流排為例如前側匯流排(FSB)、例如快速路徑互連(QPI)等點對點介面、或是類似連接795。 For example, the memory 740 can be a dynamic random access memory (DRAM), phase change memory (PCM), or a combination of both. For at least one embodiment, the controller hub 720 is connected via multiple contacts The bus is in communication with the processors 710, 715, and the plurality of busses are, for example, a front side bus (FSB), a point-to-point interface such as a fast path interconnect (QPI), or the like.

在一實施例中,副處理器745是特定用途處理器,例如高通量MIC處理器、網路或通訊處理器、壓縮引擎、圖形處理器、GPGPU、嵌入式處理器、等等。在一實施例中,控制器集線器720包含集成的圖形加速器。 In an embodiment, the secondary processor 745 is a special purpose processor, such as a high throughput MIC processor, a network or communications processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, and the like. In an embodiment, controller hub 720 includes an integrated graphics accelerator.

以包含架構、微架構、熱、耗電特徵、等等準則計量光譜的觀點而言,實體資源710、715之間有各種差異。 There are various differences between physical resources 710, 715 from the perspective of measuring spectra including architecture, microarchitecture, thermal, power consuming characteristics, and the like.

在一實施例中,處理器710執行控制一般型式的資料處理作業之指令。處理器指令可以嵌入在指令之內。處理器710將這些副處理器指令視為應由附加的副處理器745執行的型式。因此,處理器710在副處理器匯流排上或其它互連上核發這些副處理器指令(或是代表副處理器指令的控制訊號)給副處理器745。副處理器745接受及執行收到的處理器指令。 In one embodiment, processor 710 executes instructions that control a general type of data processing job. Processor instructions can be embedded within the instructions. Processor 710 treats these sub-processor instructions as a pattern that should be executed by additional sub-processor 745. Accordingly, processor 710 issues these sub-processor instructions (or control signals representing sub-processor instructions) to sub-processor 745 on the secondary processor bus or other interconnect. The secondary processor 745 accepts and executes the received processor instructions.

現在參考圖8,其顯示根據本發明的實施例之第一更特定舉例說明的系統800的方塊圖。如圖8中所示般,多處理器系統800是點對點互連系統,以及包含經由點對點互連850耦合的第一處理器870和第二處理器880。各處理器870及880可以是某版本的處理器600。在本發明的一實施例中,處理器870和880分別是處理器710和715,而副處理器838是副處理器745。在另一實施例中,處理器870及880分別是處理器710和副處理器 745。 Referring now to Figure 8, a block diagram of a system 800 in accordance with a first more specific illustration of an embodiment of the present invention is shown. As shown in FIG. 8, multiprocessor system 800 is a point-to-point interconnect system and includes a first processor 870 and a second processor 880 coupled via a point-to-point interconnect 850. Each processor 870 and 880 can be a version of processor 600. In an embodiment of the invention, processors 870 and 880 are processors 710 and 715, respectively, and secondary processor 838 is a secondary processor 745. In another embodiment, processors 870 and 880 are processor 710 and secondary processor, respectively. 745.

處理器870及880顯示為分別包含集成的記憶體控制器(IMC)單元872和882。處理器870也包含點對點(P-P)介面876和878作為它的匯流排控制器單元的一部份;類似地,第二處理器880包含P-P介面886和888。處理器870、880可以使用P-P介面電路878、888而經由點對點(P-P)介面850來交換資訊。如同圖8中所示般,IMC 872和882將處理器耦合至各別記憶體,亦即記憶體832和記憶體834,它們可以是本地附著至各別處理器的主記憶體的部份。 Processors 870 and 880 are shown as including integrated memory controller (IMC) units 872 and 882, respectively. Processor 870 also includes point-to-point (P-P) interfaces 876 and 878 as part of its bus controller unit; similarly, second processor 880 includes P-P interfaces 886 and 888. Processors 870, 880 can exchange information via point-to-point (P-P) interface 850 using P-P interface circuits 878, 888. As shown in Figure 8, IMCs 872 and 882 couple the processors to respective memories, namely memory 832 and memory 834, which may be part of the main memory locally attached to the respective processors.

處理器870、880使用點對點介面電路876、894、886、898,經由個別的P-P介面852、854而均可以與晶片組890交換資訊。晶片組890經由高性能介面839,而與副處理器838選加地交換資訊。在一實施例中,副處理器838是特別用途處理器,例如高通量MIC處理器、網路或通訊處理器、壓縮引擎、圖形處理器、GPGPU、嵌入式處理器、等等。 The processors 870, 880 can exchange information with the chipset 890 via the individual P-P interfaces 852, 854 using point-to-point interface circuits 876, 894, 886, 898. Chipset 890 selectively exchanges information with secondary processor 838 via high performance interface 839. In an embodiment, the secondary processor 838 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, and the like.

共用的快取記憶體(未顯示)可以包含在任一處理器中或是二處理器的外部,未經由P-P互連與處理器連接,以致於假使處理器置於低電力模式中時,任一或二處理器的本地快取資訊可以儲存在共用的快取記憶體中。 The shared cache memory (not shown) may be included in either or both of the processors and not connected to the processor via the PP interconnect, such that if the processor is placed in a low power mode, either Or the local cache information of the second processor can be stored in the shared cache memory.

晶片組890可以經由介面896而耦合至第一匯流排816。在一實施例中,第一匯流排816可以是週邊元件互連(PCI)匯流排,或是例如PCI快速匯流排或其它第三 代I/O互匯流排等匯流排,但是,本發明的範圍不侷限於此。 Wafer set 890 can be coupled to first bus bar 816 via interface 896. In an embodiment, the first bus bar 816 can be a peripheral component interconnect (PCI) bus, or, for example, a PCI bus or other third. A bus bar such as an I/O mutual bus bar is used, but the scope of the present invention is not limited thereto.

如圖8中所示般,各式各樣的I/O裝置814與匯流排橋接器818耦合至第一匯流排816,匯流排橋接器818耦合第一匯流排816至第二匯流排820。在一實施例中,例如副處理器、高通量MIC處理器、GPGPU、加速器(例如,圖形加速器或是數位訊號處理(DSP)單元)、現場可編程閘陣列、或是任何其它處理器等一或更多增加的處理器815耦合至第一匯流排816。在一實施例中,第二匯流排820可以是低接腳數(LPC)匯流排。在一實施例中,各種裝置可以耦合至第二匯流排820,舉例而言,包含鍵盤及/或滑鼠822、通訊裝置827及例如包含指令/碼及資料830的碟片驅動器或其它大量儲存裝置的儲存單元828。此外,音頻I/O 824可以耦合至第二匯流排820。注意,其它架構是可能的。舉例而言,取代圖8的點對點架構,系統可以實施多接點匯流排或其它此類架構。 As shown in FIG. 8, a wide variety of I/O devices 814 and bus bar bridges 818 are coupled to a first bus bar 816 that couples a first bus bar 816 to a second bus bar 820. In one embodiment, for example, a sub-processor, a high-throughput MIC processor, a GPGPU, an accelerator (eg, a graphics accelerator or a digital signal processing (DSP) unit), a field programmable gate array, or any other processor, etc. One or more additional processors 815 are coupled to the first bus 816. In an embodiment, the second bus bar 820 can be a low pin count (LPC) bus bar. In an embodiment, various devices may be coupled to the second bus 820, for example, including a keyboard and/or mouse 822, a communication device 827, and, for example, a disc drive containing instructions/codes and data 830 or other mass storage. A storage unit 828 of the device. Additionally, audio I/O 824 can be coupled to second bus 820. Note that other architectures are possible. For example, instead of the point-to-point architecture of Figure 8, the system can implement a multi-contact bus or other such architecture.

現在參考圖9,其顯示根據本發明的實施例之第二更特定的舉例說明的系統900之方塊圖。圖8及9中類似的元件帶有類似的代號,以及,圖8的某些態樣在圖9中被省略,以免模糊圖9的其它態樣。 Referring now to Figure 9, a block diagram of a second more specific illustrated system 900 in accordance with an embodiment of the present invention is shown. Similar elements in Figures 8 and 9 bear similar reference numerals, and certain aspects of Figure 8 are omitted in Figure 9 to avoid obscuring the other aspects of Figure 9.

圖9顯示處理器870、880分別包含集成的記憶體及I/O控制邏輯(CL)872和882。因此,CL 872、882包含集成的記憶體控制器單元及包含I/O控制邏輯。圖9顯示不僅記憶體832、834耦合至CL 872、882,I/O裝置914 也耦合至控制邏輯872、882。舊有I/O裝置915耦合至晶片組890。 FIG. 9 shows that processors 870, 880 include integrated memory and I/O control logic (CL) 872 and 882, respectively. Therefore, CL 872, 882 includes an integrated memory controller unit and contains I/O control logic. Figure 9 shows that not only memory 832, 834 is coupled to CL 872, 882, I/O device 914 It is also coupled to control logic 872, 882. The legacy I/O device 915 is coupled to the chip set 890.

現在參考圖10,其顯示根據本發明的實施例之系統晶片(SoC)1000的方塊圖。圖6中類似的元件帶有類似的代號。而且,虛線框關於更多先進的SoC的選加特點。在圖10中,互連單元1002耦合至:應用處理器1010,包含一或更多核心202A-N的集合及共用快取單元606;系統代理器單元610;匯流排控制器單元616;整合記憶體控制器單元614;一組或一或更多副處理器1020,包含集成的圖形邏輯、影像處理器、音頻處理器、以及視頻處理器;靜態隨機存取記憶體(SRAM)單元1030;直接記憶體存取(DMA)單元1032;以及用於耦合至一或更多外部顯示器的顯示單元1040。在一實施例中,副處理器1020包含特定用途處理器,舉例而言,例如網路或通訊處理器、壓縮引擎、GPGPU、高通量MIC處理器、嵌入式處理器、等等。 Referring now to Figure 10, there is shown a block diagram of a system wafer (SoC) 1000 in accordance with an embodiment of the present invention. Similar elements in Figure 6 have similar designations. Moreover, the dashed box is about the selection features of more advanced SoCs. In FIG. 10, the interconnection unit 1002 is coupled to: an application processor 1010, a set including one or more cores 202A-N and a shared cache unit 606; a system agent unit 610; a bus controller unit 616; integrated memory Body controller unit 614; one or more sub-processors 1020, including integrated graphics logic, image processor, audio processor, and video processor; static random access memory (SRAM) unit 1030; direct A memory access (DMA) unit 1032; and a display unit 1040 for coupling to one or more external displays. In an embodiment, the secondary processor 1020 includes a special purpose processor, such as, for example, a network or communications processor, a compression engine, a GPGPU, a high throughput MIC processor, an embedded processor, and the like.

此處揭示的機制實施例可以以硬體、軟體、韌體或這些實施方式的結合來實施。本發明的實施例可以實施成在可編程系統上執行的電腦程式或程式碼,可編程系統包括至少一處理器、儲存系統(包含依電性及非依電性記憶體及/或儲存元件)、至少一輸入裝置、及至少一輸出裝置。 The mechanism embodiments disclosed herein can be implemented in hardware, software, firmware, or a combination of these embodiments. Embodiments of the invention may be implemented as a computer program or code executed on a programmable system, the programmable system including at least one processor, a storage system (including electrical and non-electrical memory and/or storage elements) At least one input device and at least one output device.

例如圖8中所示的程式碼830可以應用至輸入指令以執行此處所述的功能和產生輸出資訊。輸出資訊可以以已 知方式應用至一或更多輸出裝置。為了此應用,處理系統包含具有例如數位訊號處理器(DSP)、微控制器、特定應用積體電路(ASIC)、或微處理器等處理器之任何系統。 For example, the code 830 shown in Figure 8 can be applied to input instructions to perform the functions described herein and to generate output information. Output information can be The knowledge mode is applied to one or more output devices. For this application, the processing system includes any system having a processor such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

程式碼可以以高階程序或物件導向的程式語言實施,以與處理系統通訊。假使需要時,程式碼也可以以組合或機器語言來實施。事實上,此處所述的機制在範圍上不侷限於任何特定的程式語言。在任何情形中,語言可以是經過編譯或解譯的語言。 The code can be implemented in a high-level program or object-oriented programming language to communicate with the processing system. The code can also be implemented in a combination or machine language, if desired. In fact, the mechanisms described herein are not limited in scope to any particular programming language. In any case, the language can be a compiled or interpreted language.

至少一實施例的一或更多態樣可以由儲存在機器可讀取的媒體上之代表指令實施,代表指令代表處理器內各種邏輯,代表指令由機器讀取時促使機器製造邏輯以執行此處所述的技術。稱為「IP核心」的這些代表可以儲存在實體的、機器可讀取的媒體並供應至各式各樣的客戶或製造設施,而載入至真正地產生邏輯的製造機器或處理器。 One or more aspects of at least one embodiment may be implemented by a representative instruction stored on a machine readable medium, the representative instructions representing various logic within the processor, and causing the machine manufacturing logic to perform this when the instructions are read by the machine The technology described. These representatives, referred to as "IP cores", can be stored in physical, machine-readable media and supplied to a wide variety of customers or manufacturing facilities, to the manufacturing machines or processors that actually generate the logic.

此機器可讀取的媒體包含但不限於由機器或裝置製造或形成的物件之非暫時、實體配置,包括例如硬碟等儲存媒體、包含軟碟、光碟、光碟唯讀記憶體(CD-ROM)、光碟可重寫記憶體(CD-RW)、及磁光碟等任何其它型式的碟片、例如唯讀記憶體(ROM)、例如動態隨機存取記憶體(DRAM)、靜態隨機存取記憶體(SRAM)等隨機存取記憶體(RAM)、可抹拭可編程唯讀記憶體(EPROM)、快閃記憶體、電可抹拭可編程唯讀記憶體(EEPROM)等半導體裝置、相位改變記憶體(PCM)、 磁性或光學卡、或適用於儲存電子指令的任何其它型式的媒體。 The machine readable medium includes, but is not limited to, non-transitory, physical configurations of articles manufactured or formed by the machine or device, including storage media such as a hard disk, including floppy disks, optical disks, and optical disk read-only memory (CD-ROM). ), any other type of disc, such as a CD-RW, and a magneto-optical disc, such as a read-only memory (ROM), such as a dynamic random access memory (DRAM), static random access memory. Semiconductor devices such as random access memory (RAM) such as SRAM, erasable programmable read-only memory (EPROM), flash memory, and electrically erasable programmable read-only memory (EEPROM), phase Change memory (PCM), Magnetic or optical card, or any other type of media suitable for storing electronic instructions.

因此,本發明的實施例也包含含有指令或含有設計資料之非暫時、實體的機器可讀取的媒體,所述設計資料是例如硬體說明語言(HDL),其界定此處所述的結構、電路、裝置、處理器及/或系統特點。這些實施例也意指程式產品。 Thus, embodiments of the invention also include non-transitory, physical machine readable media containing instructions or design data, such as hardware description language (HDL), which defines the structures described herein. , circuit, device, processor and/or system features. These embodiments also mean a program product.

在某些情形中,指令轉換器可以用以將指令從源指令集轉換至標的指令集。舉例而言,指令轉換器可以將指令轉譯(例如,使用靜態二進位轉譯、包含動態編譯的動態二進位轉譯)、變體、模仿、或以其它方式轉換至由核心處理的一或更多其它指令。指令轉換器可以以軟體、硬體、韌體、或其結合來實施。指令轉換器可以是在處理器上、不在處理器上、或部份在處理器上及部份離開處理器。 In some cases, an instruction converter can be used to convert an instruction from a source instruction set to a target instruction set. For example, the instruction converter can translate the instructions (eg, using static binary translation, dynamic binary translation including dynamic compilation), variants, impersonation, or otherwise convert to one or more other processes handled by the core instruction. The command converter can be implemented in software, hardware, firmware, or a combination thereof. The instruction converter can be on the processor, not on the processor, or partially on the processor and partially off the processor.

圖11是方塊圖,將根據本發明的實施例之使用軟體指令轉換器以將源指令集中的二進位指令轉換成標的指令集中的二進位指令作對比。在顯示的實施例中,指令轉換器是軟體指令轉換器,但是,指令轉換器可以替代地以軟體、韌體、硬體、或其各種結合來實施。圖11顯示高階語言1102的程式,可以由x86編譯器1104編譯以產生x86二進位碼1106,二進位碼1106可以由具有至少一x86指令集核心1116的處理器原地執行。具有至少一x86指令集核心1116的處理器代表藉由共容地執行或其它方 式地處理下述,而能夠執行與具有至少一x86指令集核心的英特爾處理器實質上相同功能的任何處理器:(1)英特爾x86指令集核心的指令集的實質部份,或是(2)以在具有至少一x86指令集核心的英特爾處理器上執行為目標之應用程式或其它軟體的物件碼版本,以便取得與具有至少一x86指令集核心的英特爾處理器實質上相同的結果。x86編譯器1104代表可以操作以產生x86二進位碼1106(例如,物件碼)之編譯器,x86二進位碼1106藉由或不藉由增加的鏈結處理,都可以在具有至少一x86指令集核心1116的處理器上執行。類似地,圖11顯示高階語言1102的程式,使用替代指令集編譯器1108,可以將其編譯以產生替代指令集二進位碼1110,替代指令集二進位碼1110可以由不具有至少一x86指令集核心1114的處理器(例如,具有執行例如加州Sunnyvale的MIPS Technologies公司的MIPS指令集及/或加州Sunnyvale的ARM Holdings公司的ARM指令集之核心的處理器)原地執行。指令轉換器1112用以將x86二進位碼1106轉換成可以由不具有x86指令集核心1114的處理器原地執行的碼。由於能夠如此執行的指令轉換器難以製作,所以,此轉換的碼不易與替代指令集二進位碼1110相同;但是,所述轉換的碼將完成一般作業及由來自替代指令集的指令組成。因此,指令轉換器1112代表軟體、韌體、硬體或其組合,其經由模仿、模擬或任何其它處理而允許不具有x86指令集處理器或核心的處理器或其它電子裝置 執行x86二進位碼1106。 11 is a block diagram showing the use of a software instruction converter to convert binary instructions in a source instruction set into binary instructions in a target instruction set for comparison in accordance with an embodiment of the present invention. In the embodiment shown, the command converter is a software command converter, however, the command converter can alternatively be implemented in software, firmware, hardware, or various combinations thereof. 11 shows a program of higher order language 1102 that can be compiled by x86 compiler 1104 to produce x86 binary code 1106, which can be executed in-place by a processor having at least one x86 instruction set core 1116. A processor having at least one x86 instruction set core 1116 is represented by co-processing or other parties Any of the following, capable of performing substantially the same functions as an Intel processor having at least one x86 instruction set core: (1) a substantial portion of the instruction set of the Intel x86 instruction set core, or (2) An object code version of an application or other software targeted for execution 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 1104 represents a compiler operable to generate an x86 binary code 1106 (eg, an object code), and the x86 binary code 1106 may have at least one x86 instruction set with or without added link processing. Executed on the processor of core 1116. Similarly, Figure 11 shows a higher level language 1102 program that can be compiled to generate an alternate instruction set binary code 1110 using an alternate instruction set compiler 1108, which can have no at least one x86 instruction set. The processor of core 1114 (eg, with a processor executing the MIPS instruction set of MIPS Technologies, Inc., Sunnyvale, Calif., and/or the core of the ARM instruction set of ARM Holdings, Inc. of Sunnyvale, Calif.) is performed in place. The instruction converter 1112 is operative to convert the x86 binary bit code 1106 into a code that can be executed in-situ by a processor that does not have the x86 instruction set core 1114. Since the instruction converter that can be executed in this way is difficult to fabricate, the converted code is not as identical as the alternate instruction set binary carry code 1110; however, the converted code will complete the normal operation and consist of instructions from the alternate instruction set. Thus, the instruction converter 1112 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 via emulation, emulation, or any other processing. The x86 binary code 1106 is executed.

執行大整數算數運術的方法及裝置Method and device for performing large integer arithmetic operation

大整數算數(特別是乘法)廣泛地用於例如傳輸層安全(TLS)等協定中的公用鑰密碼術。依賴大整數算數的演繹法樣本清單包含但不限於橢圓曲線(EC)密碼術,其用於橢圓曲線狄飛哈夫曼(Diffie-Hellman)(ECDH)鑰交換以及橢圓曲線數位簽章演繹法(ECDSA)簽章設計;以及,模組算數式演繹法,例如不對稱密碼演算法(Revest-Shamir-Adleman(RSA)、狄飛哈夫曼(Diffie-Hellman,DH)、及數位安全演繹法(DSA)。 Large integer arithmetic (especially multiplication) is widely used for public key cryptography in protocols such as Transport Layer Security (TLS). A list of deductive methods relying on large integer arithmetic includes, but is not limited to, elliptic curve (EC) cryptography, which is used for elliptic curve Diffie-Hellman (ECDH) key exchange and elliptic curve digital signature deduction ( ECDSA) signature design; and module arithmetic deductive methods such as Asymmetric cryptography (Revest-Shamir-Adleman (RSA), Diffie-Hellman (DH), and digital security deduction ( DSA).

由於這些演繹法的高度效率,橢圓曲線密碼術(ECC)現在正大量擴展用於實施完美正向密碼TSL通訊。目前,大部份EC式簽章及鑰交換演繹法是在256(或255)位元質場上執行。這些EC式技術從例如下述的快速256位元乘法大幅得利。 Due to the high efficiency of these deductive methods, elliptic curve cryptography (ECC) is now being extensively extended to implement perfect forward cryptography TSL communication. Currently, most EC-style signatures and key exchange deductions are performed on a 256 (or 255)-bit quality field. These EC-style techniques benefit greatly from fast 256-bit multiplication, such as the following.

本發明的一實施例包含執行二個256位元整數相乘的新指令,產生512位元結果,以及,也執行256位元整數的平方,產生512位元結果。此外,本發明的一實施例包含以有限增加的硬體,再使用目前的架構設計中使用的現存之52 x 52->104位元乘法器。舉例而言,這些乘法器可見於目前由vpmadd52luq以及vpmadd52huq指令使用的現有的x86架構中的浮點相乘相加(FMA)單元中。目前,CNL/ICL伺服器處理器包含FMA硬體(埠1/5,以4循環 執行,具有1循環通量)。有效地,16個乘法器及加法器可供利用,但是它們並未由架構曝露。 An embodiment of the invention includes a new instruction that performs a multiplication of two 256-bit integers, produces a 512-bit result, and also performs a square of a 256-bit integer, yielding a 512-bit result. In addition, an embodiment of the present invention includes a limited addition of hardware to the existing 52 x 52->104 bit multiplier used in current architecture designs. For example, these multipliers can be found in a floating point multiply-add (FMA) unit in the existing x86 architecture currently used by the vpmadd52luq and vpmadd52huq instructions. Currently, the CNL/ICL server processor contains FMA hardware (埠1/5, with 4 cycles) Execution, with 1 cycle flux). Effectively, 16 multipliers and adders are available, but they are not exposed by the architecture.

如圖12中所示,舉例說明的處理器1255設有眾多核心0-N,本發明的實施例可以在舉例說明的處理1255上實施。特別地,各核心包含解碼級1230,解碼級1230具有256位元乘法指令解碼邏輯1231,用於將256位元乘法指令解碼成由執行邏輯1240執行的眾多微作業。特別地,舉例說明的處理器1255也包含256位元乘法指令執行邏輯1241,用於執行根據下述本發明的實施例之256位元乘法運算(例如,使用下述參考圖16所述的乘法器及加法器)。 As illustrated in FIG. 12, the illustrated processor 1255 is provided with a plurality of cores 0-N, and embodiments of the present invention can be implemented on the illustrated process 1255. In particular, each core includes a decode stage 1230 having 256-bit multiply instruction decode logic 1231 for decoding 256-bit multiply instructions into a number of micro-jobs executed by execution logic 1240. In particular, the illustrated processor 1255 also includes 256-bit multiply instruction execution logic 1241 for performing a 256-bit multiplication operation in accordance with an embodiment of the invention described below (e.g., using the multiplication described below with reference to Figure 16). And adder).

此外,各核心0-N包含一般用途暫存器(GRP)1205的組、向量暫存器1206的組、遮罩暫存器1207的組。在一實施例中,多個向量資料元緊縮於各向量暫存器1206中,其具有512位元寬,用於儲存二個256位元值、四個128位元值、八個64位元值、十六個32位元值、等等。但是,本發明的基本原理不侷限於任何特定尺寸/型式的向量資料。在一實施例中,遮罩暫存器1207包含八個64位元運算元遮罩暫存器,用於對儲存在向量暫存器1206(例如,實施成上述遮罩暫存器k0-k7)中的值執行位元遮罩作業。但是,本發明的基本原理不侷限於任何特定遮罩尺寸/型式。 Further, each core 0-N includes a group of general purpose registers (GRP) 1205, a group of vector registers 1206, and a group of mask registers 1207. In one embodiment, a plurality of vector data elements are compacted in each vector register 1206, having a 512-bit width for storing two 256-bit values, four 128-bit values, and eight 64-bit elements. Value, sixteen 32-bit values, and so on. However, the basic principles of the invention are not limited to vector data of any particular size/type. In one embodiment, the mask register 1207 includes eight 64-bit operand mask registers for storing in the vector register 1206 (eg, implemented as the mask register k0-k7) The value in ) performs a bit mask job. However, the basic principles of the invention are not limited to any particular mask size/pattern.

為了簡明起見,於圖12中顯示單一處理器核心(「核心0」)的細節。但是,將瞭解,圖12中所示的 各核心可以具有與核心0相同的邏輯集。舉例而言,各核心也包含專用等級1(L1)快取記憶體1212及等級2(L2)快取記憶體1211,用於根據指定的快取管理政策而快取指令及資料。L1快取記憶體1212包含用於儲存指令之分別的指令快取記憶體1220、以及用於儲存資料之分別的資料快取記憶體1221。以可為固定尺寸(例如長度64、128、512位元組)之快取線的粒度,管理儲存於各式各樣的處理器快取記憶體內的指令及資料。本舉例說明的實施例之各核心具有:指令提取單元1210,用於從主記憶體1200及/或共用等級3(L3)快取記憶體1216提取指令;解碼單元1220,用於將指令解碼(例如,將程式指令解碼成微作業或是「μop」);執行單元1240,用於執行指令;以及,寫回單元1250,用於使指令退出及將結果寫回。 For the sake of brevity, the details of a single processor core ("core 0") are shown in FIG. However, it will be understood that the one shown in Figure 12 Each core can have the same logical set as core 0. For example, each core also includes a dedicated level 1 (L1) cache memory 1212 and a level 2 (L2) cache memory 1211 for fetching instructions and data in accordance with a specified cache management policy. The L1 cache memory 1212 includes separate instruction cache memory 1220 for storing instructions, and a separate data cache memory 1221 for storing data. Commands and data stored in a wide variety of processor cache memories are managed at a granularity of cache lines that can be of fixed size (eg, lengths of 64, 128, and 512 bytes). Each core of the illustrated embodiment has an instruction extraction unit 1210 for extracting instructions from the main memory 1200 and/or the shared level 3 (L3) cache memory 1216, and a decoding unit 1220 for decoding the instructions ( For example, the program instructions are decoded into micro-jobs or "μop"; an execution unit 1240 for executing the instructions; and a write-back unit 1250 for exiting the instructions and writing back the results.

指令提取單元1210包含各式各樣習知的組件,包含:下一指令指標器1203,用於儲存要從記憶體1200(或是快取記憶體中之一)提取的下一指令之位址;指令轉譯旁看緩衝器(ITLB)1204,用於儲存最近使用的虛擬對實體指令位址對映,以增進位址轉譯速度;分支預測單元1202,用於推測地預測指令分支位址;以及,分支標的緩衝器(BTB)1201,用於儲存分支位址及標的位址。一旦被提取時,指令接著被串流至包含解碼單元1230、執行單元1240、及寫回單元1250之指令管線的其餘級。這些單元中的各單元之結構及功能是具有此技藝中的一般 技術者所熟知的,且於此將不會詳述,以免模糊本發明的不同實施例之有關態樣。 The instruction extraction unit 1210 includes various conventional components, and includes: a next instruction indicator 1203 for storing an address of a next instruction to be extracted from the memory 1200 (or one of the cache memories) An instruction translation look-aside buffer (ITLB) 1204 for storing a recently used virtual-to-physical instruction address mapping to enhance address translation speed; a branch prediction unit 1202 for speculatively predicting an instruction branch address; A branch identifier buffer (BTB) 1201 for storing the branch address and the target address. Once extracted, the instructions are then streamed to the remaining stages of the instruction pipeline including decode unit 1230, execution unit 1240, and write back unit 1250. The structure and function of each of these units is generally in the art. It is well known to those skilled in the art and will not be described in detail herein so as not to obscure the various aspects of the various embodiments of the invention.

在一實施例中,下述指令集由256位元乘法指令解碼邏輯1231及256位元乘法指令執行邏輯1241解碼及執行。 In one embodiment, the following set of instructions is decoded and executed by 256-bit multiply instruction decode logic 1231 and 256-bit multiply instruction execution logic 1241.

1. VMUL256TO512 ZMM1,YMM2,YMM3:本指令的一實施例會將源暫存器ymm2和ymm3中的256位元的數相乘並將512位元的結果儲存在目的地向量暫存器zmm1中(所有這些暫存器可以是在向量暫存器1206的組內的暫存器)。 1. VMUL256TO512 ZMM1, YMM2, YMM3: An embodiment of the present instruction multiplies the number of 256 bits in the source register ymm2 and ymm3 and stores the result of 512 bits in the destination vector register zmm1 ( All of these registers can be scratchpads within the group of vector registers 1206).

2. VMUL256TO512 ZMM1,ZMM2,ZMM3:本指令的一實施例會將源向量暫存器zmm2和zmm3下半部中的256位元的數相乘並將512位元的結果儲存在目的地向量暫存器zmm1中。 2. VMUL256TO512 ZMM1, ZMM2, ZMM3: An embodiment of the present instruction multiplies the source vector register zmm2 and the number of 256 bits in the lower half of zmm3 and stores the result of 512 bits in the destination vector. In zmm1.

3. VMUL256TO512 ZMM1,ZMM2,ZMM3,IMM8:本指令的一實施例會將來自源向量暫存器zmm2和zmm3的256位元的數相乘並將512位元的結果儲存在目的地向量暫存器zmm1中。使用立即值,根據下述定義而實施乘法:imm8=0x00->res=zmm2[255:0]*zmm3[255:0],imm8=0x10->res=zmm2[511:256]*zmm3[255:0],imm8=0x01->res=zmm2[255:0]*zmm3[511:256],imm8=0x11->res=zmm2[511:256]*zmm3[511:256]. 3. VMUL256TO512 ZMM1, ZMM2, ZMM3, IMM8: An embodiment of the present instruction multiplies the number of 256 bits from the source vector register zmm2 and zmm3 and stores the result of 512 bits in the destination vector register. In zmm1. Using the immediate value, the multiplication is implemented according to the following definition: imm8=0x00->res=zmm2[255:0]*zmm3[255:0], imm8=0x10->res=zmm2[511:256]*zmm3[255 :0],imm8=0x01->res=zmm2[255:0]*zmm3[511:256],imm8=0x11->res=zmm2[511:256]*zmm3[511:256].

換言之,對於0x00的立即值,從源向量暫存器zmm2及zmm3的位元255:0選取256位元值。對於0x10的立 即值,從源向量暫存器zmm2的位元511:256選取256位元值以及從源向量暫存器zmm3的位元255:0選取256位元值。對於0x01的立即值,從源向量暫存器zmm3的位元511:256選取256位元值以及從源向量暫存器zmm2的位元255:0選取256位元值。最後,對於0x11的立即值,從源向量暫存器zmm2及zmm3的位元511:256選取256位元值。 In other words, for an immediate value of 0x00, a 256-bit value is selected from the source vector register zmm2 and the bit 255:0 of zmm3. For 0x10 stand That is, the 256-bit value is selected from bits 511:256 of the source vector register zmm2 and the 256-bit value is selected from the bit 255:0 of the source vector register zmm3. For an immediate value of 0x01, a 256-bit value is selected from bits 511:256 of the source vector register zmm3 and a 256-bit value is selected from bits 255:0 of the source vector register zmm2. Finally, for an immediate value of 0x11, a 256-bit value is selected from the source vector register zmm2 and the bit 511:256 of zmm3.

圖13顯示用於實施指令的第一變異之本發明的一實施例,其中,256位元乘法邏輯1300將儲存在第一256位元源暫存器1301中的第一256位元整數(例如,在一實施例中為YMM2)與儲存在第二256位元源暫存器1302中的第二256位元整數(例如,在一實施例中為YMM3)相乘。相乘結果儲存在512位元的目的地暫存器1303(例如,在一實施例中為ZMM1)。 13 shows an embodiment of the present invention for implementing a first variation of instructions in which 256-bit multiply logic 1300 stores a first 256-bit integer stored in a first 256-bit source register 1301 (eg, In one embodiment, YMM2) is multiplied by a second 256-bit integer (e.g., YMM3 in one embodiment) stored in a second 256-bit source register 1302. The multiplied result is stored in a 512-bit destination register 1303 (e.g., ZMM1 in one embodiment).

圖14顯示用於實施指令的第二變異之本發明的一實施例,其中,256位元乘法邏輯1300將儲存在第一512位元源向量暫存器1401的下半部中的第一256位元整數(例如,以ZMM2的位元255:0編碼)與儲存在第二512位元源向量暫存器1402中的第二256位元整數(例如,以ZMM3的位元255:0編碼)相乘。相乘結果儲存在512位元的目的地暫存器1303(例如,在一實施例中為ZMM1)。 14 shows an embodiment of the present invention for implementing a second variation of instructions in which 256-bit multiply logic 1300 stores the first 256 in the lower half of the first 512-bit source vector register 1401. A bit integer (eg, encoded with bits 255:0 of ZMM2) and a second 256-bit integer stored in the second 512-bit source vector register 1402 (eg, encoded with bits 255:0 of ZMM3) ) Multiply. The multiplied result is stored in a 512-bit destination register 1303 (e.g., ZMM1 in one embodiment).

圖15顯示用於實施指令的第三變異之本發明的另一實施例。在本實施例中,從第一源暫存器1401及第二源 暫存器1402的下或上半部,選取256位元源運算元。在一實施例中,256位元乘法邏輯根據隨著指令提供的立即值1500(例如imm8)而從暫存器1401-1402的下或上半部選取256位元源運算元。如上所述,假使立即值是0,則從二暫存器1401-1402的下半部(亦即,255:0)選取源運算元。假使立即值是1,則從第一源暫存器1401的上半部(亦即,511:256)選取第一源運算元以及從第二源暫存器1402的下半部(亦即,255:0)選取第二源運算元。假使立即值是2,則從第一源暫存器1401的下半部(亦即,255:0)選取第一源運算元以及從第二源暫存器1402的下半部(亦即,511:256)選取第二源運算元。最後,假使立即值是3,則從二暫存器1401-1402的上半部(亦即,511:256)選取源運算元。 Figure 15 shows another embodiment of the invention for implementing a third variation of the instructions. In this embodiment, from the first source register 1401 and the second source In the lower or upper half of the register 1402, a 256-bit source operand is selected. In one embodiment, the 256-bit multiply logic selects 256-bit source operands from the lower or upper half of the registers 1401-1402 based on the immediate value 1500 (eg, imm8) provided with the instruction. As described above, if the immediate value is 0, the source operand is selected from the lower half of the two registers 1401-1402 (i.e., 255:0). If the immediate value is 1, the first source operand is selected from the upper half of the first source register 1401 (ie, 511:256) and the lower half of the second source register 1402 (ie, 255:0) Select the second source operand. If the immediate value is 2, the first source operand is selected from the lower half of the first source register 1401 (ie, 255:0) and the lower half of the second source register 1402 (ie, 511: 256) Select the second source operand. Finally, if the immediate value is 3, the source operand is selected from the upper half of the two registers 1401-1402 (i.e., 511:256).

圖16顯示用以執行上述作業的256位元乘法邏輯1300的一實施例。下述說明假定乘法運算元是二個256位元數目A`及B`。取代將數目視為數基264中的4個位數,它們可以被當作數基252中的5個位數處理。這允許乘法在浮點執行單元1600、1610中執行,在一實施例中,浮點執行單元1600、1610能夠對52位元(雙倍的尾數)的數目操作。在一實施例中,實施相同的浮點單元,這些相同的浮點單元目前被用以對用於vpmadd52luq及vpmadd52huq x86指令的整數作業。使用此硬體,可以如下所述地決定A`及B`: A`=A4*252*4+A3*252*3+A2*252*2+A1*252*1+A0 Figure 16 shows an embodiment of 256-bit multiplication logic 1300 to perform the above-described operations. The following description assumes that the multiplication element is two 256-bit numbers A' and B'. Instead of treating the number as 4 digits in the base 264, they can be treated as 5 digits in the base 252. This allows multiplication to be performed in floating point execution units 1600, 1610, which in one embodiment can operate on the number of 52 bits (double the mantissa). In one embodiment, the same floating point unit is implemented, these same floating point units are currently used for integer operations for vpmadd52luq and vpmadd52huq x86 instructions. With this hardware, A' and B' can be determined as follows: A`=A4*2 52*4 +A3*2 52*3 +A2*2 52*2 +A1*2 52*1 +A0

B`=B4*252*4+B3*252*3+B2*252*2+B1*252*1+B0 B`=B4*2 52*4 +B3*2 52*3 +B2*2 52*2 +B1*2 52*1 +B0

在本實施例中,A0、A1、A2、A3以及B0、B1、B2、B3正好是52位元長,而A4及B4是48位元整數。將上述用於A`及B`的值相乘會造成下述:R=A4*B4*252*8+(A4*B3+A3*B4)*252*7+(A4*B2+A3*B3+A2*B4)*252*6+(A4*B1+A3*B2+A2*B3+A1*B4)*252*5+(A4*B0+A3*B1+A2*B2+A1*B3+A0*B4)*252*4+(A3*B0+A2*B1+A1*B2+A0*B3)*252*3+(A2*B0+A1*B1+A0*B2)*252*2+(A1*B0+A0*B1)*252*1+A0*B0 In the present embodiment, A0, A1, A2, A3, and B0, B1, B2, and B3 are exactly 52 bits long, and A4 and B4 are 48-bit integers. Multiplying the above values for A' and B' results in the following: R = A4 * B4 * 2 52 * 8 + (A4 * B3 + A3 * B4) * 2 52 * 7 + (A4 * B2 + A3 * B3 + A2 * B4) * 2 52 * 6 + (A4 * B1 + A3 * B2 + A2 * B3 + A1 * B4) * 2 52 * 5 + (A4 * B0 + A3 * B1 + A2 * B2 + A1 *B3+A0*B4)*2 52*4 +(A3*B0+A2*B1+A1*B2+A0*B3)*2 52*3 +(A2*B0+A1*B1+A0*B2)* 2 52*2 +(A1*B0+A0*B1)*2 52*1 +A0*B0

其中,各係數可以達到107位元長。 Among them, each coefficient can reach 107 bits long.

指令的目的因而是計算係數,然後將它們正確地總合,以產生以512位元表示(數基264)的R`=R。基於此目的,本發明的一實施例介紹四個新的微作業(μops):mulassist1,mulassist2,mulassist3及mulassist4:mulassist1/2/3/4 tmpzmm,a256,b256 The purpose of the instructions is thus to calculate the coefficients and then sum them correctly to produce R'=R expressed in 512 bits (number base 264). For this purpose, an embodiment of the present invention introduces four new micro-ops (μops): mulassist1, mulassist2, mulassist3, and mulassist4: mulassist1/2/3/4 tmpzmm, a256, b256

在操作時,各mulassist* μops首先將輸入運算元a256/b256轉換成數基252表示(例如,使用佈線及選取邏輯)。各mulassist* μops接著計算4 x 105位元值。四個值中的各值如下所述地儲存於造成的暫存器的128位元道中。 In operation, each mulassist* μops first converts the input operand a256/b256 into a base 252 representation (eg, using routing and selection logic). Each mulassist* μops then calculates a 4 x 105 bit value. Each of the four values is stored in the 128-bit track of the resulting scratchpad as described below.

mulassist1:(A0B3+A1B2)∥(A0B2+A1B1)∥(A0B1+A1B0)∥(A0B0) Mulussist1:(A0B3+A1B2)∥(A0B2+A1B1)∥(A0B1+A1B0)∥(A0B0)

mulassist2:(A2B3+A1B4)∥(A1B3+A0B4)∥(A3B0+A2B1)∥(A2B0) Mulassist2:(A2B3+A1B4)∥(A1B3+A0B4)∥(A3B0+A2B1)∥(A2B0)

mulassist3:(A3B1+A2B2)∥(A4B1+A3B2)∥(A4B1+A3B2)∥(A4B3+A3B4) Mulassist3:(A3B1+A2B2)∥(A4B1+A3B2)∥(A4B1+A3B2)∥(A4B3+A3B4)

mulassist4:(A4B0)∥(A2B4)∥(A4B4)∥0 Mulassist4: (A4B0) ∥ (A2B4) ∥ (A4B4) ∥ 0

在上述表示中,各128位元道由∥標示符分開。道0是最右道,道3是最左道,而以道2及1依序地配置在它 們之間。 In the above representation, each 128-bit track is separated by a ∥ identifier. Lane 0 is the rightmost lane, lane 3 is the leftmost lane, and lanes 2 and 1 are arranged in sequence. Between us.

在一實施例中,乘法及加法使用執行單元1240內的執行埠0及5上可供利用的浮點乘法-加法(FMA)單元。當然,本發明的基本原理不侷限於任何特定的執行埠集。在某些實施中,舉例而言,FMA單元可以在其它埠上取得。 In one embodiment, multiplication and addition uses floating point multiply-add (FMA) units available on execution 埠0 and 5 in execution unit 1240. Of course, the basic principles of the invention are not limited to any particular set of executions. In some implementations, for example, the FMA unit can be taken on other ports.

圖16顯示使用乘法單元1600及加法器1610的集合,為mulassist1執行作業之特定方式。雖然僅顯示用於mulassist1的細節,但是,可以對mulassist2、mulassist3、及mulassist4,施行相同的基本原理。 Figure 16 shows a particular manner of performing a job for mulassist1 using a set of multiplying units 1600 and adders 1610. Although only the details for mulassist1 are shown, the same basic principles can be applied to mulassist2, mulassist3, and mulassist4.

如圖16所示,使用上述提供的A及B值、52x52位元乘法器1601將A1及B2相乘;乘法器1602將A0及B3相乘;乘法器1603將A1及B1相乘;乘法器1604將A0及B2相乘;乘法器1605將A1及B0相乘;乘法器1606將A0及B1相乘;以及,乘法器1607將A0及B0相乘。 As shown in FIG. 16, A1 and B2 are multiplied using the A and B values provided above, 52x52 bit multiplier 1601; multiplier 1602 multiplies A0 and B3; multiplier 1603 multiplies A1 and B1; multiplier 1604 multiplies A0 and B2; multiplier 1605 multiplies A1 and B0; multiplier 1606 multiplies A0 and B1; and multiplier 1607 multiplies A0 and B0.

然後,104 x 104加法器1611決定A1B2及A0B3的總合以及將結果輸出至128位元道3;加法器1612接著決定A1B1及A0B2的總合以及將結果輸出至128位元道2;加法器1613決定A1B0及A0B1的總合以及將結果輸出至128位元道1;加法器1614決定A0B0及0的值的總合以將結果A0B0輸出至128位元道0。 Then, the 104 x 104 adder 1611 determines the sum of A1B2 and A0B3 and outputs the result to 128-bit track 3; the adder 1612 then determines the sum of A1B1 and A0B2 and outputs the result to 128-bit track 2; adder 1613 determines the sum of A1B0 and A0B1 and outputs the result to 128-bit track 1; adder 1614 determines the sum of the values of A0B0 and 0 to output the result A0B0 to 128-bit track 0.

在一實施例中,接著,經由增加的硬體及微作業,將四個結果總合以及轉換成規律表示。注意,可以根據設計 考量,修改運算元的真實次序。 In one embodiment, the four results are then summed and converted into regular representations via added hardware and micro-jobs. Note that it can be designed according to Consider and modify the true order of the operands.

圖17顯示根據本發明的一實施例之方法。方法可以實施於上述架構之內,但不限於任何特定架構。 Figure 17 shows a method in accordance with an embodiment of the present invention. The method can be implemented within the above architecture, but is not limited to any particular architecture.

在1701,從記憶體中提取或是從快取記憶體中讀出256位元乘法指令(舉例而言,例如vmul256to512 zmm1,zmm2,zmm3,imm8或是上述強調的其它指令中之一)。在1702,第一及第二256位元整數運算元分別儲存在第一及第二源暫存器。舉例而言,假使源運算元暫存器是512位元向量暫存器(例如ZMM2),則第一及第二256位元整數源運算元可以儲存在暫存器的上或下半部(例如根據上述實施中的imm8的值)。 At 1701, a 256-bit multiply instruction is fetched from the memory or read from the cache memory (for example, vmul256to512 zmm1, zmm2, zmm3, imm8, or one of the other instructions highlighted above). At 1702, the first and second 256-bit integer operands are stored in the first and second source registers, respectively. For example, if the source operand register is a 512-bit vector register (eg, ZMM2), the first and second 256-bit integer source operands can be stored in the upper or lower half of the scratchpad ( For example, according to the value of imm8 in the above embodiment).

在1703,根據乘法器及加法器硬體的大小,將第一及第二源運算元從第一數基表示轉換至第二數基表示。舉例而言,如上所述,對於使用52位元乘法器的實施,取代將數目視為數基264中的4個位數,將它們當作數基252中的5個位數處理。在1704,使用第二數基表示,執行一系列乘法及加法運算以達到結果(請參見例如圖16及相關說明)。最後,在1705,將結果轉換回至第一數基表示(例如,以及儲存在512位元目的地暫存器中)。 At 1703, the first and second source operands are converted from the first base representation to the second base representation based on the size of the multiplier and adder hardware. For example, as described above, for implementations using a 52-bit multiplier, instead of treating the number as 4 digits in the number base 264, treat them as 5 digits in the base 252. At 1704, a series of multiplications and additions are performed using the second base representation to achieve the result (see, for example, Figure 16 and related description). Finally, at 1705, the result is converted back to the first base representation (eg, and stored in a 512-bit destination register).

在前述說明書中,參考本發明的特定舉例說明的實施例,說明本發明的實施例。但是,顯然可知,在不悖離後附的申請專利範圍中揭示的本發明的廣義精神及範圍之下,可以作各種修改及變化。因此,說明書及圖式被視為是說明性的而非限制性的。 In the foregoing specification, embodiments of the invention are described with reference However, it is apparent that various modifications and changes can be made without departing from the spirit and scope of the invention. Accordingly, the specification and drawings are to be regarded as

本發明的實施例包含上述說明之各式各樣的步驟。步驟可以以機器可執行的指令具體實施,這些指令可用以促使一般目的或特定目的處理器執行這些步驟。替代地,這些步驟可以由含有用於執行步驟之實體接線的邏輯之特定硬體組件、或是程式化的電腦組件及客製化硬體組件的任何組合所執行。 Embodiments of the invention include the various steps described above. The steps may be embodied in machine-executable instructions that may be used to cause a general purpose or special purpose processor to perform the steps. Alternatively, these steps can be performed by a particular hardware component containing logic for performing physical wiring of the steps, or any combination of stylized computer components and customized hardware components.

如同此處所述般,指令意指例如特定應用積體電路(ASIC)等硬體的特定配置,ASIC係配置成執行具有預定功能的某些作業或儲存在記憶體中的軟體指令,記憶體係以非暫時的電腦可讀取媒體具體實施。如此,使用儲存於及執行於一或更多電子裝置(例如終端站台、網路元件、等等)上的碼及資料,可以實施圖式中所示的技術。這些電子裝置使用電腦可讀取的媒體以儲存及通訊(內部地及/或經由網路而與其它電子裝置通訊)碼及資料,電腦可讀取的媒體可為例如非暫時的電腦機器-可讀取的儲存媒體(例如磁碟;光碟;隨機存取記憶體;唯讀記憶體;快閃記憶體裝置;相變記憶體)以及暫時的電腦可讀取通訊媒體(例如電的、光學的、聲的或其它形式的傳播訊號-例如載波、紅外線訊號、數位訊號、等等)。此外,這些電子裝置典型地包含一或更多耦合至一或更多其它組件的處理器,一或更多其它組件可為例如一或更多儲存裝置(非暫時的機器可讀取的儲存媒體)、使用者輸入/輸出裝置(例如鍵盤、觸控螢幕、及/或顯示器)、及網路連接。處理器組及其它組件的耦合典型上經由一或更 多匯流排及橋接器(也稱為匯流排控制器)。載送網路交通之儲存裝置及訊號分別代表一或更多機器可讀取的儲存媒體以及機器可讀取的通訊媒體。因此,給定的電子裝置之儲存裝置典型地儲存用於在該電子裝置的一或更多處理器的組上執行之碼及/或資料。當然,可以使用軟體、韌體、及/或硬體的不同組合,實施本發明的實施例之一或更多部份。在此詳細說明中,為了說明之目的,揭示眾多特定細節以助於完整瞭解本發明。但是,習於此技藝者將清楚,不用這些特定細節中的某些細節,仍可實施本發明。在某些情形中,未特別詳細地說明熟知的結構及功能,以免模糊本發明的標的。因此,本發明的範圍及精神應以後附的申請專利範圍之觀點來判斷。 As described herein, an instruction means a specific configuration of a hardware such as an application specific integrated circuit (ASIC), which is configured to execute certain jobs having a predetermined function or software instructions stored in a memory, a memory system The implementation of non-transitory computer readable media. Thus, the techniques shown in the figures can be implemented using code and data stored and executed on one or more electronic devices (e.g., terminal stations, network elements, etc.). These electronic devices use computer readable media to store and communicate (internal and/or via a network to communicate with other electronic devices) code and data. The computer readable media can be, for example, a non-transitory computer machine - Read storage media (eg disk; CD; random access memory; read-only memory; flash memory device; phase change memory) and temporary computer readable communication media (eg electrical, optical) , audible or other forms of propagation signals - such as carrier waves, infrared signals, digital signals, etc.). Moreover, these electronic devices typically include one or more processors coupled to one or more other components, one or more other components can be, for example, one or more storage devices (non-transitory machine readable storage media) ), user input/output devices (such as keyboards, touch screens, and/or displays), and network connections. The coupling of the processor bank and other components is typically via one or more Multiple busbars and bridges (also known as busbar controllers). The storage devices and signals carrying the network traffic represent one or more machine readable storage media and machine readable communication media, respectively. Thus, a storage device of a given electronic device typically stores code and/or data for execution on a group of one or more processors of the electronic device. Of course, one or more of the embodiments of the invention may be practiced using different combinations of software, firmware, and/or hardware. In the detailed description, for the purposes of illustration However, it will be apparent to those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, well-known structures and functions are not described in detail to avoid obscuring the subject matter of the invention. Therefore, the scope and spirit of the invention should be judged from the point of view of the appended claims.

300‧‧‧暫存器架構 300‧‧‧Scratchpad Architecture

310‧‧‧向量暫存器 310‧‧‧Vector register

315‧‧‧寫入遮罩暫存器 315‧‧‧Write mask register

325‧‧‧一般用途暫存器 325‧‧‧General Purpose Register

345‧‧‧純量浮點堆疊暫存器檔案 345‧‧‧Simplified floating point stack register file

350‧‧‧MMX緊縮整數平坦暫存器檔案 350‧‧‧MMX Compact Integer Flat Register File

Claims (23)

一種用以執行大整數算數運算之處理器,包括:第一源暫存器,用以儲存第一256位元整數運算元;第二源暫存器,用以儲存第二256位元整數運算元,其中,該第一及第二源暫存器包括512位元向量暫存器,以及,其中,該第一及第二256位元整數運算元會儲存於該512位元向量暫存器的上或下區中;以及乘法邏輯,包括:乘法器及加法器組,用以執行該第一及第二256位元整數運算元的相乘而產生512位元的結果,以回應256位元乘法指令,該乘法邏輯會根據用以執行該相乘及產生結果的該些乘法器及加法器的大小,而將該第一及第二256位元整數運算元的數基表示從第一數基表示轉換成選取的第二數基表示,然後,將該結果轉換回至該第一數基表示。 A processor for performing a large integer arithmetic operation, comprising: a first source register for storing a first 256-bit integer operation element; and a second source register for storing a second 256-bit integer operation And the first and second source registers include a 512-bit vector register, and wherein the first and second 256-bit integer operands are stored in the 512-bit vector register And the multiplication logic includes: a multiplier and an adder group for performing multiplication of the first and second 256-bit integer operands to generate a result of 512 bits in response to 256 bits a multiplication instruction, the multiplication logic, based on the size of the multipliers and adders used to perform the multiplication and the generation, the first and second 256-bit integer operands are represented from the first The number base representation is converted to the selected second number base representation, and the result is then converted back to the first number base representation. 如申請專利範圍第1項之處理器,其中,各該256位元整數運算元的該第一數基表示包括數基264中表示的四個位數。 The processor of claim 1, wherein the first number base representation of each of the 256-bit integer operands comprises four digits represented in the number base 64 . 如申請專利範圍第2項之處理器,其中,該第二數基表示包括數基252中表示的五個位數。 The processor of claim 2, wherein the second number base comprises five digits represented by the number base 52 . 如申請專利範圍第3項之處理器,其中,各該乘法器包括52x52乘法器。 The processor of claim 3, wherein each of the multipliers comprises a 52x52 multiplier. 如申請專利範圍第4項之處理器,其中,各該乘法器會將來自該第一256位元整數運算元的該五個位數中之一乘以該第二256位元整數運算元的該五個位數中之 一。 The processor of claim 4, wherein each of the multipliers multiplies one of the five digits from the first 256-bit integer operand by the second 256-bit integer operand Among the five digits One. 如申請專利範圍第5項之處理器,其中,對於來自該第一256位元整數運算元的位數A0、A1、A2、A3、及A4及來自該第二256位元整數運算元的位數B0、B1、B2、B3、及B4:第一乘法器用以將A1及B2相乘以產生乘積A1B2;第二乘法器用以將A0及B3相乘以產生乘積A0B3;第三乘法器用以將A1及B1相乘以產生乘積A1B1;第四乘法器用以將A0及B2相乘以產生乘積A0B2;第五乘法器用以將A1及B0相乘以產生乘積A1B0;第六乘法器用以將A0及B1相乘以產生乘積A0B1;以及第七乘法器用以將A0及B0相乘以產生乘積A0B0。 The processor of claim 5, wherein the bits A0, A1, A2, A3, and A4 from the first 256-bit integer operand and the bits from the second 256-bit integer operand are Number B0, B1, B2, B3, and B4: the first multiplier is used to multiply A1 and B2 to produce a product A1B2; the second multiplier is used to multiply A0 and B3 to produce a product A0B3; the third multiplier is used to A1 and B1 are multiplied to produce a product A1B1; a fourth multiplier is used to multiply A0 and B2 to produce a product A0B2; a fifth multiplier is used to multiply A1 and B0 to produce a product A1B0; a sixth multiplier is used to A0 and B1 is multiplied to produce a product A0B1; and a seventh multiplier is used to multiply A0 and B0 to produce a product A0B0. 如申請專利範圍第6項之處理器,其中,各該加法器會將該些乘法器輸出的該些結果中至少之二相加。 The processor of claim 6, wherein each of the adders adds at least two of the results output by the multipliers. 如申請專利範圍第7項之處理器,又包括:第一加法器,用以決定A1B2與A0B3的第一總合;第二加法器,用以決定A1B1與A1B2的第二總合;第三加法器,用以決定A1B0與A1B1的第三總合;及第四加法器,用以決定A0B0與0的第四總合。 The processor of claim 7, further comprising: a first adder for determining a first sum of A1B2 and A0B3; and a second adder for determining a second sum of A1B1 and A1B2; An adder for determining a third sum of A1B0 and A1B1; and a fourth adder for determining a fourth sum of A0B0 and 0. 如申請專利範圍第8項之處理器,其中,該四個總合中的各總合會輸出至四個不同的128位元道之各者。 For example, the processor of claim 8 wherein each of the four sums is output to each of four different 128-bit channels. 如申請專利範圍第9項之處理器,其中,在該些 128位元道中的各道中的該四個總合會被加總及轉換成數基264表示。 The processor of claim 9, wherein the four summaries in each of the 128 bit channels are summed and converted into a number base 2 64 . 如申請專利範圍第1項之處理器,其中,該乘法邏輯包括解碼邏輯以將256位元乘法指令解碼成眾多微作業,該眾多微作業會使用第二數基表示以執行眾多乘法及加總運算而產生512位元的結果。 A processor as claimed in claim 1, wherein the multiplication logic comprises decoding logic to decode the 256-bit multiplication instruction into a plurality of micro-jobs, the plurality of micro-jobs using the second base representation to perform a plurality of multiplications and summing The result is a 512-bit result. 如申請專利範圍第1項之處理器,其中,該256位元乘法指令的立即值標示該第一及第二256位元整數運算元是否分別儲存於該第一及第二512位元向量暫存器的上或下半部中。 The processor of claim 1, wherein the immediate value of the 256-bit multiply instruction indicates whether the first and second 256-bit integer operands are respectively stored in the first and second 512-bit vectors. In the upper or lower half of the register. 一種用以執行大整數算數運算之方法,包括:將第一256位元整數運算元儲存於第一源暫存器中;將第二256位元整數運算元儲存於第二源暫存器中,其中,該第一及第二源暫存器包括512位元向量暫存器,以及,其中,該第一及第二256位元整數運算元會儲存於該512位元向量暫存器的上或下區中;以及使用乘法器及加法器組,根據用以執行乘法及產生結果的該些乘法器及加法器的大小,將該第一及第二256位元整數運算元的數基表示從第一數基表示轉換成第二數基表示,而執行該第一及第二256位元整數運算元的相乘,然後,將該結果轉換回至該第一數基表示。 A method for performing a large integer arithmetic operation includes: storing a first 256-bit integer operation element in a first source register; and storing a second 256-bit integer operation element in a second source register The first and second source registers include a 512-bit vector register, and wherein the first and second 256-bit integer operands are stored in the 512-bit vector register In the upper or lower region; and using the multiplier and the adder group, the number bases of the first and second 256-bit integer operands are based on the sizes of the multipliers and adders used to perform the multiplication and the result of the generation Representing conversion from a first number base representation to a second number base representation, performing multiplication of the first and second 256-bit integer operands, and then converting the result back to the first base representation. 如申請專利範圍第13項之方法,其中,各該256位元整數運算元的該第一數基表示包括數基264中表示的四個位數。 The method of claim 13, wherein the first number base representation of each of the 256-bit integer operands comprises four digits represented in the number base 64 . 如申請專利範圍第14項之處理器,其中,該第二數基表示包括數基252中表示的五個位數。 The processor of claim 14, wherein the second number base comprises five digits represented by the number base 52 . 如申請專利範圍第15項之方法,其中,各該乘法器包括52x52乘法器。 The method of claim 15, wherein each of the multipliers comprises a 52x52 multiplier. 如申請專利範圍第16項之方法,其中,各該乘法器會將來自該第一256位元整數運算元的該五個位數中之一乘以該第二256位元整數運算元的該五個位數中之一。 The method of claim 16, wherein each of the multipliers multiplies one of the five digits from the first 256-bit integer operand by the second 256-bit integer operand. One of five digits. 如申請專利範圍第17項之方法,其中,對於來自該第一256位元整數運算元的位數A0、A1、A2、A3、及A4及來自該第二256位元整數運算元的位數B0、B1、B2、B3、及B4,該方法又包括:將A1及B2相乘以產生乘積A1B2;將A0及B3相乘以產生乘積A0B3;將A1及B1相乘以產生乘積A1B1;將A0及B2相乘以產生乘積A0B2;將A1及B0相乘以產生乘積A1B0;將A0及B1相乘以產生乘積A0B1;以及將A0及B0相乘以產生乘積A0B0。 The method of claim 17, wherein the number of bits A0, A1, A2, A3, and A4 from the first 256-bit integer operand and the number of bits from the second 256-bit integer operand B0, B1, B2, B3, and B4, the method further comprises: multiplying A1 and B2 to produce a product A1B2; multiplying A0 and B3 to produce a product A0B3; multiplying A1 and B1 to produce a product A1B1; A0 and B2 are multiplied to produce a product A0B2; A1 and B0 are multiplied to produce a product A1B0; A0 and B1 are multiplied to produce a product A0B1; and A0 and B0 are multiplied to produce a product A0B0. 如申請專利範圍第18項之方法,其中,各該加法器會將該些乘法器輸出的該些結果中至少之二相加。 The method of claim 18, wherein each of the adders adds at least two of the results output by the multipliers. 如申請專利範圍第19項之處理器,又包括:決定A1B2與A0B3的第一總合;決定A1B1與A1B2的第二總合; 決定A1B0與A1B1的第三總合;及決定A0B0與0的第四總合。 The processor of claim 19, further comprising: determining a first sum of A1B2 and A0B3; determining a second sum of A1B1 and A1B2; Determine the third sum of A1B0 and A1B1; and determine the fourth sum of A0B0 and 0. 如申請專利範圍第20項之方法,其中,該四個總合中的各總合會輸出至四個不同的128位元道之各者。 The method of claim 20, wherein each of the four sums is output to each of four different 128-bit channels. 如申請專利範圍第21項之方法,其中,在該些128位元道中的各道中的該四個總合會被加總及轉換成數基264表示。 The method of claim 21, wherein the four summaries in each of the 128 bit channels are summed and converted into a number base 2 64 . 如申請專利範圍第13項之方法,256位元乘法指令被解碼成眾多微作業,該眾多微作業用以使用第二數基表示以執行眾多乘法及加總運算而產生512位元的結果。 As in the method of claim 13, the 256-bit multiply instruction is decoded into a plurality of micro-jobs for generating a 512-bit result using a second number base representation to perform a plurality of multiplication and summation operations.
TW104138329A 2015-11-19 2015-11-19 Method and apparatus for performing big-integer arithmetic operations TWI599953B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW104138329A TWI599953B (en) 2015-11-19 2015-11-19 Method and apparatus for performing big-integer arithmetic operations

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW104138329A TWI599953B (en) 2015-11-19 2015-11-19 Method and apparatus for performing big-integer arithmetic operations

Publications (2)

Publication Number Publication Date
TW201719388A TW201719388A (en) 2017-06-01
TWI599953B true TWI599953B (en) 2017-09-21

Family

ID=59687331

Family Applications (1)

Application Number Title Priority Date Filing Date
TW104138329A TWI599953B (en) 2015-11-19 2015-11-19 Method and apparatus for performing big-integer arithmetic operations

Country Status (1)

Country Link
TW (1) TWI599953B (en)

Also Published As

Publication number Publication date
TW201719388A (en) 2017-06-01

Similar Documents

Publication Publication Date Title
TWI818885B (en) Systems and methods for executing a fused multiply-add instruction for complex numbers
TWI610229B (en) Apparatus and method for vector broadcast and xorand logical instruction
TWI502499B (en) Systems, apparatuses, and methods for performing a conversion of a writemask register to a list of index values in a vector register
TWI575448B (en) Three source operand floating point addition processors, methods, systems, and instructions
TWI617978B (en) Method and apparatus for vector index load and store
TWI525538B (en) Super multiply add (super madd) instruction
TWI578230B (en) Method and apparatus for performing a plurality of multiplication operations
CN107003832B (en) Method and apparatus for performing large integer arithmetic operations
CN108415882B (en) Vector multiplication using operand-based systematic conversion and retransformation
TWI486872B (en) Systems, apparatuses, and methods for performing vector packed compression and repeat
TWI575451B (en) Method and apparatus for variably expanding between mask and vector registers
CN107145335B (en) Apparatus and method for vector instructions for large integer operations
TW201643695A (en) Method and apparatus for performing a vector bit reversal and crossing
TW201346744A (en) Apparatus and method of mask permute instructions
TW201810070A (en) Method and apparatus for performing a vector permute with an index and an immediate
TW201640380A (en) Method and apparatus for performing a vector bit shuffle
TWI567640B (en) Method and processors for a three input operand add instruction that does not raise arithmetic flags
TWI603261B (en) Instruction and logic to perform a centrifuge operation
CN111831335A (en) Apparatus and method for improved insertion of instructions
CN107003848B (en) Apparatus and method for fusing multiply-multiply instructions
TW201732571A (en) Systems, apparatuses, and methods for getting even and odd data elements
TW201732574A (en) Systems, methods, and apparatuses for improving vector throughput
CN107003841B (en) Apparatus and method for fusing add-add instructions
JP2014182811A (en) Systems, apparatuses, and methods for reducing number of short integer multiplications
TWI599953B (en) Method and apparatus for performing big-integer arithmetic operations

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees