TWI478065B - Emulation of execution mode banked registers - Google Patents

Emulation of execution mode banked registers Download PDF

Info

Publication number
TWI478065B
TWI478065B TW101112253A TW101112253A TWI478065B TW I478065 B TWI478065 B TW I478065B TW 101112253 A TW101112253 A TW 101112253A TW 101112253 A TW101112253 A TW 101112253A TW I478065 B TWI478065 B TW I478065B
Authority
TW
Taiwan
Prior art keywords
storage
isa
instruction
microprocessor
register
Prior art date
Application number
TW101112253A
Other languages
Chinese (zh)
Other versions
TW201250597A (en
Inventor
G Glenn Henry
Terry Parks
Rodney E Hooker
Original Assignee
Via Tech Inc
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
Priority claimed from US13/224,310 external-priority patent/US8880851B2/en
Priority claimed from US13/333,520 external-priority patent/US9032189B2/en
Priority claimed from US13/333,572 external-priority patent/US8880857B2/en
Priority claimed from US13/333,631 external-priority patent/US8924695B2/en
Priority claimed from US13/413,314 external-priority patent/US9176733B2/en
Priority claimed from US13/413,300 external-priority patent/US20120260073A1/en
Application filed by Via Tech Inc filed Critical Via Tech Inc
Publication of TW201250597A publication Critical patent/TW201250597A/en
Application granted granted Critical
Publication of TWI478065B publication Critical patent/TWI478065B/en

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

執行模式備份暫存器之模擬 Execution mode backup register simulation 【相關申請案之參考文獻】 [References in related applications]

本申請案係同在申請中美國專利正式申請案之部分連續案,該些案件整體皆納入本案參考: This application is part of the continuous case of the US patent application in the application. These cases are all included in the case:

本申請案係引用於以下美國臨時專利申請案作優先權,每一申請案整體皆納入本案參考: This application claims priority from the following US Provisional Patent Applications, each of which is incorporated herein by reference.

美國正式專利申請案 US official patent application

係引用下列美國臨時申請案之優先權: It refers to the following priority of the US temporary application:

以下三個本美國正式申請案 The following three official US applications

皆是以下美國正式申請式之延續案: These are the continuations of the following US official application:

並引用下列美國臨時申請案之優先權: And cite the following US temporary application priority:

本申請案係以下美國正式專利申請案之相關案: This application is related to the following US official patent applications:

本發明係關於微處理器之技術領域,特別是關於在指令集中具有條件指令之微處理器。 This invention relates to the technical field of microprocessors, and more particularly to microprocessors having conditional instructions in an instruction set.

由Intel Corporation of Santa Clara,California開發出來的x86處理器架構以及由ARM Ltd.of Cambridge,UK開發出來的進階精簡指令集機器(advanced risc machines,ARM)架構係電腦領域中兩種廣為人知的處理器架構。許多使用ARM或x86處理器之電腦系統已經出現,並且,對於此電腦系統的需求正在快速成長。現今,ARM架構處理核心係主宰低功耗、低價位的電腦市場,例如手機、手持式電子產品、平板電腦、網路路由器與集線器、機上盒等。舉例來說,蘋果iPhone與iPad主要的處理能力即是由ARM架構之處理核心提供。另一方面,x86架構處理器則是主宰需要高效能之高價位市場,例如膝上電腦、桌上型電腦與伺服器等。然而,隨著ARM核心效能的提升,以及某些x86處理器在功耗與成本的改善,前述低價位與高價位市場的界線逐漸模糊。在行動運算市場,如智慧型手機,這兩種架構已經開始激烈競爭。在膝上電腦、桌上型電腦與伺服器市場,可以預期這兩種架構將會有更頻繁的競爭。 The x86 processor architecture developed by Intel Corporation of Santa Clara, California and the advanced reduced risc machines (ARM) architecture developed by ARM Ltd. of Cambridge, UK are two well-known processes in the computer field. Architecture. Many computer systems using ARM or x86 processors have emerged, and the demand for this computer system is growing rapidly. Today, the ARM architecture processing core dominates the low-power, low-cost computer market, such as mobile phones, handheld electronics, tablets, network routers and hubs, and set-top boxes. For example, the main processing power of Apple's iPhone and iPad is provided by the processing core of the ARM architecture. On the other hand, x86 architecture processors dominate high-priced markets that require high performance, such as laptops, desktops, and servers. However, as the performance of ARM cores has improved and the power and cost of some x86 processors have improved, the boundaries between the aforementioned low-priced and high-priced markets have become blurred. In the mobile computing market, such as smart phones, these two architectures have begun to compete fiercely. In the laptop, desktop and server markets, it is expected that these two architectures will compete more frequently.

前述競爭態勢使得電腦裝置製造業者與消費者陷入兩難,因無從判斷哪一個架構將會主宰市場,更精確來說, 無法判定哪一種架構的軟體開發商將會開發更多軟體。舉例來說,一些每月或每年會定期購買大量電腦系統的消費個體,基於成本效率的考量,例如大量採購的價格優惠與系統維修的簡化等,會傾向於購買具有相同系統配置設定的電腦系統。然而,這些大型消費個體中的使用者群體,對於這些具有相同系統配置設定的電腦系統,往往有各種各樣的運算需求。具體來說,部分使用者的需求是希望能夠在ARM架構處理器上執行程式,其他部分使用者的需求是希望能夠在x86架構處理器上執行程式,甚至有部分使用者希望能夠同時在兩種架構上執行程式。此外,新的、預期外的運算需求也可能出現而需要使用另一種架構。在這些情況下,這些大型個體所投入的部分資金就變成浪費。在另一個例子中,使用者具有一個重要的應用程式只能在x86架構上執行,因而他購買了x86架構的電腦系統(反之亦然)。不過,這個應用程式的後續版本改為針對ARM架構開發,並且優於原本的x86版本。使用者會希望轉換架構來執行新版本的應用程式,但不幸地,他已經對於不傾向使用的架構投入相當成本。同樣地,使用者原本投資於只能在ARM架構上執行的應用程式,但是後來也希望能夠使用針對x86架構開發而未見於ARM架構的應用程式或是優於以ARM架構開發的應用程式,亦會遭遇這樣的問題,反之亦然。值得注意的是,雖然小實體或是個人投入的金額較大實體為小,然而投資損失比例可能更高。其他類似之投資損失的例子可能出現在各種不同的運算市場中,例如由x86架構轉換至ARM架構或是由ARM架構 轉換至x86架構的情況。最後,投資大量資源來開發新產品的運算裝置製造業者,例如OEM廠商,也會陷入此架構選擇的困境。若是製造業者基於x86或ARM架構研發製造大量產品,而使用者的需求突然改變,則會導致許多有價值之研發資源的浪費。 The aforementioned competitive situation has caused computer device manufacturers and consumers to be in a dilemma because it is impossible to judge which architecture will dominate the market, more precisely, It is impossible to determine which architecture software developer will develop more software. For example, some consumer individuals who purchase a large number of computer systems on a monthly or yearly basis, based on cost-efficiency considerations, such as price discounts for large purchases and simplification of system maintenance, tend to purchase computer systems with the same system configuration settings. . However, the user groups in these large consumer individuals often have various computing needs for these computer systems with the same system configuration settings. Specifically, some users' needs are to be able to execute programs on ARM architecture processors. Other users need to be able to execute programs on x86 architecture processors, and some users hope to be able to simultaneously The program is executed on the architecture. In addition, new, unexpected computing needs may arise and require another architecture. Under these circumstances, some of the funds invested by these large individuals become waste. In another example, the user has an important application that can only be executed on the x86 architecture, so he purchased a computer system with an x86 architecture (and vice versa). However, subsequent versions of this application were developed for ARM architecture and are superior to the original x86 version. The user would like to convert the architecture to execute the new version of the application, but unfortunately he has invested considerable cost in the architecture that is not intended to be used. Similarly, users originally invested in applications that can only be executed on the ARM architecture, but later hope to use applications developed for the x86 architecture that are not found in the ARM architecture or applications that are better than the ARM architecture. Will encounter such problems, and vice versa. It is worth noting that although the small entity or individual invested in a larger amount of entities is small, the investment loss ratio may be higher. Other examples of similar investment losses may occur in a variety of different computing markets, such as x86 architecture to ARM architecture or ARM architecture. Conversion to the x86 architecture. Finally, computing device manufacturers that invest large amounts of resources to develop new products, such as OEMs, will also fall into the trap of this architecture choice. If the manufacturer develops and manufactures a large number of products based on the x86 or ARM architecture, and the user's demand suddenly changes, it will lead to the waste of many valuable research and development resources.

對於運算裝置之製造業者與消費者,能夠保有其投資免於受到二種架構中何者勝出之影響是有幫助的,因而有必要提出一種解決方法讓系統製造業者發展出可讓使用者同時執行x86架構與ARM架構之程式的運算裝置。 It is helpful for manufacturers and consumers of computing devices to be able to protect their investments from the winners of the two architectures. It is therefore necessary to propose a solution for system manufacturers to develop x86 for users simultaneously. Arithmetic device for architecture and ARM architecture.

使系統能夠執行多個指令集程式的需求由來已久,這些需求主要是因為消費者會投入相當成本在舊硬體上執行的軟體程式,而其指令集往往不相容於新硬體。舉例來說,IBM 360系統Model 30即具有相容於IBM 1401系統的特徵來緩和使用者由1401系統轉換至較高效能與改良特徵之360系統的痛苦。Model 30具有360系統與1401系統之唯讀儲存控制(Read Only Storage,ROS)),使其在輔助儲存空間預先存入所需資訊的情況下能夠使用於1401系統。此外,在軟體程式以高階語言開發的情況下,新的硬體開發商幾乎沒有辦法控制為舊硬體所編譯的軟體程式,而軟體開發商也欠缺動力為新硬體重新編譯(re-compile)源碼,此情形尤其發生在軟體開發商與硬體開發商是不同個體的情況。Siberman與Ebcioglu於Computer,June 1993,No.6提出之文章“An Architectural Framework for Supporting Heterogeneous Instruction-Set Architectures”中揭露一種利 用執行於精簡指令集(RISC)、超純量架構(superscalar)與超長指令字(VLIW)架構(下稱原生架構)之系統來改善既存複雜指令集(CISC)架構(例如IBM S/390)執行效率的技術,其所揭露之系統包含執行原生碼之原生引擎(native engine)與執行目的碼之遷移引擎(migrant engine),並可依據轉譯軟體將目的碼(object bode)轉譯為原生碼(native code)的轉譯效果,在這兩種編碼間視需要進行轉換。請參照2006年5月16日公告之美國專利第7,047,394號專利案,Van Dyke et al.揭露一處理器,具有用以執行原生精簡指令集(Tapestry)之程式指令的執行管線,並利用硬體轉譯與軟體轉譯之結合,將x86程式指令轉譯為原生精簡指令集之指令。Nakada et al.提出具有ARM架構之前端管線與Fujitsu FR-V(超長指令字)架構之前端管線的異質多線程處理器(heterogeneous SMT processor),ARM架構前端管線係用於非規則(irregular)軟體程式(如作業系統),而Fujitsu FR-V(超長指令字)架構之前端管線係用於多媒體應用程式以將一增加的超長指令字佇列匯入FR-V超長指令字之後端管線以維持來自前端管線之指令。請參照Buchty與Weib,eds,Universitatsverlag Karlsruhe於2008年11月在First International Workshop on New Frontiers in High-performance and Hardware-aware Computing(HipHaC’08),Lake Como,Italy,(配合MICRO-41)發表之論文集(ISBN 978-3-86644-298-6)的文章“OROCHI:A Multiple Instruction Set SMT Processor”。文中提出之方法係用以降低整個系統在異質系統單晶片(SOC)裝置(如德州儀器 OMAP應用處理器)內所佔據之空間。此異質系統單晶片裝置具有一個ARM處理器核心加上一個或多個協同處理器(co-processors)(例如TMS320、多種數位訊號處理器、或是多種圖形處理單元(GPUs))。這些協同處理器並不分享指令執行資源,只是整合於同一晶片上之不同處理核心。 The need to enable systems to execute multiple instruction set programs has been around for a long time. These requirements are mainly due to the fact that consumers are consuming software programs that are executed on old hardware at considerable cost, and their instruction sets are often incompatible with new hardware. For example, the IBM 360 System Model 30 has the pain of being compatible with the features of the IBM 1401 system to mitigate the 360 system in which users switch from a 1401 system to a higher performance and improved feature. The Model 30 has a 360 system and a Read Only Storage (ROS) of the 1401 system, enabling it to be used in the 1401 system with the auxiliary storage space pre-stored with the required information. In addition, in the case of software programs developed in high-level languages, new hardware developers have little control over the software programs compiled for old hardware, and software developers lack the motivation to recompile for new hardware (re-compile). The source code, especially in the case where the software developer and the hardware developer are different individuals. Siberman and Ebcioglu's article "An Architectural Framework for Supporting Heterogeneous Instruction-Set Architectures" by Computer, June 1993, No. 6 reveals a benefit Improve existing Complex Instruction Set (CISC) architectures with systems implemented in Reduced Instruction Set (RISC), superscalar and super long instruction word (VLIW) architectures (hereafter referred to as native architecture) (eg IBM S/390) A technique for performing efficiency, the system disclosed therein includes a native engine that executes a native code and a migrant engine that executes a destination code, and can translate an object bode into a native code according to the translation software. (native code) translation effect, between the two encodings as needed to convert. Referring to U.S. Patent No. 7,047,394, issued May 16, 2006, Van Dyke et al. discloses a processor having an execution pipeline for executing program instructions of a native reduced instruction set (Tapestry) and utilizing hardware The combination of translation and software translation translates x86 program instructions into instructions for the native reduced instruction set. Nakada et al. proposed a heterogeneous SMT processor with an ARM architecture front-end pipeline and a Fujitsu FR-V (ultra-long instruction word) architecture front-end pipeline. The ARM architecture front-end pipeline is used for irregular (irregular) Software programs (such as operating systems), and the Fujitsu FR-V (ultra-long instruction word) architecture front-end pipeline is used in multimedia applications to import an additional long instruction word into the FR-V long instruction word. The end pipeline maintains instructions from the front end pipeline. Please refer to Buchty and Weib, eds, Universitatsverlag Karlsruhe in November 2008 at First International Workshop on New Frontiers in High-performance and Hardware-aware Computing (HipHaC'08), Lake Como, Italy, (with MICRO-41) The article "OROCHI: A Multiple Instruction Set SMT Processor" in the proceedings (ISBN 978-3-86644-298-6). The method proposed in this paper is to reduce the entire system in a heterogeneous system single-chip (SOC) device (such as Texas Instruments) The space occupied by the OMAP application processor). The heterogeneous system single chip device has an ARM processor core plus one or more co-processors (eg, TMS 320, multiple digital signal processors, or multiple graphics processing units (GPUs)). These coprocessors do not share instruction execution resources, but are integrated into different processing cores on the same die.

軟體轉譯器(software translator)、或稱軟體模擬器(software emulator,software simulator)、動態二進制碼轉譯器等,亦被用於支援將軟體程式在與此軟體程式架構不同之處理器上執行的能力。其中受歡迎的商用實例如搭配蘋果麥金塔(Macintosh)電腦之Motorola 68K-to-PowerPC模擬器,其可在具有PowerPC處理器之麥金塔電腦上執行68K程式,以及後續研發出來之PowerPC-to-x86模擬器,其可在具有x86處理器之麥金塔電腦上執行68K程式。位於加州聖塔克拉拉(Santa Clara,California)的全美達公司,結合超長指令字(VLIW)之核心硬體與“純粹軟體指令之轉譯器(亦即程式碼轉譯軟體(Code Morphing Software))以動態地編譯或模擬(emulate)x86程式碼序列”以執行x86程式碼,請參照2011年維基百科針對全美達(Transmeta)的說明<http://en.wikipedia.org/wiki/Transmeta>。另外,參照1998年11月3日由Kelly et al.提出之美國專利第5,832,205號公告案。IBM的DAISY(Dynamic Architecture Instruction Set from Yorktown)系統具有超長指令字(VLIW)機器與動態二進制軟體轉譯,可可提供100%的舊架構軟體相容模擬。DAISY具有位於唯讀記憶體內之虛擬機器觀測器 (Virtual Machine Monitor),以平行處理(parallelize)與儲存超長指令字原始碼(VLIW primitives)至未見於舊有系統架構之部分主要記憶體內,期能避免這些舊有體系架構之程式碼片段在後續程序被重新編譯(re-translation)。DAISY具有高速編譯器優化演算法(fast compiler optimization algorithms)以提升效能。QEMU係一具有軟體動態轉譯器之機器模擬器(machine emulator)。QEMU可在多種主系統(host),如x86、PowerPC、ARM、SPARC、Alpha與MIPS,模擬多種中央處理器,如x86、PowerPC、ARM與SPARC。請參照QEMU,a Fast and Portable Dynamic Translator,Fabrice Bellard,USENIX Association,FREENIX Track:2005 USENIX Annual Technical Conference,如同其開發者所稱“動態轉譯器對目標處理器指令執行時的轉換(runtime conversion),將其轉換至主系統指令集,所產生的二進制碼係儲存於一轉譯快取以利重複取用。…QEMU〔較之其他動態轉譯器〕遠為簡單,因為它只連接GNCC編譯器於離線(off line)時所產生的機器碼片段”。同時可參照2009年6月19日Adelaide大學Lee Wang Hao的學位論文“ARM Instruction Set Simulation on Multi-core x86 Hardware”。雖然以軟體轉譯為基礎之解決方案所提供之處理效能可以滿足多個運算需求之一部分,但是不大能夠滿足多個使用者的情況。 Software translators, or software emulators, dynamic binary translators, etc., are also used to support the ability to execute software programs on processors that differ from the software architecture. . Among the popular commercial examples are the Motorola 68K-to-PowerPC emulator with an Apple Macintosh computer, which can execute a 68K program on a Macintosh computer with a PowerPC processor, and a subsequent PowerPC- A to-x86 emulator that executes a 68K program on a Macintosh computer with an x86 processor. Transmeta, Inc., located in Santa Clara, Calif., combines the core hardware of the Very Long Instruction Word (VLIW) with the "Software Direct Translator (Code Morphing Software)) To dynamically compile or emulate x86 code sequences to execute x86 code, please refer to the 2011 Wikipedia instructions for Transmeta <http://en.wikipedia.org/wiki/Transmeta>. In addition, reference is made to U.S. Patent No. 5,832,205, issued to Kelly et al. IBM's DAISY (Dynamic Architecture Instruction Set from Yorktown) system features very long instruction word (VLIW) machines and dynamic binary software translation, and Cocoa provides 100% legacy architecture software compatible simulation. DAISY has a virtual machine observer in a read-only memory (Virtual Machine Monitor), parallelizing and storing VLIW primitives to some of the main memory of the old system architecture, avoiding the code fragments of these old architectures. Subsequent programs are re-translationed. DAISY has fast compiler optimization algorithms to improve performance. QEMU is a machine emulator with a software dynamic translator. QEMU can emulate a variety of central processing units such as x86, PowerPC, ARM and SPARC in a variety of host systems such as x86, PowerPC, ARM, SPARC, Alpha and MIPS. Please refer to QEMU, a Fast and Portable Dynamic Translator, Fabrice Bellard, USENIX Association, FREENIX Track: 2005 USENIX Annual Technical Conference, as its developers call "the dynamic translation of the target processor instruction execution (runtime conversion), Convert it to the main system instruction set, and the resulting binary code is stored in a translation cache for repeated access....QEMU [compared to other dynamic translators] is much simpler because it only connects to the GNCC compiler for offline The machine code fragment generated when (off line). Also refer to the dissertation "ARM Instruction Set Simulation on Multi-core x86 Hardware" by Lee Wang Hao of Adelaide University on June 19, 2009. While software-based solutions provide processing power that meets multiple computing needs, it is less than adequate for multiple users.

靜態(static)二進位制轉譯是另一種具有高效能潛力的技術。不過,二進位制轉譯技術之使用存在技術上的問題 (例如自我修改程式碼(self-modifying code)、只在執行時(run-time)可知之間接分支(indirect branches)數值)以及商業與法律上的障礙(例如:此技術可能需要硬體開發商配合開發散佈新程式所需的管道;對原程式散佈者存在潛在的授權或是著作權侵害的風險)。 Static binary translation is another technology with high performance potential. However, there are technical problems in the use of binary translation technology. (eg self-modifying code, indirect branches only at run-time) and commercial and legal barriers (eg this technology may require a hardware developer) Cooperate with the pipeline needed to develop new programs; there is a potential for unauthorized distribution or copyright infringement).

本發明之一實施例提供一微處理器。該微處理器包含複數個處理模式,該處理模式包含一使用者模式與複數個例外事件模式。該微處理器更包含至少一執行單元,係用以在程式指令指定之運算元上執行算數操作;該微處理器更包含一第一儲存元件組,耦接於該執行單元,其中,該第一儲存元件組包含第一運算元子集,並提供該第一運算元子集給該執行單元;該微處理器更包含一第二儲存元件組,係關聯於各處理模式,其中,該第二儲存元件組係包含一第二運算元子集,其中,該第二儲存元件組係無法直接提供該第二運算元子集給該執行單元;以及,該微處理器更包含一邏輯閘,其中,當從一現行處理模式進入至一新處理模式時,該邏輯閘將該第一儲存元件組中之該第一運算元子集儲存至關聯於該現行處理模式之第二儲存元件組,並將關聯於該新處理模式之該第二儲存元件組中之該第二運算元子集回復至該第一儲存元件組。 One embodiment of the present invention provides a microprocessor. The microprocessor includes a plurality of processing modes including a user mode and a plurality of exception event modes. The microprocessor further includes at least one execution unit for performing an arithmetic operation on an operation element specified by the program instruction. The microprocessor further includes a first storage element group coupled to the execution unit, wherein the a storage element group includes a first subset of operation elements and provides the first operation element subset to the execution unit; the microprocessor further includes a second storage element group associated with each processing mode, wherein the The second storage element group includes a second subset of operation elements, wherein the second storage element group cannot directly provide the second operation element subset to the execution unit; and the microprocessor further includes a logic gate. The logic gate stores the first subset of the operands in the first set of storage elements to the second set of storage elements associated with the current processing mode when entering from a current processing mode to a new processing mode. And returning the second subset of operands in the second set of storage elements associated with the new processing mode to the first set of storage elements.

本發明之另一實施例提供用於操作一種微處理器之方法,該微處理器包含複數個處理模式,該些處理模式具有一使用者模式以及複數個例外事件模式,其中該微處理器 更包含至少一執行單元,該執行單元係透過特定程式指令在運算元上執行算數操作,該方法包含:當該微處理器在該些處理模式中之一現行處理模式運作時,自一第一儲存元件組中提供一第一運算元集至該執行單元以執行算數操作;而當自該現行的處理模式進入該些處理模式中之一新處理模式時,則包含以下步驟:將該第一儲存元件組之該第一運算元集儲存至關聯於該現行處理模式之一第二儲存單元組;將該關聯於該新處理模式之一第三儲存元件組之一第二運算元集回復至該第一儲存元件組;以及當該微處理器於該新處理模式中運作時,自該第一儲存元件組提供該第二運算元集至該執行單元以執行算數操作。 Another embodiment of the present invention provides a method for operating a microprocessor, the microprocessor including a plurality of processing modes having a user mode and a plurality of exception event modes, wherein the microprocessor Further comprising at least one execution unit, the execution unit performing an arithmetic operation on the operation unit through a specific program instruction, the method comprising: when the microprocessor operates in one of the processing modes, the first one Providing a first set of operands to the execution unit to perform an arithmetic operation; and when entering the new processing mode from the current processing mode into the processing mode, the method includes the following steps: The first set of operands of the storage element group is stored to a second storage unit group associated with one of the current processing modes; and the second operand set associated with one of the third storage element groups associated with the new processing mode is restored to The first set of storage elements; and when the microprocessor is operating in the new processing mode, the second set of operands is provided from the first set of storage elements to the execution unit to perform an arithmetic operation.

本發明之又一實施例提供一種電腦程式產品。此電腦程式產品編碼於至少一電腦可讀取儲存媒介以使用於一運算裝置。此電腦程式產品具有適用於前述媒介之電腦可讀取程式碼,該電腦程式產品包括:適用於該媒介之電腦可讀取程式碼,係用以指定一微處理器,該電腦可讀取程式碼包含第一程式碼,係用以指定於複數個處理模式,該些處理模式包含一使用者模式與複數個例外事件模式;電腦可讀取程式碼更包含第二程式碼,係用以指定於至少一執行單元,該執行單元係透過特定程式指令在運算元上執行算數操作;該電腦可讀取程式碼更包含第三程式碼,係用以指定於一第一儲存元件組,該第一儲存元件組係耦接於該執行單元,其中該第一儲存元件組具有一第一運算元子集,並提供該第一運算元子集至該執行單元;該電腦可讀取程式碼更包含第四程式碼,係用以指定關聯於該些處理 模式之一第二儲存元件組。其中該第二儲存元件組具有一第二運算元子集,其中該第二運算元係不可直接提供該第二運算元子集至該執行單元;以及該電腦可讀取程式碼更包含第五程式碼,係用以指定一邏輯閘,其中當自依現行處理模式進入該些處理模式之一新處理模式時,該邏輯閘係儲存該第一儲存元件組之該第一運算元子集至關聯於該現行處理模式之該第二儲存元件組,並回復關聯於該新處理模式之該第二儲存元件組之該第二運算元子集至該第一儲存元件組。 Yet another embodiment of the present invention provides a computer program product. The computer program product is encoded in at least one computer readable storage medium for use in an computing device. The computer program product has a computer readable code for the medium, the computer program product comprising: a computer readable code for the medium, which is used to designate a microprocessor, the computer readable program The code includes a first code, which is used to specify a plurality of processing modes, the processing mode includes a user mode and a plurality of exception event modes; the computer readable code further includes a second code, which is used to specify In at least one execution unit, the execution unit performs an arithmetic operation on the operation unit through a specific program instruction; the computer readable code further includes a third code, which is used to designate a first storage element group, the A storage element group is coupled to the execution unit, wherein the first storage element group has a first subset of operation elements and provides the first operation element subset to the execution unit; the computer can read the code Contains a fourth code to specify association with the processes One of the modes of the second storage element group. The second storage element group has a second subset of operation elements, wherein the second operation element cannot directly provide the second operation element subset to the execution unit; and the computer readable code further includes a fifth The code is used to specify a logic gate, wherein when the current processing mode enters one of the processing modes, the logic gate stores the first subset of the operation element of the first storage element group to Corresponding to the second storage element group of the current processing mode, and returning the second subset of operation elements of the second storage element group associated with the new processing mode to the first storage element group.

本發明之一實施例提供一種微處理器,其係支援一ISA,該ISA係指定於複數個處理模式以及只定於複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及只定一載入多重指令,該載入多重指令係指示該微處理器自記憶體內載入資料,並傳入指定於該載入多重指令之一個或多個架構暫存器,該微處理器包含:直接儲存器,其具有關聯於該些架構暫存器之一第一部分之資料,並耦接於該微處理器之至少一執行單元,以提供該資料給該執行單元;該微處理器更包含間接儲存器,其具有關聯於該些架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該些架構暫存器之該第一部分與該些架構暫存器之該第二部分;以及,其中各架構暫存器係指定於該載入多重指令:若當該架構暫存器係位於該第一部分,該微處理器係自記憶體內載入資料,並傳 入至直接儲存器;以及若當該架構暫存器係位於該第二部分,該微處理器係自記憶體內載入資料,並傳入至該直接儲存器,而後將該直接儲存器之資料轉至該間接儲存器。 An embodiment of the present invention provides a microprocessor that supports an ISA, which is specified in a plurality of processing modes and is only fixed to a complex architecture register, and the architectural registers are associated with each processing mode. , and only one load multiple instructions, the load multiple instructions instruct the microprocessor to load data from the memory and pass in one or more architectural registers assigned to the load multiple instructions, the micro The processor includes: a direct storage device having data associated with the first portion of the one of the architecture registers, and coupled to at least one execution unit of the microprocessor to provide the data to the execution unit; The processor further includes an indirect storage having data associated with a second portion of one of the architectural registers, wherein the indirect storage cannot directly provide information associated with the second portion of the architectural register to the An execution unit, wherein the architecture registers are dynamically distributed among the first portion of the architecture registers and the architecture registers according to the current processing mode in the processing modes Moiety; and wherein each configuration register specified based on the load multiple instruction: if the configuration register when a first line is located in the portion of the microprocessor-based data from memory loaded in vivo, and transmitted Entering the direct storage; and if the architecture register is located in the second portion, the microprocessor loads the data from the memory and transmits the data to the direct storage, and then the data of the direct storage Go to the indirect storage.

本發明之另一實施例提供用於操作一種微處理器之方法,其係支援一ISA,該ISA係指定於複數個處理模式、指定於關聯於各處理模式之複數架構暫存器,以及指定於一載入多重指令,該載入多重指令係指示該微處理器自記憶體內載入資料,並傳入指定於該載入多重指令之一個或多個架構暫存器,該方法包含,對於指定於載入多重指令之各架構暫存器,若該架構暫存器係位於該第一部分,則自記憶體內載入資料至該微處理器之直接儲存器,而若該架構暫存器係位於該第二部分則自記憶體內載入資料至該直接儲存器,並接著將該直接儲存器之資料儲存至該間接儲存器。該直接儲存器具有關聯於該些架構暫存器之一第一部分之資料,並耦接於該處理器之至少一執行單元,以提供該資料給該執行單元;間接儲存器具有關聯於該些架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分。 Another embodiment of the present invention provides a method for operating a microprocessor that supports an ISA that is assigned to a plurality of processing modes, to a complex architecture register associated with each processing mode, and to specify Loading multiple instructions, the load multiple instructions instructing the microprocessor to load data from the memory and pass in one or more architectural registers assigned to the load multiple instructions, the method comprising, for Designated for each architecture register that loads multiple instructions. If the architecture register is located in the first portion, the data is loaded from the memory into the direct storage of the microprocessor, and if the architecture register is Located in the second portion, the data is loaded from the memory to the direct storage, and then the data of the direct storage is stored to the indirect storage. The direct storage device has data associated with the first portion of one of the architecture registers and is coupled to at least one execution unit of the processor to provide the data to the execution unit; the indirect storage has associated with the Information of a second part of the architecture register, wherein the indirect storage cannot directly provide information related to the second portion of the architecture register to the execution unit; wherein the architecture registers are based on the The current processing mode of the processing modes is dynamically distributed between the first portion of the architectural register and the second portion of the architectural register.

本發明之另一實施例提供一種微處理器,其支援一ISA,該ISA係指定複數個處理模式以及只定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定於一儲存多重指令,該儲存多重指令係指示該微處理器將 資料自指定於該儲存多重指令之一個或多個架構暫存器中轉存至該記憶體,該微處理器包含直接儲存器,具有關聯於該些架構暫存器之一第一部分之資料,並耦接於該微處理器之至少一執行單元,以提供該資料給該執行單元;該微處理器更包含間接儲存器,具有關聯於該些架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分;以及,其中,各架構暫存器係指定於該儲存多重指令:若當該架構暫存器係位於該第一部分,該微處理器係將資料自該直接儲存器轉存至記憶體;以及若當該架構暫存器係位於該第二部分,該微處理器係自該間接儲存器內載入資料,並傳入至該直接儲存器,而後將資料自該直接儲存器轉存至記憶體。 Another embodiment of the present invention provides a microprocessor that supports an ISA that specifies a plurality of processing modes and a fixed-number architecture register, and the architectural registers are associated with each processing mode, and Specified on a store multiple command, the store multiple command indicates that the microprocessor will Data is dumped from the one or more architectural registers designated to store the multiple instructions to the memory, the microprocessor comprising a direct storage having information associated with the first portion of one of the architectural registers, And coupled to the at least one execution unit of the microprocessor to provide the data to the execution unit; the microprocessor further includes an indirect storage having information associated with the second portion of one of the architecture registers, The indirect storage device cannot directly provide the data associated with the second portion of the architecture register to the execution unit; wherein the architecture registers are dynamically according to the current processing mode in the processing modes. The first portion of the architecture register and the second portion of the architecture register; and wherein each architectural register is assigned to the store multiple instructions: if the architectural register is located In a first part, the microprocessor transfers data from the direct storage to the memory; and if the architecture register is located in the second portion, the microprocessor is loaded from the indirect storage Information and pass directly to the reservoir, and the data will be directly from the reservoir to dump memory.

本發明之又一實施例提供一種用以操作一微處理器之方法,該微處理器係支援一ISA,該ISA係指定複數個處理模式以及指定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定一儲存多重指令,該儲存多重指令係指示該微處理器將資料自指定於該儲存多重指令之一個或多個架構暫存器中轉存至該記憶體,該方法包含:各架構暫存器係指定於該儲存多重指令:若當該架構暫存器係位於該第一部分,則將資料自該該微處理器之直接儲存器轉存至記憶體;以及若當該架構暫存器係位於該第二部分,則自該間接儲存器內載入資料,並傳入至該直接儲 存器,而後將資料自該直接儲存器轉存至記憶體。其中,該直接儲存器具有關聯於該架構暫存器之一第一部分之資料,並耦接於該微處理器之至少一執行單元以提供該資料至該執行單元;其中,該間接儲存器具有關連於該架構暫存器之一第二部分之資料。該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分。 Yet another embodiment of the present invention provides a method for operating a microprocessor that supports an ISA that specifies a plurality of processing modes and specifies a complex architecture register, and the structures are temporarily stored. Corresponding to each processing mode, and designating a store multiple instruction instructing the microprocessor to transfer data from the one or more architectural registers designated to store the multiple instructions to the memory The method includes: each architecture register is configured to store the multiple instructions: if the architecture register is located in the first portion, transferring data from the direct storage of the microprocessor to the memory; And if the architecture register is located in the second part, the data is loaded from the indirect storage and passed to the direct storage The memory is then transferred from the direct storage to the memory. The direct storage device has information associated with a first portion of the architecture register and is coupled to at least one execution unit of the microprocessor to provide the data to the execution unit; wherein the indirect storage device is associated with Information attached to the second part of one of the architecture registers. The indirect storage cannot directly provide the data associated with the second portion of the architecture register to the execution unit; wherein the architectural registers are dynamically distributed according to the current processing mode in the processing modes The first portion of the architecture register and the second portion of the architecture register.

本發明之又一實施例提供一種電腦程式產品,此電腦程式產品編碼於至少一電腦可讀取儲存媒介,以使用於一運算裝置,該電腦程式產品包括:適用於該媒介之電腦可讀取程式碼,係用以指定一微處理器,該微處理器係支援一ISA,該ISA係指定複數個處理模式以及只定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定於一載入多重指令,該載入多重指令係指示該微處理器自記憶體內載入資料,並傳入指定於該載入多重指令之一個或多個架構暫存器,該電腦可讀取程式碼包含第一程式碼,係用以指定於直接儲存器,該直接儲存器具有關聯於該架構暫存器之一第一部分之資料,且並耦接於該微處理器之至少一執行單元,以提供該資料給該執行單元;該電腦可讀取程式碼更包含第二程式碼,係用以指定於間接儲存器,該間接儲存器具有關聯於該些架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些 架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分;其中,各架構暫存器係指定於該載入多重指令:若當該架構暫存器係位於該第一部分,該微處理器係自記憶體內載入資料,並傳入至該直接儲存器;以及若當該架構暫存器係位於該第二部分,則該微處理器係自記憶體內載入資料,並傳入至該直接儲存器,而後將該直接儲存器之資料轉至該間接儲存器。 A further embodiment of the present invention provides a computer program product encoded in at least one computer readable storage medium for use in an computing device, the computer program product comprising: a computer readable medium suitable for the medium The code is used to designate a microprocessor that supports an ISA that specifies a plurality of processing modes and only a complex architecture register, and the architecture registers are associated with each processing. a mode, and a load multiple instruction, the load multiple instruction instructing the microprocessor to load data from the memory and pass in one or more architectural registers designated for the load multiple instructions, The computer readable code includes a first code for specifying a direct storage having a data associated with a first portion of the architecture register and coupled to the microprocessor At least one execution unit for providing the information to the execution unit; the computer readable code further comprising a second code for specifying indirect storage, the indirect storage device To one of the plurality of configuration register information of the second portion, wherein the reservoir can not provide indirect directly related to the profile of the second portion of the architecture register to the execution unit; wherein the plurality of The architecture register is dynamically distributed in the first portion of the architecture register and the second portion of the architecture register according to the current processing mode in the processing modes; wherein each architecture register is Specifying to load multiple instructions: if the architecture register is located in the first portion, the microprocessor loads data from the memory and passes it to the direct storage; and if the architecture register In the second part, the microprocessor loads the data from the memory and transfers it to the direct storage, and then transfers the direct storage data to the indirect storage.

關於本發明之優點與精神可以藉由以下的發明詳述及所附圖式得到進一步的瞭解。 The advantages and spirit of the present invention will be further understood from the following detailed description of the invention.

名詞定義Noun definition

指令集,係定義二進位制編碼值之集合(即機器語言指令)與微處理器所執行操作間的對應關係。機器語言程式基本上以二進位制進行編碼,不過亦可使用其他進位制的系統,如部分早期IBM電腦的機器語言程式,雖然最終亦是以電壓高低呈現二進位值之物理信號來表現,不過卻是以十進位制進行編碼。機器語言指令指示微處理器執行的操作如:將暫存器1內之運算元與暫存器2內之運算元相加並將結果寫入暫存器3、將記憶體位址0x12345678之運算元減掉指令所指定之立即運算元並將結果寫入暫存器5、依據暫存器7所指定之位元數移動暫存器6內的數值、若是零旗標被設定時,分支到指令後方之36個位元組、將記憶體位址0xABCD0000的數值載入暫存器8。因此,指 令集係定義各個機器語言指令使微處理器執行所欲執行之操作的二進位編碼值。需瞭解的是,指令集定義二進位值與微處理器操作間的對應關係,並不意味著單一個二進位值就會對應至單一個微處理器操作。具體來說,在部分指令集中,多個二進位值可能會對應至同一個微處理器操作。 The instruction set defines the correspondence between the set of binary code values (ie, machine language instructions) and the operations performed by the microprocessor. Machine language programs are basically encoded in binary systems, but other systems can be used, such as some of the early IBM computer language programs, although they are ultimately represented by physical signals that exhibit binary values at high or low voltages. It is encoded by the decimal system. The machine language instruction instructs the microprocessor to perform operations such as: adding the operands in the scratchpad 1 to the operands in the scratchpad 2 and writing the result to the scratchpad 3, and the operand of the memory address 0x12345678 The immediate operation element specified by the instruction is subtracted and the result is written into the scratchpad 5. The value in the temporary register 6 is moved according to the number of bits specified by the temporary register 7, and if the zero flag is set, the branch is commanded. The latter 36 bytes are loaded into the scratchpad 8 with the value of the memory address 0xABCD0000. Therefore, The set system defines the binary coded values of the various machine language instructions that cause the microprocessor to perform the operations to be performed. It should be understood that the instruction set defines the correspondence between the binary value and the operation of the microprocessor, and does not mean that a single binary value corresponds to a single microprocessor operation. Specifically, in some instruction sets, multiple binary values may correspond to the same microprocessor operation.

指令集架構(ISA),從微處理器家族的脈絡來看包含(1)指令集;(2)指令集之指令所能存取之資源集(例如:記憶體定址所需之暫存器與模式);以及(3)微處理器回應指令集之指令執行所產生的例外事件集(例如:除以零、分頁錯誤、記憶體保護違反等)。因為程式撰寫者,如組譯器與編譯器的撰寫者,想要作出機器語言程式在一微處理器家族執行時,就需要此微處理器家族之ISA定義。所以微處理器家族的製造者通常會將ISA定義於操作者操作手冊中。舉例來說,2009年3月公佈之Intel 64與IA-32架構軟體開發者手冊(Intel 64 and IA-32 Architectures Software Developer’s Manual)即定義Intel 64與IA-32處理器架構的ISA。此軟體開發者手冊包含有五個章節,第一章是基本架構;第二A章是指令集參考A至M;第二B章是指令集參考N至Z;第三A章是系統編程指南;第三B章是系統編程指南第二部分,此手冊係列為本案的參考文件。此種處理器架構通常被稱為x86架構,本文中則是以x86、x86 ISA、x86 ISA家族、x86家族或是相似用語來說明。在另一個例子中,2010年公佈之ARM架構參考手冊,ARM v7-A與ARM v7-R版本Errata markup,定義ARM處理器架構之ISA。此參考手冊係列為參考文件。此ARM處理器 架構之ISA在此亦被稱為ARM、ARM ISA、ARM ISA家族、ARM家族或是相似用語。其他眾所周知的ISA家族還有IBM System/360/370/390與z/Architecture、DEC VAX、Motorola 68k、MIPS、SPARC、PowerPC與DEC Alpha等等。ISA的定義會涵蓋處理器家族,因為處理器家族的發展中,製造者會透過在指令集中增加新指令、以及/或在暫存器組中增加新的暫存器等方式來改進原始處理器之ISA。舉例來說,隨著x86程式集架構的發展,其於Intel Pentium III處理器家族導入一組128位元之多媒體擴展指令集(MMX)暫存器作為單指令多重數據流擴展(SSE)指令集的一部分,而x86 ISA機器語言程式已經開發來利用XMM暫存器以提升效能,雖然現存的x86 ISA機器語言程式並不使用單指令多重數據流擴展指令集之XMM暫存器。此外,其他製造商亦設計且製造出可執行x86 ISA機器語言程式之微處理器。例如,超微半導體(AMD)與威盛電子(VIA Technologies)即在x86 ISA增加新技術特徵,如超微半導體之3DNOW!單指令多重數據流(SIMD)向量處理指令,以及威盛電子之Padlock安全引擎隨機數產生器(random number generator)與先進譯碼引擎(advanced cryptography engine)的技術,前述技術都是採用x86 ISA之機器語言程式,但卻非由現有之Intel微處理器實現。以另一個實例來說明,ARM ISA原本定義ARM指令集狀態具有4位元組之指令。然而,隨著ARM ISA的發展而增加其他指令集狀態,如具有2位元組指令以提升編碼密度之Thumb指令集狀態以及用以加速Java位元組碼程式之 Jazelle指令集狀態,ARM ISA機器語言程式已被發展來使用部分或所有其他ARM ISA指令集狀態,即使現存的ARM ISA機器語言程式產生之初並非採用這些其他ARM ISA指令集狀態。 The Instruction Set Architecture (ISA), from the context of the family of microprocessors, contains (1) the instruction set; (2) the set of resources that the instruction set instruction can access (eg, the scratchpad required for memory addressing) Mode); and (3) a set of exception events generated by the microprocessor in response to instruction execution of the instruction set (eg, division by zero, page fault, memory protection violation, etc.). Because programmers, such as compilers and compiler writers, want to make machine language programs executed in a family of microprocessors, the ISA definition for this family of microprocessors is needed. So the manufacturer of the microprocessor family usually defines the ISA in the operator's manual. For example, the Intel 64 and IA-32 Architectures Software Developer's Manual (Intel 64 and IA-32 Architectures Software Developer's Manual), which was released in March 2009, defines the ISA for Intel 64 and IA-32 processor architectures. This software developer's manual contains five chapters. The first chapter is the basic architecture; the second chapter is the instruction set reference A to M; the second chapter is the instruction set reference N to Z; the third chapter is the system programming guide. The third chapter is the second part of the system programming guide. This manual series is the reference document for this case. This type of processor architecture is often referred to as the x86 architecture, and is described in x86, x86 ISA, x86 ISA family, x86 family, or similar terms. In another example, the ARM architecture reference manual published in 2010, ARM v7-A and ARM v7-R version Errata markup, defines the ISA of the ARM processor architecture. This reference manual series is a reference file. This ARM processor The architecture ISA is also referred to herein as ARM, ARM ISA, ARM ISA family, ARM family or similar terms. Other well-known ISA families include IBM System/360/370/390 and z/Architecture, DEC VAX, Motorola 68k, MIPS, SPARC, PowerPC and DEC Alpha. The definition of ISA will cover the processor family. As the processor family evolves, manufacturers will improve the original processor by adding new instructions to the instruction set and/or adding new scratchpads to the scratchpad group. ISA. For example, with the development of the x86 programming architecture, the Intel Pentium III processor family imported a set of 128-bit multimedia extended instruction set (MMX) registers as a single instruction multiple data stream extension (SSE) instruction set. As part of the x86 ISA machine language program has been developed to take advantage of the XMM scratchpad to improve performance, although the existing x86 ISA machine language program does not use the single-instruction multiple data stream extension instruction set XMM register. In addition, other manufacturers have designed and manufactured microprocessors that can execute x86 ISA machine language programs. For example, AMD and VIA Technologies are adding new technology features to the x86 ISA, such as 3DNOW for AMD! Single-instruction multiple data stream (SIMD) vector processing instructions, and VIA Technologies' Padlock security engine random number generator and advanced cryptography engine technology, all of which are machines using x86 ISA Language programs, but not implemented by existing Intel microprocessors. As another example, the ARM ISA originally defined an ARM instruction set state with a 4-bit instruction. However, as the ARM ISA evolves, other instruction set states are added, such as the Thumb instruction set state with 2-bit instruction to increase the encoding density and to speed up the Java bytecode program. The Jazelle instruction set state, the ARM ISA machine language program has been developed to use some or all of the other ARM ISA instruction set states, even if the existing ARM ISA machine language program was originally created without these other ARM ISA instruction set states.

指令集架構(ISA)機器語言程式,包含ISA指令序列,即ISA指令集對應至程式撰寫者要程式執行之操作序列的二進位編碼值序列。因此,x86 ISA機器語言程式包含x86 ISA指令序列,ARM ISA機器語言程式則包含ARM ISA指令序列。機器語言程式指令係存放於記憶體內,且由微處理器擷取並執行。 An Instruction Set Architecture (ISA) machine language program that contains a sequence of ISA instructions, that is, a sequence of binary code values corresponding to the sequence of operations performed by the program writer to execute the program. Therefore, the x86 ISA machine language program contains the x86 ISA instruction sequence, and the ARM ISA machine language program contains the ARM ISA instruction sequence. Machine language program instructions are stored in memory and retrieved and executed by the microprocessor.

硬體指令轉譯器,包含多個電晶體的配置,用以接收ISA機器語言指令(例如x86 ISA或是ARM ISA機器語言指令)作為輸入,並對應地輸出一個或多個微指令至微處理器之執行管線。執行管線執行微指令的執行結果係由ISA指令所定義。因此,執行管線透過對這些微指令的集體執行來“實現”ISA指令。也就是說,執行管線透過對於硬體指令轉譯器輸出之實行微指令的集體執行,實現所輸入ISA指令所指定之操作,以產生此ISA指令定義的結果。因此,硬體指令轉譯器可視為是將ISA指令“轉譯(translate)”為一個或多個實行微指令。本實施例所描述之微處理器具有硬體指令轉譯器以將x86 ISA指令與ARM ISA指令轉譯為微指令。不過,需理解的是,硬體指令轉譯器並非必然可對x86使用者操作手冊或是ARM使用者操作手冊所定義的整個指令集進行轉譯,而往往只能轉譯這些指令中一個子集合,如同絕大多數x86 ISA與ARM ISA處 理器只支援其對應之使用者操作手冊所定義的一個指令子集合。具體來說,x86使用者操作手冊定義由硬體指令轉譯器轉譯之指令子集合,不必然就對應至所有既有的x86 ISA處理器,ARM使用者操作手冊定義由硬體指令轉譯器轉譯之指令子集合,不必然就對應至所有現存的ARM ISA處理器。 A hardware instruction translator comprising a plurality of transistor configurations for receiving ISA machine language instructions (eg, x86 ISA or ARM ISA machine language instructions) as input and correspondingly outputting one or more microinstructions to the microprocessor The execution pipeline. The execution result of the execution pipeline execution microinstruction is defined by the ISA instruction. Thus, the execution pipeline "implements" the ISA instructions through collective execution of these microinstructions. That is, the execution pipeline implements the operations specified by the input ISA instructions through the collective execution of the microinstructions that are output to the hardware instruction translator to produce the results defined by the ISA instructions. Thus, a hardware instruction translator can be considered to "translate" an ISA instruction into one or more execution microinstructions. The microprocessor described in this embodiment has a hardware instruction translator to translate x86 ISA instructions and ARM ISA instructions into microinstructions. However, it should be understood that the hardware instruction translator does not necessarily translate the entire instruction set defined by the x86 user manual or the ARM user manual, but often only translates a subset of these instructions, as Most x86 ISA and ARM ISA The processor only supports a subset of instructions defined in its corresponding user manual. Specifically, the x86 user operation manual defines a subset of instructions translated by the hardware instruction translator, which does not necessarily correspond to all existing x86 ISA processors, and the ARM user operation manual defines translation by the hardware instruction translator. The set of instructions does not necessarily correspond to all existing ARM ISA processors.

執行管線,係一多層級序列(sequence of stages)。此多層級序列之各個層級分別具有硬體邏輯與一硬體暫存器。硬體暫存器係保持硬體邏輯之輸出信號,並依據微處理器之時脈信號,將此輸出信號提供至多層級序列之下一層級。執行管線可以具有複數個多層級序列,例多重執行管線。執行管線接收微指令作為輸入信號,並相應地執行微指令所指定的操作以輸出執行結果。微指令所指定且由執行管線之硬體邏輯所執行的操作包括但不限於算數、邏輯、記憶體載入/儲存、比較、測試、與分支解析,對進行操作的資料格式包括但不限於整數、浮點數、字母、二進編碼十進數(BCD)、與壓縮格式(packed format)。執行管線執行微指令以實現ISA指令(如x86與ARM),藉以產生ISA指令所定義的結果。執行管線不同於硬體指令轉譯器。具體來說,硬體指令轉譯器產生實行微指令,執行管線則是執行這些指令,但不產生這些實行微指令。 The execution pipeline is a sequence of stages. Each level of the multi-level sequence has hardware logic and a hardware register. The hardware register maintains the output signal of the hardware logic and provides the output signal to a level below the multi-level sequence according to the clock signal of the microprocessor. The execution pipeline can have multiple multi-level sequences, such as multiple execution pipelines. The execution pipeline receives the microinstruction as an input signal and accordingly performs an operation specified by the microinstruction to output an execution result. The operations specified by the microinstructions and performed by the hardware logic of the execution pipeline include, but are not limited to, arithmetic, logic, memory load/store, compare, test, and branch parsing, and the data formats for operations include, but are not limited to, integers. , floating point numbers, letters, binary coded decimals (BCD), and packed format. The execution pipeline executes microinstructions to implement ISA instructions (such as x86 and ARM) to generate the results defined by the ISA instructions. The execution pipeline is different from the hardware instruction translator. Specifically, the hardware instruction translator generates the execution micro-instructions, and the execution pipeline executes the instructions, but does not generate these execution micro-instructions.

指令快取,係微處理器內的一個隨機存取記憶裝置,微處理器將ISA機器語言程式之指令(例如x86 ISA與ARM ISA的機器語言指令)放置其中,這些指令係擷取自系統記憶體並由微處理器依據ISA機器語言程式之執行流 程,來執行。具體來說,ISA定義一指令位址暫存器以持有下一個待執行ISA指令的記憶體位址(舉例來說,在x86 ISA係定義為指令指標(IP)而在ARM ISA係定義為程式計數器(PC)),而在微處理器執行機器語言程式以控制程式流程時,微處理器會更新指令位址暫存器的內容。ISA指令被快取來供後續擷取之用。當該暫存器所包含的下一個機器語言程式的ISA指令位址係位於目前的指令快取中,可依據指令暫存器的內容快速地指令快取擷取ISA指令由系統記憶體中取出該ISA指令。尤其是,此程序係基於指令位址暫存器(如指令指標(IP)或是程式計數器(PC))的記憶體位址向指令快取取得資料,而非特地運用一載入或儲存指令所指定之記憶體位址來進行資料擷取。因此,將指令集架構之指令視為資料(例如採用軟體轉譯之系統的硬體部分所呈現的資料)之專用資料快取,特地運用一載入/儲存位址,而非基於指令位址暫存器的數值做存取的,就不是此處所稱的指令快取。此外,可取得指令與資料之混合式快取,係基於指令位址暫存器的數值以及基於載入/儲存位址,而非僅僅基於載入/儲存位址,亦被涵蓋在本說明對指令快取的定義內。在本說明內容中,載入指令係指將資料由記憶體載入至微處理器之指令,儲存指令係指將資料由微處理器寫入記憶體之指令。 The instruction cache is a random access memory device in the microprocessor. The microprocessor places instructions of the ISA machine language program (such as x86 ISA and ARM ISA machine language instructions), and the instructions are retrieved from the system memory. And by the microprocessor according to the execution flow of the ISA machine language program Cheng, to execute. Specifically, the ISA defines an instruction address register to hold the memory address of the next pending ISA instruction (for example, the x86 ISA is defined as an instruction indicator (IP) and is defined as a program in the ARM ISA system). Counter (PC)), and when the microprocessor executes a machine language program to control the program flow, the microprocessor updates the contents of the instruction address register. The ISA instructions are cached for subsequent retrieval. When the ISA instruction address of the next machine language program included in the register is located in the current instruction cache, the cache instruction can be quickly fetched according to the contents of the instruction register, and the ISA instruction is taken out from the system memory. The ISA directive. In particular, the program obtains data from the instruction cache based on the memory address of the instruction address register (such as instruction index (IP) or program counter (PC), instead of specifically using a load or store instruction. The specified memory address is used for data retrieval. Therefore, the instruction set architecture instruction is treated as a dedicated data cache of data (eg, data presented by the hardware portion of the software translation system), specifically using a load/store address rather than an instruction address. The value of the register is accessed, not the instruction cache referred to here. In addition, a hybrid cache of instructions and data is available, based on the value of the instruction address register and based on the load/store address, rather than just the load/store address, and is also covered in this description. Within the definition of the instruction cache. In the present description, a load instruction is an instruction to load data from a memory to a microprocessor, and a storage instruction is an instruction to write data to a memory by a microprocessor.

微指令集,係微處理器之執行管線能夠執行之指令(微指令)的集合。 A microinstruction set is a collection of instructions (microinstructions) that a microprocessor's execution pipeline can execute.

實施例說明Description of the embodiments

本發明實施例揭露之微處理器可透過硬體將其對應之 x86 ISA與ARM ISA指令轉譯為由微處理器執行管線直接執行之微指令,以達到可執行x86 ISA與ARM ISA機器語言程式之目的。此微指令係由不同於x86 ISA與ARM ISA之微處理器微架構(microarchitecture)的微指令集所定義。由於本文所述之微處理器需要執行x86與ARM機器語言程式,微處理器之硬體指令轉譯器會將x86與ARM指令轉譯為微指令,並將這些微指令提供至微處理器之執行管線,由微處理器執行這些微指令以實現前述x86與ARM指令。由於這些實行微指令(係直接由硬體指令轉譯器提供至執行管線來執行,而不同於採用軟體轉譯器之系統需於執行管線執行指令前,將預先儲存本機(host)指令至記憶體,因此,前揭微處理器具有潛力能夠以較快的執行速度執行x86與ARM機器語言程式。 The microprocessor disclosed in the embodiment of the present invention can correspond to the hardware through the hardware. The x86 ISA and ARM ISA instructions are translated into micro-instructions that are executed directly by the microprocessor execution pipeline to achieve the x86 ISA and ARM ISA machine language programs. This microinstruction is defined by a microinstruction set different from the microarchitecture of the x86 ISA and ARM ISA. Since the microprocessor described herein requires execution of x86 and ARM machine language programs, the microprocessor's hardware instruction translator translates x86 and ARM instructions into microinstructions and provides these microinstructions to the microprocessor's execution pipeline. These microinstructions are executed by the microprocessor to implement the aforementioned x86 and ARM instructions. Since these implementation micro-instructions are directly provided by the hardware instruction translator to the execution pipeline, unlike systems using software translators, the host instructions are pre-stored to the memory before executing the pipeline execution instructions. Therefore, the aforementioned microprocessor has the potential to execute x86 and ARM machine language programs at a faster execution speed.

第1圖係一方塊圖顯示本發明執行x86 ISA與ARM ISA機器語言程式之微處理器100之實施例。此微處理器100具有一指令快取102;一硬體指令轉譯器104,用以由指令快取102接收x86 ISA指令與ARM ISA指令124並將其轉譯為微指令126;一執行管線112,執行由硬體指令轉譯器104接收之微指令126以產生微指令結果128,該結果係以運算元的型式回傳至執行管線112;一暫存器檔案106與一記憶體子系統108,分別提供運算元至執行管線112並由執行管線112接收微指令結果128;一指令擷取單元與分支預測器114,提供一擷取位址134至指令快取102;一ARM ISA定義之程式計數器暫存器116與一x86 ISA定義之指令指標暫存器118,其依據微指令結果128 進行更新,且提供其內容至指令擷取單元與分支預測器114;以及多個組態暫存器122,提供一指令模式指標132與一環境模式指標136至硬體指令轉譯器104與指令擷取單元與分支預測器114,並基於微指令結果128進行更新。 1 is a block diagram showing an embodiment of a microprocessor 100 of the present invention that executes x86 ISA and ARM ISA machine language programs. The microprocessor 100 has an instruction cache 102; a hardware instruction translator 104 for receiving x86 ISA instructions and ARM ISA instructions 124 by the instruction cache 102 and translating them into microinstructions 126; an execution pipeline 112, Executing the microinstruction 126 received by the hardware instruction translator 104 to generate the microinstruction result 128, the result is returned to the execution pipeline 112 in the form of an operand; a temporary register file 106 and a memory subsystem 108, respectively An operand is provided to execution pipeline 112 and receives microinstruction result 128 by execution pipeline 112; an instruction fetch unit and branch predictor 114 provides a fetch address 134 to instruction fetch 102; an ARM ISA defined program counter is temporarily The register 116 and an x86 ISA defined instruction indicator register 118 are based on the microinstruction result 128. An update is made and its contents are provided to the instruction fetch unit and the branch predictor 114; and a plurality of configuration registers 122 provide an instruction mode indicator 132 and an environmental mode indicator 136 to the hardware instruction translator 104 and the command port. The unit and branch predictor 114 are fetched and updated based on the microinstruction result 128.

由於微處理器100可執行x86 ISA與ARM ISA機器語言指令,微處理器100係依據程式流程由系統記憶體(未圖示)擷取指令至微處理器100。微處理器100存取最近擷取的x86 ISA與ARM ISA之機器語言指令至指令快取102。指令擷取單元114將依據由系統記憶體擷取之x86或ARM指令位元組區段,產生一擷取位址134。若是命中指令快取102,指令快取102將位於擷取位址134之x86或ARM指令位元組區段提供至硬體指令轉譯器104,否則由系統記憶體中擷取指令集架構的指令124。指令擷取單元114係基於ARM程式計數器116與x86指令指標118的值產生擷取位址134。具體來說,指令擷取單元114會在一擷取位址暫存器中維持一擷取位址。任何時候指令擷取單元114擷取到新的ISA指令位元組區段,它就會依據此區段的大小更新擷取位址,並依據既有方式依序進行,直到出現一控制流程事件。控制流程事件包含例外事件的產生、分支預測器114的預測顯示擷取區段內有一將發生的分支(taken branch)、以及執行管線112回應一非由分支預測器114所預測之將發生分支指令之執行結果,而對ARM程式計數器116與x86指令指標118進行之更新。指令擷取單元114係將擷取位址相應地更新為例外處理程序位址、預測目標位址或是執行目標位址以回應一控制流程 事件。在一實施例中,指令快取102係一混合快取,以存取ISA指令124與資料。值得注意的是,在此混合快取之實施例中,雖然混合快取可基於一載入/儲存位址將資料寫入快取或由快取載入資料,在微處理器100係由混合快取擷取指令集架構之指令124的情況下,混合快取係基於ARM程式計數器116與x86指令指標118的數值來存取,而非基於載入/儲存位址。指令快取102可以係一隨機存取記憶體裝置。 Since the microprocessor 100 can execute x86 ISA and ARM ISA machine language instructions, the microprocessor 100 retrieves instructions from the system memory (not shown) to the microprocessor 100 in accordance with the program flow. The microprocessor 100 accesses the recently retrieved x86 ISA and ARM ISA machine language instructions to the instruction cache 102. The instruction fetch unit 114 will generate a fetch address 134 based on the x86 or ARM instruction byte segments retrieved by the system memory. If the hit instruction cache 102, the instruction cache 102 provides the x86 or ARM instruction byte segment located in the capture address 134 to the hardware instruction translator 104, otherwise the instructions in the system memory are retrieved from the instruction set architecture. 124. The instruction fetch unit 114 generates the fetch address 134 based on the values of the ARM program counter 116 and the x86 command indicator 118. Specifically, the instruction fetch unit 114 maintains a fetch address in a fetch address register. At any time, the instruction fetching unit 114 retrieves the new ISA instruction byte segment, and it updates the retrieval address according to the size of the segment, and sequentially performs according to the existing method until a control flow event occurs. . The control flow event includes the generation of an exception event, the prediction of the branch predictor 114 indicates that there is a take branch in the capture segment, and the execution pipeline 112 responds to a branch instruction that is not predicted by the branch predictor 114. The result of the execution is updated with the ARM program counter 116 and the x86 command indicator 118. The instruction fetching unit 114 updates the captured address to the exception handler address, the predicted target address, or the execution target address in response to a control flow. event. In one embodiment, the instruction cache 102 is a hybrid cache to access the ISA instructions 124 and data. It should be noted that in the hybrid cache embodiment, although the hybrid cache can write data to the cache or load data based on a load/store address, the microprocessor 100 is mixed. In the case of cache fetch instruction 124 of the instruction set architecture, the hybrid cache is accessed based on the values of the ARM program counter 116 and the x86 instruction index 118, rather than based on the load/store address. The instruction cache 102 can be a random access memory device.

指令模式指標132係一狀態指示微處理器100當前是否正在擷取、格式化(formatting)/解碼、以及將x86 ISA或ARM ISA指令124轉譯為微指令126。此外,執行管線112與記憶體子系統108接收此指令模式指標132,此指令模式指標132會影響微指令126的執行方式,儘管只是微指令集內的一個小集合受影響而已。x86指令指標暫存器118持有下一個待執行之x86 ISA指令124的記憶體位址,ARM程式計數器暫存器116持有下一個待執行之ARM ISA指令124的記憶體位址。為了控制程式流程,微處理器100在其執行x86與ARM機器語言程式時,分別更新x86指令指標暫存器118與ARM程式計數器暫存器116,至下一個指令、分支指令之目標位址或是例外處理程序位址。在微處理器100執行x86與ARM ISA之機器語言程式的指令時,微處理器100係由系統記憶體擷取機器語言程式之指令集架構的指令,並將其置入指令快取102以取代最近較不被擷取與執行的指令。此指令擷取單元114基於x86指令指標暫存器118或是ARM程式計數器暫存器116的數 值,並依據指令模式指標132指示微處理器100正在擷取的ISA指令124是x86或是ARM模式來產生擷取位址134。在一實施例中,x86指令指標暫存器118與ARM程式計數器暫存器116可實施為一共享的硬體指令位址暫存器,用以提供其內容至指令擷取單元與分支預測器114並由執行管線112依據指令模式指標132指示之模式是x86或ARM與x86或ARM之語意(semantics)來進行更新。 The command mode indicator 132 is a state indicating whether the microprocessor 100 is currently capturing, formatting/decoding, and translating the x86 ISA or ARM ISA instructions 124 into the microinstructions 126. In addition, execution pipeline 112 and memory subsystem 108 receive this instruction mode indicator 132, which affects the manner in which microinstruction 126 is executed, although only a small set within the microinstruction set is affected. The x86 instruction index register 118 holds the memory address of the next x86 ISA instruction 124 to be executed, and the ARM program counter register 116 holds the memory address of the next ARM ISA instruction 124 to be executed. In order to control the program flow, the microprocessor 100 updates the x86 instruction index register 118 and the ARM program counter register 116 to the next instruction, the target address of the branch instruction, or the target code of the branch instruction, respectively, when executing the x86 and ARM machine language programs. Is the exception handler address. When the microprocessor 100 executes the instructions of the machine language program of the x86 and ARM ISA, the microprocessor 100 retrieves the instruction of the instruction set architecture of the machine language program from the system memory and places it into the instruction cache 102 to replace Recently less instructions have been taken and executed. The instruction fetch unit 114 is based on the number of the x86 instruction index register 118 or the ARM program counter register 116. The value, and in accordance with the instruction mode indicator 132, indicates that the ISA instruction 124 being retrieved by the microprocessor 100 is in x86 or ARM mode to generate the capture address 134. In one embodiment, the x86 instruction index register 118 and the ARM program counter register 116 can be implemented as a shared hardware instruction address register for providing its contents to the instruction fetch unit and the branch predictor. The mode indicated by the execution pipeline 112 in accordance with the command mode indicator 132 is x86 or ARM and x86 or ARM semantics.

環境模式指標136係一狀態指示微處理器100是使用x86或ARM ISA之語意於此微處理器100所操作之多種執行環境,例如虛擬記憶體、例外事件、快取控制、與全域執行時間保護。因此,指令模式指標132與環境模式指標136共同產生多個執行模式。在第一種模式中,指令模式指標132與環境模式指標136都指向x86 ISA,微處理器100係作為一般的x86 ISA處理器。在第二種模式中,指令模式指標132與環境模式指標136都指向ARM ISA,微處理器100係作為一般的ARM ISA處理器。在第三種模式中,指令模式指標132指向x86 ISA,不過環境模式指標136則是指向ARM ISA,此模式有利於在ARM作業系統或是超管理器之控制下執行使用者模式x86機器語言程式;相反地,在第四種模式中,指令模式指標132係指向ARM ISA,不過環境模式指標136則是指向x86 ISA,此模式有利於在x86作業系統或超管理器之控制下執行使用者模式ARM機器語言程式。指令模式指標132與環境模式指標136的數值在重置(reset)之初就已確定。在一實施例中,此初始值係被視為微碼常數進行編碼,不過可透過 熔斷組態熔絲與/或使用微碼修補進行修改。在另一實施例中,此初始值則是由一外部輸入提供至微處理器100。在一實施例中,環境模式指標136只在由一重置至ARM(reset-to-ARM)指令124或是一重置至x86(reset-to-x86)指令124執行重置後才會改變(請參照下述第6A圖及第6B圖);亦即,在微處理器100正常運作而未由一般重置、重置至x86或重置至ARM指令124執行重置時,環境模式指標136並不會改變。 The environmental mode indicator 136 is a state indicating that the microprocessor 100 is using x86 or ARM ISA to describe various execution environments operated by the microprocessor 100, such as virtual memory, exception events, cache control, and global execution time protection. . Thus, the command mode indicator 132 and the environmental mode indicator 136 together produce a plurality of execution modes. In the first mode, both the command mode indicator 132 and the environmental mode indicator 136 point to the x86 ISA, which acts as a general x86 ISA processor. In the second mode, both the command mode indicator 132 and the environment mode indicator 136 point to the ARM ISA, and the microprocessor 100 acts as a general ARM ISA processor. In the third mode, the command mode indicator 132 points to the x86 ISA, but the environment mode indicator 136 points to the ARM ISA, which facilitates the execution of the user mode x86 machine language program under the control of the ARM operating system or the hypervisor. Conversely, in the fourth mode, the command mode indicator 132 points to the ARM ISA, but the environment mode indicator 136 points to the x86 ISA, which facilitates the execution of the user mode under the control of the x86 operating system or hypervisor. ARM machine language program. The values of the command mode indicator 132 and the environmental mode indicator 136 are determined at the beginning of the reset. In an embodiment, the initial value is encoded as a microcode constant, but is permeable. Fuse the configuration fuse and/or modify it using microcode patching. In another embodiment, this initial value is provided to microprocessor 100 by an external input. In one embodiment, the ambient mode indicator 136 will only change after a reset by reset to the ARM (reset-to-ARM) instruction 124 or a reset to x86 (reset-to-x86) instruction 124. (Refer to Figures 6A and 6B below); that is, when the microprocessor 100 is operating normally without being reset by normal reset, reset to x86, or reset to ARM instruction 124, the environmental mode indicator 136 does not change.

硬體指令轉譯器104接收x86與ARM ISA之機器語言指令124作為輸入,相應地提供一個或多個微指令126作為輸出信號以實現x86或ARM ISA指令124。執行管線112執行前揭一個或多個微指令126,其集體執行之結果實現x86或ARM ISA指令124。也就是說,這些微指令126的集體執行可依據輸入端所指定的x86或ARM ISA指令124,來執行x86或是ARM ISA指令124所指定的操作,以產生x86或ARM ISA指令124所定義的結果。因此,硬體指令轉譯器104係將x86或ARM ISA指令124轉譯為一個或多個微指令126。硬體指令轉譯器104包含一組電晶體,以一預設方式進行配置來將x86 ISA與ARM ISA之機器語言指令124轉譯為實行微指令126。硬體指令轉譯器104並具有布林邏輯閘以產生實行微指令126(如第2圖所示之簡單指令轉譯器204)。在一實施例中,硬體指令轉譯器104並具有一微碼唯讀記憶體(如第2圖中複雜指令轉譯器206之元件234)。硬體指令轉譯器104利用此微碼唯讀記憶體,並依據複雜ISA指令124產生實行微指令 126,這部份將在第2圖的說明內容會有進一步的說明。就一較佳實施例而言,硬體指令轉譯器104不必然要能轉譯x86使用者操作手冊或是ARM使用者操作手冊所定義之整個ISA指令124集,而只要能夠轉譯這些指令的一個子集合即可。具體來說,由x86程式員操作手冊定義且由硬體指令轉譯器104轉譯的ISA指令124的子集合,並不必然對應至任何Intel開發之既有x86 ISA處理器,而由ARM使用者操作手冊定義且由硬體指令轉譯器104轉譯之ISA指令124的子集合並不必然對應至任何由ARM Ltd.開發之既有的ISA處理器。前揭一個或多個用以實現x86或ARM ISA指令124的實行微指令126,可由硬體指令轉譯器104一次全部提供至執行管線112或是依序提供。本實施例的優點在於,硬體指令轉譯器104可將實行微指令126直接提供至執行管線112執行,而不需要將這些微指令126儲存於設置兩者間之記憶體。在第1圖之微處理器100的實施例中,當微處理器100執行x86或是ARM機器語言程式時,微處理器100每一次執行x86或是ARM指令124時,硬體指令轉譯器104就會將x86或ARM機器語言指令124轉譯為一個或多個微指令126。不過,第8圖的實施例則是利用一微指令快取以避免微處理器100每次執行x86或ARM ISA指令124所會遭遇到之重複轉譯的問題。硬體指令轉譯器104之實施例在第2圖會有更詳細的說明。 The hardware instruction translator 104 receives the x86 and ARM ISA machine language instructions 124 as inputs, and accordingly provides one or more microinstructions 126 as output signals to implement the x86 or ARM ISA instructions 124. Execution pipeline 112 executes one or more microinstructions 126, the result of which is collectively implemented to implement x86 or ARM ISA instructions 124. That is, the collective execution of these microinstructions 126 may perform the operations specified by the x86 or ARM ISA instructions 124 in accordance with the x86 or ARM ISA instructions 124 specified at the input to produce the x86 or ARM ISA instructions 124 defined by the instructions. result. Thus, hardware instruction translator 104 translates x86 or ARM ISA instructions 124 into one or more microinstructions 126. The hardware instruction translator 104 includes a set of transistors that are configured in a predetermined manner to translate the x86 ISA and ARM ISA machine language instructions 124 into the execution microinstructions 126. The hardware instruction translator 104 also has a Boolean logic gate to generate a microinstruction 126 (such as the simple instruction translator 204 shown in FIG. 2). In one embodiment, hardware instruction translator 104 has a microcode read-only memory (e.g., element 234 of complex instruction translator 206 in FIG. 2). The hardware instruction translator 104 utilizes the microcode read-only memory and generates microinstructions according to the complex ISA instruction 124. 126, this part will be further explained in the description of Figure 2. In a preferred embodiment, the hardware instruction translator 104 does not necessarily have to translate the entire set of ISA instructions defined in the x86 user manual or the ARM user manual, as long as one of these instructions can be translated. The collection is fine. In particular, a subset of the ISA instructions 124 defined by the x86 programmer operating manual and translated by the hardware instruction translator 104 does not necessarily correspond to any existing Intel x86 ISA processor developed by the ARM user. The subset of ISA instructions 124 defined by the manual and translated by the hardware instruction translator 104 does not necessarily correspond to any of the existing ISA processors developed by ARM Ltd. Executing one or more of the implementation microinstructions 126 for implementing the x86 or ARM ISA instructions 124 may be provided by the hardware instruction translator 104 all at once to the execution pipeline 112 or sequentially. An advantage of this embodiment is that the hardware instruction translator 104 can provide the execution microinstructions 126 directly to the execution pipeline 112 without having to store the microinstructions 126 in memory between the settings. In the embodiment of the microprocessor 100 of FIG. 1, when the microprocessor 100 executes an x86 or ARM machine language program, the microprocessor 100 executes the x86 or ARM instructions 124 each time the hardware instruction translator 104 The x86 or ARM machine language instructions 124 are translated into one or more microinstructions 126. However, the embodiment of Figure 8 utilizes a microinstruction cache to avoid the problem of repeated translations encountered by the microprocessor 100 each time the x86 or ARM ISA instructions 124 are executed. An embodiment of the hardware instruction translator 104 will be described in more detail in FIG.

執行管線112執行由硬體指令轉譯器104提供之實行微指令126。基本上,執行管線112係一通用高速微指令處理器。雖然本文所描述的功能係由具有x86/ARM特定特 徵的執行管線112執行,但大多數x86/ARM特定功能其實是由此微處理器100的其他部分,如硬體指令轉譯器104,來執行。在一實施例中,執行管線112執行由硬體指令轉譯器104接收到之實行微指令126的暫存器重命名、超純量發佈、與非循序執行。執行管線112在第4圖會有更詳細的說明。 Execution pipeline 112 executes the execution microinstructions 126 provided by hardware instruction translator 104. Basically, execution pipeline 112 is a general purpose high speed microinstruction processor. Although the functions described in this article are made of x86/ARM specific Execution pipeline 112 is executed, but most x86/ARM specific functions are actually performed by other portions of microprocessor 100, such as hardware instruction translator 104. In one embodiment, execution pipeline 112 executes register renaming, super-scaling, and non-sequential execution of microinstruction 126 received by hardware instruction translator 104. Execution line 112 will be described in more detail in Figure 4.

微處理器100的微架構包含:(1)微指令集;(2)微指令集之微指令126所能取用之資源集,此資源集係x86與ARM ISA之資源的超集合(superset);以及(3)微處理器100相應於微指令126之執行所定義的微例外事件(micro-exception)集,此微例外事件集係x86 ISA與ARM ISA之例外事件的超集合。此微架構不同於x86 ISA與ARM ISA。具體來說,此微指令集在許多面向不同於x86 ISA與ARM ISA之指令集。首先,微指令集之微指令指示執行管線112執行的操作與x86 ISA與ARM ISA之指令集的指令指示微處理器執行的操作並非一對一對應。雖然其中許多操作相同,不過,仍有一些微指令集指定的操作並非x86 ISA與/或ARM ISA指令集所指定。相反地,有一些x86 ISA及/或ARM ISA指令集特定的操作並非微指令集所指定。其次,微指令集之微指令係以不同於x86 ISA與ARM ISA指令集之指令的編碼方式進行編碼。亦即,雖然有許多相同的操作(如:相加、偏移、載入、返回)在微指令集以及x86與ARM ISA指令集中都有指定,微指令集與x86或ARM ISA指令集的二進制操作碼值對應表並沒有一對一對應。微指令集與x86或ARM ISA指令 集的二進制操作碼值對應表相同通常是巧合,其間仍不具有一對一的對應關係。第三,微指令集之微指令位元欄與x86或是ARM ISA指令集之指令位元欄也不是一對一對應。 The micro-architecture of the microprocessor 100 includes: (1) a microinstruction set; (2) a set of resources that can be accessed by the microinstruction 126 of the microinstruction set, which is a superset of the resources of the x86 and the ARM ISA. And (3) the micro-exception set defined by the microprocessor 100 corresponding to the execution of the microinstruction 126, which is a superset of the exception events of the x86 ISA and the ARM ISA. This microarchitecture is different from x86 ISA and ARM ISA. Specifically, this microinstruction set is oriented in many instruction sets that differ from x86 ISA and ARM ISA. First, the microinstructions of the microinstruction set indicate that the operations performed by the execution pipeline 112 and the instructions of the x86 ISA and ARM ISA instruction sets indicate that the operations performed by the microprocessor are not one-to-one correspondence. Although many of these operations are the same, there are still some microinstruction sets that specify operations that are not specified by the x86 ISA and/or ARM ISA instruction set. Conversely, some x86 ISA and/or ARM ISA instruction set specific operations are not specified by the microinstruction set. Second, the microinstructions of the microinstruction set are encoded in an encoding that is different from the instructions of the x86 ISA and ARM ISA instruction sets. That is, although many of the same operations (eg, add, offset, load, return) are specified in the microinstruction set and in the x86 and ARM ISA instruction sets, the microinstruction set is binary with the x86 or ARM ISA instruction set. There is no one-to-one correspondence between the opcode value correspondence tables. Microinstruction set with x86 or ARM ISA instructions It is often a coincidence that the set binary operation code value correspondence table is the same, and there is still no one-to-one correspondence between them. Third, the microinstruction bit field of the microinstruction set does not have a one-to-one correspondence with the instruction bit field of the x86 or ARM ISA instruction set.

整體而言,微處理器100可執行x86 ISA與ARM ISA機器語言程式指令。然而,執行管線112本身無法執行x86或ARM ISA機器語言指令;而是執行由x86 ISA與ARM ISA指令轉譯成之微處理器100微架構之微指令集的實行微指令126。然而,雖然此微架構與x86 ISA以及ARM ISA不同,本發明亦提出其他實施例將微指令集與其他微架構特定的資源開放給使用者。在這些實施例中,此微架構可有效地作為在x86 ISA與ARM ISA外之一個具有微處理器所能執行之機器語言程式的第三ISA。 In general, the microprocessor 100 can execute x86 ISA and ARM ISA machine language program instructions. However, the execution pipeline 112 itself is not capable of executing x86 or ARM ISA machine language instructions; rather, the execution microinstructions 126 of the microinstruction set of the microprocessor 100 microarchitecture translated by the x86 ISA and ARM ISA instructions are executed. However, although this micro-architecture is different from the x86 ISA and the ARM ISA, the present invention also proposes other embodiments to open the microinstruction set and other micro-architecture-specific resources to the user. In these embodiments, the microarchitecture can effectively function as a third ISA with a machine language program executable by the microprocessor outside of the x86 ISA and ARM ISA.

下表(表一)描述本發明微處理器100之一實施例之微指令集之微指令126的一些位元欄。 The following table (Table 1) describes some of the bit fields of the microinstructions 126 of the microinstruction set of one embodiment of the microprocessor 100 of the present invention.

下表(表二)描述本發明微處理器100之一實施例之微指令集的一些微指令。 The following table (Table 2) describes some of the microinstructions of the microinstruction set of one embodiment of the microprocessor 100 of the present invention.

微處理器100也包含一些微架構特定的資源,如微架構特定的通用暫存器、媒體暫存器與區段暫存器(如用於重命名的暫存器或由微碼所使用的暫存器)以及未見於x86或ARM ISA的控制暫存器,以及一私有隨機存取記憶體(PRAM)。此外,此微架構可產生例外事件,亦即前述之微例外事件。這些例外事件未見於x86或ARM ISA或是由它們所指定,而通常是微指令126與相關微指令126的重新執行(replay)。舉例來說,這些情形包含:載入錯過(load miss)的情況,其係執行管線112假設載入動作並於錯過時重新執行此載入微指令126;錯過轉譯後備緩衝區(TLB),在查表(page table walk)與轉譯後備緩衝區填滿後,重新執行此微指令126;浮點微指令126接收一異常運算元(denormal operand)但此運算元被評估為正常,需在執行管線112正常化此運算元後重新執行此微指令126;一載入微指令126執行後偵測到一個更早的儲存微指令126與其位址衝突(address-colliding),需要重新執行此載入微指令 126。需理解的是,本文表一所列的位元欄,表二所列的微指令,以及微架構特定的資源與微架構特定的例外事件,只是作為例示說明本發明之微架構,而非窮盡本發明之所有可能實施例。 The microprocessor 100 also contains some micro-architecture-specific resources, such as micro-architecture-specific general-purpose registers, media registers, and sector registers (such as scratchpads for renaming or used by microcode). The scratchpad) and the control scratchpad not found on x86 or ARM ISA, and a private random access memory (PRAM). In addition, this micro-architecture can generate exception events, which are the aforementioned micro-exception events. These exceptions are not seen or specified by the x86 or ARM ISA, but are typically replays of the microinstructions 126 and associated microinstructions 126. For example, these situations include: loading a load miss, which is an execution pipeline 112 assuming a load action and re-executing the load microinstruction 126 upon miss; missing the translation lookaside buffer (TLB), at After the page table walk and the translation lookaside buffer are filled, the microinstruction 126 is re-executed; the floating-point microinstruction 126 receives an abnormal operand (the denormal operand) but the operand is evaluated as normal and needs to be executed in the pipeline. After the operation unit is normalized, the micro-instruction 126 is re-executed; after the execution of the micro-instruction 126, an earlier storage micro-instruction 126 is detected and its address-colliding conflicts, and the loading micro-requirement needs to be re-executed. instruction 126. It should be understood that the bit columns listed in Table 1, the microinstructions listed in Table 2, and the micro-architecture-specific resources and micro-architecture-specific exception events are merely illustrative of the micro-architecture of the present invention, rather than exhaustive All possible embodiments of the invention.

暫存器檔案106包含微指令126所使用之硬體暫存器,以持有資源與/或目的運算元。執行管線112將其結果128寫入暫存器檔案106,並由暫存器檔案106為微指令126接收運算元。硬體暫存器係引用(instantiate)x86 ISA定義與ARM ISA定義的通用暫存器係共享暫存器檔案106中之一些暫存器。舉例來說,在一實施例中,暫存器檔案106係引用十五個32位元的暫存器,由ARM ISA暫存器R0至R14以及x86 ISA累積暫存器(EAX register)至R14D暫存器所共享。因此,若是一第一微指令126將一數值寫入ARM R2暫存器,隨後一後續的第二微指令126讀取x86累積暫存器將會接收到與第一微指令126寫入相同的數值,反之亦然。此技術特徵有利於使x86 ISA與ARM ISA之機器語言程式得以快速透過暫存器進行溝通。舉例來說,假設在ARM機器語言作業系統執行的ARM機器語言程式能使指令模式132改變為x86 ISA,並將控制權轉換至一x86機器語言程序以執行特定功能,因為x86 ISA可支援一些指令,其執行操作的速度快於ARM ISA,在這種情形下將有利於執行速度的提升。ARM程式可透過暫存器檔案106之共享暫存器提供需要的資料給x86執行程序。反之,x86執行程序可將執行結果提供至暫存器檔案106之共享暫存器內,以使ARM程式在x86執行程序回覆後 可見到此執行結果。相似地,在x86機器語言作業系統執行之x86機器語言程式可使指令模式132改變為ARM ISA並將控制權轉換至ARM機器語言程序;此x86程式可透過暫存器檔案106之共享暫存器提供所需的資料給ARM執行程序,而此ARM執行程序可透過暫存器檔案106之共享暫存器提供執行結果,以使x86程式在ARM執行程序回覆後可見到此執行結果。因為ARM R15暫存器係一獨立引用的ARM程式計數器暫存器116,因此,引用x86 R15D暫存器的第十六個32位元暫存器並不分享給ARM R15暫存器。此外,在一實施例中,x86之十六個128位元XMM0至XMM15暫存器與十六個128位元進階單指令多重數據擴展(Advanced SIMD(“Neon”))暫存器的32位元區段係分享給三十二個32位元ARM VFPV3浮點暫存器。暫存器檔案106亦引用旗標暫存器(即x86 EFLAGS暫存器與ARM條件旗標暫存器),以及x86 ISA與ARM ISA所定義之多種控制權與狀態暫存器,這些架構控制與狀態暫存器包括x86架構之特定模型暫存器(model specific registers,MSRs)與保留給ARM架構的協同處理器(8-15)暫存器。此暫存器檔案106亦引用非架構暫存器,如用於暫存器重命名或是由微碼234所使用的非架構通用暫存器,以及非架構x86特定模型暫存器與實作定義的或是由製造商指定之ARM協同處理器暫存器。暫存器檔案106在第5圖會有更進一步的說明。 The scratchpad file 106 contains hardware registers used by the microinstructions 126 to hold resources and/or destination operands. Execution pipeline 112 writes its result 128 to scratchpad file 106 and receives the operand by micro-instruction 126 from scratchpad file 106. The hardware scratchpad is an instantiated x86 ISA definition shared with the ARM ISA shared scratchpad family of some of the scratchpad files 106. For example, in one embodiment, the scratchpad file 106 references fifteen 32-bit scratchpads, from the ARM ISA scratchpad R0 to R14 and the x86 ISA estenator (EAX register) to R14D. Shared by the scratchpad. Therefore, if a first microinstruction 126 writes a value to the ARM R2 register, then a subsequent second microinstruction 126 reads the x86 accumulator to receive the same write as the first microinstruction 126. Value and vice versa. This technical feature facilitates the rapid communication of x86 ISA and ARM ISA machine language programs through the scratchpad. For example, assume that the ARM machine language program executed in the ARM machine language operating system can change the command mode 132 to x86 ISA and convert control to an x86 machine language program to perform specific functions because the x86 ISA can support some instructions. It performs operations faster than the ARM ISA, which in this case will facilitate the speed of execution. The ARM program can provide the required information to the x86 executive through the shared register of the scratchpad file 106. Conversely, the x86 executive can provide execution results to the shared scratchpad of the scratchpad file 106 for the ARM program to respond to the x86 executable. This execution result can be seen. Similarly, the x86 machine language program executed by the x86 machine language operating system can change the command mode 132 to the ARM ISA and transfer control to the ARM machine language program; the x86 program can be shared through the scratchpad file 106. The required data is provided to the ARM executive program, and the ARM executable program can provide execution results through the shared scratchpad of the scratchpad file 106, so that the x86 program can see the execution result after the ARM executable program replies. Because the ARM R15 scratchpad is an independently referenced ARM program counter register 116, the sixteenth 32-bit scratchpad that references the x86 R15D register is not shared with the ARM R15 scratchpad. In addition, in one embodiment, sixteen 128-bit XMM0 to XMM15 registers of x86 and sixteen 128-bit advanced single instruction multiple data extensions (Advanced SIMD ("Neon")) register 32 The bit segment is shared with thirty-two 32-bit ARM VFPV3 floating-point registers. The scratchpad file 106 also references the flag register (ie, the x86 EFLAGS register and the ARM condition flag register), and the various control and status registers defined by the x86 ISA and ARM ISA. The state register includes a model specific registers (MSRs) of the x86 architecture and a coprocessor (8-15) register reserved for the ARM architecture. The scratchpad file 106 also references non-architected scratchpads, such as non-architected general-purpose registers for register renaming or used by microcode 234, and non-architected x86-specific model registers and implementation definitions. Or an ARM coprocessor register specified by the manufacturer. The scratchpad file 106 will be further described in Figure 5.

記憶體子系統108包含一由快取記憶體構成的快取記憶體階層架構(在一實施例中包含第1層(level-1)指令快取 102、第1層(level-1)資料快取與第2層混合快取)。此記憶體子系統108包含多種記憶體請求佇列,如載入、儲存、填入、窺探、合併寫入歸併緩衝區。記憶體子系統亦包含一記憶體管理單元(MMU)。記憶體管理單元具有轉譯後備緩衝區(TLBs),尤以獨立的指令與資料轉譯後備緩衝區為佳。記憶體子系統還包含一查表引擎(table walk engine)以獲得虛擬與實體位址間之轉譯,來回應轉譯後備緩衝區的錯失。雖然在第1圖中指令快取102與記憶體子系統108係顯示為各自獨立,不過,在邏輯上,指令快取102亦是記憶體子系統108的一部分。記憶體子系統108係設定使x86與ARM機器語言程式分享一共同的記憶空間,以使x86與ARM機器語言程式容易透過記憶體互相溝通。 The memory subsystem 108 includes a cache memory hierarchy of cache memory (in one embodiment, a level-1 instruction cache is included). 102, the first level (level-1) data cache and the second layer hybrid cache). The memory subsystem 108 includes a plurality of memory request queues, such as load, store, fill, snoop, and merge write merge buffers. The memory subsystem also includes a memory management unit (MMU). The memory management unit has translation look-aside buffers (TLBs), especially independent instruction and data translation back buffers. The memory subsystem also includes a table walk engine to obtain translations between virtual and physical addresses in response to missed translation buffer buffers. Although instruction cache 102 and memory subsystem 108 are shown as separate in FIG. 1, logically, instruction cache 102 is also part of memory subsystem 108. The memory subsystem 108 is configured to share a common memory space between the x86 and the ARM machine language program so that the x86 and ARM machine language programs can easily communicate with each other through the memory.

記憶體子系統108得知指令模式132與環境模式136,使其能夠在適當ISA內容中執行多種操作。舉例來說,記憶體子系統108依據指令模式指標132指示為x86或ARM ISA,來執行特定記憶體存取違規的檢驗(例如過限檢驗(limit violation check))。在另一實施例中,回應環境模式指標136的改變,記憶體子系統108會更新(flush)轉譯後備緩衝區;不過在指令模式指標132改變時,記憶體子系統108並不相應地更新轉譯後備緩衝區,以在前述指令模式指標132與環境模式指標136分指x86與ARM之第三與第四模式中提供較佳的效能。在另一實施例中,回應一轉譯後備緩衝區錯失(TKB miss),查表引擎依據環境模式指標136指示為x86或ARM ISA,從而決定利用x86分頁表或ARM分頁表執行一分頁查表動作以取出轉 譯後備緩衝區。在另一實施例中,若是環境狀態指標136指示為x86 ISA,記憶體次系統108檢查會影響快取策略之x86 ISA控制暫存器(如CR0 CD與NW位元)的架構狀態;若是環境模式指標136指示為ARM ISA,則檢查相關之ARM ISA控制暫存器(如SCTLR I與C位元)的架構模式。在另一實施例中,若是狀態指標136指示為x86 ISA,記憶體子系統108檢查會影響記憶體管理之x86 ISA控制暫存器(如CR0 PG位元)的架構狀態;若是環境模式指標136指示為ARM ISA,則檢查相關之ARM ISA控制暫存器(如SCTLR M位元)的架構模式。在另一實施例中,若是狀態指標136指示為x86 ISA,記憶體次系統108檢查會影響對準檢測之x86 ISA控制暫存器(如CR0 AM位元)的架構狀態,若是環境模式指標136指示為ARM ISA,則檢查相關之ARM ISA控制暫存器(如SCTLR A位元)的架構模式。在另一實施例中,若是狀態指標136指示為x86 ISA,記憶體子系統108(以及用於特權指令之硬體指令轉譯器104)檢查當前所指定特權級(CPL)之x86 ISA控制暫存器的架構狀態;若是環境模式指標136指示為ARM ISA,則檢查指示使用者或特權模式之相關ARM ISA控制暫存器的架構模式。不過,在一實施例中,x86 ISA與ARM ISA係分享微處理器100中具有相似功能之控制位元組/暫存器,微處理器100並不對各個指令集架構引用獨立的控制位元組/暫存器。 The memory subsystem 108 learns the instruction mode 132 and the environment mode 136 to enable it to perform various operations in the appropriate ISA content. For example, memory subsystem 108, in accordance with instruction mode indicator 132, indicates x86 or ARM ISA to perform a check for a particular memory access violation (eg, a limit violation check). In another embodiment, in response to a change in the environmental mode indicator 136, the memory subsystem 108 will flush the translation lookaside buffer; however, when the command mode indicator 132 changes, the memory subsystem 108 does not update the translation accordingly. The backup buffer provides better performance in the third and fourth modes of x86 and ARM in the aforementioned command mode indicator 132 and environmental mode indicator 136. In another embodiment, in response to a translation lookaside buffer miss (TKB miss), the lookup engine indicates x86 or ARM ISA according to the environment mode indicator 136, thereby determining to perform a page lookup operation using the x86 page table or the ARM page table. Take out Translation of the backup buffer. In another embodiment, if the environmental status indicator 136 indicates an x86 ISA, the memory subsystem 108 checks the architectural state of the x86 ISA control registers (eg, CR0 CD and NW bits) that affect the cache policy; Mode indicator 136, indicated as ARM ISA, checks the architectural mode of the associated ARM ISA control register (such as SCTLR I and C bits). In another embodiment, if the status indicator 136 indicates an x86 ISA, the memory subsystem 108 checks the architectural state of the x86 ISA control register (eg, CR0 PG bit) that affects memory management; if the environmental mode indicator 136 Indicated as ARM ISA, check the architectural mode of the associated ARM ISA control register (such as SCTLR M bits). In another embodiment, if the status indicator 136 indicates an x86 ISA, the memory subsystem 108 checks the architectural state of the x86 ISA control register (eg, CR0 AM bit) that would affect alignment detection, if the environmental mode indicator 136 Indicated as ARM ISA, check the architectural mode of the associated ARM ISA control register (such as SCTLR A bit). In another embodiment, if the status indicator 136 indicates an x86 ISA, the memory subsystem 108 (and the hardware instruction translator 104 for privileged instructions) checks the x86 ISA control staging of the currently assigned privilege level (CPL). The architectural state of the device; if the environmental mode indicator 136 indicates an ARM ISA, then the architectural mode of the associated ARM ISA control register indicating the user or privileged mode is checked. However, in one embodiment, the x86 ISA and the ARM ISA share control bits/scratches having similar functions in the microprocessor 100, and the microprocessor 100 does not reference independent control bytes for each instruction set architecture. / scratchpad.

雖然組態暫存器122與暫存器檔案106在圖示中是各自獨立,不過組態暫存器122可被理解為暫存器檔案106 的一部分。組態暫存器122具有一全域組態暫存器,用以控制微處理器100在x86 ISA與ARM ISA各種不同面向的操作,例如使多種特徵生效或失效的功能。全域組態暫存器可使微處理器100執行ARM ISA機器語言程式之能力失效,即讓微處理器100成為一個僅能執行x86指令的微處理器100,並可使其他相關且專屬於ARM的能力(如啟動x86(launch-x86)與重置至x86(reset-to-x86)的指令124與本文所稱之實作定義(implementation-defined)協同處理器暫存器)失效。全域組態暫存器亦可使微處理器100執行x86 ISA機器語言程式的能力失效,亦即讓微處理器100成為一個僅能執行ARM指令的微處理器100,並可使其他相關的能力(如啟動ARM與重置至ARM的指令124與本文所稱之新的非架構特定模型暫存器)失效。在一實施例中,微處理器100在製造時具有預設的組態設定,如微碼234中之硬式編碼值,此微碼234在啟動時係利用此硬式編碼值來設定微處理器100的組態,例如寫入編碼暫存器122。不過,部分編碼暫存器122係以硬體而非以微碼234進行設定。此外,微處理器100具有多個熔絲,可由微碼234進行讀取。這些熔絲可被熔斷以修改預設組態值。在一實施例中,微碼234讀取熔絲值,對預設值與熔絲值執行一互斥或操作,並將操作結果寫入組態暫存器122。此外,對於熔絲值修改的效果可利用一微碼234修補而回復。在微處理器100能夠執行x86與ARM程式的情況下,全域組態暫存器可用於確認微處理器100(或如第7圖所示處理器之一多核心部分之一特定核心100)在重置或如 第6A圖及第6B圖所示在回應x86形式之INIT指令時,會以x86微處理器的形態還是以ARM微處理器的形態進行開機。全域組態暫存器並具有一些位元提供起始預設值給特定的架構控制暫存器,如ARM ISA SCTLT與CPACR暫存器。第7圖所示之多核心的實施例中僅具有一個全域組態暫存器,即使各核心的組態可分別設定,如在指令模式指標132與環境模式指標136都設定為x86或ARM時,選擇以x86核心或是ARM核心開機。此外,啟動ARM指令126與啟動x86指令126可用以在x86與ARM指令模式132間動態切換。在一實施例中,全域組態暫存器可透過一x86 RDMSR指令對一新的非架構特定模型暫存器進行讀取,並且其中部分的控制位元可透過x86 WRMSR指令對前揭新的非架構特定模型暫存器之寫入來進行寫入操作。全域組態暫存器還可透過ARM MCR/MCRR指令對一對應至前揭新的非架構特定模型暫存器之ARM協同處理器暫存器進行讀取,而其中部分的控制位元可透過ARM MRC/MRRC指令對應至此新的非架構特定模型暫存器的ARM協同處理器暫存器之寫入來進行寫入操作。 Although the configuration register 122 and the register file 106 are separate in the illustration, the configuration register 122 can be understood as a register file 106. a part of. The configuration register 122 has a global configuration register for controlling various operations of the microprocessor 100 in the x86 ISA and ARM ISA, such as functions that invalidate or disable various features. The global configuration register can disable the ability of the microprocessor 100 to execute the ARM ISA machine language program, that is, the microprocessor 100 becomes a microprocessor 100 capable of executing only x86 instructions, and can make other related and exclusive ARM The capabilities (such as booting x86 (launch-x86) and resetting to x86 (reset-to-x86) instructions 124 and the implementation-defined coprocessor register) are invalid. The global configuration register can also disable the ability of the microprocessor 100 to execute the x86 ISA machine language program, that is, to make the microprocessor 100 a microprocessor 100 capable of executing only ARM instructions, and to enable other related capabilities. (such as the start of ARM and reset to ARM instructions 124 and the new non-architectural specific model register referred to herein) are invalid. In one embodiment, the microprocessor 100 has a predetermined configuration setting at the time of manufacture, such as a hard coded value in the microcode 234. The microcode 234 uses the hard coded value to set the microprocessor 100 at startup. The configuration is written, for example, to the code register 122. However, the partial code register 122 is set in hardware rather than in microcode 234. Additionally, the microprocessor 100 has a plurality of fuses that can be read by the microcode 234. These fuses can be blown to modify the preset configuration values. In one embodiment, the microcode 234 reads the fuse value, performs a mutual exclusion or operation on the preset value and the fuse value, and writes the result of the operation to the configuration register 122. In addition, the effect of the fuse value modification can be recovered with a microcode 234 patch. In the case where the microprocessor 100 is capable of executing x86 and ARM programs, the global configuration register can be used to confirm that the microprocessor 100 (or a particular core 100 of one of the multicore portions of the processor shown in FIG. 7) is Reset or as 6A and 6B show that in response to the x86 form of the INIT instruction, it will boot in the form of an x86 microprocessor or an ARM microprocessor. The global configuration register has some bits to provide the initial preset values to specific architecture control registers, such as the ARM ISA SCTLT and CPACR registers. The multi-core embodiment shown in FIG. 7 has only one global configuration register, even if the configuration of each core can be set separately, such as when the command mode indicator 132 and the environmental mode indicator 136 are both set to x86 or ARM. Choose to boot from x86 core or ARM core. In addition, the enable ARM instruction 126 and the start x86 instruction 126 can be used to dynamically switch between the x86 and ARM instruction modes 132. In one embodiment, the global configuration register can read a new non-architectural specific model register through an x86 RDMSR instruction, and some of the control bits can be uncovered by the x86 WRMSR instruction. A write to a non-architectural-specific model register for a write operation. The global configuration register can also be read by an ARM MCR/MCRR instruction to an ARM coprocessor register that corresponds to the previously unreleased non-architecture specific model register, and some of the control bits are transparent. The ARM MRC/MRRC instruction corresponds to the write to the ARM coprocessor register of this new non-architectural specific model register for write operations.

組態暫存器122並包含多種不同的控制暫存器從不同面向控制微處理器100的操作。這些非x86(non-x86)/ARM的控制暫存器包括本文所稱之全域控制暫存器、非指令集架構控制暫存器、非x86/ARM控制暫存器、通用控制暫存器、以及其他類似的暫存器。在一實施例中,這些控制暫存器可利用x86 RDMSR/WRMSR指令至非架構特定模型暫存器(MSRS)進行存取、以及利用ARM MCR/MRC(或 MCRR/MRRC)指令至新實作定義之協同處理器暫存器進行存取。舉例來說,微處理器100包含非專屬於x86/ARM之控制暫存器,以確認微型(fine-grained)快取控制,此微型快取控制係小於x86 ISA與ARM ISA控制暫存器所能提供者。 The register 122 is configured and includes a plurality of different control registers for controlling the operation of the microprocessor 100 from different sides. These non-x86 (non-x86)/ARM control registers include the global control register, non-instruction set architecture control register, non-x86/ARM control register, general control register, And other similar scratchpads. In one embodiment, these control registers can utilize x86 RDMSR/WRMSR instructions to access non-architected specific model registers (MSRS) and utilize ARM MCR/MRC (or The MCRR/MRRC) instruction is accessed by the coprocessor register defined by the new implementation. For example, the microprocessor 100 includes a control register that is not dedicated to x86/ARM to confirm fine-grained cache control. This micro-cache control system is smaller than the x86 ISA and ARM ISA control register. Can provide.

在一實施例中,微處理器100提供ARM ISA機器語言程式透過實作定義ARM ISA協同處理器暫存器存取x86 ISA特定模型暫存器,這些實作定義ARM ISA協同處理器暫存器係直接對應於相對應的x86特定模型暫存器。此特定模型暫存器的位址係指定於ARM ISA R1暫存器。此資料係由MRC/MRRC/MCR/MCRR指令所指定之ARM ISA暫存器讀出或寫入。在一實施例中,特定模型暫存器之一子集合係以密碼保護,亦即指令在嘗試存取特定模型暫存器時必須使用密碼。在此實施例中,密碼係指定於ARM R7:R6暫存器。若是此存取動作導致x86通用保護錯誤,微處理器100隨即產生一ARM ISA未定義指令中止模式(UND)例外事件。在一實施例中,ARM協同處理器4(位址為:0,7,15,0)係存取相對應的x86特定模型暫存器。 In one embodiment, the microprocessor 100 provides an ARM ISA machine language program to define an ARM ISA co-processor register to access an x86 ISA-specific model register by implementing the ARM ISA co-processor register. It corresponds directly to the corresponding x86 specific model register. The address of this particular model register is specified in the ARM ISA R1 scratchpad. This data is read or written by the ARM ISA register specified by the MRC/MRRC/MCR/MCRR instructions. In one embodiment, a subset of a particular model register is password protected, i.e., the instruction must use a password when attempting to access a particular model register. In this embodiment, the cipher is assigned to the ARM R7:R6 register. If this access action results in an x86 general protection fault, the microprocessor 100 then generates an ARM ISA undefined instruction abort mode (UND) exception event. In one embodiment, the ARM coprocessor 4 (address: 0, 7, 15, 0) accesses the corresponding x86 specific model register.

微處理器100並包含一個耦接至執行管線112之中斷控制器(未圖示)。在一實施例中,此中斷控制器係一x86型式之先進可程式化中斷控制器(APIC)。中斷控制器係將x86 ISA中斷事件對應至ARM ISA中斷事件。在一實施例中,x86 INTR對應至ARM IRQ中斷事件;x86 NMI係對應至ARM IRQ中斷事件;x86 INIT在微處理器100啟動時引發起動重置循序過程(INIT-reset sequence),無論那一 個指令集架構(x86或ARM)原本是由硬體重置啟動的;x86 SMI對應至ARM FIQ中斷事件;以及x86 STPCLK、A20、Thermal、PREQ、與Rebranch則不對應至ARM中斷事件。ARM機器語言能透過新的實作定義之ARM協同處理器暫存器存取先進可程式化中斷控制器之功能。在一實施例中,APIC暫存器位址係指定於ARM R0暫存器,此APIC暫存器的位址與x86的位址相同。在一實施例中,ARM協同處理器6係通常用於作業系統通常需執行之特權模式功能(privileged mode functions)。此ARM協同處理器6的位址為:0,7,nn,0;其中nn為15時可存取先進可程式化中斷控制器;nn係12-14以存取匯流排介面單元,藉以在處理器匯流排上執行8位元、16位元與32位元輸入/輸出循環。微處理器100並包含一匯流排介面單元(未圖示),此匯流排介面單元耦接至記憶體子系統108與執行管線112,作為微處理器100與處理器匯流排之介面。在一實施例中,處理器匯流排符合一個Intel Pentium微處理器家族之微處理器匯流排的規格。ARM機器語言程式可夠透過新的實作定義之ARM協同處理器暫存器存取匯流排介面單元之功能以在處理器匯流排上產生輸入/輸出循環,即由輸入輸出匯流排傳送至輸入輸出空間之一特定位址,藉以與系統晶片組溝通。舉例來說,ARM機器語言程式可產生一SMI認可之特定循環或是關於C狀態轉換之輸入輸出循環。在一實施例中,輸入輸出位址係指定於ARM R0暫存器。在一實施例中,微處理器100具有電力管理能力,如習知的P-state與C-state管理。ARM機器語言程式 可透過新的實作定義ARM協同處理器暫存器執行電力管理。在一實施例中,微處理器100包含一加密單元(未圖示),此加密單元係位於執行管線112內。在一實施例中,此加密單元實質上類似於具有Padlock安全科技功能之VIA微處理器的加密單元。ARM機器語言程式能透過新的實作定義的ARM協同處理器暫存器取得加密單元的功能,如加密指令。在一實施例中,ARM協同處理器5係用於通常由使用者模式應用程式執行之使用者模式功能,例如那些使用加密單元之技術特徵所產生的功能。 Microprocessor 100 also includes an interrupt controller (not shown) coupled to execution pipeline 112. In one embodiment, the interrupt controller is an x86 type of Advanced Programmable Interrupt Controller (APIC). The interrupt controller maps the x86 ISA interrupt event to the ARM ISA interrupt event. In one embodiment, x86 INTR corresponds to an ARM IRQ interrupt event; x86 NMI corresponds to an ARM IRQ interrupt event; x86 INIT triggers an INIT-reset sequence when microprocessor 100 starts, regardless of which The instruction set architecture (x86 or ARM) was originally initiated by a hardware reset; the x86 SMI corresponds to the ARM FIQ interrupt event; and the x86 STPCLK, A20, Thermal, PREQ, and Rebranch do not correspond to ARM interrupt events. The ARM machine language accesses the advanced programmable interrupt controller through the new implementation-defined ARM coprocessor register. In one embodiment, the APIC register address is specified in the ARM R0 register, and the address of the APIC register is the same as the address of the x86. In one embodiment, the ARM coprocessor 6 is typically used for privileged mode functions that are typically performed by the operating system. The address of the ARM coprocessor 6 is: 0, 7, nn, 0; wherein nn is 15 to access the advanced programmable interrupt controller; nn is 12-14 to access the bus interface unit, thereby The 8-bit, 16-bit, and 32-bit input/output loops are executed on the processor bus. The microprocessor 100 also includes a bus interface unit (not shown) coupled to the memory subsystem 108 and the execution pipeline 112 as an interface between the microprocessor 100 and the processor bus. In one embodiment, the processor bus is compliant with the specifications of a microprocessor bus of the Intel Pentium microprocessor family. The ARM machine language program can access the function of the bus interface unit through the new implementation-defined ARM coprocessor register to generate an input/output loop on the processor bus, that is, from the input/output bus to the input. One of the output spaces is a specific address to communicate with the system chipset. For example, an ARM machine language program can generate a specific cycle of SMI approval or an input/output loop for C state transitions. In one embodiment, the input and output address locations are assigned to the ARM R0 register. In one embodiment, the microprocessor 100 has power management capabilities, such as the well-known P-state and C-state management. ARM machine language program Power management can be performed through a new implementation of the ARM coprocessor register. In one embodiment, microprocessor 100 includes an encryption unit (not shown) that is located within execution pipeline 112. In one embodiment, the encryption unit is substantially similar to the encryption unit of the VIA microprocessor with Padlock security technology functionality. The ARM machine language program can obtain the functionality of an encryption unit, such as an encrypted instruction, through a new implementation-defined ARM coprocessor register. In one embodiment, the ARM coprocessor 5 is used for user mode functions typically performed by user mode applications, such as those produced using the technical features of the cryptographic unit.

在微處理器100執行x86 ISA與ARM ISA機器語言程式時,每一次微處理器100執行x86或是ARM ISA指令124,硬體指令轉譯器104就會執行硬體轉譯。反之,採用軟體轉譯之系統則能在多個事件中重複使用同一個轉譯,而非對之前已轉譯過的機器語言指令重複轉譯,因而有助於改善效能。此外,第8圖之實施例使用微指令快取以避免微處理器每一次執行x86或ARM ISA指令124時可能發生之重複轉譯動作。本發明之前述各個實施例所描述的方式係配合不同之程式特徵及其執行環境,因此確實有助於改善效能。 When the microprocessor 100 executes the x86 ISA and ARM ISA machine language programs, each time the microprocessor 100 executes the x86 or ARM ISA instructions 124, the hardware instruction translator 104 performs a hardware translation. Conversely, a software-translated system can reuse the same translation across multiple events instead of repeatedly translating previously translated machine language instructions, thus helping to improve performance. In addition, the embodiment of Figure 8 uses microinstruction cache to avoid repeated translations that may occur each time the microprocessor executes the x86 or ARM ISA instructions 124. The manners described in the various embodiments of the present invention are in accordance with different program features and their execution environments, and thus indeed contribute to improved performance.

分支預測器114存取之前執行過的x86與ARM分支指令的歷史資料。分支預測器114依據之前的快取歷史資料,來分析由指令快取102所取得快取線是否存在x86與ARM分支指令以及其目標位址。在一實施例中,快取歷史資料包含分支指令124的記憶體位址、分支目標位址、一個方向指標、分支指令的種類、分支指令在快取線的起始 位元組、以及一個顯示是否橫跨多個快取線的指標。在一實施例中,如2011年4月7日提出之美國第61/473,067號臨時申請案“APPARATUS AND METHOD FOR USING BRANCH PREDICTION TO EFFICIENTLY EXECUTE CONDITIONAL NON-BRANCH INSTRUCTIONS”,其提供改善分支預測器114之效能以使其能預測ARM ISA條件非分支指令方向的方法。在一實施例中,硬體指令轉譯器104並包含一靜態分支預測器,可依據執行碼、條件碼之類型、向後(backward)或向前(forward)等等資料,預測x86與ARM分支指令之方向與分支目標位址。 The branch predictor 114 accesses the history data of the x86 and ARM branch instructions that were previously executed. The branch predictor 114 analyzes whether the cache line obtained by the instruction cache 102 has x86 and ARM branch instructions and its target address based on the previous cache history data. In an embodiment, the cache history data includes a memory address of the branch instruction 124, a branch target address, a direction indicator, a type of branch instruction, and a branch instruction at the start of the cache line. A byte, and an indicator that shows whether it spans multiple cache lines. In an embodiment, the provisional application No. 61/473,067, "APPARATUS AND METHOD FOR USING BRANCH PREDICTION TO EFFICIENTLY EXECUTE CONDITIONAL NON-BRANCH INSTRUCTIONS", which is proposed on April 7, 2011, provides an improved branch predictor 114. The ability to make it possible to predict the direction of the ARM ISA conditional non-branch instruction. In one embodiment, the hardware instruction translator 104 includes a static branch predictor that predicts x86 and ARM branch instructions based on the execution code, the type of condition code, the backward or forward, and the like. The direction and branch target address.

本發明亦思量多種不同的實施例以實現x86 ISA與ARM ISA定義之不同特徵的組合。舉例來說,在一實施例中,微處理器100實現ARM、Thumb、ThumbEE與Jazelle指令集狀態,但對Jazelle擴充指令集則是提供無意義的實現(trivial implementation);微處理器100並實現下述擴充指令集,包含:Thumb-2、VFPv3-D32、進階單指令多重數據(Advanced SIMD(Neon))、多重處理、與VMSA;但不實現下述擴充指令集,包含:安全性擴充、快速內容切換擴充、ARM除錯(ARM程式可透過ARM MCR/MRC指令至新的實作定義協同處理器暫存器取得x86除錯功能)、效能偵測計數器(ARM程式可透過新的實作定義協同處理器暫存器取得x86效能計數器)。舉例來說,在一實施例中,微處理器100將ARM SETEND指令視為一無操作指令(NOP)並且只支援Little-endian資料格式。在另一實施例中,微處理器100並不實現x86 SSE 4.2的功能。 The present invention also contemplates a variety of different embodiments to achieve a combination of different features of the x86 ISA and ARM ISA definitions. For example, in one embodiment, the microprocessor 100 implements the ARM, Thumb, ThumbEE, and Jazelle instruction set states, but provides a trivial implementation for the Jazelle extended instruction set; the microprocessor 100 implements The following extended instruction set includes: Thumb-2, VFPv3-D32, Advanced SIMD (Neon), multiple processing, and VMSA; but does not implement the following extended instruction set, including: security extension Fast content switching expansion, ARM debugging (ARM program can achieve x86 debugging function through ARM MCR/MRC instruction to new implementation definition coprocessor register), performance detection counter (ARM program can pass new real Define the coprocessor register to get the x86 performance counter). For example, in one embodiment, the microprocessor 100 treats the ARM SETEND instruction as a no-op (NOP) and only supports the Little-endian data format. In another embodiment, the microprocessor 100 does not implement the functionality of x86 SSE 4.2.

本發明考量多個實施例之微處理器100之改良,例如對台灣台北的威盛電子股份有限公司所生產之商用微處理器VIA NanoTM進行改良。此Nano微處理器能夠執行x86 ISA機器語言程式,但無法執行ARM ISA機器語言程式。Nano微處理器包含高效能暫存器重命名(、超純量指令技術、非循序執行管線與一硬體轉譯器以將x86 ISA指令轉譯為微指令供執行管線執行。本發明對於Nano硬體指令轉譯器之改良,使其除了可轉譯x86機器語言指令外,還可將ARM ISA機器語言指令轉譯為微指令供執行管線執行。硬體指令轉譯器的改良包含簡單指令轉譯器的改良與複雜指令轉譯器的改良,亦包含微碼在內。此外,微指令集可加入新的微指令以支援ARM ISA機器語言指令與微指令間的轉譯,並可改善執行管線使能執行新的微指令。此外,Nano暫存器檔案與記憶體子系統亦可經改善使其能支援ARM ISA,亦包含特定暫存器之共享。分支預測單元可透過改善使其在x86分支預測外,亦能適用於ARM分支指令預測。此實施例的優點在於,因為在很大的程度上與ISA無關(largely ISA-agnostic)的限制,因而只需對於Nano微處理器的執行管線進行輕微的修改,即可適用於ARM ISA指令。對於執行管線的改良包含條件碼旗標之產生與使用方式、用以更新與回報指令指標暫存器的語意、存取特權保護方法、以及多種記憶體管理相關的功能,如存取違規檢測、分頁與轉譯後備緩衝區(TLB)的使用、與快取策略等。前述內容僅為例示,而非限定本案發明,其中部分特徵在後續內容會有進一步的說明。最後,如前述, x86 ISA與ARM ISA定義之部分特徵可能無法為前揭對Nano微處理器進行改良的實施例所支援,這些特徵如x86 SSE 4.2與ARM安全性擴充、快速內容切換擴充、除錯與效能計數器,其中部分特徵在後續內容會有更進一步的說明。此外,前揭透過對於Nano處理器的改良以支援ARM ISA機器語言程式,係為一整合使用設計、測試與製造資源以完成能夠執行x86與ARM機器語言程式之單積體電路產品的實施例,此單積體電路產品係涵蓋市場絕大多數既存的機器語言程式,而符合現今市場潮流。本文所述之微處理器100的實施例實質上可被配置為x86微處理器、ARM微處理器、或是可同時執行x86 ISA與ARM ISA機器語言程式微處理器。此微處理器可透過在單一微處理器100(或是第7圖之核心100)上之x86與ARM指令模式132間的動態切換以取得同時執行x86 ISA與ARM ISA機器語言程式的能力,亦可透過將多核心微處理100(對應於第7圖所示)之一個或多個核心配置為ARM核心而一或多個核心配置為x86核心,亦即透過在多核心100的每一個核心上進行x86與ARM指令間的動態切換,以取得同時執行x86 ISA與ARM ISA機器語言程式的能力。此外,傳統上,ARM ISA核心係被設計作為知識產權核心,而被各個第三者協力廠商納入其應用,如系統晶片與/或嵌入式應用。因此,ARM ISA並不具有一特定的標準處理器匯流排,作為ARM核心與系統之其他部分(如晶片組或其他周邊設備)間的介面。有利的是,Nano處理器已具有一高速x86型式處理器匯流排作為連接至記憶體與周邊設 備的介面,以及一記憶體一致性結構可協同微處理器100在x86電腦系統環境下支援ARM ISA機器語言程式之執行。 Consideration of the present invention a plurality of modified embodiments of the microprocessor 100 of the embodiment, for example, by the production of VIA Technologies, Inc., Taipei, Taiwan VIA Nano TM commercial microprocessor for improvement. This Nano microprocessor is capable of executing x86 ISA machine language programs, but cannot execute ARM ISA machine language programs. The Nano microprocessor includes high-performance register renaming (, super-scaling instruction technology, non-sequential execution pipeline and a hardware translator to translate x86 ISA instructions into microinstructions for execution pipeline execution. The present invention is for Nano hardware instructions The improved version of the translator, in addition to the translation of x86 machine language instructions, can also translate ARM ISA machine language instructions into micro-instructions for execution pipeline execution. Improvements to hardware instruction translators include improvements and complex instructions for simple instruction translators. The translator's improvements also include microcode. In addition, the microinstruction set can add new microinstructions to support translation between ARM ISA machine language instructions and microinstructions, and improve the execution pipeline to enable execution of new microinstructions. In addition, the Nano scratchpad file and memory subsystem can be improved to support the ARM ISA, including the sharing of specific scratchpads. The branch prediction unit can be improved to make it predictable on x86 branches. ARM branch instruction prediction. The advantage of this embodiment is that, because it is largely independent of ISA-agnostic restrictions, it is only necessary for Nano micro-location. The implementation pipeline of the processor can be applied to the ARM ISA instructions with minor modifications. The improvement of the execution pipeline includes the generation and use of the condition code flag, the semantics of the update and return instruction index register, and the access privileges. Protection methods, and a variety of memory management related functions, such as access violation detection, paging and translation lookaside buffer (TLB) use, and cache strategy, etc. The foregoing is merely illustrative, not limiting the invention, some of which Features will be further described in the following sections. Finally, as mentioned above, some of the features defined by x86 ISA and ARM ISA may not be supported by the previously unmodified embodiment of the Nano microprocessor, such as x86 SSE 4.2 and ARM. Security extensions, fast content switching extensions, debugging and performance counters, some of which will be further explained in the following sections. In addition, the previous release of the Nano processor is supported by the ARM ISA machine language program. Integrate design, test and manufacturing resources to complete single-integrated circuit products capable of executing x86 and ARM machine language programs For example, the single integrated circuit product product covers most of the existing machine language programs in the market, and conforms to the current market trend. The embodiment of the microprocessor 100 described herein can be substantially configured as an x86 microprocessor, ARM. A microprocessor, or both x86 ISA and ARM ISA machine language program microprocessors. This microprocessor can be used in x86 and ARM instruction modes on a single microprocessor 100 (or core 100 of Figure 7). Dynamic switching between 132 to achieve the ability to execute both x86 ISA and ARM ISA machine language programs. It is also possible to configure one or more cores of multi-core microprocessor 100 (corresponding to Figure 7) as ARM cores. Or multiple core configurations are x86 cores, that is, the ability to perform x86 ISA and ARM ISA machine language programs simultaneously by dynamically switching between x86 and ARM instructions on each core of the multi-core 100. In addition, the ARM ISA core is traditionally designed as the core of intellectual property and is being incorporated into its applications by third-party third-party vendors, such as system-on-a-chip and/or embedded applications. Therefore, the ARM ISA does not have a specific standard processor bus as the interface between the ARM core and other parts of the system, such as chipset or other peripherals. Advantageously, the Nano processor has a high speed x86 type processor bus as an interface to the memory and peripherals, and a memory coherency structure that cooperates with the microprocessor 100 to support the ARM ISA in an x86 computer system environment. Execution of machine language programs.

請參照第2圖,圖中係以方塊圖詳細顯示第1圖之硬體指令轉譯器104。此硬體指令轉譯器104包含硬體,更具體來說,就是電晶體的集合。硬體指令轉譯器104包含一指令格式化程式202,由第1圖之指令快取102接收指令模式指標132以及x86 ISA與ARM ISA指令位元組124的區塊,並輸出格式化的x86 ISA與ARM ISA指令242;一簡單指令轉譯器(SIT)204接收指令模式指標132與環境模式指標136,並輸出實行微指令244與一微碼位址252;一複雜指令轉譯器(CIT)206(亦稱為一微碼單元),接收微碼位址252與環境模式指標136,並提供實行微指令246;以及一多工器212,其一輸入端由簡單指令轉譯器204接收微指令244,另一輸入端由複雜指令轉譯器206接收微指令246,並提供實行微指令126至第1圖的執行管線112。指令格式化程式202在第3圖會有更詳細的說明。簡單指令轉譯器204包含一x86簡單指令轉譯器222與一ARM簡單指令轉譯器224。複雜指令轉譯器206包含一接收微碼位址252之微程式計數器232,一由微程式計數器232接收唯讀記憶體位址254之微碼唯讀記憶體234,一用以更新微程式計數器的微序列器236、一指令間接暫存器(instruction indirection register,IIR)235、以及一用以產生複雜指令轉譯器所輸出之實行微指令246的微轉譯器(microtranslator)237。由簡單指令轉譯器204所產生之實行 微指令244與由複雜指令轉譯器206所產生之實行微指令246都屬於微處理器100之微架構的微指令集之微指令126,並且都可直接由執行管線112執行。 Referring to FIG. 2, the hardware command translator 104 of FIG. 1 is shown in detail in a block diagram. This hardware instruction translator 104 contains hardware, and more specifically, a collection of transistors. The hardware instruction translator 104 includes an instruction formatter 202 that receives the instruction mode indicator 132 and the blocks of the x86 ISA and ARM ISA instruction bytes 124 from the instruction cache 102 of FIG. 1 and outputs the formatted x86 ISA. And a simple instruction translator (SIT) 204 receives the instruction mode indicator 132 and the environment mode indicator 136, and outputs the execution microinstruction 244 and a microcode address 252; a complex instruction translator (CIT) 206 ( Also referred to as a microcode unit, receiving microcode address 252 and environment mode indicator 136, and providing execution microinstruction 246; and a multiplexer 212 having an input received by microinstruction 244 by simple instruction translator 204, The other input receives the microinstruction 246 by the complex instruction translator 206 and provides an execution pipeline 112 that executes the microinstructions 126 through FIG. Instruction formatter 202 will be described in more detail in Figure 3. The simple instruction translator 204 includes an x86 simple instruction translator 222 and an ARM simple instruction translator 224. The complex instruction translator 206 includes a microprogram counter 232 that receives the microcode address 252, a microcode counter 232 that receives the microcode read-only memory 234 of the read-only memory address 254, and a micro-program counter that updates the micro-program counter. The sequencer 236, an instruction indirection register (IIR) 235, and a microtranslator 237 for generating the microinstruction 246 output by the complex instruction translator. Implementation by the simple instruction translator 204 The microinstructions 244 and the execution microinstructions 246 generated by the complex instruction translator 206 are all microinstructions 126 of the microinstruction set of the microarchitecture of the microprocessor 100, and are all directly executable by the execution pipeline 112.

多工器212係受到一選擇輸入248所控制。一般的時候,多工器212會選擇來自簡單指令轉譯器204之微指令;然而,當簡單指令轉譯器204遭遇一複雜x86或ARM ISA指令242而將控制權移轉、或遭遇陷阱(traps)、以轉移至複雜指令轉譯器206時,簡單指令轉譯器204控制選擇輸入248讓多工器212選擇來自複雜指令轉譯器的微指令246。當暫存器配置表(RAT)402(請參照第4圖)遭遇到一個微指令126具有一特定位元指出其為實現複雜ISA指令242序列的最後一個微指令126時,暫存器配置表402隨即控制選擇輸入248使多工器212回復至選擇來自簡單指令轉譯器204之微指令244。此外,當重排緩衝器422(請參照第4圖)準備要使微指令126引退且該指令之狀態指出需要選擇來自複雜指令器的微指令時,重排緩衝器422控制選擇輸入248使多工器212選擇來自複雜指令轉譯器206的微指令246。前揭需引退微指令126的情形如:微指令126已經導致一例外條件產生。 The multiplexer 212 is controlled by a select input 248. In general, multiplexer 212 will select microinstructions from simple instruction translator 204; however, when simple instruction translator 204 encounters a complex x86 or ARM ISA instruction 242, it transfers control or encounters traps. To transition to the complex instruction translator 206, the simple instruction translator 204 controls the selection input 248 to cause the multiplexer 212 to select the microinstructions 246 from the complex instruction translator. When the scratchpad configuration table (RAT) 402 (see FIG. 4) encounters a microinstruction 126 having a particular bit indicating that it is the last microinstruction 126 that implements the sequence of complex ISA instructions 242, the scratchpad configuration table 402 then selects control input 248 to cause multiplexer 212 to revert to selecting microinstruction 244 from simple instruction translator 204. In addition, when the rearrangement buffer 422 (see FIG. 4) is ready to cause the microinstruction 126 to retired and the state of the instruction indicates that a microinstruction from the complex instructor needs to be selected, the rearrangement buffer 422 controls the selection input 248 to The worker 212 selects the microinstructions 246 from the complex instruction translator 206. In the case where the microinstruction 126 needs to be retired, the microinstruction 126 has caused an exceptional condition to be generated.

簡單指令轉譯器204接收ISA指令242,並且在指令模式指標132指示為x86時,將這些指令視為x86 ISA指令進行解碼,而在指令模式指標132指示為ARM時,將這些指令視為ARM ISA指令進行解碼。簡單指令轉譯器204並確認此ISA指令242係為簡單或是複雜ISA指令。簡單指令轉譯器204能夠為簡單ISA指令242,輸出所有 用以實現此ISA指令242之實行微指令126;也就是說,複雜指令轉譯器206並不提供任何實行微指令126給簡單ISA指令124。反之,複雜ISA指令124要求複雜指令轉譯器206提供至少部分(若非全部)的實行微指令126。在一實施例中,對ARM與x86 ISA指令集之指令124的子集合而言,簡單指令轉譯器204輸出部分實現x86/ARM ISA指令126的微指令244,隨後將控制權轉移至複雜指令轉譯器206,由複雜指令轉譯器206接續輸出剩下的微指令246來實現x86/ARM ISA指令126。多工器212係受到控制,首先提供來自簡單指令轉譯器204之實行微指令244作為提供至執行管線112的微指令126,隨後提供來自複雜指令轉譯器206之實行微指令246作為提供至執行管線112的微指令126。簡單指令轉譯器204知道由硬體指令轉譯器104執行,以針對多個不同複雜ISA指令124產生實行微指令126之多個微碼程序中之起始微碼唯讀記憶體234的位址,並且當簡單指令轉譯器204對一複雜ISA指令242進行解碼時,簡單指令轉譯器204會提供相對應的微碼程序位址252至複雜指令轉譯器206之微程式計數器232。簡單指令轉譯器204輸出實現ARM與x86 ISA指令集中相當大比例之指令124所需的微指令244,尤其是對於需要由x86 ISA與ARM ISA機器語言程式來說係較常執行之ISA指令124,而只有相對少數的指令124需要由複雜指令轉譯器206提供實行微指令246。依據一實施例,主要由複雜指令轉譯器206實現的x86指令如RDMSR/WRMSR、CPUID、複雜運算指令(如FSQRT與 超越指令(transcendental instruction))、以及IRET指令;主要由複雜指令轉譯器206實現的ARM指令如MCR、MRC、MSR、MRS、SRS、與RFE指令。前揭列出的指令並非限定本案發明,僅例示指出本案複雜指令轉譯器206所能實現之ISA指令的種類。 The simple instruction translator 204 receives the ISA instructions 242 and treats these instructions as x86 ISA instructions for decoding when the instruction mode indicator 132 indicates x86, and treats these instructions as ARM ISA when the instruction mode indicator 132 indicates ARM. The instruction is decoded. The simple instruction translator 204 confirms that the ISA instruction 242 is a simple or complex ISA instruction. The simple instruction translator 204 can output all of the simple ISA instructions 242 The microinstruction 126 is implemented to implement the ISA instruction 242; that is, the complex instruction translator 206 does not provide any implementation microinstructions 126 to the simple ISA instruction 124. Conversely, the complex ISA instructions 124 require the complex instruction translator 206 to provide at least some, if not all, of the execution microinstructions 126. In one embodiment, for a subset of the instructions of the ARM and x86 ISA instruction sets 124, the simple instruction translator 204 outputs a portion of the microinstructions 244 that implement the x86/ARM ISA instructions 126, and then transfers control to complex instruction translations. The 206 is further processed by the complex instruction translator 206 to output the remaining microinstructions 246 to implement the x86/ARM ISA instructions 126. The multiplexer 212 is controlled to first provide the execution microinstructions 244 from the simple instruction translator 204 as microinstructions 126 provided to the execution pipeline 112, and then provide the execution microinstructions 246 from the complex instruction translator 206 as provided to the execution pipeline. 112 microinstructions 126. The simple instruction translator 204 is known to be executed by the hardware instruction translator 104 to generate an address of the starting microcode read memory 234 of the plurality of microcode programs that implement the microinstruction 126 for a plurality of different complex ISA instructions 124, And when the simple instruction translator 204 decodes a complex ISA instruction 242, the simple instruction translator 204 provides the corresponding microcode program address 252 to the microprogram counter 232 of the complex instruction translator 206. The simple instruction translator 204 outputs the microinstructions 244 required to implement a substantial proportion of the instructions 124 in the ARM and x86 ISA instruction sets, particularly for the ISA instructions 124 that are required to be executed more frequently by the x86 ISA and ARM ISA machine language programs. Only a relatively small number of instructions 124 need to be provided by the complex instruction translator 206 to implement the microinstructions 246. According to an embodiment, x86 instructions, such as RDMSR/WRMSR, CPUID, complex arithmetic instructions (such as FSQRT), are implemented primarily by complex instruction translator 206. Transcendental instructions, and IRET instructions; ARM instructions such as MCR, MRC, MSR, MRS, SRS, and RFE instructions implemented primarily by complex instruction translator 206. The above-listed instructions are not intended to limit the invention, but merely illustrate the types of ISA instructions that can be implemented by the complex instruction translator 206 of the present invention.

當指令模式指標132指示為x86,x86簡單指令轉譯器222對於x86 ISA指令242進行解碼,並且將其轉譯為實行微指令244;當指令模式指標132指示為ARM,ARM簡單指令轉譯器224對於ARM ISA指令242進行解碼,並將其轉譯為實行微指令244。在一實施例中,簡單指令轉譯器204係一可由習知合成工具合成之布林邏輯閘方塊。在一實施例中,x86簡單指令轉譯器222與ARM簡單指令轉譯器224係獨立的布林邏輯閘方塊;不過,在另一實施例中,x86簡單指令轉譯器222與ARM簡單指令轉譯器224係位於同一個布林邏輯閘方塊。在一實施例中,簡單指令轉譯器204在單一時脈週期中轉譯最多三個ISA指令242並提供最多六個實行微指令244至執行管線112。在一實施例中,簡單指令轉譯器204包含三個次轉譯器(未圖示),各個次轉譯器轉譯單一個格式化的ISA指令242,其中,第一個轉譯器能夠轉譯需要不多於三個實行微指令126之格式化ISA指令242;第二個轉譯器能夠轉譯需要不多於兩個實行微指令126之格式化ISA指令242;第三次轉譯器能後轉譯需要不多於一個實行微指令126之格式化ISA指令242。在一實施例中,簡單指令轉譯器204包含一硬體狀態機器使其能夠在多個時脈週期輸出多個微指 令244以實現一個ISA指令242。 When instruction mode indicator 132 indicates x86, x86 simple instruction translator 222 decodes x86 ISA instruction 242 and translates it into execution microinstruction 244; when instruction mode indicator 132 indicates ARM, ARM simple instruction translator 224 for ARM The ISA instruction 242 decodes and translates it into a practice microinstruction 244. In one embodiment, the simple instruction translator 204 is a Boolean logic gate block that can be synthesized by conventional synthesis tools. In one embodiment, the x86 simple instruction translator 222 and the ARM simple instruction translator 224 are separate Boolean logic gate blocks; however, in another embodiment, the x86 simple instruction translator 222 and the ARM simple instruction translator 224 The system is located in the same Boolean logic gate block. In one embodiment, the simple instruction translator 204 translates up to three ISA instructions 242 and provides up to six execution microinstructions 244 to the execution pipeline 112 in a single clock cycle. In one embodiment, the simple instruction translator 204 includes three sub-translators (not shown), each sub-translator translating a single formatted ISA instruction 242, wherein the first inter-translator can translate no more than Three formatted ISA instructions 242 that implement microinstructions 126; the second translator can translate no more than two formatted ISA instructions 242 that implement microinstructions 126; the third interpreter can require no more than one translation The formatted ISA instruction 242 of the microinstruction 126 is implemented. In one embodiment, the simple instruction translator 204 includes a hardware state machine that is capable of outputting multiple fingers over multiple clock cycles. Let 244 implement an ISA instruction 242.

在一實施例中,簡單指令轉譯器204並依據指令模式指標132與/或環境模式指標136,執行多個不同的例外事件檢測。舉例來說,若是指令模式指標132指示為x86且x86簡單指令轉譯器222對一個就x86 ISA而言是無效的ISA指令124進行解碼,簡單指令轉譯器204隨即產生一個x86無效操作碼例外事件;相似地,若是指令模式指標132指示為ARM且ARM簡單指令轉譯器224對一個就ARM ISA而言是無效的ISA指令124進行解碼,簡單指令轉譯器204隨即產生一個ARM未定義指令例外事件。在另一實施例中,若是環境模式指標136指示為x86 ISA,簡單指令轉譯器204隨即檢測是否其所遭遇之每個x86 ISA指令242需要一特別特權級(particular privilege level),若是,檢測當前特權級(CPL)是否滿足此x86 ISA指令242所需之特別特權級,並於不滿足時產生一例外事件;相似地,若是環境模式指標136指示為ARM ISA,簡單指令轉譯器204隨即檢測是否每個格式化ARM ISA指令242需要一特權模式指令,若是,檢測當前的模式是否為特權模式,並於現在模式為使用者模式時,產生一例外事件。複雜指令轉譯器206對於特定複雜ISA指令242亦執行類似的功能。 In one embodiment, the simple instruction translator 204 performs a plurality of different exception event detections in accordance with the instruction mode indicator 132 and/or the environmental mode indicator 136. For example, if the command mode indicator 132 indicates x86 and the x86 simple instruction translator 222 decodes an ISA instruction 124 that is invalid for the x86 ISA, the simple instruction translator 204 then generates an x86 invalid opcode exception event; Similarly, if the command mode indicator 132 indicates ARM and the ARM simple instruction translator 224 decodes an ISA instruction 124 that is invalid for the ARM ISA, the simple instruction translator 204 then generates an ARM undefined instruction exception event. In another embodiment, if the environmental mode indicator 136 indicates an x86 ISA, the simple instruction translator 204 then detects if each x86 ISA instruction 242 it encounters requires a particular privilege level, and if so, detects the current Whether the privilege level (CPL) satisfies the special privilege level required by this x86 ISA instruction 242 and generates an exception event when not satisfied; similarly, if the environment mode indicator 136 indicates an ARM ISA, the simple instruction translator 204 then detects if Each formatted ARM ISA instruction 242 requires a privileged mode instruction, and if so, whether the current mode is privileged mode and an exception condition is generated when the current mode is user mode. Complex instruction translator 206 also performs similar functions for specific complex ISA instructions 242.

複雜指令轉譯器206輸出一系列實行微指令246至多工器212。微碼唯讀記憶體234儲存微碼程序之唯讀記憶體指令247。微碼唯讀記憶體234輸出唯讀記憶體指令247以回應由微碼唯讀記憶體234取得之下一個唯讀記憶體指 令247的位址,並由微程式計數器232所持有。一般來說,微程式計數器232係由簡單指令轉譯器204接收其起始值252,以回應簡單指令轉譯器204對於一複雜ISA指令242的解碼動作。在其他情形,例如回應一重置或例外事件,微程式計數器232分別接收重置微碼程序位或適當之微碼例外事件處理位址。微程序器236通常依據唯讀記憶體指令247的大小,將微程式計數器232更新為微碼程序的序列以及選擇性地更新為執行管線112回應控制型微指令126(如分支指令)執行所產生的目標位址,以使指向微碼唯讀記憶體234內之非程序位址的分支生效。微碼唯讀記憶體234係製造於微處理器100之半導體晶片內。 Complex instruction translator 206 outputs a series of execution microinstructions 246 to multiplexer 212. The microcode read only memory 234 stores the read only memory command 247 of the microcode program. The microcode read-only memory 234 outputs a read-only memory command 247 in response to the next read-only memory reference obtained by the microcode-reading memory 234. The address of 247 is held by the microprogram counter 232. In general, the microprogram counter 232 receives its start value 252 by the simple instruction translator 204 in response to the decoding action of the simple instruction translator 204 for a complex ISA instruction 242. In other cases, such as responding to a reset or exception event, the microprogram counter 232 receives the reset microcode program bit or the appropriate microcode exception event processing address, respectively. Microprogrammer 236 typically updates microprogram counter 232 to a sequence of microcode programs and selectively updates to execution pipeline 112 in response to control microinstructions 126 (eg, branch instructions) in accordance with the size of read only memory instructions 247. The target address is validated for a branch that points to a non-program address within the microcode read-only memory 234. The microcode read only memory 234 is fabricated in a semiconductor wafer of the microprocessor 100.

除了用來實現簡單ISA指令124或部分複雜ISA指令124的微指令244外,簡單指令轉譯器204也產生ISA指令資訊255以寫入指令間接暫存器235。儲存於指令間接暫存器235的ISA指令資訊255包含關於被轉譯之ISA指令124的資訊,例如,確認由ISA指令所指定之來源與目的暫存器的資訊以及ISA指令124的格式,如ISA指令124係在記憶體之一運算元上或是在微處理器100之一架構暫存器106內執行。這樣可藉此使微碼程序能夠變為通用,亦即不需對於各個不同的來源與/或目的架構暫存器106使用不同的微碼程序。尤其是,簡單指令轉譯器204知道暫存器檔案106的內容,包含哪些暫存器是共享暫存器504,而能將x86 ISA與ARM ISA指令124內提供的暫存器資訊,透過ISA指令資訊255之使用,轉譯至暫存器檔案106內之適當的暫存器。ISA指令資訊255包含一移位欄、一 立即欄、一常數欄、各個來源運算元與微指令126本身的重命名資訊、用以實現ISA指令124之一系列微指令126中指示第一個與最後一個微指令126的資訊、以及儲存由硬體指令轉譯器104對ISA指令124轉譯時所蒐集到的有用資訊的其他位元。 In addition to the microinstructions 244 used to implement the simple ISA instructions 124 or portions of the complex ISA instructions 124, the simple instruction translator 204 also generates ISA instruction information 255 for writing to the instruction indirect registers 235. The ISA instruction information 255 stored in the instruction indirect register 235 contains information about the translated ISA instruction 124, for example, information identifying the source and destination registers specified by the ISA instruction, and the format of the ISA instruction 124, such as ISA. The instructions 124 are executed on one of the memory elements or in one of the architecture registers 106 of the microprocessor 100. This allows the microcode program to become versatile, i.e., does not require the use of different microcode programs for the various source and/or destination architecture registers 106. In particular, the simple instruction translator 204 knows the contents of the scratchpad file 106, including which registers are the shared registers 504, and can pass the scratchpad information provided in the x86 ISA and ARM ISA instructions 124 through the ISA instructions. The use of information 255 is translated to the appropriate register in the scratchpad file 106. ISA command information 255 contains a shift bar, a Immediate column, a constant column, renaming information of each source operand and microinstruction 126 itself, information for indicating the first and last microinstructions 126 in a series of microinstructions 126 of the ISA instruction 124, and storage by The other bits of the useful information collected by the hardware instruction translator 104 when the ISA instruction 124 was translated.

微轉譯器237係由微碼唯讀記憶體234與間接指令暫存器235的內容接收唯讀記憶體指令247,並相應地產生實行微指令246。微轉譯器237依據由間接指令暫存器235接收的資訊,如依據ISA指令124的格式以及由其所指定之來源與/或目的架構暫存器106組合,來將特定唯讀記憶體指令247轉譯為不同的微指令246系列。在一些實施例中,許多ISA指令資訊255係與唯讀記憶體指令247合併以產生實行微指令246。在一實施例中,各個唯讀記憶體指令247係大約有40位元寬,並且各個微指令246係大約有200位元寬。在一實施例中,微轉譯器237最多能夠由一個微讀記憶體指令247產生三個微指令246。微轉譯器237包含多個布林邏輯閘以產生實行微指令246。 The micro translator 237 receives the read only memory instruction 247 from the contents of the microcode read only memory 234 and the indirect instruction register 235, and generates the execution microinstruction 246 accordingly. The micro-translator 237, based on the information received by the indirect instruction register 235, such as in accordance with the format of the ISA instruction 124 and its source and/or destination architecture register 106, specifies a particular read-only memory instruction 247. Translated into different microinstructions 246 series. In some embodiments, a number of ISA instruction messages 255 are combined with read-only memory instructions 247 to generate execution micro-instructions 246. In one embodiment, each of the read only memory instructions 247 is approximately 40 bits wide, and each microinstruction 246 is approximately 200 bits wide. In one embodiment, the micro-translator 237 can generate up to three micro-instructions 246 from one micro-read memory instruction 247. Micro-translator 237 includes a plurality of Boolean logic gates to generate execution microinstructions 246.

使用微轉譯器237的優點在於,由於簡單指令轉譯器204本身就會產生ISA指令資訊255,微碼唯讀記憶體234不需要儲存間接指令暫存器235提供之ISA指令資訊255,因而可以降低減少其大小。此外,因為微碼唯讀記憶體234不需要為了各個不同的ISA指令格式、以及各個來源與/或目的架構暫存器106之組合,提供一獨立的程序,微碼唯讀記憶體234程序可包含較少的條件分支指令。舉例來說,若是複雜ISA指令124係記憶體格式,簡單指令 轉譯器204會產生微指令244的邏輯編程,包含將源運算元由記憶體載入一暫時暫存器106之微指令244,並且微轉譯器237會產生微指令246將結果由暫時暫存器106儲存至記憶體。然而,若是複雜ISA指令124係暫存器格式(register form),此邏輯編程會將源運算元由ISA指令124所特定的來源暫存器移動至暫時暫存器,並且微轉譯器237會產生微指令246用以將結果由暫時暫存器移動至由間接指令暫存器235所指定之架構目的暫存器106。在一實施例中,微轉譯器237之許多面向係類似於2010年4月23日提出之美國專利第12/766,244號申請案,在此係列為參考資料。不過,本案之微轉譯器237除了x86 ISA指令124外,亦經改良以轉譯ARM ISA指令124。 The advantage of using the micro-translator 237 is that since the simple instruction translator 204 itself generates the ISA instruction information 255, the microcode-reading memory 234 does not need to store the ISA instruction information 255 provided by the indirect instruction register 235, thereby reducing Reduce its size. In addition, because the microcode read-only memory 234 does not need to provide a separate program for each different ISA instruction format, and a combination of various source and/or destination architecture registers 106, the microcode read-only memory 234 program can Contains fewer conditional branch instructions. For example, if the complex ISA instruction 124 system memory format, simple instructions The translator 204 generates logic programming of the microinstruction 244, including the microinstruction 244 that loads the source operand from the memory into a temporary register 106, and the microtranslator 237 generates the microinstruction 246 to pass the result from the temporary register. 106 is stored to the memory. However, if the complex ISA instruction 124 is a register form, the logic programming moves the source operand from the source register specified by the ISA instruction 124 to the temporary register, and the micro translator 237 generates The microinstruction 246 is used to move the result from the temporary register to the architectural destination register 106 designated by the indirect instruction register 235. In one embodiment, the many aspects of the micro-translator 237 are similar to the application of U.S. Patent No. 12/766,244, filed on Apr. 23, 2010, which is incorporated herein by reference. However, the micro-translator 237 of this case has been modified to translate the ARM ISA instructions 124 in addition to the x86 ISA instructions 124.

值得注意的是,微程式計數器232不同於ARM程式計數器116與x86指令指標118,亦即,微程式計數器232並不持有ISA指令124的位址,微程式計數器232所持有的位址亦不落於系統記憶體位址空間內。此外,更值得注意的是,微指令246係由硬體指令轉譯器104所產生,並且直接提供給執行管線112執行,而非作為執行管線112之執行結果128。 It should be noted that the micro-program counter 232 is different from the ARM program counter 116 and the x86 command indicator 118, that is, the micro-program counter 232 does not hold the address of the ISA command 124, and the address held by the micro-program counter 232 is also Does not fall within the system memory address space. Moreover, more notably, the microinstructions 246 are generated by the hardware instruction translator 104 and are provided directly to the execution pipeline 112 for execution, rather than as an execution result 128 of the execution pipeline 112.

請參照第3圖,圖中係以方塊圖詳述第2圖之指令格式化器202。指令格式化器202由第1圖之指令快取102接收x86 ISA與ARM ISA指令位元組124區塊。憑藉x86 ISA指令長度可變之特性,x86指令124可以由指令位元組124區塊之任何位元組開始。由於x86 ISA容許首碼位元組的長度會受到當前位址長度與運算元長度預設值之影 響,因此確認快取區塊內之x86 ISA指令的長度與位置之任務會更為複雜。此外,依據當前ARM指令集狀態322與ARM ISA指令124的操作碼,ARM ISA指令的長度不是2位元組就是4位元組,因而不是2位元組對齊就是4位元組對齊。因此,指令格式化器202由指令位元組124串(stream)擷取不同的x86 ISA與ARM ISA指令,此指令位元組124串係由指令快取102接收之區塊所構成。也就是說,指令格式化器202格式化x86 ISA與ARM ISA指令位元組串,因而大幅簡化第2圖之簡單指令轉譯器對ISA指令124進行解碼與轉譯的困難任務。 Please refer to FIG. 3, which illustrates the instruction formatter 202 of FIG. 2 in a block diagram. The instruction formatter 202 receives the x86 ISA and ARM ISA instruction byte 124 blocks from the instruction cache 102 of FIG. With the variable length of the x86 ISA instructions, the x86 instructions 124 can begin with any byte of the instruction byte 128 block. Because the x86 ISA allows the length of the first code byte to be affected by the current address length and the default value of the operand length. The task of confirming the length and location of the x86 ISA instructions in the cache block is more complicated. In addition, according to the current ARM instruction set state 322 and the ARM ISA instruction 124 opcode, the length of the ARM ISA instruction is not 2 bytes or 4 bytes, and thus is not 2-bit alignment or 4-bit alignment. Thus, the instruction formatter 202 fetches different x86 ISA and ARM ISA instructions from the instruction byte 124 stream, which is formed by the block received by the instruction cache 102. That is, the instruction formatter 202 formats the x86 ISA and ARM ISA instruction byte strings, thereby greatly simplifying the difficult task of decoding and translating the ISA instructions 124 by the simple instruction translator of FIG.

指令格式化器202包含一預解碼器302,在指令模式指標132指示為x86時,預解碼器302預先將指令位元組124視為x86指令位元組進行解碼以產生預解碼資訊,在指令模式指標132指示為ARM時,預解碼器302預先將指令位元組124視為ARM指令位元組進行解碼以產生預解碼資訊。指令位元組佇列(IBQ)304接收ISA指令位元組124區塊以及由預解碼器302產生之相關預解碼資訊。 The instruction formatter 202 includes a predecoder 302 that, when the instruction mode indicator 132 indicates x86, pre-decodes the instruction byte 124 as an x86 instruction byte to generate pre-decoded information, in the instruction When mode indicator 132 is indicated as ARM, predecoder 302 pre-decodes instruction byte 124 as an ARM instruction byte to generate pre-decoded information. Instruction byte array (IBQ) 304 receives the ISA instruction byte 124 block and associated pre-decode information generated by pre-decoder 302.

一個由長度解碼器與漣波邏輯閘306構成的陣列接收指令位元組佇列304之底部項目(bottom entry)的內容,亦即ISA指令位元組124區塊與相關的預解碼資訊。此長度解碼器與漣波邏輯閘306亦接收指令模式指標132與ARM ISA指令集狀態322。在一實施例中,ARM ISA指令集狀態322包含ARM ISA CPSR暫存器之J與T位元。為了回應其輸入資訊,此長度解碼器與漣波邏輯閘306產生解碼資訊,此解碼資訊包含ISA指令位元組124區塊內之x86 與ARM指令的長度、x86首碼資訊、以及關於各個ISA指令位元組124的指標,此指標指出此位元組是否為ISA指令124之起始位元組、終止位元組、以及/或一有效位元組。一多工器佇列308接收ISA指令位元組126區塊、由預解碼器302產生之相關預解碼資訊、以及由長度解碼器與漣波邏輯閘306產生之相關解碼資訊。 An array of length decoders and chopping logic gates 306 receives the contents of the bottom entry of the instruction byte array 304, i.e., the ISA instruction byte 124 block and associated pre-decode information. The length decoder and chopping logic gate 306 also receives the command mode indicator 132 and the ARM ISA instruction set state 322. In one embodiment, the ARM ISA instruction set state 322 includes the J and T bits of the ARM ISA CPSR scratchpad. In response to its input information, the length decoder and chopping logic gate 306 generate decoding information that includes x86 within the block of the ISA instruction byte 124. With the length of the ARM instruction, the x86 first code information, and the metrics for each ISA instruction byte 124, this indicator indicates whether the byte is the starting byte, the terminating byte, and/or the ISA instruction 124. A valid byte. A multiplexer array 308 receives the ISA instruction byte 126 block, the associated pre-decode information generated by the predecoder 302, and the associated decoded information generated by the length decoder and the chop logic gate 306.

控制邏輯(未圖示)檢驗多工器佇列(MQ)308底部項目的內容,並控制多工器312擷取不同的或格式化的ISA指令與相關的預解碼與解碼資訊,所擷取的資訊提供至一格式化指令佇列(FIQ)314。格式化指令佇列314在格式化ISA指令242與提供至第2圖之簡單指令轉譯器204之相關資訊間作為緩衝。在一實施例中,多工器312在每一個時脈週期內擷取至多三個格式化ISA指令與相關的資訊。 Control logic (not shown) examines the contents of the bottom item of the multiplexer queue (MQ) 308 and controls the multiplexer 312 to retrieve different or formatted ISA commands and associated pre-decode and decode information. The information is provided to a formatted command queue (FIQ) 314. The formatter command queue 314 acts as a buffer between the formatted ISA command 242 and the associated information provided to the simple instruction translator 204 of FIG. In one embodiment, multiplexer 312 retrieves up to three formatted ISA instructions and associated information in each clock cycle.

在一實施例中,指令格式化程式202在許多方面類似於2009年10月1日提出之美國專利第12/571,997號、第12/572,002號、第12/572,045號、第12/572,024號、第12/572,052號與第12/572,058號申請案共同揭露的XIBQ、指令格式化程式、與FIQ,這些申請案在此列為參考資料。然而,前述專利申請案所揭示的XIBQ、指令格式化程式、與FIQ透過修改,使其能在格式化x86 ISA指令124外,還能格式化ARM ISA指令124。長度解碼器306被修改,使能對ARM ISA指令124進行解碼以產生長度以及起點、終點與有效性的位元組指標。尤其,若是指令模式指標132指示為ARM ISA,長度解碼器306檢測當前ARM指令集狀態322與ARM ISA指令124的操作碼,以確認ARM指 令124是一個2位元組長度或是4位元組長度的指令。在一實施例中,長度解碼器306包含多個獨立的長度解碼器分別用以產生x86 ISA指令124的長度資料以及ARM ISA指令124的長度資料,這些獨立的長度解碼器之輸出再以連線或(wire-ORed)耦接在一起,以提供輸出至漣波邏輯閘306。在一實施例中,此格式化指令佇列314包含獨立的佇列以持有格式化指令242之多個互相分離的部分。在一實施例中,指令格式化程式202在單一時脈週期內,提供簡單指令轉譯器204至多三個格式化ISA指令242。 In one embodiment, the instruction formatting program 202 is similar in many respects to U.S. Patent Nos. 12/571,997, 12/572,002, 12/572,045, 12/572,024, issued October 1, 2009. The XIBQ, the instruction formatter, and the FIQ are disclosed in the application Serial No. 12/572,052, the disclosure of which is incorporated herein by reference. However, the XIBQ, the instruction formatter, and the FIQ are modified by the aforementioned patent application to enable formatting of the ARM ISA instructions 124 in addition to formatting the x86 ISA instructions 124. Length decoder 306 is modified to enable decoding of ARM ISA instructions 124 to produce length and start, end and validity byte metrics. In particular, if the command mode indicator 132 is indicated as an ARM ISA, the length decoder 306 detects the current ARM instruction set state 322 and the ARM ISA instruction 124 opcode to confirm the ARM finger. Let 124 be a 2-bit length or a 4-byte length instruction. In one embodiment, the length decoder 306 includes a plurality of independent length decoders for generating the length data of the x86 ISA instructions 124 and the length data of the ARM ISA instructions 124. The outputs of the independent length decoders are then connected. Wire-ORed are coupled together to provide an output to chopper logic gate 306. In one embodiment, the formatted command queue 314 includes separate queues to hold a plurality of separate portions of the formatted instructions 242. In one embodiment, the instruction formatter 202 provides a simple instruction translator 204 to at most three formatted ISA instructions 242 in a single clock cycle.

請參照第4圖,圖中係以方塊圖詳細顯示第1圖之執行管線112,此執行管線112係耦接至硬體指令轉譯器104以直接接收來自第2圖之硬體指令轉譯器104的實行微指令。執行管線112包含一微指令佇列401,以接收微指令126;一暫存器配置表402,由微指令佇列401接收微指令;一指令調度器404,耦接至暫存器配置表402;多個保留站406,耦接至指令調度器404;一指令發送單元408,耦接至保留站406;一重排緩衝器422,耦接至暫存器配置表402、指令調度器404與保留站406;以及,執行單元424耦接至保留站406、指令發送單元408與重排緩衝器422。暫存器配置表402與執行單元424接收指令模式指標132。 Referring to FIG. 4, the execution pipeline 112 of FIG. 1 is shown in detail in a block diagram. The execution pipeline 112 is coupled to the hardware instruction translator 104 to directly receive the hardware instruction translator 104 from FIG. The implementation of micro-instructions. The execution pipeline 112 includes a microinstruction queue 401 for receiving the microinstruction 126; a register configuration table 402 for receiving the microinstruction by the microinstruction queue 401; an instruction scheduler 404 coupled to the register configuration table 402 A plurality of reservation stations 406 are coupled to the instruction scheduler 404; an instruction transmission unit 408 is coupled to the reservation station 406; a reorder buffer 422 is coupled to the register configuration table 402, the instruction scheduler 404, and Retention station 406; and execution unit 424 is coupled to reservation station 406, instruction transmission unit 408, and reorder buffer 422. The scratchpad configuration table 402 and the execution unit 424 receive the command mode indicator 132.

在硬體指令轉譯器104產生實行微指令126的速率不同於執行管線112執行微指令126之情況下,微指令佇列401係作為一緩衝器。在一實施例中,微指令佇列401包含一個M至N可壓縮微指令佇列。此可壓縮微指令佇列使執行管線112能夠在一給定的時脈週期內,從硬體指令轉 譯器104接收至多M個(在一實施例中,M是六)微指令126,並且隨後將接收到的微指令126儲存至寬度為N(在一實施例中,N是三)的佇列結構,以在每個時脈週期提供至多N個微指令126至暫存器配置表402,此暫存器配置表402能夠在每個時脈週期處理最多N個微指令126。微指令佇列401係可壓縮的,因它不論接收到微指令126之特定時脈週期為何,皆會依序將由硬體指令轉譯器104所傳送之微指令126時填滿佇列的空項目,因而不會在佇列項目中留下空洞。此方法的優點為能夠充分利用執行單元424(請參照第4圖),因為它可比不可壓縮寬度M或寬度M的指令佇列提供較高的指令儲存效能。具體來說,不可壓縮寬度N的佇列會需要硬體指令轉譯器104,尤其是簡單指令轉譯器204,在之後的時脈週期內會重複轉譯一個或多個已經在之前的時脈週期內已經被轉譯過的ISA指令124。會這樣做的原因是,不可壓縮寬度N的佇列無法在同一個時脈週期接收多於N個微指令126,而重複轉譯將導致電力耗損。不過,不可壓縮寬度M的佇列雖然不需要簡單指令轉譯器204重複轉譯,但卻會在佇列項目中產生空洞而導致浪費,因而需要更多列項目以及一個較大且更耗能的佇列來提供相當的緩衝能力。 In the case where the hardware instruction translator 104 generates a rate at which the microinstruction 126 is executed differently than the execution pipeline 112 executes the microinstruction 126, the microinstruction queue 401 acts as a buffer. In one embodiment, the microinstruction queue 401 includes an M to N compressible microinstruction queue. This compressible microinstruction queue enables execution pipeline 112 to be transferred from a hardware command within a given clock cycle. Translator 104 receives at most M (in one embodiment, M is six) microinstructions 126, and then stores the received microinstructions 126 to a queue of width N (in one embodiment, N is three) The structure is configured to provide up to N microinstructions 126 to the scratchpad configuration table 402 at each clock cycle, the scratchpad configuration table 402 being capable of processing up to N microinstructions 126 per clock cycle. The microinstruction queue 401 is compressible because it will sequentially fill the empty items of the queue by the microinstruction 126 transmitted by the hardware instruction translator 104 regardless of the particular clock cycle in which the microinstruction 126 is received. Therefore, it will not leave a void in the queue project. An advantage of this method is that the execution unit 424 can be fully utilized (see Figure 4) because it provides higher instruction storage performance than an instruction array of incompressible width M or width M. In particular, a queue of incompressible widths N would require a hardware instruction translator 104, particularly a simple instruction translator 204, to repeatedly translate one or more already preceding clock cycles during subsequent clock cycles. The ISA instruction 124 that has been translated. The reason for this is that the queue of incompressible width N cannot receive more than N microinstructions 126 in the same clock cycle, and repeated translations will result in power loss. However, the incompressible width M column does not require a simple instruction translator 204 to repeatedly translate, but it creates a void in the queue item and wastes, thus requiring more columns and a larger and more energy-consuming flaw. Columns provide considerable buffering power.

暫存器配置表402係由微指令佇列401接收微指令126並產生與微處理器100內進行中之微指令126的附屬資訊,暫存器配置表402並執行暫存器重命名動作增加微指令平行處理,以利於執行管線112之超純量、非循序執行能力。若是ISA指令124指示為x86,暫存器配置表402 會對應於微處理器100之x86 ISA暫存器106,產生附屬資訊且執行相對應的暫存器重命名動作;反之,若是ISA指令124指示為ARM,暫存器配置表402就會對應於微處理器100之ARM ISA暫存器106,產生附屬資訊且執行相對應的暫存器重命名動作;不過,如前述,部分暫存器106可能是由x86 ISA與ARM ISA所共享。暫存器配置表402亦在重排緩衝器422中依據程式順序配置一項目給各個微指令126,因此重排緩衝器422可使微指令126以及其相關的x86 ISA與ARM ISA指令124依據程式順序進行引退,即使微指令126的執行對應於其所欲實現之x86 ISA與ARM ISA指令124而言係以非循序的方式進行的。重排緩衝器422包含一環形佇列,此環形佇列之各個項目係用以儲存關於進行中之微指令126的資訊,此資訊除了其他事項,還包含微指令126執行狀態、一個確認微指令126係由x86或是ARM ISA指令124所轉譯的標籤、以及用以儲存微指令126之結果的儲存空間。 The register configuration table 402 receives the microinstructions 126 from the microinstruction queue 401 and generates ancillary information with the microinstructions 126 in progress in the microprocessor 100. The register configuration table 402 and the execution of the register renaming action are incremented. The instructions are processed in parallel to facilitate execution of the ultra-scaling, non-sequential execution capability of pipeline 112. If the ISA instruction 124 indicates x86, the scratchpad configuration table 402 Corresponding to the x86 ISA register 106 of the microprocessor 100, the auxiliary information is generated and the corresponding register rename operation is performed; otherwise, if the ISA command 124 is indicated as ARM, the register configuration table 402 corresponds to the micro The ARM ISA register 106 of the processor 100 generates the affiliate information and performs the corresponding scratchpad rename operation; however, as previously described, the portion of the scratchpad 106 may be shared by the x86 ISA and the ARM ISA. The scratchpad configuration table 402 also configures an entry in the reorder buffer 422 in accordance with the program order for each microinstruction 126, so the reorder buffer 422 can cause the microinstruction 126 and its associated x86 ISA and ARM ISA instructions 124 to be programmed. The retirement is performed sequentially, even though the execution of microinstruction 126 corresponds to the x86 ISA and ARM ISA instructions 124 that it is intended to implement in a non-sequential manner. The rearrangement buffer 422 includes a circular array of items for storing information about the in-progress microinstruction 126. The information includes, among other things, the microinstruction 126 execution status, a confirmation microinstruction. 126 is a tag translated by x86 or ARM ISA instructions 124 and a storage space for storing the results of microinstructions 126.

指令調度器404由暫存器配置表402接收暫存器重命名微指令126與附屬資訊,並依據指令的種類以及執行單元424之可利用性,將微指令126及其附屬資訊分派至關聯於適當的執行單元424之保留站406。此執行單元424將會執行微指令126。 The instruction dispatcher 404 receives the scratchpad rename microinstruction 126 and the affiliate information from the scratchpad configuration table 402, and assigns the microinstruction 126 and its ancillary information to the appropriate one depending on the type of the instruction and the availability of the execution unit 424. Retention station 406 of execution unit 424. This execution unit 424 will execute the microinstruction 126.

對各個在保留站406中等待的微指令126而言,指令發布單元408測得相關執行單元424可被運用且其附屬資訊被滿足(如來源運算元可被運用)時,即發布微指令126至執行單元424供執行。如前述,指令發布單元408所發 布的微指令126,可以非循序執行於程式次序外以及以超純量方式執行。 For each microinstruction 126 that is waiting in the reservation station 406, the instruction issue unit 408 detects that the correlation execution unit 424 can be used and its ancillary information is satisfied (eg, the source operand can be used), ie, issues the microinstructions 126. Execution unit 424 is available for execution. As described above, the instruction issuing unit 408 issues The microinstructions 126 of the cloth can be executed out of order and in a super-scalar manner.

在一實施例中,執行單元424包含整數/分支單元412、媒體單元414、載入/儲存單元416、以及浮點單元418。執行單元424執行微指令126以產生結果128並提供至重排緩衝器422。雖然執行單元424並不大受到其所執行之微指令126係由x86或是ARM ISA指令124轉譯而來的影響,執行單元424仍會使用指令模式指標132與環境模式指標136以執行相對較小的微指令126子集。舉例來說,執行管線112管理旗標的產生,其管理會依據指令模式指標132指示為x86 ISA或是ARM ISA而有些微不同,並且,執行管線112係依據指令模式指標132指示為x86 ISA或是ARM ISA,對x86 EFLAGS暫存器或是程式狀態暫存器(PSR)內的ARM條件碼旗標進行更新。在另一實例中,執行管線112對指令模式指標132進行取樣以決定去更新x86指令指標(IP)118或ARM程式計數器(PC)116,還是更新共通的指令位址暫存器。此外,執行管線122亦藉此來決定使用x86或是ARM語意(semantics)執行前述動作。一旦微指令126變成微處理器100中最舊的已完成微指令126(亦即,在重排緩衝器422佇列的排頭且呈現已完成的狀態)且其他用以實現相關之ISA指令124的所有微指令126均已完成,重排緩衝器422就會引退ISA指令124並釋放與實行微指令126相關的項目。在一實施例中,微處理器100可在一時脈週期內引退至多三個ISA指令124。此處理方法的優點在於,執行管線112 係一高效能、通用執行引擎,其可執行支援x86 ISA與ARM ISA指令124之微處理器100微架構的微指令126。 In an embodiment, execution unit 424 includes integer/branch unit 412, media unit 414, load/store unit 416, and floating point unit 418. Execution unit 424 executes microinstructions 126 to produce results 128 and provides them to reorder buffer 422. Although execution unit 424 is not greatly affected by the translation of microinstructions 126 that it executes by x86 or ARM ISA instructions 124, execution unit 424 will still use instruction mode indicator 132 and environment mode indicator 136 to perform relatively small. A subset of microinstructions 126. For example, execution pipeline 112 manages the generation of flags, the management of which is slightly different depending on the command mode indicator 132 indicating x86 ISA or ARM ISA, and the execution pipeline 112 is indicated by the command mode indicator 132 as x86 ISA or The ARM ISA updates the ARM condition code flag in the x86 EFLAGS register or in the Program Status Register (PSR). In another example, execution pipeline 112 samples instruction mode indicator 132 to determine whether to update x86 instruction index (IP) 118 or ARM program counter (PC) 116 or to update a common instruction address register. In addition, the execution pipeline 122 also uses this to determine whether to perform the aforementioned actions using x86 or ARM semantics. Once the microinstruction 126 becomes the oldest completed microinstruction 126 in the microprocessor 100 (i.e., in the top of the rearrangement buffer 422 queue and presents the completed state) and other to implement the associated ISA instruction 124 All microinstructions 126 have been completed and the reorder buffer 422 retires the ISA instruction 124 and releases the items associated with the microinstruction 126. In one embodiment, microprocessor 100 can retid up to three ISA instructions 124 in a clock cycle. An advantage of this processing method is that the execution pipeline 112 A high performance, general purpose execution engine that executes microinstructions 126 that support the microprocessor 100 microarchitecture of the x86 ISA and ARM ISA instructions 124.

請參照第5圖,圖中係以方塊圖詳述第1圖之暫存器檔案106。就一較佳實施例而言,暫存器檔案106為獨立的暫存器區塊實體。在一實施例中,通用暫存器係由一具有多個讀出埠與寫入埠之暫存器檔案實體來實現;其他暫存器可在實體上獨立於此通用暫存器檔案以及其他會存取這些暫存器但具有較少之讀取寫入埠的鄰近功能方塊。在一實施例中,部分非通用暫存器,尤其是那些不直接控制微處理器100之硬體而僅儲存微碼234會使用到之數值的暫存器(如部分x86 MSR或是ARM協同處理器暫存器),則是在一個微碼234可存取之私有隨機存取記憶體(PRAM)內實現。不過,x86 ISA與ARM ISA程式者無法見到此私有隨機存取記憶體,亦即此記憶體並不在ISA系統記憶體位址空間內。 Please refer to FIG. 5, which illustrates the register file 106 of FIG. 1 in a block diagram. In a preferred embodiment, the scratchpad file 106 is a separate scratchpad block entity. In one embodiment, the general purpose register is implemented by a register file entity having a plurality of read and write ports; other registers can be physically separate from the general register file and other Adjacent function blocks that access these registers but have fewer read writes. In an embodiment, some non-general-purpose scratchpads, especially those that do not directly control the hardware of the microprocessor 100 and only store the values that the microcode 234 will use (such as partial x86 MSR or ARM collaboration) The processor register is implemented in a private random access memory (PRAM) accessible by the microcode 234. However, x86 ISA and ARM ISA programmers cannot see this private random access memory, which means that this memory is not in the ISA system memory address space.

總括來說,如第5圖所示,暫存器檔案106在邏輯上係區分為三種,亦即ARM特定的暫存器502、x86特定的暫存器504、以及共享暫存器506。在一實施例中,共享暫存器506包含十五個32位元暫存器,由ARM ISA暫存器R0至R14以及x86 ISA EAX至R14D暫存器所共享,另外有十六個128位元暫存器由x86 ISA XMM0至XMM15暫存器以及ARM ISA進階單指令多重數據擴展(Neon)暫存器所共享,這些暫存器之部分係重疊於三十二個32位元ARM VFPv3浮點暫存器。如前文第1圖所述,通用暫存器之共享意指由x86 ISA指令124寫入一共享暫存器的數 值,會被ARM ISA指令124在隨後讀取此共享暫存器時見到,反之亦然。此方式的優點在於,能夠使x86 ISA與ARM ISA程序透過暫存器互相溝通。此外,如前述,x86 ISA與ARM ISA之架構控制暫存器的特定位元亦可被引用為共享暫存器506。如前述,在一實施例中,x86特定模型暫存器可被ARM ISA指令124透過實作定義協處理器暫存器存取,因而是由x86 ISA與ARM ISA所共享。此共享暫存器506可包含非架構暫存器,例如條件旗標之非架構同等物,這些非架構暫存器同樣由暫存器配置表402重命名。硬體指令轉譯器104知道哪一個暫存器係由x86 ISA與ARM ISA所共享,因而會產生實行微指令126來存取正確的暫存器。 In summary, as shown in FIG. 5, the scratchpad file 106 is logically divided into three types, namely, an ARM-specific register 502, an x86-specific register 504, and a shared register 506. In one embodiment, the shared scratchpad 506 includes fifteen 32-bit scratchpads shared by the ARM ISA scratchpads R0 through R14 and the x86 ISA EAX through R14D registers, with an additional sixteen 128 bits. The meta-register is shared by the x86 ISA XMM0 to XMM15 registers and the ARM ISA Advanced Single Instruction Multiple Data Extension (Neon) register, which is partially overlapped by thirty-two 32-bit ARM VFPv3 Floating point register. As described in Figure 1 above, the sharing of the general purpose register means the number of writes to a shared register by the x86 ISA instruction 124. The value will be seen by the ARM ISA instruction 124 when subsequently reading the shared scratchpad, and vice versa. The advantage of this approach is that it enables the x86 ISA and ARM ISA programs to communicate with each other through the scratchpad. In addition, as described above, the specific bits of the x86 ISA and ARM ISA architecture control registers may also be referred to as shared registers 506. As described above, in one embodiment, the x86-specific model scratchpad can be accessed by the ARM ISA instruction 124 through the implementation-defined coprocessor register, and thus is shared by the x86 ISA and the ARM ISA. This shared scratchpad 506 can include non-architected scratchpads, such as non-architected equivalents of conditional flags, which are also renamed by the scratchpad configuration table 402. The hardware instruction translator 104 knows which register is shared by the x86 ISA and the ARM ISA, and thus executes the microinstruction 126 to access the correct register.

ARM特定的暫存器502包含ARM ISA所定義但未被包含於共享暫存器506之其他暫存器,而x86特定的暫存器502包含x86 ISA所定義但未被包含於共享暫存器506之其他暫存器。舉例來說,ARM特定的暫存器502包含ARM程式計數器116、CPSR、SCTRL、FPSCR、CPACR、協處理器暫存器、多種例外事件模式的備用(banked)通用暫存器與程序狀態保存暫存器(saved program status registers,SPSRs)等等。前文列出的ARM特定暫存器502並非為限定本案發明,僅為例示以說明本發明。另外,舉例來說,x86特定的暫存器504包含x86指令指標(EIP或IP)118、EFLAGS、R15D、64位元之R0至R15暫存器的上面32位元(亦即未落於共享暫存器506的部分)、區段暫存器(SS,CS,DS,ES,FS,GS)、x87 FPU暫存器、MMX暫存器、控 制暫存器(如CR0-CR3、CR8)等。前文列出的x86特定暫存器504並非為限定本案發明,而僅為例示以說明本發明。 The ARM specific scratchpad 502 contains other scratchpads defined by the ARM ISA but not included in the shared scratchpad 506, while the x86 specific scratchpad 502 contains x86 ISA defined but not included in the shared scratchpad 506 other scratchpads. For example, the ARM-specific register 502 includes an ARM program counter 116, a CPSR, an SCTRL, an FPSCR, a CPACR, a coprocessor register, a banked general-purpose register for various exception event modes, and a program state save temporary. Saved program status registers (SPSRs) and so on. The ARM-specific registers 502 listed above are not intended to limit the invention, but are merely illustrative to illustrate the invention. In addition, for example, the x86-specific register 504 includes x86 instruction indicators (EIP or IP) 118, EFLAGS, R15D, 64-bit R0 to R32 registers above the 32-bit (ie, not falling under the share) Part of the register 506), sector register (SS, CS, DS, ES, FS, GS), x87 FPU register, MMX register, control System registers (such as CR0-CR3, CR8). The x86 specific registers 504 listed above are not intended to limit the invention, but are merely illustrative to illustrate the invention.

在一實施例中,微處理器100包含新的實作定義ARM協同處理器暫存器,在指令模式指標132指示為ARM ISA時,此實作定義協同處理器暫存器可被存取以執行x86 ISA相關的操作。這些操作包含但不限於:將微處理器100重置為一x86 ISA處理器(重置至x86指令)的能力;將微處理器100初始化為x86特定的狀態,將指令模式指標132切換至x86,並開始在一特定x86目標位址擷取x86指令124(啟動至x86指令)的能力;存取前述全域組態暫存器的能力;存取x86特定暫存器(如EFLAGS)的能力,此x86暫存器係指定在ARM R0暫存器中,存取電力管理(如P狀態與C狀態的轉換),存取處理器匯流排功能(如輸入/輸出循環)、中斷控制器之存取、以及加密加速功能之存取。此外,在一實施例中,微處理器100包含新的x86非架構特定模型暫存器,在指令模式指標132指示為x86 ISA時,此非架構特定模型暫存器可被存取以執行ARM ISA相關的操作。這些操作包含但不限於:將微處理器100重置為一ARM ISA處理器(重置至ARM指令)的能力;將微處理器100初始化為ARM特定的狀態,將指令模式指標132切換至ARM,且開始在一特定ARM目標位址擷取ARM指令124(啟動至ARM指令)的能力;存取前述全域組態暫存器的能力;存取ARM特定暫存器(如CPSR)的能力,此ARM暫存器係指定在EAX暫存器內。 In one embodiment, the microprocessor 100 includes a new implementation-defined ARM coprocessor register, which, when the instruction mode indicator 132 indicates an ARM ISA, defines the coprocessor register to be accessible. Perform x86 ISA related operations. These operations include, but are not limited to, the ability to reset microprocessor 100 to an x86 ISA processor (reset to x86 instructions); initialize microprocessor 100 to an x86-specific state, switch command mode indicator 132 to x86 And begin to capture the ability of the x86 instruction 124 (boot to x86 instruction) on a particular x86 target address; the ability to access the aforementioned global configuration register; access to x86 specific registers (eg EFLAGS), This x86 register is specified in the ARM R0 register, accessing power management (such as P state and C state conversion), accessing processor bus functions (such as input/output cycles), and interrupt controller storage. Access and access to the encryption acceleration function. Moreover, in an embodiment, the microprocessor 100 includes a new x86 non-architectural specific model register that can be accessed to execute ARM when the instruction mode indicator 132 is indicated as an x86 ISA. ISA related operations. These operations include, but are not limited to, the ability to reset the microprocessor 100 to an ARM ISA processor (reset to ARM instructions); initialize the microprocessor 100 to an ARM-specific state, and switch the command mode indicator 132 to ARM. And the ability to capture ARM instructions 124 (start to ARM instructions) at a particular ARM target address; the ability to access the aforementioned global configuration registers; access to ARM specific registers (such as CPSR), This ARM register is specified in the EAX register.

請參照第6A與6B圖,圖中顯示一流程說明第1圖之微處理器100的操作程序。此流程始於步驟602。 Referring to Figures 6A and 6B, there is shown a flow chart illustrating the operation of the microprocessor 100 of Figure 1. This process begins in step 602.

如步驟602所示,微處理器100係被重置。可向微處理器100之重置輸入端發出信號來進行此重置動作。此外,在一實施例中,此微處理器匯流排係一x86型式之處理器匯流排,此重置動作可由x86型式之INIT命令進行。回應此重置動作,微碼234的重置程序係被調用來執行。此重置微碼之動作包含:(1)將x86特定的狀態504初始化為x86 ISA所指定的預設數值;(2)將ARM特定的狀態502初始化為ARM ISA所指定的預設數值;(3)將微處理器100之非ISA特定的狀態初始化為微處理器100製造商所指定的預設數值;(4)將共享ISA狀態506,如GPRs,初始化為x86 ISA所指定的預設數值;以及(5)將指令模式指標132與環境模式指標136設定為指示x86 ISA。在另一實施例中,不同於前揭動作(4)與(5),此重置微碼將共享ISA狀態506初始化為ARM ISA特定的預設數值,並將指令模式指標132與環境模式指標136設定為指示ARM ISA。在此實施例中,步驟638與642的動作不需要被執行,並且,在步驟614之前,此重置微碼會將共享ISA狀態506初始化為x86 ISA所指定的預設數值,並將指令模式指標132與環境模式指標136設定為指示x86 ISA。接下來進入步驟604。 As shown in step 602, the microprocessor 100 is reset. A reset signal can be sent to the reset input of microprocessor 100 to perform this reset action. Moreover, in one embodiment, the microprocessor bus is arranged in an x86 type processor bus, and the reset action can be performed by an x86 type INIT command. In response to this reset action, the reset procedure of the microcode 234 is invoked to execute. The action of resetting the microcode includes: (1) initializing the x86 specific state 504 to a preset value specified by the x86 ISA; (2) initializing the ARM specific state 502 to a preset value specified by the ARM ISA; 3) Initializing the non-ISA-specific state of the microprocessor 100 to a preset value specified by the microprocessor 100 manufacturer; (4) initializing the shared ISA state 506, such as GPRs, to a preset value specified by the x86 ISA And (5) setting the command mode indicator 132 and the environmental mode indicator 136 to indicate the x86 ISA. In another embodiment, unlike the pre-launch actions (4) and (5), the reset microcode initializes the shared ISA state 506 to an ARM ISA-specific preset value and directs the command mode indicator 132 to the environmental mode indicator. 136 is set to indicate the ARM ISA. In this embodiment, the actions of steps 638 and 642 need not be performed, and prior to step 614, the reset microcode initializes the shared ISA state 506 to the preset value specified by the x86 ISA and will mode the command. Indicator 132 and environmental mode indicator 136 are set to indicate the x86 ISA. Next, proceed to step 604.

在步驟604,重置微碼確認微處理器100係配置為一個x86處理器或是一個ARM處理器來進行開機。在一實施例中,如前述,預設ISA開機模式係硬式編碼於微碼, 不過可透過熔斷組態熔絲的方式,或利用一微碼修補來修改。在一實施例中,此預設ISA開機模式作為一外部輸入提供至微處理器100,例如一外部輸入接腳。接下來進入步驟606。在步驟606中,若是預設ISA開機模式為x86,就會進入步驟614;反之,若是預設開機模式為ARM,就會進入步驟638。 At step 604, the reset microcode confirms that the microprocessor 100 is configured as an x86 processor or an ARM processor to boot. In an embodiment, as described above, the preset ISA boot mode is hard coded in the microcode. However, it can be modified by blowing the fuse configuration or by using a microcode patch. In one embodiment, the preset ISA boot mode is provided as an external input to the microprocessor 100, such as an external input pin. Next, proceed to step 606. In step 606, if the default ISA boot mode is x86, then step 614 is entered; otherwise, if the default boot mode is ARM, then step 638 is entered.

在步驟614中,重置微碼使微處理器100開始由x86 ISA指定的重置向量位址擷取x86指令124。接下來進入步驟616。 In step 614, resetting the microcode causes microprocessor 100 to begin the x86 instruction 124 by the reset vector address specified by the x86 ISA. Next, proceed to step 616.

在步驟616中,x86系統軟體(如BIOS)係配置微處理器100來使用如x86 ISA RDMSR與WRMSR指令124。接下來進入步驟618。 In step 616, the x86 system software (e.g., BIOS) configures the microprocessor 100 to use, for example, the x86 ISA RDMSR and WRMSR instructions 124. Next, proceed to step 618.

在步驟618中,x86系統軟體執行一重置至ARM的指令124。此重置至ARM的指令使微處理器100重置並以一ARM處理器的狀態離開重置程序。然而,因為x86特定狀態504以及非ISA特定組態狀態不會因為重置至ARM的指令126而改變,此方式有利於使x86系統韌體執行微處理器100之初步設定並使微處理器100隨後以ARM處理器的狀態重開機,而同時還能使x86系統軟體執行之微處理器100的非ARM組態配置維持完好。藉此,此方法能夠使用“小型的”微開機碼來執行ARM作業系統的開機程序,而不需要使用微開機碼來解決如何配置微處理器100之複雜問題。在一實施例中,此重置至ARM指令係一x86 WRMSR指令至一新的非架構特定模型暫存器。接下來進入步驟622。 In step 618, the x86 system software executes an instruction 124 to reset to the ARM. This reset to ARM instruction causes the microprocessor 100 to reset and exit the reset procedure in the state of an ARM processor. However, because the x86 specific state 504 and the non-ISA specific configuration state are not changed by the instruction 126 reset to the ARM, this approach facilitates the x86 system firmware to perform the preliminary setup of the microprocessor 100 and the microprocessor 100 It is then rebooted in the state of the ARM processor, while still allowing the non-ARM configuration of the microprocessor 100 executed by the x86 system software to remain intact. In this way, the method can use the "small" micro boot code to execute the boot process of the ARM operating system without using the micro boot code to solve the complicated problem of how to configure the microprocessor 100. In one embodiment, this reset to the ARM instruction is an x86 WRMSR instruction to a new non-architectural specific model register. Next, proceed to step 622.

在步驟622,簡單指令轉譯器204進入陷阱至重置微碼,以回應複雜重置至ARM(complex reset-to-ARM)指令124。此重置微碼使ARM特定狀態502初始化至由ARM ISA指定的預設數值。不過,重置微碼並不修改微處理器100之非ISA特定狀態,因而有利於保存步驟616執行所需的組態設定。此外,重置微碼使共享ISA狀態506初始化至ARM ISA指定的預設數值。最後,重置微碼設定指令模式指標132與環境模式指標136以指示ARM ISA。接下來進入步驟624。 At step 622, the simple instruction translator 204 enters the trap to reset the microcode in response to a complex reset to ARM (complex reset-to-ARM) instruction 124. This reset microcode initializes the ARM specific state 502 to a preset value specified by the ARM ISA. However, resetting the microcode does not modify the non-ISA specific state of the microprocessor 100, thus facilitating the saving of the configuration settings required for execution of step 616. In addition, resetting the microcode causes the shared ISA state 506 to be initialized to a preset value specified by the ARM ISA. Finally, the microcode set command mode indicator 132 and the ambient mode indicator 136 are reset to indicate the ARM ISA. Next, proceed to step 624.

在步驟624中,重置微碼使微處理器100開始在x86 ISA EDX:EAX暫存器指定的位址擷取ARM指令124。此流程結束於步驟624。 In step 624, resetting the microcode causes microprocessor 100 to begin fetching ARM instruction 124 at the address specified by the x86 ISA EDX:EAX register. The process ends at step 624.

在步驟638中,重置微碼將共享ISA狀態506,如GPRs,初始化至ARM ISA指定的預設數值。接下來進入步驟642。 In step 638, the reset microcode will share the ISA state 506, such as GPRs, to the preset value specified by the ARM ISA. Next, proceed to step 642.

在步驟642中,重置微碼設定指令模式指標132與環境模式指標136以指示ARM ISA。接下來進入步驟644。 In step 642, the microcode set command mode indicator 132 and the ambient mode indicator 136 are reset to indicate the ARM ISA. Next, proceed to step 644.

在步驟644中,重置微碼使微處理器100開始在ARM ISA指定的重置向量位址擷取ARM指令124。此ARM ISA定義兩個重置向量位址,並可由一輸入來選擇。在一實施例中,微處理器100包含一外部輸入,以在兩個ARM ISA定義的重置向量位址間進行選擇。在另一實施例中,微碼234包含在兩個ARM ISA定義的重置向量位址間之一預設選擇,此預設選則可透過熔斷熔絲以及/或是微碼修補丁來修改。接下來進入步驟646。 In step 644, resetting the microcode causes the microprocessor 100 to begin fetching the ARM instruction 124 at the reset vector address specified by the ARM ISA. This ARM ISA defines two reset vector addresses and can be selected by an input. In one embodiment, microprocessor 100 includes an external input to select between two ARM ISA defined reset vector addresses. In another embodiment, the microcode 234 includes a preset selection between two ARM ISA defined reset vector addresses, which can be modified by blowing fuses and/or microcode patching. . Next, proceed to step 646.

在步驟646中,ARM系統軟體設定微處理器100來使用特定指令,如ARM ISA MCR與MRC指令124。接下來進入步驟648。 In step 646, the ARM system software sets up the microprocessor 100 to use specific instructions, such as the ARM ISA MCR and MRC instructions 124. Next, proceed to step 648.

在步驟648中,ARM系統軟體執行一重置至x86的指令124,來使微處理器100重置並以一x86處理器的狀態離開重置程序。然而,因為ARM特定狀態502以及非ISA特定組態狀態不會因為重置至x86的指令126而改變,此方式有利於使ARM系統韌體執行微處理器100之初步設定並使微處理器100隨後以x86處理器的狀態重開機,而同時還能使由ARM系統軟體執行之微處理器100的非x86組態配置維持完好。藉此,此方法能夠使用“小型的”微開機碼來執行x86作業系統的開機程序,而不需要使用微開機碼來解決如何配置微處理器100之複雜問題。在一實施例中,此重置至x86指令係一ARM MRC/MRCC指令至一新的實作定義協同處理器暫存器。接下來進入步驟652。 In step 648, the ARM system software executes a reset 124 to x86 instruction to reset the microprocessor 100 and exit the reset procedure in an x86 processor state. However, because the ARM-specific state 502 and the non-ISA-specific configuration state are not changed by the instruction 126 reset to x86, this approach facilitates the ARM system firmware to perform the preliminary setup of the microprocessor 100 and the microprocessor 100 It is then rebooted in the state of the x86 processor while still maintaining the non-x86 configuration of the microprocessor 100 executed by the ARM system software intact. In this way, the method can use the "small" micro boot code to execute the boot process of the x86 operating system without using the micro boot code to solve the complicated problem of how to configure the microprocessor 100. In one embodiment, this reset to the x86 instruction is an ARM MRC/MRCC instruction to a new implementation-defined coprocessor register. Next, proceed to step 652.

在步驟652中,簡單指令轉譯器204進入陷阱至重置微碼,以回應複雜重置至x86指令124。重置微碼使x86特定狀態504初始化至x86 ISA所指定的預設數值。不過,重置微碼並不修改微處理器100之非ISA特定狀態,此處理有利於保存步驟646所執行的組態設定。此外,重置微碼使共享ISA狀態506初始化至x86 ISA所指定的預設數值。最後,重置微碼設定指令模式指標132與環境模式指標136以指示x86 ISA。接下來進入步驟654。 In step 652, the simple instruction translator 204 enters the trap to reset the microcode in response to the complex reset to x86 instruction 124. Resetting the microcode initializes the x86 specific state 504 to the preset value specified by the x86 ISA. However, resetting the microcode does not modify the non-ISA specific state of the microprocessor 100, which facilitates saving the configuration settings performed at step 646. In addition, resetting the microcode causes the shared ISA state 506 to be initialized to a preset value specified by the x86 ISA. Finally, the microcode set command mode indicator 132 and the ambient mode indicator 136 are reset to indicate the x86 ISA. Next, proceed to step 654.

在步驟654中,重置微碼使微處理器100開始在ARM ISA R1:R0暫存器所指定的位址擷取ARM指令124。此流 程終止於步驟654。 In step 654, resetting the microcode causes microprocessor 100 to begin fetching ARM instruction 124 at the address specified by the ARM ISA R1:R0 register. This stream The process terminates at step 654.

請參照第7圖,圖中係以一方塊圖說明本發明之一雙核心微處理器700。此雙核心微處理器700包含兩個處理核心100,各個核心100包含有第1圖之微處理器100所具有的元件,藉此,各個核心均可執行x86 ISA與ARM ISA機器語言程式。這些核心100可被設定為兩個核心100都執行x86 ISA程式、兩個核心100都執行ARM ISA程式、或是一個核心100執行x86 ISA程式而另一個核心100則是執行ARM ISA程式。在微處理器700的操作過程中,前述三種設定方式可混合且動態改變。如第6A圖及第6B圖之說明內容所述,各個核心100對於其指令模式指標132與環境模式指標136均具有一預設數值,此預設數值可利用熔絲或微碼修補做修改,藉此,各個核心100可以獨立地透過重置改變為x86或是ARM處理器。雖然第7圖的實施例僅具有二個核心100,在其他實施例中,微處理器700可具有多於二個核心100,而各個核心均可執行x86 ISA與ARM ISA機器語言程式。 Referring to Figure 7, a dual core microprocessor 700 of the present invention is illustrated in a block diagram. The dual core microprocessor 700 includes two processing cores 100, each of which includes the components of the microprocessor 100 of FIG. 1, whereby each core can execute x86 ISA and ARM ISA machine language programs. These cores 100 can be configured such that both cores 100 execute x86 ISA programs, both cores 100 execute ARM ISA programs, or one core 100 executes x86 ISA programs and the other core 100 executes ARM ISA programs. During the operation of the microprocessor 700, the aforementioned three settings may be mixed and dynamically changed. As described in the description of FIG. 6A and FIG. 6B, each core 100 has a preset value for its command mode indicator 132 and the environment mode indicator 136, and the preset value can be modified by using fuse or microcode patching. Thereby, each core 100 can be independently changed to an x86 or ARM processor through a reset. Although the embodiment of Figure 7 has only two cores 100, in other embodiments, the microprocessor 700 can have more than two cores 100, and each core can execute x86 ISA and ARM ISA machine language programs.

請參照第8圖,圖中係以一方塊圖說明本發明另一實施例之可執行x86 ISA與ARM ISA機器語言程式的微處理器100。第8圖之微處理器100係類似於第1圖之微處理器100,其中的元件亦相似。然而,第8圖之微處理器100亦包含一微指令快取892,此微指令快取892存取由硬體指令轉譯器104產生且直接提供給執行管線112之微指令126。微指令快取892係由指令擷取單元114所產生之擷取位址做索引。若是擷取位址134命中微指令快取892,執 行管線112內之多工器(未圖示)就選擇來自微指令快取892之微指令126,而非來自硬體指令轉譯器104之微指令126;反之,多工器則是選擇直接由硬體指令轉譯器104提供之微指令126。微指令快取的操作,通常亦稱為追蹤快取,係微處理器設計之技術領域所習知的技術。微指令快取892所帶來的優點在於,由微指令快取892擷取微指令126所需的時間通常會少於由指令快取102擷取指令124並且利用硬體指令轉譯器將其轉譯為微指令126的時間。在第8圖之實施例中,微處理器100在執行x86或是ARM ISA機器語言程式時,硬體指令轉譯器104不需要在每次執行x86或ARM ISA指令124時都執行硬體轉譯,亦即當實行微指令126已經存在於微指令快取892,就不需要執行硬體轉譯。 Referring to FIG. 8, a block diagram of a microprocessor 100 emulating an x86 ISA and ARM ISA machine language program according to another embodiment of the present invention is illustrated. The microprocessor 100 of Figure 8 is similar to the microprocessor 100 of Figure 1, in which the components are similar. However, the microprocessor 100 of FIG. 8 also includes a microinstruction cache 892 that accesses the microinstructions 126 generated by the hardware instruction translator 104 and provided directly to the execution pipeline 112. The microinstruction cache 892 is indexed by the retrieved address generated by the instruction fetch unit 114. If the capture address 134 hits the micro-instruction cache 892, The multiplexer (not shown) in row pipeline 112 selects microinstruction 126 from microinstruction cache 892 instead of microinstruction 126 from hardware instruction translator 104; conversely, the multiplexer is selected directly by The microinstruction 126 provided by the hardware instruction translator 104. Micro-instruction cache operations, also commonly referred to as trace caches, are techniques well known in the art of microprocessor design. The advantage of microinstruction cache 892 is that the time required to retrieve microinstruction 126 by microinstruction cache 892 is typically less than the instruction fetch 124 by instruction fetch 102 and is translated using a hardware instruction interpreter. The time for the microinstruction 126. In the embodiment of FIG. 8, when the microprocessor 100 executes an x86 or ARM ISA machine language program, the hardware instruction translator 104 does not need to perform a hardware translation every time the x86 or ARM ISA instruction 124 is executed. That is, when the execution microinstruction 126 already exists in the microinstruction cache 892, there is no need to perform a hardware translation.

在此所述之微處理器的實施例之優點在於,其透過內建之硬體指令轉譯器來將x86 ISA與ARM ISA指令轉譯為微指令集之微指令,而能執行x86 ISA與ARM ISA機器語言程式,此微指令集不同於x86 ISA與ARM ISA指令集,且微指令可利用微處理器之共用的執行管線來執行以提供實行微指令。在此所述之微處理器的實施例之優點在於,透過協同利用大量與ISA之執行管線來執行由x86 ISA與ARM ISA指令硬體轉譯來的微指令,微處理器的設計與製造所需的資源會少於兩個獨立設計製造之微處理器(亦即一個能夠執行x86 ISA機器語言程式,一個能夠執行ARM ISA機器語言程式)所需的資源。此外,這些微處理器的實施例中,尤其是那些使用超純量非循序執行管線的微處 理器,具有潛力能提供相較於既有ARM ISA處理器更高的效能。此外,這些微處理器的實施例,相較於採用軟體轉譯器之系統,亦在x86與ARM的執行上可更具潛力地提供更高的效能。最後,由於微處理器可執行x86 ISA與ARM ISA機器語言程式,此微處理器有利於建構一個能夠高效地同時執行x86與ARM機器語言程式的系統。 An advantage of an embodiment of the microprocessor described herein is that it can execute x86 ISA and ARM ISA through a built-in hardware instruction translator to translate x86 ISA and ARM ISA instructions into microinstructions of the microinstruction set. A machine language program that differs from the x86 ISA and ARM ISA instruction sets, and the microinstructions can be executed using a shared execution pipeline of the microprocessor to provide execution microinstructions. An advantage of the embodiment of the microprocessor described herein is that the microprocessor is designed and manufactured by cooperatively utilizing a large number of micro-instructions that are hard-translated by the x86 ISA and ARM ISA instructions with the ISA execution pipeline. The resources will be less than two independently designed microprocessors (that is, one capable of executing an x86 ISA machine language program, one capable of executing an ARM ISA machine language program). Moreover, embodiments of these microprocessors, especially those that use ultra-pure quantities of non-sequential execution pipelines The processor has the potential to provide higher performance than existing ARM ISA processors. In addition, embodiments of these microprocessors offer greater potential for higher performance in x86 and ARM implementations than systems employing software interpreters. Finally, because the microprocessor can execute x86 ISA and ARM ISA machine language programs, this microprocessor facilitates the construction of a system that can efficiently execute both x86 and ARM machine language programs.

備份暫存器模擬Backup scratchpad simulation

該ARM ISA包含一備份暫存器之特徵,如表三所示,該表係摘錄自ARM使用者手冊(ARM programmer’s manual)中第B1-9頁之圖B1-1。在第B1章節裡描述了一ARM ISA核心之系統層級程式開發者模型,其包含詳細的ARM核心暫存器與備份暫存器之布局(scheme)。如ARM程式開發者手冊第B1.3.2章節所述: 如第A2-11頁ARM核心暫存器所述之該ARM暫存器檔案之應用層級架構。此一架構提供了16個ARM核心暫存器,即R0-R15,其包含了堆疊指標器(Stack Pointer,SP)、連結暫存器(Link Register,LR)以及程式記數器(Program Counter,PC)。該些暫存器係選自總數31或33個之暫存器,其係依據是否實現安全性擴充而定。如第B1-1圖所示,現行之執行模式決定暫存器之組別選擇,其顯示暫存器的設置係依據現行執行模式之選擇,而重製某些暫存器之內容。此一設置稱之為暫存器備份,而該重製部分之暫存器係稱為備份暫存器。 The ARM ISA includes a feature of a backup scratchpad, as shown in Table 3, which is extracted from Figure B1-1 on page B1-9 of the ARM programmer's manual. In Section B1, a system-level program developer model for the ARM ISA core is described, which contains a detailed layout of the ARM core scratchpad and backup scratchpad. As described in Section B1.3.2 of the ARM Program Developer's Manual: The application hierarchy of the ARM scratchpad file as described in the ARM Core Register on page A2-11. This architecture provides 16 ARM core registers, namely R0-R15, which includes Stack Pointer (SP), Link Register (LR) and Program Counter (Program Counter, PC). The registers are selected from a total of 31 or 33 registers, depending on whether a security extension is implemented. As shown in Figure B1-1, the current execution mode determines the group selection of the scratchpad. The display of the scratchpad is based on the selection of the current execution mode, and the contents of some registers are reworked. This setting is called a scratchpad backup, and the scratchpad of this rework is called a backup scratchpad.

因此如表三所示,一個ARM ISA之核心可能執行八種不同執行模式之一。執行模式也可稱為處理模式或操作方法。應用層級程式係執行於使用者模式,且不能存取受保護之系統資源,而且除非有例外事件發生外否則不能切換執行模式。相比之下,其他七個模式則統稱為特權模式,其具有存取系統資源,並可隨意更改核心之處理模式。特權模式中之六者被稱為例外事件模式,其係在有例外事件時進入該些模式,而特權模式之第七種亦即系統模式,進入此一模式並非因為例外事件之發生,其通常係因為一指 令之執行而進入。 So as shown in Table 3, the core of an ARM ISA may perform one of eight different execution modes. The execution mode can also be referred to as a processing mode or an operation method. The application level program is executed in user mode and cannot access protected system resources, and the execution mode cannot be switched unless an exception event occurs. In contrast, the other seven modes are collectively referred to as privileged mode, which has access to system resources and is free to change the core processing mode. The six of the privileged modes are called the exception event mode, which enters the mode when there are exception events, and the seventh mode of the privileged mode is the system mode. Entering this mode is not because of the exception event, which is usually Because one finger Let it enter and enter.

從前述表三中可知,ARM ISA包含了16種通用核心暫存器R0-R15,用以供應用層級程式在使用者模式中執行。R13-R15暫存器各具有專屬用途:R13為堆疊暫存器(SP);R14為連結暫存器(LR);以及R15為程式記數器(PC)。這16個相同的通用暫存器樣可系統模式中被作業系統所取用。 As can be seen from the foregoing Table 3, the ARM ISA includes 16 general-purpose core registers R0-R15 for supplying the user program in a hierarchical mode. The R13-R15 registers have their exclusive uses: R13 is the stack register (SP); R14 is the link register (LR); and R15 is the program counter (PC). These 16 identical general-purpose registers are available to the operating system in the system mode.

在六個例外事件模式中,如表三所示,每一模式都有相關於SP與LR暫存器之備份版本,以避免在使用時遭遇例外事件而導致SP與LR暫存器之損毀。也就是說,當遭遇例外事件時,核心係存取相關於例外事件模式之SP與LR暫存器,而非使用者模式下之SP與LR暫存器(或是另一例外事件模式下之SP與LR暫存器)。更具體地說,當遭遇例外事件,核心儲存一特定於例外事件之例外事件回傳位址於LR暫存器中,其中該LR暫存器係相關於所遭遇例外事件之例外事件模式(如LR_abt),而非儲存該回傳位址於使用者模式下之LR暫存器(LR_usr)。此外,當例外事件管理程序之指令存取SP或LR暫存器時,核心係存取相關於例外事件之SP或LR暫存器之備份版本(除非該指令另有明確指定),而非使用者模式之SP與LR暫存器(或是另一例外事件模式下之SP與LR暫存器)。舉例而言,在一管理者模式下執行之包含連結指令之Branch,會將次一指令之位址放置於LR_svc暫存器,而非LR_ust暫存器。在另一例子中,在IRQ模式下執行之一Push或Pop指令將會使用SP_irq暫存器而非SP_usr暫存器,以記憶體中存 取相關於該IRQ例外事件模式之一堆疊,而非存取使用者模式之堆疊(假設該SP_irq暫存器已依據作業系統之初始化,而得以存取不同之記憶體堆疊而非使用者模式堆疊)。 In the six exception event modes, as shown in Table 3, each mode has a backup version associated with the SP and LR registers to avoid the SP and LR registers being corrupted by exceptions encountered during use. That is, when an exception event is encountered, the core accesses the SP and LR registers associated with the exception event mode, rather than the SP and LR registers in user mode (or another exception mode). SP and LR register). More specifically, when an exception event is encountered, the core stores an exception event return address specific to the exception event in the LR register, wherein the LR register is associated with an exception event pattern of the exception event encountered (eg, LR_abt) instead of storing the LR register (LR_usr) in the user mode. In addition, when an exception event manager's instruction accesses the SP or LR register, the core accesses the backup version of the SP or LR register associated with the exception event (unless otherwise explicitly specified by the directive), rather than using SP mode and LR register (or SP and LR register in another exception mode). For example, a Branch that includes a link instruction executed in an administrator mode places the address of the next instruction in the LR_svc register instead of the LR_ust register. In another example, executing one of the Push or Pop instructions in IRQ mode will use the SP_irq register instead of the SP_usr register to store in memory. Stacking related to one of the IRQ exception event modes instead of accessing the user mode stack (assuming that the SP_irq register has been accessed according to the initialization of the operating system, accessing different memory stacks instead of user mode stacking) ).

此外,FIQ模式具有R8-R12暫存器之備份版本,其係可使FIQ中斷管理程序避免必須自記憶體中保存與回復R8-R12暫存器,因此FIQ中斷管理程序的執行速度會比其他例外事件處理程序來的快。當FIQ例外事件處理程序之指令存取R8-R12暫存器時,該核心存取R8-R12之FIQ備份版本(如標註於表三之R8_fiq至R12_fiq)(除非該指令另由明確指定),而非使用者模式之R8-R12暫存器。舉例而言,執行於FIQ模式下之存取R10暫存器之Add指令,其係存取R10_fiq暫存器而非R10_user暫存器。因此,實行安全性擴充的ISA ARM核心,將從一組共33個暫存器選出相關監視模式備份暫存器,包含:16種使用者模式暫存器、相關於各六種例外事件模式之SP與LR之暫存器備份版本,以及相關於FIQ模式之R8-R12之備份版本;相反的,未實行安全性擴充的ARM ISA核心將從一組共31個暫存器中選出相關監視模式備份暫存器,也就是說並不包含LR_mon與SP_mon暫存器。 In addition, the FIQ mode has a backup version of the R8-R12 scratchpad, which allows the FIQ interrupt management program to avoid having to save and reply to the R8-R12 register from the memory, so the FIQ interrupt management program will execute faster than others. The exception event handler comes quickly. When the instruction of the FIQ exception event handler accesses the R8-R12 register, the core accesses the FIQ backup version of R8-R12 (as indicated in Table 3, R8_fiq to R12_fiq) (unless the instruction is otherwise specified) R8-R12 scratchpad instead of user mode. For example, an Add instruction that accesses the R10 register in FIQ mode accesses the R10_fiq register instead of the R10_user register. Therefore, the security-expanded ISA ARM core will select a related monitoring mode backup register from a group of 33 temporary registers, including: 16 user mode registers, related to each of the six exception event modes. SP and LR scratchpad backup versions, and R8-R12 backup versions related to FIQ mode; conversely, the ARM ISA core without security extension will select the relevant monitoring mode from a total of 31 registers. Back up the scratchpad, which means that it does not contain the LR_mon and SP_mon registers.

最後,指定於現行程式狀態處理器(Current program status register,CPSR)之ARM ISA包含條件碼旗標,執行狀態位元、例外事件遮罩位元、以及定義現行處理模式之位元。CPSR應用層級程式之模式被稱為應用程式狀態暫存器(Application Program Status Register,APSR),並且僅提供存取條件碼旗標。每一例外事件具有其自身之CPSR備份 版本,如前述表三所示。當遭遇例外事件時,該CPSR數值之副本將寫入相關於該所進入例外事件之SPSR中。如此可令該例外事件管理程序自該例外事件中回復時,復原該CPSR至遭遇例外事件前之數值,以便檢視例外事件發生時該CPSR之數值。 Finally, the ARM ISA assigned to the Current Program Status Register (CPSR) contains condition code flags, execution status bits, exception event mask bits, and bits that define the current processing mode. The mode of the CPSR application level program is called the Application Program Status Register (APSR) and only provides the access condition code flag. Each exception has its own CPSR backup The version is as shown in Table 3 above. When an exception event is encountered, a copy of the CPSR value is written into the SPSR associated with the entered exception event. This allows the exception manager to recover from the exception event and restore the CPSR to the value before the exception event to view the value of the CPSR when the exception occurred.

第9圖為一傳統之實施例,其ARM ISA通用暫存器係實施為如同硬體暫存器906,硬體暫存器906係位於包含該ARM ISA例外事件模式備份暫存器之硬體暫存器檔案902中(電腦於圖中未示)。如第9圖所示,暫存器檔案902包含硬體多工邏輯閘908,係依據現行處理模式914,以選擇R8至R12暫存器之合適版本以及R13與R14暫存器之合適版本。額外之硬體多工邏輯閘904係基於指令所指定之暫存器位址912,以選擇指定於執行指令之暫存器。(一般的暫存器檔案係實施為如同多埠暫存器檔案,其包含二載入埠與一寫入埠,是以一指令可指定二來源運算元以及一目的運算元,因此該硬體多工邏輯閘908與904可重複設置三次,各對應於一埠)一實施例可合併操作模式硬體多工邏輯閘908與暫存器位址硬體多工邏輯閘904;然而,這樣的作法在處理模式914中需要額外之複雜度、電晶體、與電源組件,方能進行暫存器之選擇。 Figure 9 is a conventional embodiment in which the ARM ISA general-purpose register is implemented as a hardware register 906, and the hardware register 906 is located in the hardware including the ARM ISA exception event mode backup register. The scratchpad file 902 (the computer is not shown in the figure). As shown in FIG. 9, the scratchpad file 902 includes a hardware multiplex logic gate 908 that is based on the current processing mode 914 to select the appropriate version of the R8 through R12 registers and the appropriate versions of the R13 and R14 registers. The additional hardware multiplex logic gate 904 is based on the register address 912 specified by the instruction to select the register specified to execute the instruction. (A general scratchpad file is implemented as a multi-register register file, which includes two load files and one write file, so that an instruction can specify two source operation elements and a destination operation element, so the hardware The multiplexed logic gates 908 and 904 can be repeatedly set three times, each corresponding to one). An embodiment can combine the operational mode hardware multiplex logic gate 908 with the scratchpad address hardware multiplex logic gate 904; however, such The method requires additional complexity, transistors, and power components in processing mode 914 to enable the selection of the scratchpad.

典型地,處理器在一所提供之處理模式下執行許多指令(有時達到上千種),而當一例外事件模式發生或者是執行模式切換指令以切換至新處理模式時,接著許多指令執行於一新處理模式,而後又發生新的模式切換等等。幾乎(即使不是全部)所有被執行之指令存取包含備份版本之 R8-R14之通用暫存器902。依據該傳統實施例,每一存取至該通用暫存器檔案係通過如第9圖所示之硬體多工邏輯閘908,以選擇合適之備份暫存器(R8-R14暫存器),其增加每一存取連接至供應暫存檔案902之延遲。此一現象同樣發生於相對不那麼頻繁的處理模式切換上,以及相較於使用者模式暫存器之存取不那麼頻繁之備份暫存器之存取上。或者說,即使該選擇輸入914至該硬體多工邏輯閘908之更新較不頻繁,每一指令之執行而存取該暫存器檔案902之操作亦將導致硬體多工處理器908之延遲。基本上,存取暫存器檔案902對處理器而言係一關鍵之硬體時序路程,其可能需要降低核心時脈,抑或將存取比例較高的部分被切割為較低頻率分格窗口(bin)。因此,需要一種可避免硬體多工邏輯閘908延遲之解決方案。 Typically, the processor executes a number of instructions (sometimes in the thousands) in one of the provided processing modes, and when an exception event mode occurs or a mode switching instruction is executed to switch to the new processing mode, then many instructions are executed A new processing mode, followed by a new mode switch and so on. Almost (if not all) of all executed instruction accesses contain backup versions Universal register 902 of R8-R14. According to the conventional embodiment, each access to the general-purpose register file passes through the hardware multiplex logic gate 908 as shown in FIG. 9 to select a suitable backup register (R8-R14 register) It increases the delay of each access connection to the provisioning staging file 902. This phenomenon also occurs on relatively less frequent processing mode switching, as well as access to backup registers that are less frequently accessed by the user mode register. In other words, even if the selection input 914 to the hardware multiplex logic gate 908 is less frequently updated, the operation of accessing the register file 902 for each instruction execution will result in the hardware multiplex processor 908. delay. Basically, accessing the scratchpad file 902 is a critical hardware timing path for the processor, which may require lowering the core clock or cutting the higher access portion into a lower frequency binning window. (bin). Therefore, there is a need for a solution that avoids the delay of the hardware multiplex logic gate 908.

在本實施例所提供之微處理器,其提供改良ARM ISA通用暫存器檔案(其餘部分均相同),由於本微處理器簡化在硬體多工邏輯閘中,並基於處理模式輸入以不同的方式選擇合適暫存器,故相較傳統之通用暫存檔案有更佳之存取性能。替代的,本實施例所描述的R8-R14之備份版本係模擬的,而非實際存在於暫存器檔案(此暫存器檔案會直接提供運算元給微處理器之執行單元),故而只有一個單獨之實體暫存器R8-R14存在於暫存器檔案中。更具體的說,該微處理器包含間接儲存器以放置該模擬檔案。在另一實施例中,該間接儲存器係一私有隨機存取記憶體,其包含於該微處理器之記憶體子系統中。為了因應處理模式之切換,硬體暫存器R13-R14之數值(或是R8-R14,若切換至 FIQ模式)係先儲存於間接儲存器中之相關於該舊處理模式之位置,且硬體暫存器R13-R14(或是R8-R14,若切換至FIQ模式)接著在新處理模式中自間接儲存器中之相關位置而回復。此外,在切換至FIQ模式之情況下,R8-R12之內容係儲存至全域間接儲存器,而在從FIQ模式做切換之情況下,其內容係由全域間接儲存器中回復。應注意的是,該儲存與回復之操作係利用該微處理器之微碼進行。因此,隨後之執行單元係自直接暫存器檔案(direct register file)中之R8-R14單一副本,存取相關於新處理模式之數值。是以,從概念上來說,本實施例之優點在於,相對較不頻繁的處裡模式切換係透過一個虛擬多工器執行,而非頻繁透過一實體多工器執行每一暫存器之存取。本實施例之另一優點在於,由於處理模式的切換相對來說較不頻繁,因此用相關於模式切換所造成額外的延遲做代價以獲得其他益處,譬如在缺乏相關硬體多工邏輯閘且基於處理模式輸入的自多個暫存器中選擇之情況下,能更快的暫存器檔案存取等等。 The microprocessor provided in this embodiment provides an improved ARM ISA Universal Scratchpad file (the rest are the same), since the microprocessor is simplified in the hardware multiplex logic gate and is different based on the processing mode input. The way to choose the appropriate register, so it has better access performance than the traditional general temporary file. In addition, the backup version of R8-R14 described in this embodiment is simulated, instead of actually existing in the scratchpad file (this register file directly provides the operation unit to the execution unit of the microprocessor), so only A separate physical register R8-R14 exists in the scratchpad file. More specifically, the microprocessor includes an indirect storage to place the simulated file. In another embodiment, the indirect storage is a private random access memory that is included in a memory subsystem of the microprocessor. In order to respond to the processing mode switching, the value of the hardware register R13-R14 (or R8-R14, if switched to FIQ mode) is stored in the indirect storage in relation to the old processing mode, and the hardware registers R13-R14 (or R8-R14, if switched to FIQ mode) are then in the new processing mode. Reply to the relevant location in the indirect storage. In addition, in the case of switching to the FIQ mode, the contents of R8-R12 are stored to the global indirect storage, and in the case of switching from the FIQ mode, the contents are replied by the global indirect storage. It should be noted that the operation of storing and replying is performed using the microcode of the microprocessor. Thus, the subsequent execution unit is a single copy of R8-R14 from the direct register file, accessing the value associated with the new processing mode. Therefore, conceptually, the advantage of this embodiment is that relatively less frequent intra-mode switching is performed through a virtual multiplexer, rather than frequently executing each temporary storage through a physical multiplexer. take. Another advantage of this embodiment is that since the switching of processing modes is relatively infrequent, additional costs associated with mode switching are used at the expense of other benefits, such as lack of associated hardware multiplex logic gates and Based on the selection of multiple mode registers for processing mode input, faster register file access and the like can be performed.

請參閱第10圖,第10圖係本發明之系統方塊圖,詳細顯示第1圖之微處理器。如先前所述,在實施例中微處理器100之微架構在許多方面係類似於由威盛電子所製造之VIA NanoTM處理器,但其已修改為支援ARM ISA,更具體的說,可模擬ARM ISA之備份暫存器模式。 Please refer to FIG. 10, which is a block diagram of the system of the present invention, showing the microprocessor of FIG. 1 in detail. As previously described, the microprocessor 100 of the micro-architecture is similar in many respects to the system processor VIA Nano TM VIA being fabricated, but has been modified to support embodiments ARM ISA, more particularly, to simulate Backup servlet mode for ARM ISA.

微處理器100包含:如第1圖之暫存器檔案106,在第10圖中係標示為直接儲存器106;多工器1014、1016與1018係耦接於直接儲存器106,以接收直接儲存器106 之輸出;多工器1004、1006與1008係耦接於多工器1014、1016與1018以接收多工器1014、1016與1018之輸出;載入單元416、儲存單元416,以及如第4圖之整數/分支單元、媒體單元與浮點單元412/414/418(在第10圖中稱為ALU單元412/414/418),係分別耦接於多工器1004、1006與1008,以接收多工器1004、1006與1008之輸出;第4圖之重排緩衝器(ROB)422係耦接於載入單元416、儲存單元416以及ALU單元412/414/418,以接收載入單元416、儲存單元416以及ALU單元412/414/418之結果128;以及間接儲存器1002,間接儲存器1002係耦接於重排緩衝器422與多工器1008,用以自重排緩衝器422接收微指令126之結果128,以及將其輸出作為一輸入傳至多工器1008。 The microprocessor 100 includes: a register file 106 as shown in FIG. 1 , which is labeled as a direct storage 106 in FIG. 10; and multiplexers 1014 , 1016 and 1018 are coupled to the direct storage 106 for receiving direct Storage 106 Outputs; multiplexers 1004, 1006, and 1008 are coupled to multiplexers 1014, 1016, and 1018 to receive outputs of multiplexers 1014, 1016, and 1018; load unit 416, storage unit 416, and FIG. The integer/branch unit, media unit and floating point unit 412/414/418 (referred to as ALU unit 412/414/418 in FIG. 10) are respectively coupled to multiplexers 1004, 1006 and 1008 for receiving The output of the multiplexers 1004, 1006, and 1008; the rearrangement buffer (ROB) 422 of FIG. 4 is coupled to the loading unit 416, the storage unit 416, and the ALU unit 412/414/418 to receive the loading unit 416. The storage unit 416 and the result 128 of the ALU unit 412/414/418; and the indirect storage 1002, the indirect storage 1002 is coupled to the rearrangement buffer 422 and the multiplexer 1008 for receiving from the rearrangement buffer 422 The result 128 of the microinstruction 126, and its output is passed to the multiplexer 1008 as an input.

重排緩衝器422保留微指令126之結果128於其之重新命名暫存器(rename registers),直到結果128引退至架構暫存器。每一多工器1014/1016/1018基於相關於微指令126所指定之暫存器位址,以自直接儲存器106中選擇一運算元。每一多工器1004/1006/1008基於指定於微指令126之運算元類型,以自其輸入來源中選擇一運算元。雖然在各執行單元中僅顯示一組運算元多工器對,1014對應1004、1016對1006與1018對1008,需了解的是,一多工器對存在於每一來源運算元與每一執行單元之間。此外,除了分別與多工器1014/1016/1018之輸出耦接之外,多工器1004、1006、1008還耦接每一執行單元以自各執行單元接收結果128,以及儲存於重排緩衝器422中的結果128。此 外,載入單元416亦自多工器1008接收間接儲存器1002之輸出。本發明之優點在於,當處理模式切換時,為了模擬ARM ISA備份暫存器,微處理器100可利用微碼234在直接儲存器106或間接儲存器1002間儲存或回復數值,下面將會對其工作方式作進一步描述。 The reorder buffer 422 retains the result 128 of the microinstruction 126 and renames the rename registers thereto until the result 128 is retired to the architectural register. Each multiplexer 1014/1016/1018 selects an operand from the direct store 106 based on the register address associated with the microinstruction 126. Each multiplexer 1004/1006/1008 is based on an operand type assigned to microinstruction 126 to select an operand from its input source. Although only one set of operand multiplexer pairs is displayed in each execution unit, 1014 corresponds to 1004, 1016 pairs 1006 and 1018 pairs 1008, it is to be understood that a multiplexer pair exists in each source operation unit and each execution. Between units. Moreover, in addition to being coupled to the outputs of the multiplexers 1014/1016/1018, respectively, the multiplexers 1004, 1006, 1008 are coupled to each of the execution units to receive the results 128 from the respective execution units, and are stored in the rearrangement buffer. The result in 422 is 128. this In addition, load unit 416 also receives the output of indirect storage 1002 from multiplexer 1008. An advantage of the present invention is that when processing mode switching, in order to emulate an ARM ISA backup scratchpad, the microprocessor 100 can use the microcode 234 to store or restore values between the direct storage 106 or the indirect storage 1002, as will be The way it works is further described.

如第10圖所示,直接儲存器106包含複數暫存器以儲存資料或運算元,以供ARM R0-R14通用暫存器之運用。雖然駐留在實體暫存器檔案的通用暫存器與CPSR(以及自PC)不同,但直接儲存器106仍包含一用以儲存CPSR之暫存器。在一實施例中,一硬體暫存器檔案包含直接儲存器106。 As shown in FIG. 10, the direct memory 106 includes a plurality of registers to store data or operands for use by the ARM R0-R14 general purpose register. Although the general purpose register residing in the physical scratchpad file is different from the CPSR (and from the PC), the direct storage 106 still contains a register for storing the CPSR. In one embodiment, a hardware scratchpad file contains a direct storage 106.

間接儲存器1002包含R13、R14與SPSR儲存器,其係關連於每一ARM ISA之處理模式,亦即使用者(User)、管理者(SVC)、終止(ABT)、未定義(UND)、IRQ以及FIQ處理模式。此外,間接儲存器1002包含關連於FIQ處理模式之R8-R12儲存器。最後,除了FIQ模式之外,間接儲存器1002包含關連於全域(GLOBAL)之全部處理模式。這些包含在間接儲存器1002中不同儲存器位址之運用將描述於後。 The indirect storage 1002 includes R13, R14 and SPSR storage, which are related to the processing mode of each ARM ISA, that is, User, Manager (SVC), Termination (ABT), Undefined (UND), IRQ and FIQ processing mode. In addition, indirect storage 1002 includes R8-R12 storage associated with the FIQ processing mode. Finally, in addition to the FIQ mode, the indirect storage 1002 contains all processing modes associated with the global domain (GLOBAL). The use of these different memory addresses contained in the indirect storage 1002 will be described later.

在一實施例中,間接儲存器1002包含屬於記憶體子系統108之一私有隨機存取記憶體(PRAM),如先前所述,該PRAM係利用如第2圖之微碼234加以定址,但此一操作對於x86 ISA與ARM ISA程式員係不可見的,也就是說並不存在於ISA系統記憶體位址空間。在2010年2月11日所發佈的美國專利第7,827,390中所描述之PRAM實施 例中,在此將其列入參考。特別是,間接儲存器1002僅可利用載入單元416來加以載入,以及僅可利用儲存單元416來加以儲存。更具體的說,間接儲存器1002僅可由載入單元416所執行之間接儲存器1002之載入微指令126(在此其對應於load_PRAM微指令)、以及由儲存單元416所執行之間接儲存器1002之儲存微指令126(在此其對應於store_PRAM微指令)予以定址。故此,其他的執行單元412/414/418不可載入或寫入間接儲存器1002。該load_PRAM微指令指示載入單元416自間接儲存器1002中之一指定位址載入資料至暫存器檔案106之一特定暫存器,該特定暫存器可為如第10圖所示之一架構暫存器或是可由微碼234存取之一非架構暫存器(也可稱為一臨時暫存器)。相反的,該store_PRAM微指令指令儲存單元416自暫存器檔案106中之一特定暫存器,儲存資料至間接儲存器1002中之一指定位址中。 In one embodiment, the indirect storage 1002 includes a private random access memory (PRAM) belonging to one of the memory subsystems 108. As previously described, the PRAM is addressed using the microcode 234 as shown in FIG. 2, but This operation is invisible to the x86 ISA and ARM ISA programmers, that is, it does not exist in the ISA system memory address space. PRAM implementation as described in U.S. Patent No. 7,827,390, issued Feb. 11, 2010. In the example, it is hereby incorporated by reference. In particular, the indirect storage 1002 can only be loaded using the load unit 416 and can only be stored using the storage unit 416. More specifically, the indirect storage 1002 can only be executed by the load unit 416 by the load micro-instruction 126 of the inter-storage storage 1002 (here, which corresponds to the load_PRAM micro-instruction), and the inter-bank storage executed by the storage unit 416. The store microinstruction 126 of 1002 (here corresponding to the store_PRAM microinstruction) is addressed. Therefore, other execution units 411/414/418 cannot be loaded or written to the indirect storage 1002. The load_PRAM microinstruction instructs the load unit 416 to load data from one of the specified addresses in the indirect storage 1002 to a particular register of the scratchpad file 106, which may be as shown in FIG. An architectural register may be accessed by microcode 234 as one of the non-architected registers (also referred to as a temporary register). Conversely, the store_PRAM microinstruction instruction storage unit 416 stores a data from one of the temporary registers in the scratchpad file 106 to one of the specified addresses in the indirect storage 1002.

請參閱至第11A及11B圖,第11A及11B圖係顯示在本發明第10圖微處理器100之操作流程圖,該流程係始於步驟1102。 Referring to FIGS. 11A and 11B, FIGS. 11A and 11B are flowcharts showing the operation of the microprocessor 100 in FIG. 10 of the present invention, the flow beginning at step 1102.

如步驟1102,硬體指令轉譯器104偵測一自現行處理模式切換至新處理模式之要求,並回應地將進入陷阱而前往如第2圖微碼234中之適當的程式,其係設定用以管理處理模式切換之要求。指令轉譯器104可透過不同的方式以偵測切換處理模式要求,但不設限於以下所述之方法。首先,指令轉譯器104可能遭遇一明確要求切換處理模式的ISA指令124,例如一ARM ISA切換處理狀態指令 (CPS)、管理者呼叫(SVC)指令、安全監視呼叫(SMC)指令或者是移動至特殊暫存器(MSR)。其次,指令轉譯器104可能遭遇一隱含處理模式切換要求之ISA指令124,如一ARM ISA自例外事件返回(RFE)指令、載入多重(自例外事件返回)、SUBS PC、LR或斷點(BKPT)指令。第三,指令轉譯器104可能遭遇一由未定義指令例外事件(Undefined instruction exception)所導致之未定義ISA指令124。第四,指令轉譯器104可能接收到另一單元之微處理器100所發出一遭遇例外事件之信號。舉例而言,指令轉譯器104可能自微處理器100之記憶體子系統(未顯示)中收到一信號,該信號表示有一指令要求一不在存取權限中之存取動作,譬如當微處理器並非處於一特權模式卻請求存取一僅供特權存取之記憶體區塊時,則建立一資料終止例外事件條件(Data Abort exception condition);或者是當一指令被提取(fetched)以及要求執行一無效指令時,指令轉譯器104可能接收到一發生記憶體終止之指示,並建立一預先提取之終止例外事件條件(Prefetch Abort exception condition);或者是指令轉譯器104可能自微處理器100之匯流排介面單元接受到一訊號,該訊號指示要求一中斷操作(IRQ或FIQ)。第五,該指令轉譯器104可能遭遇一用以存取如先前所述之全域組態暫存器122之x86 RDMSR/WRMSR指令124,或者x86 launch-ARM,或者如先前所述之reset-to-ARM指令124。微碼234基於特定模式轉換之種類執行多個動作,譬如準備更新中斷遮罩位元、條件旗標或是在CPSR中的其他位元。此外,在步驟 1114更新直接儲存器106 CPSR之前,微碼234可儲存現行之直接儲存器106 CPSR數值至SPSR在間接暫存器1002中關連於新處理模式的位置。更進一步的說,ARM SIT 224可在進入陷阱至微碼234前執行其他動作。舉例來說在ARM ISA LDM(自例外事件回復)指令124之情況下,ARM SIT 224可發送載入微指令126以要求自記憶體內載入特定之暫存器,接下來進入步驟1104。 In step 1102, the hardware command translator 104 detects a request to switch from the current processing mode to the new processing mode, and responsively enters the trap and proceeds to the appropriate program in the microcode 234 of FIG. 2, which is used for setting. The requirement to manage the processing mode switching. The command translator 104 can detect the switching processing mode requirements in different ways, but is not limited to the methods described below. First, the instruction translator 104 may encounter an ISA instruction 124 that explicitly requires a switch processing mode, such as an ARM ISA switch processing status instruction. (CPS), Manager Call (SVC) command, Security Monitor Call (SMC) command or move to Special Register (MSR). Second, the instruction translator 104 may encounter an ISA instruction 124 that implicitly handles mode switching requirements, such as an ARM ISA self-exception event return (RFE) instruction, load multiple (from exception event return), SUBS PC, LR, or breakpoint ( BKPT) instruction. Third, the instruction translator 104 may encounter an undefined ISA instruction 124 caused by an Undefined instruction exception. Fourth, the instruction translator 104 may receive a signal from the microprocessor 100 of another unit that an exception event has been encountered. For example, the instruction translator 104 may receive a signal from a memory subsystem (not shown) of the microprocessor 100 indicating that an instruction requires an access action that is not in access rights, such as when processing micro-processing When a device is not in a privileged mode but requests access to a privileged access memory block, a Data Abort exception condition is established; or when an instruction is fetched and requested When an invalid instruction is executed, the instruction translator 104 may receive an indication that a memory termination has occurred and establish a prefetching exception condition (Prefetch Abort exception condition); or the instruction translator 104 may be from the microprocessor 100. The bus interface unit receives a signal indicating that an interrupt operation (IRQ or FIQ) is required. Fifth, the instruction translator 104 may encounter an x86 RDMSR/WRMSR instruction 124, or x86 launch-ARM, for accessing the global configuration register 122 as previously described, or reset-to as previously described. -ARM instruction 124. The microcode 234 performs a number of actions based on the type of the particular mode transition, such as preparing to update the interrupt mask bit, the condition flag, or other bits in the CPSR. Also, at the step Prior to 1114 updating the direct memory 106 CPSR, the microcode 234 can store the current direct memory 106 CPSR value to the location of the SPSR in the indirect register 1002 that is associated with the new processing mode. Further, the ARM SIT 224 can perform other actions before entering the trap to the microcode 234. For example, in the case of the ARM ISA LDM (Self-Exception Event Reply) instruction 124, the ARM SIT 224 can send a load micro-instruction 126 to request that a particular scratchpad be loaded from the memory, and then proceeds to step 1104.

在步驟1104中,微碼234判斷在步驟1102中所要求之新處理模式是否與現行處理模式相同,假如相同則流程結束;若不相同則進入步驟1106。 In step 1104, the microcode 234 determines whether the new processing mode required in step 1102 is the same as the current processing mode. If the same, the flow ends; if not, the process proceeds to step 1106.

在步驟1106,微碼234將直接儲存器106之暫存器R13與R14的數值儲存在間接儲存器1002中相關於現行處理模式所對應之位置。舉例而言,假若該現行處理模式係管理者模式,微碼234將直接儲存器106之R13/R14之數值儲存至間接儲存器1002之SVC部分中R13/R14之位置,如第12圖之箭頭(1)所示。而在另一例子中,假若現行處理模式係FIQ模式,微碼234將直接儲存器106之R13/R14數值儲存至間接儲存器1002之FIQ部分之R13/R14之位置,如第12圖之箭頭(5)所示。有利的是,該微碼可包含一store_PRAM微指令126之序列,以自直接儲存器106中儲存數值至間接儲存器1002。接著進入步驟1108。 At step 1106, the microcode 234 stores the values of the registers R13 and R14 of the direct memory 106 in the indirect storage 1002 in relation to the location corresponding to the current processing mode. For example, if the current processing mode is the manager mode, the microcode 234 stores the value of R13/R14 of the direct memory 106 to the location of R13/R14 in the SVC portion of the indirect storage 1002, as indicated by the arrow in FIG. (1) shown. In another example, if the current processing mode is FIQ mode, the microcode 234 stores the R13/R14 value of the direct memory 106 to the R13/R14 position of the FIQ portion of the indirect storage 1002, as indicated by the arrow in FIG. (5) is shown. Advantageously, the microcode can include a sequence of store_PRAM microinstructions 126 to store values from the direct store 106 to the indirect storage 1002. Then proceed to step 1108.

在步驟1108,微碼234判斷現行處理模式是否為FIQ處理模式,若是則進入步驟1112;若否則進入步驟1114。 At step 1108, the microcode 234 determines if the current processing mode is the FIQ processing mode, and if so, proceeds to step 1112; otherwise, proceeds to step 1114.

在步驟1112,微碼234將直接儲存器106之暫存器 R8-R12之數值,儲存至間接儲存器1002中之關連於FIQ模式所對應之位置,如第12圖之箭頭(6)所示。此外,微碼234將間接儲存器1002中相關於全域的非FIQ模式之數值回復至直接儲存器106之暫存器R8-R12中,如第12圖之箭頭(7)所示。有利的是,執行回復之微碼可包含一load_PRAM微指令126之序列,以自間接儲存器1002中載入數值至直接儲存器106。接著進入步驟1114。 At step 1112, the microcode 234 will directly store the register of the memory 106. The value of R8-R12 is stored in the indirect storage 1002 in relation to the position corresponding to the FIQ mode, as indicated by the arrow (6) in Fig. 12. In addition, the microcode 234 returns the value of the non-FIQ mode associated with the global domain in the indirect storage 1002 to the registers R8-R12 of the direct storage 106, as indicated by arrow (7) in FIG. Advantageously, the microcode that performs the reply may include a sequence of load_PRAM microinstructions 126 to load values from the indirect storage 1002 to the direct store 106. Then proceed to step 1114.

在步驟1114中,微碼234將步驟1102中所要求之新處理模式來更新CPSR 106之模式(Mode)位元。CPSR106之寫入更包含對CPSR 106在模式位元旁的其他位元之更新。接著進入步驟1116。 In step 1114, the microcode 234 updates the mode bit of the CPSR 106 with the new processing mode required in step 1102. The writing of CPSR 106 further includes updates to other bits of CPSR 106 next to the mode bits. Then proceed to step 1116.

在步驟1116中,微碼234將間接儲存器1002中關連於新處理模式之相對應位置的數值,回復至直接儲存器106之R13與R14暫存器中。舉例而言,若新處理模式係為FIQ模式,微碼234將間接儲存器1002之FIQ部分的R13/R14位置之數值回復至直接儲存器106之R13/R14,如第12圖之箭頭(2)所示。舉例而言,假若新處理模式係UND模式,微碼234將間接儲存器之UND部分的R13/R14位置之數值回復至直接儲存器106之R13/R14,如第12圖之箭頭(8)所示。接著進入步驟1118。 In step 1116, the microcode 234 returns the value of the indirect storage 1002 associated with the corresponding location of the new processing mode to the R13 and R14 registers of the direct storage 106. For example, if the new processing mode is FIQ mode, the microcode 234 returns the value of the R13/R14 position of the FIQ portion of the indirect storage 1002 to the R13/R14 of the direct storage 106, as indicated by the arrow in FIG. ) shown. For example, if the new processing mode is the UND mode, the microcode 234 returns the value of the R13/R14 position of the UND portion of the indirect storage to the R13/R14 of the direct storage 106, as indicated by the arrow (8) in FIG. Show. Then proceed to step 1118.

在步驟1118,微碼234判斷該新處理模式是否為FIQ模式,若是則進入步驟1122;若否則進入步驟1124。 At step 1118, the microcode 234 determines if the new processing mode is FIQ mode, and if so, proceeds to step 1122; otherwise, proceeds to step 1124.

在步驟1122,微碼234將直接儲存器106之R8-R12暫存器之數值,儲存至間接儲存器1002中關連於全域的非FIQ模式所對應之位置,如第12圖之箭頭(3)所示。此外, 微碼234自間接儲存器1002中關連於FIQ模式之相對應位置數值,回復至直接儲存器106之R8-R12暫存器,如第12圖之箭頭(4)所示,接著進入步驟1124。 At step 1122, the microcode 234 stores the value of the R8-R12 register of the direct memory 106 to a location in the indirect storage 1002 that is associated with the non-FIQ mode of the global domain, as indicated by arrow (3) in FIG. Shown. In addition, The microcode 234 returns from the corresponding position value of the FIQ mode in the indirect storage 1002 to the R8-R12 register of the direct storage 106, as indicated by the arrow (4) in Fig. 12, and proceeds to step 1124.

在步驟1124中,微碼234執行更多基於特定模式切換類型之動作,舉例來說,若在一例外事件發生後,微碼234將一更新過之數值填入直接儲存器106之R14暫存器(也就是LR暫存器)中,其中該更新過之數值係依據ARM手冊中第B1-34與第B1-35頁中之表B1-4,隨後再跳躍至典型之例外事件管理程序,亦即將控制權還給ARM ISA程式。流程結束於步驟1124。 In step 1124, the microcode 234 performs more actions based on the particular mode switch type. For example, if an exception event occurs, the microcode 234 fills an updated value into the R14 temporary storage of the direct memory 106. In the device (that is, the LR register), the updated value is based on the B1-3 in the ARM manual and the table B1-4 in the B1-35 page, and then jump to the typical exception event management program. Control is also returned to the ARM ISA program. The process ends at step 1124.

可從第12圖中觀察到,即使執行一自第一處理模式(譬如SVC)至FIQ模式之切換,接著在沒有立即回復至該第一處理模式即切換至第三處理模式(譬如UND)之情況下,使用該全域間接儲存器1002之位置的優點在於仍可使微處理器100在直接儲存器106之R8-R12暫存器中保持正確的數值,從而模擬ARM ISA備份暫存器。 It can be observed from Fig. 12 that even if a switching from the first processing mode (e.g., SVC) to the FIQ mode is performed, then switching to the third processing mode (e.g., UND) is performed without immediately returning to the first processing mode. In this case, the advantage of using the location of the global indirect storage 1002 is that the microprocessor 100 can still maintain the correct value in the R8-R12 register of the direct storage 106, thereby emulating the ARM ISA backup register.

從前述內容可知,一種用以將ARM ISA備份暫存器之模擬的構思藍圖如下所述。當微處理器100切換至一個新處理模式時,微處理器100將正確之數值存放至直接儲存器106中,其為習知ARM處理器中新處理模式之備份暫存器。舉例而言,在切換至FIQ模式後,直接儲存器106的R0-R14暫存器具有在習知ARM處理器的R0_usr-R7_usr以及R8_fiq-R14_fiq之內容。因此,FIQ處理模式之運算元可直接由直接儲存器106中供給ALU單元412/414/418,以使在FIQ模式下之微處理器100(亦即FIQ 例外事件管理程序指令)可執行轉譯自ARM ISA資料處理指令124之微指令126,。在另一個例子中,在切換至UND模式後,直接儲存器106的R0-R14暫存器將具有習知ARM處理器的R0_usr-R12_usr以及R13_und-R14_und之內容,因此,UND處理模式之運算元可直接由直接儲存器106中供給ALU單元412/414/418,以使在UND模式下之微處理器100可執行轉譯自ARM ISA資料處理指令124之微指令126。為了達成此一功效,該微碼將直接儲存器中合適的現有數值儲存至間接儲存器1002中所規劃之位置(以便在隨後之模式切換時可將其回復),並且自間接儲存器1002中其他規劃之位置中回復先前所儲存之數值至直接儲存器106。一般而言,可透過儲存直接儲存器106的R13與R14中現行或是舊的數值至間接儲存器1002中舊的處理模式之位置,並且自間接儲存器1002中新處理模式之位置回復至直接儲存器106的R13與R14。然而,在切換至FIQ模式或是自FIQ模式中切換出來時,有著更多處理要求。當自模式X切換至FIQ模式並隨後自FIQ模式切換至模式Y時,直接儲存器106之R8-R12暫存器中的數值必須與在模式Y中時相同,雖然他們均切換自模式X,且模式X可能與模式Y有著不同數值。因此在此一情況下,間接儲存器1002中之全域位置係有利於自直接儲存器106的R8-R16暫存器中儲存與回復數值。 As can be seen from the foregoing, a blueprint for the simulation of the ARM ISA backup register is as follows. When the microprocessor 100 switches to a new processing mode, the microprocessor 100 stores the correct value in the direct memory 106, which is a backup register for the new processing mode in the conventional ARM processor. For example, after switching to the FIQ mode, the R0-R14 register of the direct memory 106 has the contents of R0_usr-R7_usr and R8_fiq-R14_fiq of the conventional ARM processor. Therefore, the arithmetic elements of the FIQ processing mode can be directly supplied to the ALU unit 412/414/418 from the direct memory 106 to enable the microprocessor 100 (i.e., FIQ) in the FIQ mode. The exception event manager command) can execute microinstructions 126 that are translated from the ARM ISA data processing instructions 124. In another example, after switching to the UND mode, the R0-R14 register of the direct memory 106 will have the contents of the R0_usr-R12_usr and R13_und-R14_und of the conventional ARM processor, and therefore, the operand of the UND processing mode The ALU unit 412/414/418 can be supplied directly from the direct storage 106 such that the microprocessor 100 in UND mode can execute the microinstructions 126 that are translated from the ARM ISA data processing instructions 124. In order to achieve this effect, the microcode stores the appropriate existing values in the direct memory to the location planned in the indirect storage 1002 (to be replied upon subsequent mode switching) and from the indirect storage 1002. The previously stored values are returned to the direct storage 106 in other planned locations. In general, the current or old values in R13 and R14 of the direct storage 106 can be stored to the position of the old processing mode in the indirect storage 1002, and the position of the new processing mode in the indirect storage 1002 is restored to the direct R13 and R14 of the reservoir 106. However, there are more processing requirements when switching to FIQ mode or switching from FIQ mode. When switching from mode X to FIQ mode and then switching from FIQ mode to mode Y, the value in the R8-R12 register of direct memory 106 must be the same as in mode Y, although they all switch from mode X, And mode X may have a different value than mode Y. Thus, in this case, the global location in the indirect storage 1002 facilitates storing and recovering values from the R8-R16 registers of the direct storage 106.

從前述內容更可得知,在此所描述的模擬備份暫存器可能在切換處理模式時,由於係利用微碼將數值在直接儲存器106與間接儲存器1002間儲存與回復,相較傳統的設 計方式將導致些微的額外負荷。然而,此潛在額外負擔所產生之潛在優勢,可使直接儲存器106相較傳統設計有著更快的存取。這係因為在此所述的實施例中,可避免在傳統設計中由於硬體多工器必須考慮處理模式對於相對較不頻繁備份暫存器的使用,所導致之額外傳送延遲。由於硬體多工器係典型的位於重要的時序路程中,使得硬體多工器加速運行將有利於時脈之提昇,因此這係十分重要的。此外,在直接儲存器106中之暫存器數量將少於傳統設計,其可減少存取直接儲存器106的時間。此外,實施例中之另一優點為,其僅需對現存之微架構進行相對些微之修改即可支援ARM ISA備份暫存器。更進一步的,實施例之另一優點在於,其係可減輕RAT106中之相依檢查器(dependency checker)在區分處理模式間之不同時的負擔。另一優點在於,其亦可減少暫存器更名表之大小,或者是避免在部分處理模式切換中要求序列化(如更新管線,即RAT與ROB)。最後,實施例之另一優點在於,因為切換係利用微碼實施而非硬體上之切換,故可增加切換一架構至ARM ISA備份暫存器等事件的彈性。總結地說,在此所描述之實施例,雖然可能增加處理模式切換所需之時間,但相對而言模式切換係較不頻繁的,並可據此換取在一般情況下提供更高的效能表現,其中,在此所述之一般情況係指為獲得ALU運算元之主要暫存器之存取。 As can be seen from the foregoing, the analog backup register described herein may be stored and replied between the direct storage 106 and the indirect storage 1002 by using microcode in the switching processing mode. Design The metering method will result in a slight extra load. However, the potential advantages of this potential additional burden allow the direct storage 106 to have faster access than conventional designs. This is because, in the embodiments described herein, additional transfer delays due to the use of processing modes for relatively less frequent backup registers must be avoided in conventional designs due to the hardware multiplexer. Since the hardware multiplexer is typically located in an important timing path, it is important that the hardware multiplexer accelerates the operation to facilitate the clock. Moreover, the number of registers in direct storage 106 will be less than conventional designs, which can reduce the time to access direct storage 106. In addition, another advantage of the embodiment is that it only needs to make minor modifications to the existing micro-architecture to support the ARM ISA backup register. Still further, another advantage of the embodiment is that it reduces the burden of the dependency checker in the RAT 106 when distinguishing between processing modes. Another advantage is that it can also reduce the size of the register rename table, or avoid serialization (such as update pipelines, ie RAT and ROB) in partial processing mode switching. Finally, another advantage of the embodiment is that the flexibility of switching an architecture to an ARM ISA backup register can be increased because the switching utilizes microcode implementation rather than hardware switching. In summary, the embodiments described herein, although it is possible to increase the time required for processing mode switching, relatively mode switching is relatively infrequent, and can be exchanged for higher performance in general. Wherein, the general case described herein refers to accessing the primary register for obtaining an ALU operand.

雖然前述之實施例中,微碼係執行將數值在直接儲存器與間接儲存器之間的儲存與回復功能,在其他實施例中係利用具有硬體組合邏輯閘之微處理器,以執行回應處理 模式切換所需之將數值在直接儲存器與間接儲存器之間之儲存與回復功能,而非利用微碼執行之。更進一步的說,雖然在前述之實施例中,用以儲存舊的處理模式數值之間接儲存器為PRAM,在其他實施例中係利用硬體暫存器作為間接儲存器,但其係不可由ALU單元直接存取之。再更進一步的說,雖然前述之實施例係關於ARM ISA,在其他實施例中係應用於其他關連於不同處理模式之特定備份暫存器的ISA。 Although in the foregoing embodiments, the microcode system performs a storage and reply function between the direct storage and the indirect storage, in other embodiments, a microprocessor having a hardware combined logic gate is used to perform the response. deal with The mode switching requires the storage and reply functions between the direct storage and the indirect storage instead of using microcode. Further, although in the foregoing embodiments, the storage device for storing the old processing mode value is a PRAM, in other embodiments, the hardware temporary storage device is used as an indirect storage, but the system cannot be used. The ALU unit directly accesses it. Still further, while the foregoing embodiments are directed to the ARM ISA, in other embodiments are applied to other ISAs associated with particular backup registers of different processing modes.

載入多重/儲存多重ARM ISA指令Load Multiple/Store Multiple ARM ISA Instructions

另一個關於ARM ISA之特徵係載入多重(LDM)與儲存多重(STM)指令。載入多重指令係自記憶體中載入每一指定於指令之通用暫存器,如ARM手冊中第A8-110至A8-116頁中所述。相反地,STM指令自每一指定於指令之通用暫存器中儲存至記憶體,如ARM手冊中第A8-374頁至A8-381頁中所述。在此說述之實施例,其係如前述的微處理器100之超純量非循序執行微架構上實行LDM指令與STM指令。更具體而言,ARM ISA指定自例外事件模式存取架構使用者模式暫存器之LDM指令與STM指令之版本(亦即當微處理器100並非處於使用者模式下時)。這些指令版本係對應LDM(使用者暫存器)指令與STM(使用者暫存器)指令,如ARM手冊中第B6-7頁至第B6-8頁以及第B6-22頁至第B6-23中所述。在此所述之實施例中,其係在微處理器100之微架構上實行LDM(使用者暫存器)指令與STM(使用者暫存器)指令,微處理器100 之微架構包含用以模擬前述之備份暫存器之間接儲存器1002。 Another feature of the ARM ISA is the Load Multiple (LDM) and Store Multiple (STM) instructions. Loading multiple instructions loads each of the general-purpose registers specified in the instruction from the memory, as described in pages A8-110 through A8-116 of the ARM manual. Conversely, STM instructions are stored in memory from each of the general-purpose registers assigned to the instructions, as described in pages A8-374 through A8-381 of the ARM manual. The embodiment described herein implements the LDM instruction and the STM instruction on the super-scaling non-sequential execution micro-architecture of the microprocessor 100 as described above. More specifically, the ARM ISA specifies the version of the LDM instruction and STM instruction from the exception event mode access architecture user mode register (ie, when the microprocessor 100 is not in user mode). These instruction versions correspond to LDM (User Scratchpad) instructions and STM (User Scratchpad) instructions, such as pages B6-7 to B6-8 and B6-22 to B6- in the ARM manual. Said in 23. In the embodiment described herein, the LDM (User Scratch) command and the STM (User Scratch) command are executed on the micro-architecture of the microprocessor 100, and the microprocessor 100 The micro-architecture includes an inter-reservoir storage 1002 for simulating the aforementioned backup register.

請參閱至第13A及13B圖,其係顯示在本發明中第1圖之微處理器100執行一LDM指令之流程圖,該流程係始於步驟1302。 Please refer to FIGS. 13A and 13B, which are flowcharts showing the execution of an LDM instruction by the microprocessor 100 of FIG. 1 in the present invention, starting from step 1302.

在步驟1302中,如第2圖之軟體指令轉譯器204接收到一LDM指令124。尤其是,指令模式指標132指示ARM ISA以及第2圖之ARM SIT 224對LDM指令124解碼。LDM指令124係指定一組用以載入資料之通用暫存器,以及將被載入資料之連續記憶體位址。此外,LDM指令124係指定該指令為LDM(使用者暫存器)指令124。接著進入步驟1304。 In step 1302, the software instruction translator 204 of FIG. 2 receives an LDM instruction 124. In particular, the instruction mode indicator 132 indicates that the ARM ISA and the ARM SIT 224 of FIG. 2 decode the LDM instruction 124. The LDM instruction 124 specifies a set of general purpose registers for loading data and a contiguous memory address to be loaded into the data. In addition, the LDM instruction 124 specifies that the instruction is an LDM (User Scratch) instruction 124. Then proceed to step 1304.

在步驟1304中,ARM SIT 224考慮指定於LDM指令124之次一(或第一)暫存器,接著進入步驟1306。 In step 1304, ARM SIT 224 considers the next (or first) register assigned to LDM instruction 124, and proceeds to step 1306.

在步驟1306中,ARM SIT 224判斷指令124是否為LDM(使用者暫存器)指令124,若是,則進入步驟1312;若否,則進入步驟1308。 In step 1306, ARM SIT 224 determines if instruction 124 is an LDM (user register) instruction 124, and if so, proceeds to step 1312; if not, proceeds to step 1308.

在步驟1308,ARM SIT 224發出載入微指令126以自指定於LDM指令124之記憶體內中的次一(或第一)位置載入資料,並送至如第10圖之直接儲存器106的特定暫存器(其係於步驟1306被考慮)。載入微指令126將會送往執行管線112而被載入單元416所執行。接著進入步驟1318。 At step 1308, the ARM SIT 224 issues a load microinstruction 126 to load data from the next (or first) location in the memory designated by the LDM instruction 124 and to the direct storage 106 as in FIG. A particular register (which is considered in step 1306). The load microinstruction 126 will be sent to the execution pipeline 112 and executed by the load unit 416. Then proceed to step 1318.

在步驟1312,ARM SIT 224判斷暫存器是否為R8-R12其中之一種,以及現行處理模式是否為FIQ模式。若是,進入步驟1314;若否,則進入步驟1316。 At step 1312, the ARM SIT 224 determines if the scratchpad is one of R8-R12 and if the current processing mode is FIQ mode. If yes, go to step 1314; if no, go to step 1316.

在步驟1314,ARM SIT 224發出載入微指令126以自指定於LDM指令124之記憶體內中的次一(或第一)位置載入資料,並送至非架構的、或是臨時的直接儲存器106之暫存器。載入微指令126將送往執行管線112而被載入單元416所執行,如後述之步驟1324,資料將會持續的自臨時暫存器中,儲存至間接儲存器1002。接著進入步驟1318。 At step 1314, the ARM SIT 224 issues a load microinstruction 126 to load data from the next (or first) location in the memory specified by the LDM instruction 124 and to the non-architected, or temporary, direct storage. The register of the device 106. The load microinstruction 126 will be sent to the execution pipeline 112 and executed by the load unit 416. As will be described later, step 1324, the data will continue to be stored in the temporary scratchpad from the temporary scratchpad 1002. Then proceed to step 1318.

在步驟1316,ARM SIT 224判斷暫存器是否為R13或是R14暫存器,若是,則進入步驟1314;若否,則進入步驟1308。 At step 1316, the ARM SIT 224 determines if the register is an R13 or R14 register, and if so, proceeds to step 1314; if not, proceeds to step 1308.

在步驟1318,ARM SIT 224判斷是否有其他指定於LDM指令124之暫存器尚未考慮,亦即硬體指令轉譯器104尚未發送之相關微指令126。若尚有其他暫存器時,則回到步驟1304以考慮指定於LDM指令124之次一暫存器;若否,則進入步驟1322。 At step 1318, the ARM SIT 224 determines if there are other registers associated with the LDM instruction 124 that have not been considered, i.e., the associated microinstructions 126 that the hardware instruction translator 104 has not sent. If there are other registers, then return to step 1304 to consider the next register designated by the LDM instruction 124; if not, proceed to step 1322.

在步驟1322,ARM SIT 224判斷在步驟1314中是否有發送任何微指令126載入資料至臨時暫存器106,若有,則進入步驟1324;若否,則流程結束。 At step 1322, ARM SIT 224 determines if any microinstructions 126 have been sent to the temporary registers 106 in step 1314, and if so, proceeds to step 1324; if not, the flow ends.

在步驟1324,SIT 204轉移控制權至第2圖之複雜指令轉譯器(CIT)206,CIT206係基於微碼234以產生store_PRAM微指令126,用以於將步驟1314中所載入之資料,自臨時暫存器106中儲存至間接儲存器1002中之合適位置。更具體而言,在間接儲存器1002中之合適位置係指關連於使用者模式之R13與R14位置,以及全域性關連於非FIQ處理模式之R8-R12位置。儲存微指令126將送往執行管線112而被儲存單元416所執行,且流程結束於 步驟1324。 At step 1324, SIT 204 transfers control to complex instruction translator (CIT) 206 of FIG. 2, which is based on microcode 234 to generate store_PRAM microinstructions 126 for use in loading the data loaded in step 1314. The temporary register 106 is stored in a suitable location in the indirect storage 1002. More specifically, the appropriate locations in the indirect storage 1002 refer to the R13 and R14 locations associated with the user mode, and the R8-R12 locations that are globally related to the non-FIQ processing mode. The store microinstruction 126 will be sent to the execution pipeline 112 and executed by the storage unit 416, and the process ends. Step 1324.

請參閱至第14A及14B圖,其顯示本發明第1圖之微處理器100執行一LDM指令之另一流程圖,在第14A及14B圖中許多步驟類似於第13A及13B圖之步驟,且具有相同之標號。然而,在第14A及14B圖中,若於步驟1318中,ARM SIT 224判斷並無其他暫存器待考慮,則流程結束;故此,在第14A及14B圖之流程中係不具有步驟1322與步驟1324。此外,係有自步驟1314進入之新步驟1424,以及自新步驟1424進入步驟1318之流程。 Please refer to FIGS. 14A and 14B, which show another flow chart of the microprocessor 100 of FIG. 1 for executing an LDM instruction. In steps 14A and 14B, many steps are similar to the steps of FIGS. 13A and 13B. And have the same label. However, in the 14A and 14B diagrams, if the ARM SIT 224 determines in step 1318 that there are no other registers to be considered, the flow ends; therefore, in the flow of the 14A and 14B processes, there is no step 1322 and Step 1324. In addition, there is a new step 1424 from step 1314, and a flow from step 1418 to step 1318.

在步驟1424中,ARM SIT 224發送store_PRAM微指令126,以將在步驟1314中所載入之資料自臨時暫存器106儲存至間接儲存器1002中之合適位置。 In step 1424, the ARM SIT 224 sends a store_PRAM microinstruction 126 to store the data loaded in step 1314 from the temporary scratchpad 106 to a suitable location in the indirect storage 1002.

從第14A及14B圖中可知,本實施例中之優點在於LDM(使用者暫存器)微指令之執行並不需要將控制權轉移至微碼234。而缺點則在於其增加了ARM SIT224之複雜度。具體而言,在ARM SIT 224必須發送store_PRAM微指令126的前提之下,ARM SIT 224必須知道關於間接儲存器1002中之合適位置,以及資料必須被儲存至該處之相關資訊,因此與第13A及13B圖之實施例有所不同。 As can be seen from Figures 14A and 14B, an advantage in this embodiment is that the execution of the LDM (User Scratchpad) microinstruction does not require the transfer of control to the microcode 234. The downside is that it adds to the complexity of the ARM SIT224. In particular, under the premise that the ARM SIT 224 must send the store_PRAM microinstruction 126, the ARM SIT 224 must know about the appropriate location in the indirect storage 1002, and the information that the data must be stored there, and therefore with the 13A The embodiment of Figure 13B differs.

請參閱第15A及15B圖,其顯示本發明中第1圖之微處理器100執行一STM指令之流程圖,該流程係始於步驟1502。 Referring to Figures 15A and 15B, there is shown a flow chart of the microprocessor 100 of Figure 1 of the present invention executing an STM instruction beginning at step 1502.

在步驟1302中,如第2圖之軟體指令轉譯器204接收到一STM指令124。尤其是,指令模式指標132指示ARM ISA而第2圖之ARM SIT 224對STM指令124進行 解碼。STM指令124係指定用以儲存之通用暫存器以及將儲存資料的連續記憶體位址。此外,STM指令124係指定該指令為STM(使用者暫存器)指令124。接著進入步驟1504。 In step 1302, the software instruction translator 204 of FIG. 2 receives an STM instruction 124. In particular, the command mode indicator 132 indicates the ARM ISA and the ARM SIT 224 of FIG. 2 performs the STM instruction 124. decoding. The STM instruction 124 specifies the general purpose register to store and the contiguous memory address where the data will be stored. In addition, the STM instruction 124 specifies that the instruction is an STM (user register) instruction 124. Then proceed to step 1504.

在步驟1504中,ARM SIT 224考慮指定於STM指令124之次一(或第一)暫存器,接著進入步驟1506。 In step 1504, ARM SIT 224 considers the next (or first) register assigned to STM instruction 124, and proceeds to step 1506.

在步驟1506中,ARM SIT 224判斷指令124是否為SDM(使用者暫存器)指令124,若是,則進入步驟1512;若否,則進入步驟1508。 In step 1506, ARM SIT 224 determines if instruction 124 is an SDM (user register) instruction 124, and if so, proceeds to step 1512; if not, proceeds to step 1508.

在步驟1508,ARM SIT 224發出儲存微指令126以將資料自如第10圖之直接儲存器106的特定暫存器中,儲存至指定於STM指令124之記憶體中的次一(或第一)位置(其係已考慮於步驟1504中)。儲存微指令126將會送往執行管線112並被儲存單元416所執行。接著進入步驟1518。 At step 1508, the ARM SIT 224 issues a store microinstruction 126 to store the data from the particular scratchpad of the direct store 106 of FIG. 10 to the next (or first) of the memory designated for the STM instruction 124. Location (which has been considered in step 1504). The store microinstruction 126 will be sent to the execution pipeline 112 and executed by the storage unit 416. Then proceed to step 1518.

在步驟1512,ARM SIT 224判斷暫存器是否為R8-R12其中之一種,以及現行處理模式是否為FIQ模式。若是,進入步驟1514;若否,則進入步驟1516。 At step 1512, the ARM SIT 224 determines if the scratchpad is one of R8-R12 and if the current processing mode is FIQ mode. If yes, go to step 1514; if no, go to step 1516.

在步驟1514,ARM SIT 224略過此特定暫存器,並隨後於步驟1524中之微碼234處理之,接著進入步驟1518。 At step 1514, ARM SIT 224 skips the particular register and then processes it at microcode 234 in step 1524, and proceeds to step 1518.

在步驟1516,ARM SIT 224判斷暫存器是否為R13或是R14暫存器,若是,則進入步驟1514;若否,則進入步驟1508。 At step 1516, the ARM SIT 224 determines if the register is an R13 or R14 register, and if so, proceeds to step 1514; if not, proceeds to step 1508.

在步驟1518,ARM SIT 224判斷是否有其他指定於STM指令124之暫存器尚未考慮,亦即硬體指令轉譯器104尚未發送關連之微指令126(或於步驟1514中略過)。若尚 有其他暫存器時,則回到步驟1504以考慮指定於STM指令124之次一暫存器;若否,則進入步驟1522。 At step 1518, the ARM SIT 224 determines if there are other registers designated for the STM instruction 124 that have not been considered, i.e., the hardware instruction translator 104 has not sent the associated microinstruction 126 (or skipped in step 1514). If still If there are other registers, then return to step 1504 to consider the next register designated by the STM instruction 124; if not, proceed to step 1522.

在步驟1522,ARM SIT 224判斷是否有任何暫存器於步驟1514中被略過,若有,則進入步驟1524;若否,則流程結束。 At step 1522, the ARM SIT 224 determines if any of the registers are skipped in step 1514, and if so, proceeds to step 1524; if not, the flow ends.

步驟1524,SIT 204轉移控制權至第2圖之複雜指令轉譯器(CIT)206,CIT 206係基於微碼234以對步驟1514所略過之每一暫存器產生一微指令126對(pair)。具體而言,微指令126對包含伴隨一儲存微指令126之載入微指令load_PRAM微指令126,load_PRAM微指令126自間接儲存器1002中之合適位置載入資料,至一非架構,或臨時之直接儲存器106的暫存器。儲存微指令126將臨時暫存器之資料儲存至記憶體內指定於STM指令124之位置。更具體而言,在間接儲存器1002中之合適位置係指關連於使用者模式之R13與R14位置,以及關連於全域性非FIQ處理模式之R8-R12位置。load_PRAM與儲存微指令126將會送往執行管線112而分別被儲存單元416與載入單元416所執行,且流程結束於步驟1524。 In step 1524, SIT 204 transfers control to complex instruction translator (CIT) 206 of FIG. 2, which is based on microcode 234 to generate a microinstruction 126 pair (pair) for each register skipped by step 1514. ). Specifically, the microinstruction 126 loads the micro-instruction load_PRAM microinstruction 126 with a stored microinstruction 126, the load_PRAM microinstruction 126 loads the data from the appropriate location in the indirect storage 1002, to a non-architectural, or temporary The scratchpad of the direct storage 106. The store microinstruction 126 stores the data of the temporary scratchpad to a location in the memory designated by the STM instruction 124. More specifically, the appropriate locations in the indirect storage 1002 refer to the R13 and R14 locations associated with the user mode and the R8-R12 locations associated with the global non-FIQ processing mode. The load_PRAM and store microinstructions 126 will be sent to the execution pipeline 112 and executed by the storage unit 416 and the load unit 416, respectively, and the process ends at step 1524.

請參閱至第16A及16B圖,其係顯示本發明第1圖之微處理器100執行一STM指令之另一流程圖,在第16A及16B圖中許多步驟類似於第15A及15B圖之步驟,且具有相同之標號。然而,在第16A及16B圖中,若於步驟1518中,ARM SIT 224判斷並無其他暫存器待考慮則流程結束;故此,在第16A及16B圖之流程中係不具有步驟1522與步驟1524。此外,在步驟1512與1516判斷為”是” 的流程後具有新的流程,其係進入新步驟1624,以及自新步驟1624至新步驟1614,與自新步驟1624至步驟1518。 Please refer to FIGS. 16A and 16B, which are another flow chart showing the execution of an STM instruction by the microprocessor 100 of FIG. 1 of the present invention. In steps 16A and 16B, many steps are similar to the steps of FIGS. 15A and 15B. And have the same reference numerals. However, in the 16A and 16B diagrams, if the ARM SIT 224 determines in step 1518 that there are no other registers to be considered, the flow ends; therefore, in the flow of the 16A and 16B processes, there are no steps 1522 and steps. 1524. Further, it is judged as "Yes" at steps 1512 and 1516. The process has a new process, which proceeds to a new step 1624, and from a new step 1624 to a new step 1614, and a new step 1624 to step 1518.

在步驟1624中,ARM SIT 224發送load_PRAM微指令126,以自間接儲存器1002中之合適位置載入資料至臨時暫存器106,接著進入步驟1614。 In step 1624, the ARM SIT 224 sends a load_PRAM microinstruction 126 to load data from the appropriate location in the indirect storage 1002 to the temporary scratchpad 106, and then proceeds to step 1614.

在步驟1614中,ARM SIT 224發送儲存微指令126,以將在臨時暫存器106中,已於步驟1624所載入之資料,儲存至記憶體內指定於STM指令124之次一(或是第一)位置,接著進入步驟1518。 In step 1614, the ARM SIT 224 sends a store microinstruction 126 to store the data that has been loaded in the temporary register 106 in step 1624 to the next one of the STM instructions 124 in the memory (or a) Position, then proceeds to step 1518.

從第16A及16B圖中可知,在本實施例中之優點在於,STM(使用者暫存器)微指令之執行並不需要將控制權轉移至微碼234,而缺點則在於其增加了ARM SIT224之複雜度。具體而言,在ARM SIT 224必須發送載入微指令126/store_PRAM微指令126的前提之下,ARM SIT 224必須知道關於間接儲存器1002中之合適位置,以及資料必須被儲存至該處之相關資訊,因此與第15A及15B圖之實施例有所不同。 As can be seen from Figures 16A and 16B, the advantage in this embodiment is that the execution of the STM (User Scratchpad) microinstruction does not require the transfer of control to the microcode 234, but the disadvantage is that it adds ARM. The complexity of the SIT224. In particular, under the premise that the ARM SIT 224 must send the load microinstruction 126/store_PRAM microinstruction 126, the ARM SIT 224 must know about the appropriate location in the indirect storage 1002 and the information to which the data must be stored. The information is therefore different from the embodiment of Figures 15A and 15B.

如先前所述,ARM SIT 224其優點在於包含一狀態機器,以在多重之時脈週期中,發送多重微指令126來實行ISA指令124。 As previously described, the ARM SIT 224 has the advantage of including a state machine to transmit multiple microinstructions 126 to implement the ISA instructions 124 during multiple clock cycles.

ARM ISA也包含一儲存回復狀態(SRS)指令124,SRS指令124係將現行處理模式之LR與SPSR暫存器儲存於由SRS指令124所指定的目標處理模式之記憶體堆疊中,其中SRS指令124係可與現行處理模式不同。因此,SRS指令124需要微處理器100以載入目標處理模式之架構SP 暫存器的數值,以便存取其記憶體堆疊。在一實施例中,當ARM SIT 224解碼一ARM ISA SRS指令124,其產生一load_PRAM微指令126,以自間接儲存器1002之目標模式部分的R13位置中載入目標模式之SP數值,並送至直接儲存器106之臨時暫存器,以存取目標模式之記憶體堆疊。 The ARM ISA also includes a store reply status (SRS) instruction 124 that stores the LR and SPSR registers of the current processing mode in a memory stack of the target processing mode specified by the SRS instruction 124, where the SRS instruction The 124 Series can be different from the current processing mode. Therefore, the SRS instruction 124 requires the microprocessor 100 to load the target processing mode of the architecture SP. The value of the scratchpad to access its memory stack. In one embodiment, when the ARM SIT 224 decodes an ARM ISA SRS instruction 124, it generates a load_PRAM microinstruction 126 to load the SP value of the target mode from the R13 position of the target mode portion of the indirect storage 1002 and send To the temporary register of the direct memory 106 to access the memory stack of the target mode.

然而各種有關於本發明之實施例已在本文詳述,應可充分了解如何實施並且不限於這些實施方式。舉凡所屬技術領域中具有通常知識者當可依據本發明之上述實施例說明而作其它種種之改良及變化。舉例來說,軟體可以啟動如功能、製造、模型、模擬、描述及/或測試本文所述之裝置及方法。可以藉由一般程式語言(如C及C++)、硬體描述語言(Hardware Description Languages;HDL)或其他可用程式的使用來達成,其中硬體描述語言(Hardware Description languages;HDL)包含Verilog HDL、VHDL等硬體描述語言。這樣的軟體能在任何所知的計算機可用媒介中處理執行,例如磁帶、半導體、磁碟或光碟(如CD-ROM及DVD-ROM等)、網路、有線電纜、無線網路或其他通訊媒介。本文所述之裝置及方法的實施例中,可包含在智慧型核心半導體內,並且轉換為積體電路產品的硬體,其中智慧型核心半導體如微處理器核心(如硬體描述語言內之實施或設定)。此外,本文所述之裝置及方法可由硬體及軟體的結合來實施。因此,本發明並不侷限於任何本發明所述之實施例,但係根據下述之專利範圍及等效之專利範圍而定義。具體來說,本發明能在普遍使用的微處理器裝置裡執行實施。最後,熟練於本技術領域的應能體會他們 能很快地以本文所揭露的觀念及具體的實施例為基礎,並且在沒有背離本發明所述之附屬項範圍下,來設計或修正其他結構而實行與本發明之同樣目的。 However, various embodiments of the present invention have been described in detail herein, and it should be fully understood how to implement and not be limited to these embodiments. Various other modifications and changes can be made by those skilled in the art in the light of the above-described embodiments of the invention. For example, the software can initiate devices and methods as described herein, such as function, manufacture, model, simulation, description, and/or testing. This can be achieved by using general programming languages (such as C and C++), Hardware Description Languages (HDL), or other available programs. Hardware Description languages (HDL) include Verilog HDL, VHDL. And other hardware description languages. Such software can be executed in any known computer usable medium, such as tape, semiconductor, disk or optical disc (such as CD-ROM and DVD-ROM), network, cable, wireless network or other communication medium. . Embodiments of the apparatus and method described herein may be included in a smart core semiconductor and converted into hardware of an integrated circuit product, such as a microprocessor core (such as in a hardware description language) Implementation or setting). Furthermore, the devices and methods described herein can be implemented by a combination of hardware and software. Therefore, the present invention is not limited to the embodiments of the invention, but is defined by the scope of the following patents and equivalents. In particular, the present invention can be implemented in a commonly used microprocessor device. Finally, those skilled in the art should be able to appreciate them. The same objects as those of the present invention can be made by designing or modifying other structures without departing from the scope of the invention as set forth in the appended claims.

100‧‧‧微處理器(處理核心) 100‧‧‧Microprocessor (Processing Core)

102‧‧‧指令快取 102‧‧‧ instruction cache

104‧‧‧硬體指令轉譯器 104‧‧‧ hardware instruction translator

106‧‧‧暫存器檔案 106‧‧‧Scratch file

108‧‧‧記憶體子系統 108‧‧‧ memory subsystem

112‧‧‧執行管線 112‧‧‧Execution pipeline

114‧‧‧指令擷取單元與分支預測器 114‧‧‧Command Capture Unit and Branch Predictor

116‧‧‧ARM程式計數器(PC)暫存器 116‧‧‧ARM Program Counter (PC) Register

118‧‧‧x86指令指標(IP)暫存器 118‧‧‧x86 instruction index (IP) register

122‧‧‧組態暫存器(configuration register) 122‧‧‧Configuration register

124‧‧‧ISA指令 124‧‧‧ISA Directive

126‧‧‧微指令 126‧‧‧ microinstructions

128‧‧‧結果 128‧‧‧ Results

132‧‧‧指令模式指標(instruction mode indicator) 132‧‧‧instruction mode indicator

134‧‧‧擷取位址 134‧‧‧Select address

136‧‧‧環境模式指標(environment mode indicator) 136‧‧‧Environment mode indicator

202‧‧‧指令格式化程式 202‧‧‧Instruction Formatter

204‧‧‧簡單指令轉譯器(SIT) 204‧‧‧Simple Instruction Translator (SIT)

206‧‧‧複雜指令轉譯器(CIT) 206‧‧‧Complex Instruction Translator (CIT)

212‧‧‧多工器(mux) 212‧‧‧Multiplexer (mux)

222‧‧‧x86簡單指令轉譯器 222‧‧‧x86 Simple Instruction Translator

224‧‧‧ARM簡單指令轉譯器 224‧‧‧ARM Simple Instruction Translator

232‧‧‧微程式計數器(micro-program counter,micro-PC) 232‧‧‧micro-program counter (micro-PC)

234‧‧‧微碼唯讀記憶體 234‧‧‧microcode read-only memory

236‧‧‧微程序器(microsequencer) 236‧‧‧microprogrammer (microsequencer)

235‧‧‧指令間接暫存器(instruction indirection register,IIR) 235‧‧‧Instruction indirection register (IIR)

237‧‧‧微轉譯器(microtranslator) 237‧‧‧microtranslator

242‧‧‧格式化ISA指令 242‧‧‧Format ISA instructions

244‧‧‧實行微指令(implementing microinstructions) 244‧‧‧implementing microinstructions

246‧‧‧實行微指令 246‧‧‧ Micro-instructions

248‧‧‧選擇輸入 248‧‧‧Select input

252‧‧‧微碼位址 252‧‧‧ microcode address

254‧‧‧唯讀記憶體位址 254‧‧‧Read-only memory address

255‧‧‧ISA指令資訊 255‧‧‧ISA Command Information

302‧‧‧預解碼器(pre-decoder) 302‧‧‧Pre-decoder

304‧‧‧指令位元組佇列(IBQ) 304‧‧‧Command byte array (IBQ)

306‧‧‧長度解碼器(length decoders)與漣波邏輯閘(ripple logic) 306‧‧‧length decoders and ripple logic

308‧‧‧多工器佇列(mux queue,MQ) 308‧‧‧Multiplexer queue (mux queue, MQ)

312‧‧‧多工器 312‧‧‧Multiplexer

314‧‧‧格式化指令佇列(formatted instruction queue,FIQ) 314‧‧‧formatted instruction queue (FIQ)

322‧‧‧ARM指令集狀態 322‧‧‧ARM instruction set status

401‧‧‧微指令佇列 401‧‧‧Micro-instruction queue

402‧‧‧暫存器配置表(register allocation table,RAT) 402‧‧‧register allocation table (RAT)

404‧‧‧指令調度器(instruction dispatcher) 404‧‧‧instruction dispatcher

406‧‧‧保留站(reservation station) 406‧‧‧reservation station

408‧‧‧指令發送單元(instruction issue unit) 408‧‧‧instruction issue unit

412‧‧‧整數/分支(integer/branch)單元 412‧‧‧integer/branch unit

414‧‧‧媒體單元(media unit) 414‧‧‧media unit

416‧‧‧載入/儲存(load/store)單元 416‧‧‧Load/store unit

418‧‧‧浮點(floating point)單元 418‧‧‧floating point unit

422‧‧‧重排緩衝器(reorder buffer,ROB) 422‧‧‧reorder buffer (ROB)

424‧‧‧執行單元 424‧‧‧ execution unit

502‧‧‧ARM特定暫存器 502‧‧‧ARM specific register

504‧‧‧x86特定暫存器 504‧‧‧86 specific register

506‧‧‧共享暫存器 506‧‧‧Shared register

700‧‧‧雙核心微處理器 700‧‧‧Dual Core Microprocessor

892‧‧‧微指令快取 892‧‧‧Micro-instruction cache

902‧‧‧硬體暫存器檔案 902‧‧‧ Hardware Register File

904‧‧‧硬體多工邏輯閘 904‧‧‧ Hardware multiplexed logic gate

906‧‧‧硬體暫存器 906‧‧‧ hardware register

908‧‧‧硬體多工邏輯閘 908‧‧‧ hardware multiplexed logic gate

912‧‧‧暫存器位址 912‧‧‧Scratchpad address

914‧‧‧處理模式 914‧‧‧ Processing mode

1004、1006、1008、1014、1016、1018‧‧‧多工器 1004, 1006, 1008, 1014, 1016, 1018‧‧‧ multiplexers

第1圖係本發明執行x86程式集架構與ARM程式集架構機器語言程式之微處理器一實施例之方塊圖;第2圖係一方塊圖,詳細顯示第1圖之硬體指令轉譯器;第3圖係一方塊圖,詳細顯示第2圖之指令格式化程式(instruction formatter);第4圖係一方塊圖,詳細顯示第1圖之執行管線;第5圖係一方塊圖,詳細顯示第1圖之暫存器檔案;第6圖(包含第6A圖與第6B圖)係一流程圖,顯示第1圖之微處理器之操作步驟;第7圖係本發明一雙核心微處理器之方塊圖;第8圖係本發明執行x86 ISA與ARM ISA機器語言程式之微處理器另一實施例之方塊圖;第9圖係為一習知硬體暫存器檔案架構示意圖;第10圖係本發明之系統方塊圖,詳細顯示第1圖之微處理器;第11圖(包含第11A圖與第11B圖)係顯示在本發明中,如第10圖之微處理器100操作之流程圖;第12圖係一流程圖,顯示第10圖之微處理器依據第11圖,另,資料在直接儲存器與間接儲存器間流動;第13圖(包含第13A圖與第13B圖)係一流程圖,顯示 在本發明中如第1圖之微處理器100執行一LDM指令之流程圖;第14圖(包含第14A圖與第14B圖)係一流程圖,顯示在本發明中如第1圖之微處理器100執行一LDM指令之另一流程圖;第15圖(包含第15A圖與第15B圖)係一流程圖,顯示在本發明中如第1圖之微處理器100執行一STM指令之流程圖;以及第16圖(包含第16A圖與第16B圖)係一流程圖,顯示在本發明中如第1圖之微處理器100執行一STM指令之另一流程圖。 1 is a block diagram of an embodiment of a microprocessor for executing an x86 program architecture and an ARM program architecture machine language program; and FIG. 2 is a block diagram showing the hardware instruction translator of FIG. 1 in detail; Figure 3 is a block diagram showing the instruction formatter (Fig. 2) in detail; Figure 4 is a block diagram showing the execution pipeline of Figure 1 in detail; Figure 5 is a block diagram showing the details. Figure 1 is a register file; Figure 6 (including Figures 6A and 6B) is a flow chart showing the operation steps of the microprocessor of Figure 1; Figure 7 is a dual core microprocessor of the present invention. Figure 8 is a block diagram of another embodiment of a microprocessor executing the x86 ISA and ARM ISA machine language programs of the present invention; and Figure 9 is a schematic diagram of a conventional hardware register file structure; 10 is a system block diagram of the present invention, showing the microprocessor of FIG. 1 in detail; FIG. 11 (including FIG. 11A and FIG. 11B) is shown in the present invention, and the microprocessor 100 is operated as shown in FIG. Flow chart; Fig. 12 is a flow chart showing the microprocessor of Fig. 10 according to Fig. 11 Also, the flow of information between the direct and indirect storage reservoir; FIG. 13 (comprising FIG. 13A, FIG. 13B and the second) -based a flow chart showing In the present invention, the microprocessor 100 of FIG. 1 executes a flowchart of an LDM instruction; and FIG. 14 (including FIG. 14A and FIG. 14B) is a flowchart showing the micrograph as shown in FIG. 1 in the present invention. Another flowchart of the processor 100 executing an LDM instruction; FIG. 15 (including FIG. 15A and FIG. 15B) is a flowchart showing that the microprocessor 100 as shown in FIG. 1 executes an STM instruction in the present invention. FIG. 16 and FIG. 16 (including FIGS. 16A and 16B) are flowcharts showing another flow chart of the microprocessor 100 executing an STM instruction as shown in FIG. 1 in the present invention.

100‧‧‧微處理器 100‧‧‧Microprocessor

102‧‧‧指令快取 102‧‧‧ instruction cache

104‧‧‧硬體指令轉譯器 104‧‧‧ hardware instruction translator

106‧‧‧暫存器檔案 106‧‧‧Scratch file

108‧‧‧記憶體子系統 108‧‧‧ memory subsystem

112‧‧‧執行管線 112‧‧‧Execution pipeline

114‧‧‧指令擷取單元與分支預測器 114‧‧‧Command Capture Unit and Branch Predictor

116‧‧‧ARM程式計數器(PC)暫存器 116‧‧‧ARM Program Counter (PC) Register

118‧‧‧x86指令指標(IP)暫存器 118‧‧‧x86 instruction index (IP) register

122‧‧‧組態暫存器(configuration register) 122‧‧‧Configuration register

124‧‧‧ISA指令 124‧‧‧ISA Directive

126‧‧‧微指令 126‧‧‧ microinstructions

128‧‧‧結果 128‧‧‧ Results

132‧‧‧指令模式指標(instruction mode indicator) 132‧‧‧instruction mode indicator

134‧‧‧擷取位址 134‧‧‧Select address

136‧‧‧環境模式指標(environment mode indicator) 136‧‧‧Environment mode indicator

Claims (42)

一種微處理器,包含:複數個處理模式,包含一使用者模式與複數個例外事件模式;至少一執行單元,用以在程式指令指定之運算元上執行複數算數操作;一第一儲存元件組,耦接於該執行單元,其中該第一儲存元件組包含一第一運算元子集,並提供該第一運算元子集給該執行單元;一第二儲存元件組,關聯於各處理模式,其中該第二儲存元件組係包含一第二運算元子集,其中該第二儲存元件組係無法直接提供該第二運算元子集給該執行單元;以及一邏輯單元,其中,當從該些處理模式中之一現行處理模式進入一新處理模式時,該邏輯單元將該第一儲存元件組中之該第一運算元子集儲存至關聯於該現行處理模式之第二儲存元件組,並將關聯於該新處理模式之該第二儲存元件組中之該第二運算元子集回復至該第一儲存元件組。 A microprocessor includes: a plurality of processing modes including a user mode and a plurality of exception event modes; at least one execution unit configured to perform a complex arithmetic operation on an operand specified by the program instruction; a first storage element group And coupled to the execution unit, wherein the first storage element group includes a first subset of operation elements, and provides the first operation element subset to the execution unit; and a second storage element group associated with each processing mode The second storage element group includes a second subset of operation elements, wherein the second storage element group cannot directly provide the second operation element subset to the execution unit; and a logic unit, wherein, when When one of the processing modes enters a new processing mode, the logic unit stores the first subset of the operating elements in the first storage element group to the second storage element group associated with the current processing mode And reverting the second subset of operands in the second set of storage elements associated with the new processing mode to the first set of storage elements. 如申請專利範圍第1項之微處理器,更包含:一第三儲存元件組,耦接於該執行單元,其中該第三儲存元件組包含一第三運算元子集,並提供該第三運算元子集至該執行單元;其中該新處理模式係該些例外事件模式中之一第一例外事件模式; 一第四儲存元件組,關聯於該第一例外事件模式,其中該第四儲存元件組包含一第四運算元子集,其中該第四儲存元件組無法直接提供該第四運算元子集至該執行單元;以及一第五儲存元件組,全域性地關聯於除了該第一例外事件模式之外之所有該些處理模式,其中該第五儲存元件組包含一第五運算元子集,其中該第五儲存元件組無法直接提供該第五運算元子集至該執行單元;其中,當從該現行處理模式進入該新處理模式或該第一例外事件模式時,該邏輯單元額外將該第三儲存單元組之該第三運算元子集儲存至該第五儲存單元,並將該第四儲存元件組中之該第四運算元子集回復至該第三儲存元件組;其中,當從該第一例外事件模式進入該些例外事件模式之一第二例外事件模式時,該邏輯單元將該第三儲存單元組之該第四運算元子集儲存至該第四儲存單元,並將關聯於該新處理模式之該第五儲存元件組中之該第三運算元子集回復至該第三儲存元件組。 The microprocessor of claim 1, further comprising: a third storage element group coupled to the execution unit, wherein the third storage element group includes a third subset of operation elements and provides the third a subset of operands to the execution unit; wherein the new processing mode is one of the first exception event modes of the exception event patterns; a fourth storage element group associated with the first exception event pattern, wherein the fourth storage element group includes a fourth subset of operation elements, wherein the fourth storage element group cannot directly provide the fourth operation element subset to The execution unit; and a fifth storage element group are globally associated with all of the processing modes except the first exception event mode, wherein the fifth storage element group includes a fifth subset of operation elements, wherein The fifth storage element group cannot directly provide the fifth operation element subset to the execution unit; wherein, when entering the new processing mode or the first exception event mode from the current processing mode, the logic unit additionally adds the The third subset of operands of the third storage unit group is stored to the fifth storage unit, and the fourth subset of operation elements in the fourth storage element group is returned to the third storage element group; When the first exception event mode enters one of the exception event modes, the second exception event mode, the logic unit stores the fourth operand subset of the third storage unit group to the fourth storage Means associated with the storage element and the fifth group of the new processing mode of operation of the third set is returned to the subspace third storage element group. 如申請專利範圍第2項之微處理器,其中,該微處理器利用該第一儲存元件組之一第一儲存元件以保存該ARM ISA之一堆疊式指標暫存器運算元,並利用該第一儲存元件組之一第二儲存元件以保存該執行單元執行該些算數操作之該ARM ISA之一連結暫存器運算元;其中,各第二儲存元件組包含一第一儲存元件以保存一 ARM ISA堆疊式指標暫存器運算元,以及一第二儲存元件以保存用以關聯處理模式之一ARM ISA連結暫存器運算元;其中,該微處理器利用該第三儲存元件組以保存該執行單元執行該些算數操作之ARM ISA R8-R12通用暫存器之運算元;其中,該第四儲存元件組包含複數用以保存ARM ISA R8-R12通用暫存器運算元之儲存元件,以對應ARM ISA FIQ例外事件模式;其中,該第五儲存元件組包含複數用以保存ARM ISA R8-R12通用暫存器運算元之儲存元件,以對應除了ARM ISA FIQ例外事件模式之外全域性ARM ISA處理模式。 The microprocessor of claim 2, wherein the microprocessor utilizes one of the first storage element groups to store a stacked index indicator operand of the ARM ISA, and utilizes the One of the first storage element groups, the second storage element, is configured to store one of the ARM ISAs that perform the arithmetic operations by the execution unit, and the second storage element group includes a first storage element to save One An ARM ISA stacked index register operand, and a second storage element to store an ARM ISA linked register operand for correlating processing modes; wherein the microprocessor utilizes the third storage element group to save The execution unit executes the arithmetic elements of the ARM ISA R8-R12 general-purpose register of the arithmetic operations; wherein the fourth storage element group includes a plurality of storage elements for storing the ARM ISA R8-R12 universal register operand. Corresponding to the ARM ISA FIQ exception event mode; wherein the fifth storage component group includes a plurality of storage elements for holding the ARM ISA R8-R12 general register operand to correspond to the globality except the ARM ISA FIQ exception event mode. ARM ISA processing mode. 如申請專利範圍第1項之微處理器,其中該微處理器利用該第一儲存元件組之該第一儲存元件以保存該ARM ISA之一堆疊式指標暫存器運算元,以及利用該第一儲存元件組之該第二儲存元件以保存該執行單元執行該些算數操作之該ARM ISA之一連結暫存器運算元。 The microprocessor of claim 1, wherein the microprocessor utilizes the first storage element of the first storage element group to save a stacked index register operand of the ARM ISA, and utilize the first The second storage element of a storage element group is coupled to the register operand by one of the ARM ISAs that hold the execution unit to perform the arithmetic operations. 如申請專利範圍第1項之微處理器,其中該第一儲存元件組包含複數硬體暫存器,其中該第二儲存元件組包含一隨機存取記憶體(RAM)。 The microprocessor of claim 1, wherein the first storage element group comprises a plurality of hardware registers, wherein the second storage element group comprises a random access memory (RAM). 如申請專利範圍第5項之微處理器,其中該隨機存取記憶體係可透過該微處理器之微碼進行載入或寫入;其中該隨機存取記憶體係不可透過ISA機器語言程式指 令進行載入或寫入。 The microprocessor of claim 5, wherein the random access memory system can be loaded or written by using a microcode of the microprocessor; wherein the random access memory system is not ISA machine language Let it be loaded or written. 如申請專利範圍第1項之微處理器,更包含:一超純量非循序執行管線,包含:至少一執行單元;以及一載入單元,耦接於該第一儲存元件組,其中該第二儲存元件組提供該第二運算元子集至該載入單元,其中該載入單元提供該第二運算元子集至該執行單元。 The microprocessor of claim 1, further comprising: a super-quantity non-sequential execution pipeline, comprising: at least one execution unit; and a loading unit coupled to the first storage component group, wherein the The second set of storage elements provides the second subset of operands to the load unit, wherein the load unit provides the second subset of operands to the execution unit. 如申請專利範圍第1項之微處理器,其中該些例外事件模式包含該ARM ISA例外事件模式。 The microprocessor of claim 1, wherein the exception event mode includes the ARM ISA exception event mode. 如申請專利範圍第1項之微處理器,其中該邏輯單元包含該微處理器之微碼。 A microprocessor as claimed in claim 1, wherein the logic unit comprises a microcode of the microprocessor. 如申請專利範圍第1項之微處理器,其中該邏輯單元包含一硬體組合邏輯單元。 A microprocessor as claimed in claim 1, wherein the logic unit comprises a hardware combination logic unit. 如申請專利範圍第1項之微處理器,更包含:一指令轉譯器,用以將該ARM ISA機械語言之指令轉譯至複數微指令,其中至少一ARM ISA指令指示該微處理器自該現行處理模式進入至該新處理模式;以及一執行管線,用以執行該些微指令以將該第一儲存元件組之該第一運算元子集儲存至關聯於該現行處理模式的該第二儲存元件組,以及回復關聯於該新處理模式的該第二儲存元件組之該第二運算元子集至該第一儲存元件組。 The microprocessor of claim 1, further comprising: an instruction translator for translating the instructions of the ARM ISA mechanical language to the plurality of microinstructions, wherein at least one ARM ISA instruction indicates the microprocessor from the current Processing mode entering the new processing mode; and an execution pipeline for executing the microinstructions to store the first subset of operating elements of the first set of storage elements to the second storage element associated with the current processing mode Grouping, and replying the second subset of operands of the second set of storage elements associated with the new processing mode to the first set of storage elements. 如申請專利範圍第11項之微處理器,其中該指令轉譯器 更將x86 ISA機器語言指令之指令轉譯為複數微指令,其中該些微指令係以不同於x86 ISA指令集之指令編碼方式進行編碼,其中該執行管線更執行該些微指令以產生由x86 ISA指令所定義之結果。 Such as the microprocessor of claim 11th, wherein the instruction translator The instructions of the x86 ISA machine language instructions are further translated into a plurality of microinstructions, wherein the microinstructions are encoded in an instruction encoding manner different from the x86 ISA instruction set, wherein the execution pipeline further executes the microinstructions to generate the x86 ISA instructions. The result of the definition. 一種操作一微處理器之方法,該微處理器包含複數個處理模式,該些處理模式具有一使用者模式以及複數個例外事件模式,其中該微處理器更包含至少一執行單元,該執行單元透過特定程式指令在運算元上執行複數算數操作,該方法包含:當該微處理器在該些處理模式中之一現行處理模式運作時,自一第一儲存元件組中提供一第一運算元子集至該執行單元以執行該些算數操作;當自該現行處理模式進入該些處理模式之一新處理模式時,包含以下步驟:將該第一儲存元件組之該第一運算元子集儲存至關聯於該現行處理模式之一第二儲存單元組;將該關聯於該新處理模式之一第三儲存元件組之一第二運算元子集回復至該第一儲存元件組;以及當該微處理器於該新處理模式中運作時,自該第一儲存元件組提供該第二運算元子集至該執行單元以執行該些算數操作。 A method of operating a microprocessor, the microprocessor comprising a plurality of processing modes, the processing mode having a user mode and a plurality of exception event modes, wherein the microprocessor further comprises at least one execution unit, the execution unit Performing a complex arithmetic operation on the operand through a specific program instruction, the method comprising: providing a first operand from a first set of storage elements when the microprocessor is operating in one of the processing modes Subsetting to the execution unit to perform the arithmetic operations; when entering the new processing mode from the current processing mode, the method includes the step of: dividing the first operational element subset of the first storage element group Storing to a second storage unit group associated with one of the current processing modes; reverting the second subset of operation elements associated with one of the third storage element groups associated with the new processing mode to the first storage element group; The microprocessor, when operating in the new processing mode, provides the second subset of operands from the first set of storage elements to the execution unit to perform the calculations Operation. 如申請專利範圍第13項之方法,更包含:當該微處理器於該現行處理模式下運作時,自一第四儲存元件組提供一第三運算元子集至該執行單元以執行該些算數操作; 其中當自該現行處理模式進入該新處理模式時,更包含:將該第四儲存元件組之該第三運算元子集儲存至關聯於該新處理模式之一第五儲存元件組;以及將一第六儲存元件組之一第四運算元子集回復至該第四儲存元件組,且該第六儲存元件組係全域性關聯於除了該第一例外事件模式之外之該些處理模式;當該微處理器於該新處理模式下運作時,自該第四儲存元件組提供該第四運算元子集至該執行單元以執行該些算數操作;當自該新處理模式進入該些處理模式之一第三處理模式時,包含:自該第四儲存元件組之第四運算元子集儲存至該第六儲存元件組;以及將該第五儲存元件組之該第三運算元子集回復至該第四儲存元件組:以及當該微處理器於該第三處理模式下運作時,自該第四儲存元件組提供該第三運算元子集至該執行單元以執行該些算數操作。 The method of claim 13, further comprising: when the microprocessor operates in the current processing mode, providing a third subset of operands from a fourth storage component group to the execution unit to perform the Arithmetic operation When the current processing mode enters the new processing mode, the method further includes: storing the third subset of the operating elements of the fourth storage element group to a fifth storage element group associated with the new processing mode; Returning, to the fourth storage element group, a fourth operational element subset of a sixth storage element group, and the sixth storage element group is globally associated with the processing modes except the first exception event mode; When the microprocessor is operating in the new processing mode, the fourth subset of operands is provided from the fourth set of storage elements to the execution unit to perform the arithmetic operations; when the processing is entered from the new processing mode And a mode of the third processing mode, comprising: storing a fourth subset of operation elements from the fourth storage element group to the sixth storage element group; and the third subset of operation elements of the fifth storage element group Reverting to the fourth storage element group: and when the microprocessor is operating in the third processing mode, providing the third subset of operands from the fourth storage element group to the execution unit to perform the arithmetic operations . 如申請專利範圍第14項之方法,其中該第一儲存元件組之一第一儲存元件具有一ARM ISA之堆疊式暫存器運算元以及該第一儲存元件組之一第二儲存元件具有一該執行單元執行該些算數操作之ARM ISA之連結暫存器運算元;其中,該第二儲存元件組與該第三儲存元件組各包含具有一ARM ISA堆疊式指標暫存器運算元之一第一儲 存元件以及一關聯於該些處理模式並具有一ARM ISA連結暫存器運算元之一第二儲存元件;其中,該第四儲存元件組具有該執行單元執行該些算數操作之ARM ISA R8-R12通用暫存器;其中,該第五儲存元件組具有ARM ISA R8-R12通用暫存器運算元之儲存元件,以對應該ARM ISA FIQ例外事件模式;其中,該第六儲存元件組包含具有ARM ISA R8-R12通用暫存器運算元之儲存元件,以全域性地對應該除了該ARM ISA FIQ例外事件模式外所有之該些ARM ISA處理模式。 The method of claim 14, wherein the first storage element of the first storage element group has an ARM ISA stacked register operand and the first storage element group has a second storage element The execution unit performs the ARM ISA connection register operand of the arithmetic operations; wherein the second storage element group and the third storage element group each comprise one of the ARM ISA stacked index register operands First store And a second storage element associated with the processing mode and having an ARM ISA connection register operand; wherein the fourth storage element group has an ARM ISA R8- that performs the arithmetic operations on the execution unit An R12 general register; wherein the fifth storage element group has a storage element of an ARM ISA R8-R12 general register operand to correspond to an ARM ISA FIQ exception event mode; wherein the sixth storage element group includes The storage elements of the ARM ISA R8-R12 Universal Scratchpad operand are globally aligned to all of the ARM ISA processing modes except the ARM ISA FIQ exception event mode. 如申請專利範圍第13項之方法,其中該第一儲存元件組之一第一儲存元件具有該ARM ISA之一堆疊式指標暫存器運算元,以及該第一儲存元件組之該第二儲存元件具有該執行單元執行該些算數操作之該ARM ISA之一連結暫存器運算元。 The method of claim 13, wherein the first storage element of the first storage element group has one of the ARM ISA stacked index register operands, and the second storage of the first storage element group The component has one of the ARM ISAs that the execution unit performs the arithmetic operations to connect to the scratchpad operand. 如申請專利範圍第13項之方法,其中該些例外事件模式包含該ARM ISA例外事件模式。 The method of claim 13, wherein the exception event pattern includes the ARM ISA exception event pattern. 如申請專利範圍第13項之方法,更包含:將ARM ISA機器指令語言之指令轉譯至複數微指令,其中至少一ARM ISA之指令指示該微處理器自該現行處理模式進入該新處理模式;以及執行該些微指令以將該第一儲存元件組之該第一運算元子集儲存至關聯於該現行處理模式之該第二儲存元件組,以及將關聯於該新處理模式之該第二儲存元件 組之該第二運算元子集回復至該第一儲存元件組。 The method of claim 13, further comprising: translating instructions of the ARM ISA machine instruction language to the plurality of microinstructions, wherein the at least one ARM ISA instruction instructs the microprocessor to enter the new processing mode from the current processing mode; And executing the microinstructions to store the first subset of operands of the first set of storage elements to the second set of storage elements associated with the current processing mode, and to associate the second storage associated with the new processing mode element The second subset of operands of the group is returned to the first set of storage elements. 如申請專利範圍第18項之方法,更包含:將x86 ISA機器指令語言之指令轉譯至該些微指令,其中該些微指令係以不同於x86 ISA指令集之指令編碼方式進行編碼。 The method of claim 18, further comprising: translating instructions of the x86 ISA machine instruction language into the microinstructions, wherein the microinstructions are encoded in an instruction encoding manner different from the x86 ISA instruction set. 一種電腦程式產品,編碼於至少一電腦可讀取儲存媒介,以使用於一運算裝置,該電腦程式產品包括:適用於該媒介之電腦可讀取程式碼,係用以指定於一微處理器,包含:一第一程式碼,用以指定於複數個處理模式,該些處理模式包含一使用者模式與複數個例外事件模式;一第二程式碼,用以指定於至少一執行單元,該執行單元透過特定程式指令在運算元上執行複數算數操作;一第三程式碼,用以指定於一第一儲存元件組,該第一儲存元件組耦接於該執行單元,其中該第一儲存元件組具有一第一運算元子集,並提供該第一運算元子集至該執行單元;一第四程式碼,用以指定關聯於該些處理模式之一第二儲存元件組;其中該第二儲存元件組具有一第二運算元子集,其中該第二運算元不可直接提供該第二運算元子集至該執行單元;以及一第五程式碼,用以指定一邏輯單元,其中當自一現行處理模式進入該些處理模式之一新處理模 式時,該邏輯單元儲存該第一儲存元件組之第一運算元子集至關聯於該現行處理模式之該第二儲存元件組,並回復關聯於該新處理模式之該第二儲存元件組之該第二運算元子集至該第一儲存元件組。 A computer program product encoded in at least one computer readable storage medium for use in an computing device, the computer program product comprising: computer readable code for the medium, designated for use in a microprocessor The method includes: a first code for specifying a plurality of processing modes, the processing mode includes a user mode and a plurality of exception event modes; and a second code for specifying at least one execution unit, The execution unit performs a complex arithmetic operation on the operand through a specific program instruction; a third code is used to designate a first storage element group, the first storage element group is coupled to the execution unit, wherein the first storage The component group has a first subset of operation elements and provides the first subset of operation elements to the execution unit; a fourth code for specifying a second storage element group associated with one of the processing modes; The second storage element group has a second subset of operation elements, wherein the second operation element cannot directly provide the second operation element subset to the execution unit; and a fifth code A logic unit for specifying, from which a current processing mode when entering a new one of the plurality of processing modules processing mode In the formula, the logic unit stores the first subset of the operation elements of the first storage element group to the second storage element group associated with the current processing mode, and returns the second storage element group associated with the new processing mode The second subset of operands is coupled to the first set of storage elements. 如申請專利範圍第20項之電腦程式產品,其中該至少一電腦可讀取儲存媒介係選自由碟片、磁帶、或是其他磁性、光學或電子之儲存媒介以及網路、纜線、無線或其他通訊媒介所構成之一群組。 The computer program product of claim 20, wherein the at least one computer readable storage medium is selected from the group consisting of a disc, a magnetic tape, or other magnetic, optical or electronic storage medium and a network, cable, wireless or A group of other communication media. 一種微處理器,其係支援一ISA,該ISA係指定複數個處理模式以及指定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定一載入多重指令,該載入多重指令係指示該微處理器自記憶體內載入資料,並傳入指定於該載入多重指令之一個或多個架構暫存器,該微處理器包含:一直接儲存器,具有關聯於該些架構暫存器之一第一部分之資料,並耦接於該處理器之至少一執行單元,以提供該資料給該執行單元;一間接儲存器,具有關聯於該些架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之一現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分;以及其中,各架構暫存器係指定於該載入多重指令: 若當該架構暫存器係位於該第一部分,該微處理器係自記憶體內載入資料,並傳入至該直接儲存器;以及若當該架構暫存器係位於該第二部分,該微處理器係自記憶體內載入資料,並傳入至該直接儲存器,而後將該直接儲存器之資料轉至該間接儲存器。 A microprocessor that supports an ISA that specifies a plurality of processing modes and specifies a complex architecture register, and wherein the architectural registers are associated with each processing mode, and a load multiple instruction is specified, Loading multiple instructions instructs the microprocessor to load data from memory and pass in one or more architectural registers designated for the load multiple instructions, the microprocessor comprising: a direct storage with associated The first part of the architecture register is coupled to at least one execution unit of the processor to provide the data to the execution unit; and an indirect storage associated with the architecture register The data of the second part, wherein the indirect storage cannot directly provide the data associated with the second part of the architecture register to the execution unit; wherein the architecture registers are in accordance with the processing modes One of the current processing modes is dynamically distributed between the first portion of the architectural register and the second portion of the architectural register; and wherein each architectural register is assigned to the load Instruction: If the architecture register is located in the first portion, the microprocessor loads data from the memory and transfers the data to the direct storage; and if the architecture register is located in the second portion, The microprocessor loads the data from the memory and transfers it to the direct storage, and then transfers the data of the direct storage to the indirect storage. 如申請專利範圍第22項之微處理器,其中該微處理器所支援之該ISA包含ARM ISA,其中指定於ISA之該些處理模式係包含ARM ISA使用者、系統、管理者、終止、未定、IRQ以及FIQ處理模式,其中指定於該ISA之該架構暫存器包含關聯於該使用者處理模式之ARM ISA R0-R14暫存器,以及關聯於該管理者、終止、未定、IRQ與FIQ處理模式之備份暫存器,其中指定於該ISA之該載入多重指令包含ARM ISA載入多重指令。 The microprocessor of claim 22, wherein the ISA supported by the microprocessor comprises an ARM ISA, wherein the processing modes specified in the ISA comprise an ARM ISA user, a system, a manager, a termination, an undetermined , IRQ, and FIQ processing modes, wherein the architecture register specified for the ISA includes an ARM ISA R0-R14 register associated with the user processing mode, and associated with the manager, terminated, undecided, IRQ, and FIQ A backup buffer for processing mode in which the load multiple instructions specified for the ISA include ARM ISA load multiple instructions. 如申請專利範圍第22項之微處理器,更包含:一指令轉譯器,係用以將該載入多重指令轉譯為該微處理器可執行之複數微指令,其中各架構暫存器係指定於該載入多重指令:若當該架構暫存器係位於該第一部分,該指令轉譯器發送一微指令,以自該記憶體載入資料轉入至該直接儲存器;若當該架構暫存器係位於該第二部分,該指令轉譯器發送一第一微指令,以自該記憶體載入資料轉入至該直接儲存器,並且發送一第二微指令以將該直接儲存器之資料轉至該間接儲存器。 The microprocessor of claim 22, further comprising: an instruction translator for translating the load multiple instructions into a plurality of micro instructions executable by the microprocessor, wherein each architecture register is specified Loading multiple instructions: if the architecture register is located in the first portion, the instruction translator sends a micro-instruction to transfer data from the memory to the direct storage; The memory is located in the second portion, the instruction translator sends a first micro-instruction to transfer data from the memory to the direct storage, and sends a second micro-instruction to the direct storage The data is transferred to the indirect storage. 如申請專利範圍第24項之微處理器,其中該指令轉譯器 包含:一第一部分,係發送該微指令以自記憶體內載入資料,並送入該直接儲存器,以及發送該第一微指令以自記憶體內載入資料並送入該直接儲存器,其中該第一部分包含一硬體狀態機器;以及一第二部分,係發送該第二微指令以將該直接儲存器之資料轉至該間接儲存器,其中該第二部分包含一微碼。 Such as the microprocessor of claim 24, wherein the instruction translator The first part includes: sending the micro-instruction to load data from the memory and feeding the data into the direct storage, and sending the first micro-instruction to load data from the memory and send the data to the direct storage device, wherein The first portion includes a hardware state machine; and a second portion transmits the second microinstruction to transfer the direct memory data to the indirect storage, wherein the second portion includes a microcode. 如申請專利範圍第24項之微處理器,其中該硬體指令轉譯器將x86 ISA機器語言指令ARM ISA機器語言指令之指令轉譯為該些微指令,其中該些微指令係以不同於x86 ISA與ARM ISA指令集之指令編碼方式進行編碼,其中該微處理器更包含一執行管線,係耦接於該硬體指令轉譯器,其中該執行管線執行該些微指令以產生由x86 ISA與ARM ISA指令所定義之結果。 The microprocessor of claim 24, wherein the hardware instruction translator translates instructions of the x86 ISA machine language instruction ARM ISA machine language instruction into the micro instructions, wherein the micro instructions are different from x86 ISA and ARM The instruction encoding mode of the ISA instruction set is encoded, wherein the microprocessor further includes an execution pipeline coupled to the hardware instruction translator, wherein the execution pipeline executes the micro instructions to generate instructions by the x86 ISA and ARM ISA instructions. The result of the definition. 如申請專利範圍第22項之微處理器,其中,若該現行處理模式係為該ARM ISA使用者模式,則該直接儲存器具有關聯於該使用者模式架構暫存器之資料,且該間接儲存器具有關聯於ARM ISA例外事件模式之R13-R14架構暫存器之資料以及關聯於ARM ISA FIQ模式之R8-R12架構暫存器之資料其中,若該現行處理模式係為該ARM ISA FIQ模式,則該直接儲存器具有關聯於該FIQ架構暫存器之資料,且該間接儲存器具有關連於該ARM ISA使用者模式與non-FIQ例外事件模式之R13-R14架構暫存器之資 料,以及關聯於早於該現行處理模式之該ARM ISA模式之R8-R12架構暫存器之資料;其中,若該現行處理模式係為一ARM ISA non-FIQ例外事件模式,則該直接儲存器係具有關聯於該non-FIQ例外事件模式架構暫存器之資料,且該間接儲存器具有關聯於該ARM ISA使用者模式與非現行之例外事件模式之R13-R14架構暫存器之資料,以及關聯於該ARM ISA FIQ模式之R8-R12架構暫存器之資料。 The microprocessor of claim 22, wherein if the current processing mode is the ARM ISA user mode, the direct storage has data associated with the user mode architecture register, and the indirect The memory has information about the R13-R14 architecture register associated with the ARM ISA exception event pattern and the R8-R12 architecture register associated with the ARM ISA FIQ mode, if the current processing mode is the ARM ISA FIQ In the mode, the direct storage has information associated with the FIQ architecture register, and the indirect storage device is related to the R13-R14 architecture register connected to the ARM ISA user mode and the non-FIQ exception event mode. And the data associated with the R8-R12 architecture register of the ARM ISA mode prior to the current processing mode; wherein if the current processing mode is an ARM ISA non-FIQ exception event mode, the direct storage The device has information associated with the non-FIQ exception event mode architecture register, and the indirect storage has information about the R13-R14 architecture register associated with the ARM ISA user mode and the non-current exception event pattern. And the information associated with the R8-R12 architecture register for the ARM ISA FIQ mode. 一種用以操作一微處理器之方法,該處理器係支援一ISA,該ISA係指定複數個處理模式以及指定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定一載入多重指令,該載入多重指令係指示該微處理器自記憶體內載入資料,並傳入指定於該載入多重指令之一個或多個架構暫存器,該方法包含:各架構暫存器係指定於該載入多重指令:若當該架構暫存器係位於一第一部分,則自記憶體內載入資料,並傳入至該微處理器之直接儲存器;以及若當該架構暫存器係位於一第二部分,則自記憶體內載入資料並傳入至該直接儲存器,而後將該直接儲存器之資料轉至該間接儲存器;其中,該直接儲存器具有關聯於該架構暫存器之一第一部分之資料,並耦接於該微處理器之至少一執行單元以提供該資料至該執行單元;其中,該間接儲存器具有關連於該架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於 該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分。 A method for operating a microprocessor that supports an ISA that specifies a plurality of processing modes and specifies a complex architecture register, and wherein the architectural registers are associated with respective processing modes, and Specifying a load multiple instruction that instructs the microprocessor to load data from memory and pass one or more architectural registers designated for the load multiple instructions, the method comprising: The architecture register is configured to load the multiple instructions: if the architecture register is located in a first portion, the data is loaded from the memory and passed to the direct memory of the microprocessor; The architecture register is located in a second portion, and the data is loaded from the memory and transmitted to the direct storage, and then the data of the direct storage is transferred to the indirect storage; wherein the direct storage has Corresponding to the first portion of the architecture register and coupled to at least one execution unit of the microprocessor to provide the data to the execution unit; wherein the indirect storage device is associated with the One register configuration information of a second portion, wherein the reservoir can not provide indirect directly linked to And the data of the second part of the architecture register is sent to the execution unit; wherein the architecture registers are dynamically distributed in the architecture register according to the current processing mode in the processing modes Part of this second part of the architecture register. 如申請專利範圍第28項之方法,其中該微處理器所支援之該ISA包含ARM ISA,其中指定於ISA之該些處理模式係包含ARM ISA使用者、系統、管理者、終止、未定、IRQ以及FIQ處理模式,其中指定於該ISA之該架構暫存器包含關聯於該使用者處理模式之ARM ISA R0-R14暫存器,以及關聯於該管理者、終止、未定、IRQ與FIQ處理模式之備份暫存器,其中指定於該ISA之該載入多重指令包含ARM ISA載入多重指令。 The method of claim 28, wherein the ISA supported by the microprocessor comprises an ARM ISA, wherein the processing modes specified in the ISA comprise an ARM ISA user, system, manager, termination, pending, IRQ And an FIQ processing mode, wherein the architecture register specified for the ISA includes an ARM ISA R0-R14 register associated with the user processing mode, and associated with the manager, termination, pending, IRQ, and FIQ processing modes The backup scratchpad, wherein the load multiple instructions specified for the ISA include ARM ISA load multiple instructions. 如申請專利範圍第29項之方法,更包含:利用該微處理器將該載入多重指令轉譯為該微處理器可執行之複數微指令,其中各架構暫存器係指定於該載入多重指令:若當該架構暫存器係位於該第一部分,該指令轉譯器發送一微指令,以自該記憶體載入資料轉入至該直接儲存器;若當該架構暫存器係位於該第二部分,該指令轉譯器發送一第一微指令,以自該記憶體載入資料轉入至該直接儲存器,並且發送一第二微指令以將該直接儲存器之資料轉至該間接儲存器。 The method of claim 29, further comprising: translating, by the microprocessor, the load multiple instructions into a plurality of micro instructions executable by the microprocessor, wherein each architecture register is assigned to the load multiple Instruction: if the architecture register is located in the first portion, the instruction translator sends a microinstruction to transfer data from the memory to the direct storage; if the architecture register is located in the In the second part, the instruction translator sends a first micro-instruction to transfer data from the memory to the direct storage, and sends a second micro-instruction to transfer the direct storage data to the indirect Storage. 如申請專利範圍第30項之方法,其中係透過一硬體狀態機器發送該微指令,以自記憶體內載入資料並送入該直 接儲存器,其中係透過一微碼發送該第二微指令,以將該直接儲存器之資料轉至該間接儲存器。 The method of claim 30, wherein the microinstruction is sent through a hardware state machine to load data from the memory and feed the straight And storing the second microinstruction through a microcode to transfer the data of the direct storage to the indirect storage. 如申請專利範圍第29項之方法,其中,若該現行處理模式係為該ARM ISA使用者模式,則該直接儲存器具有關聯於該使用者模式架構暫存器之資料,且該間接儲存器具有關聯於ARM ISA例外事件模式之R13-R14架構暫存器之資料以及關聯於ARM ISA FIQ模式之R8-R12架構暫存器之資料其中,若該現行處理模式係為該ARM ISA FIQ模式,則該直接儲存器具有關聯於該FIQ架構暫存器之資料,且該間接儲存器具有關連於該ARM ISA使用者模式與non-FIQ例外事件模式之R13-R14架構暫存器之資料,以及關聯於早於該現行處理模式之該ARM ISA模式之R8-R12架構暫存器之資料;其中,若該現行處理模式係為一ARM ISA non-FIQ例外事件模式,則該直接儲存器具有關聯於該non-FIQ例外事件模式架構暫存器之資料,且該間接儲存器具有關聯於該ARM ISA使用者模式與非現行之例外事件模式之R13-R14架構暫存器之資料,以及關聯於該ARM ISA FIQ模式之R8-R12架構暫存器之資料。 The method of claim 29, wherein if the current processing mode is the ARM ISA user mode, the direct storage has information associated with the user mode architecture register, and the indirect storage Information on the R13-R14 architecture register associated with the ARM ISA exception event pattern and the R8-R12 architecture register associated with the ARM ISA FIQ mode. If the current processing mode is the ARM ISA FIQ mode, The direct storage device has information associated with the FIQ architecture register, and the indirect storage device relates to the R13-R14 architecture register connected to the ARM ISA user mode and the non-FIQ exception event mode, and Data relating to the R8-R12 architecture register of the ARM ISA mode prior to the current processing mode; wherein the direct memory is associated if the current processing mode is an ARM ISA non-FIQ exception event mode Information about the non-FIQ exception event mode architecture register, and the indirect storage has information about the R13-R14 architecture register associated with the ARM ISA user mode and the non-current exception event pattern. And the information associated with the R8-R12 architecture register for the ARM ISA FIQ mode. 一種微處理器,其係支援一ISA,該ISA係指定複數個處理模式以及指定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定一儲存多重指令,該儲存多重指令係指令該微處理器將資料自指定於該儲存多重指令之一個或多個架構暫存器中,轉存至該記憶體, 該微處理器包含:一直接儲存器,具有關聯於該些架構暫存器之一第一部分之資料,並耦接於該處理器之至少一執行單元,以提供該資料給該執行單元;一間接儲存器,具有關聯於該些架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分;以及其中,各架構暫存器係特定於該儲存多重指令:若當該架構暫存器係位於該第一部分,該微處理器係將資料自該直接儲存器轉存至記憶體;以及若當該架構暫存既係位於該第二部分,該微處理器係自該間接儲存器內載入資料,並傳入至該直接儲存器,而後將資料自該直接儲存器轉存至記憶體。 A microprocessor that supports an ISA that specifies a plurality of processing modes and a specified complex architecture register, and wherein the architectural registers are associated with each processing mode, and a storage multiple instruction is specified, the storage The multi-instruction command instructs the microprocessor to transfer data from the one or more architectural registers designated to store the multiple instructions to the memory. The microprocessor includes: a direct storage having data associated with a first portion of one of the architecture registers and coupled to at least one execution unit of the processor to provide the data to the execution unit; An indirect storage having information associated with a second portion of one of the architectural registers, wherein the indirect storage cannot directly provide information associated with the second portion of the architectural register to the execution unit; The architecture registers are dynamically distributed between the first portion of the architecture register and the second portion of the architecture register in accordance with the current processing mode of the processing modes; and wherein each architecture temporarily The storage system is specific to the storage multiple instructions: if the architecture register is located in the first portion, the microprocessor transfers data from the direct storage to the memory; and if the architecture is temporarily stored Located in the second portion, the microprocessor loads data from the indirect storage and passes it to the direct storage, and then transfers the data from the direct storage to the memory. 如申請專利範圍第33項之微處理器,其中該微處理器所支援之該ISA包含ARM ISA,其中指定於ISA之該些處理模式係包含ARM ISA使用者、系統、管理者、終止、未定、IRQ以及FIQ處理模式,其中指定於該ISA之該架構暫存器包含關聯於該使用者處理模式之ARM ISA R0-R14暫存器,以及關聯於該管理者、終止、未定、IRQ與FIQ處理模式之備份暫存器,其中指定於該ISA之該儲存多重指令包含ARM ISA儲存多重指令。 The microprocessor of claim 33, wherein the ISA supported by the microprocessor comprises an ARM ISA, wherein the processing modes specified in the ISA comprise an ARM ISA user, a system, a manager, a termination, an undetermined , IRQ, and FIQ processing modes, wherein the architecture register specified for the ISA includes an ARM ISA R0-R14 register associated with the user processing mode, and associated with the manager, terminated, undecided, IRQ, and FIQ A backup buffer for processing mode, wherein the store multiple instructions specified for the ISA include an ARM ISA store multiple instructions. 如申請專利範圍第34項之微處理器,更包含 一指令轉譯器,係用以將該儲存多重指令轉譯為該微處理器可執行之複數微指令,其中各架構暫存器係指定於該儲存多重指令:若當該架構暫存器係位於該第一部分,該指令轉譯器發送一微指令,以將資料自該直接儲存器轉存至記憶體;若當該架構暫存器係位於該第二部分,該指令轉譯器發送一第一微指令,以自該間接儲存器內載入資料並傳入至該直接儲存器,而後將資料自該直接儲存器轉存至記憶體。 Such as the microprocessor of claim 34, including An instruction interpreter for translating the stored multiple instructions into a plurality of microinstructions executable by the microprocessor, wherein each architectural register is assigned to the stored multiple instructions: if the architectural register is located in the In the first part, the instruction translator sends a micro-instruction to transfer data from the direct storage to the memory; if the architecture register is located in the second part, the instruction translator sends a first micro-instruction Loading data from the indirect storage and passing it to the direct storage, and then transferring the data from the direct storage to the memory. 如申請專利範圍第34項之微處理器,其中若該現行處理模式係為該ARM ISA使用者模式,則該直接儲存器具有關聯於該使用者模式架構暫存器之資料,且該間接儲存器具有關聯於ARM ISA例外事件模式之R13-R14架構暫存器之資料以及關聯於ARM ISA FIQ模式之R8-R12架構暫存器之資料;其中,若該現行處理模式係為該ARM ISA FIQ模式,則該直接儲存器具有關聯於該FIQ架構暫存器之資料,且該間接儲存器具有關連於該ARM ISA使用者模式與non-FIQ例外事件模式之R13-R14架構暫存器之資料,以及關聯於早於該現行處理模式之該ARM ISA模式之R8-R12架構暫存器之資料;其中,若該現行處理模式係為一ARM ISA non-FIQ例外事件模式,則該直接儲存器具有關聯於該non-FIQ例外事件模式架構暫存器之資料,且該間接儲存器具有關聯於該ARM ISA使用者模式與非現行之例外事件模式之 R13-R14架構暫存器之資料,以及關聯於該ARM ISA FIQ模式之R8-R12架構暫存器之資料。 The microprocessor of claim 34, wherein if the current processing mode is the ARM ISA user mode, the direct storage has data associated with the user mode architecture register, and the indirect storage The device has information about the R13-R14 architecture register associated with the ARM ISA exception event pattern and the R8-R12 architecture register associated with the ARM ISA FIQ mode; if the current processing mode is the ARM ISA FIQ Mode, the direct storage has information associated with the FIQ architecture register, and the indirect storage device has information about the R13-R14 architecture register connected to the ARM ISA user mode and the non-FIQ exception event mode. And data relating to the R8-R12 architecture register of the ARM ISA mode prior to the current processing mode; wherein the direct memory is if the current processing mode is an ARM ISA non-FIQ exception event mode Having information associated with the non-FIQ exception event mode architecture register, and the indirect storage has associated with the ARM ISA user mode and a non-current exception event pattern Information on the R13-R14 architecture register and information on the R8-R12 architecture register associated with the ARM ISA FIQ mode. 一種用以操作一微處理器之方法,該處理器係支援一ISA,該ISA係指定複數個處理模式以及指定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定一儲存多重指令該儲存多重指令係指示該微處理器將資料自指定於該儲存多重指令之一個或多個架構暫存器中轉存至該記憶體,該方法包含:各架構暫存器係指定於該儲存多重指令:若當該架構暫存器係位於該第一部分,則將資料自該該微處理器之直接儲存器轉存至記憶體;以及若當該架構暫存器係位於該第二部分,則自該間接儲存器內載入資料並傳入至該直接儲存器,而後將資料自該直接儲存器轉存至記憶體;其中,該直接儲存器具有關聯於該架構暫存器之一第一部分之資料,並耦接於該微處理器之至少一執行單元以提供該資料至該執行單元;其中,該間接儲存器具有關連於該架構暫存器之一第二部分之資料,其中該間接儲存器無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分。 A method for operating a microprocessor that supports an ISA that specifies a plurality of processing modes and specifies a complex architecture register, and wherein the architectural registers are associated with respective processing modes, and Specifying a store multiple instruction to store the data instruction to the microprocessor to transfer data from the one or more architectural registers designated to store the multiple instructions to the memory, the method comprising: each architecture register Designating the store multiple instructions: if the architecture register is located in the first portion, transferring data from the direct storage of the microprocessor to the memory; and if the architecture register is located The second part loads data from the indirect storage and transfers the data to the direct storage, and then transfers the data from the direct storage to the memory; wherein the direct storage has a correlation with the architecture And the at least one execution unit of the microprocessor is coupled to the execution unit; wherein the indirect storage device is temporarily connected to the architecture The data of the second part, wherein the indirect storage cannot directly provide the data associated with the second part of the architecture register to the execution unit; wherein the architecture registers are in accordance with the processing modes The current processing mode is dynamically distributed between the first portion of the architectural register and the second portion of the architectural register. 如申請專利範圍第37項之方法,其中該微處理器所支援之該ISA包含ARM ISA,其中指定於ISA之該些處理模 式係包含ARM ISA使用者、系統、管理者、終止、未定、IRQ以及FIQ處理模式,其中指定於該ISA之該架構暫存器包含關聯於該使用者處理模式之ARM ISA R0-R14暫存器,以及關聯於該管理者、終止、未定、IRQ與FIQ處理模式之備份暫存器,其中指定於該ISA之該儲存多重指令包含ARM ISA儲存多重指令。 The method of claim 37, wherein the ISA supported by the microprocessor comprises an ARM ISA, wherein the processing modes specified by the ISA are The system includes an ARM ISA user, system, manager, termination, pending, IRQ, and FIQ processing modes, wherein the architecture register specified for the ISA includes an ARM ISA R0-R14 temporary storage associated with the user processing mode. And a backup register associated with the manager, termination, pending, IRQ, and FIQ processing modes, wherein the stored multiple instructions specified for the ISA include an ARM ISA store multiple instructions. 如申請專利範圍第38項之方法,更包含利用該微處理器將該儲存多重指令轉譯為該微處理器可執行之複數微指令,其中各架構暫存器係指定於該儲存多重指令:若當該架構暫存器係位於該第一部分,該指令轉譯器發送一微指令,以將資料自該直接儲存器轉存至記憶體;若當該架構暫存器係位於該第二部分,該指令轉譯器發送一第一微指令,以自該間接儲存器內載入資料,並傳入至該直接儲存器,而後將資料自該直接儲存器轉存至記憶體。 The method of claim 38, further comprising translating, by the microprocessor, the stored multiple instructions into a plurality of micro instructions executable by the microprocessor, wherein each architectural register is assigned to the stored multiple instructions: When the architecture register is located in the first portion, the instruction translator sends a microinstruction to transfer data from the direct storage to the memory; if the architecture register is located in the second portion, The instruction translator sends a first microinstruction to load data from the indirect storage and pass it to the direct storage, and then transfer the data from the direct storage to the memory. 如申請專利範圍第37項之方法,其中若該現行處理模式係為該ARM ISA使用者模式,則該直接儲存器具有關聯於該使用者模式架構暫存器之資料,且該間接儲存器具有關聯於ARM ISA例外事件模式之R13-R14架構暫存器之資料以及關聯於ARM ISA FIQ模式之R8-R12架構暫存器之資料;其中,若該現行處理模式係為該ARM ISA FIQ模式,則該直接儲存器具有關聯於該FIQ架構暫存器之資料, 且該間接儲存器具有關連於該ARM ISA使用者模式與non-FIQ例外事件模式之R13-R14架構暫存器之資料,以及關聯於早於該現行處理模式之該ARM ISA模式之R8-R12架構暫存器之資料;其中,若該現行處理模式係為一ARM ISA non-FIQ例外事件模式,則該直接儲存器具有關聯於該non-FIQ例外事件模式架構暫存器之資料,且該間接儲存器具有關聯於該ARM ISA使用者模式與非現行之例外事件模式之R13-R14架構暫存器之資料,以及關聯於該ARM ISA FIQ模式之R8-R12架構暫存器之資料。 The method of claim 37, wherein if the current processing mode is the ARM ISA user mode, the direct storage has information associated with the user mode architecture register, and the indirect storage has Information about the R13-R14 architecture register associated with the ARM ISA exception event pattern and the R8-R12 architecture register associated with the ARM ISA FIQ mode; if the current processing mode is the ARM ISA FIQ mode, The direct storage has information associated with the FIQ architecture register. And the indirect storage device is related to the R13-R14 architecture register of the ARM ISA user mode and the non-FIQ exception event mode, and the R8-R12 associated with the ARM ISA mode earlier than the current processing mode. The data of the architecture register; wherein, if the current processing mode is an ARM ISA non-FIQ exception event mode, the direct storage has information associated with the non-FIQ exception event mode architecture register, and the The indirect storage has information about the R13-R14 architecture register associated with the ARM ISA user mode and the non-current exception event mode, and the R8-R12 architecture register associated with the ARM ISA FIQ mode. 一種電腦程式產品,編碼於至少一電腦可讀取儲存媒介,以使用於一運算裝置,該電腦程式產品包括:適用於該媒介之電腦可讀取程式碼,係用以指定一微處理器,該微處理器係支援一ISA,該ISA係指定複數個處理模式以及指定複數架構暫存器,且該些架構暫存器係關聯於各處理模式,以及指定一載入多重指令,該載入多重指令係指示該微處理器自記憶體內載入資料,並傳入指定於該載入多重指令之一個或多個架構暫存器,該電腦可載入程式碼包含:一第一程式碼,係用以指定於一直接儲存器,該直接儲存器具有關聯於該架構暫存器之一第一部分之資料,且並耦接於該處理器之至少一執行單元,以提供該資料給該執行單元;一第二程式碼,係用以指定於一間接儲存器,該間接儲存器具有關聯於該些架構暫存器之一第二部分 之資料,其中該間接儲存器係無法直接提供關聯於該架構暫存器之該第二部分之資料至該執行單元;其中,該些架構暫存器係依據該些處理模式中之該現行處理模式,動態地分布於該架構暫存器之該第一部分與該架構暫存器之該第二部分;其中,各架構暫存器係指定於該載入多重指令:若當該架構暫存器係位於該第一部分,該微處理器係自記憶體內載入資料,並傳入至該直接儲存器;以及若當該架構暫存器係位於該第二部分,該微處理器係自記憶體內載入資料並傳入至該直接儲存器,而後將該直接儲存器之資料轉至該間接儲存器。 A computer program product encoded in at least one computer readable storage medium for use in an computing device, the computer program product comprising: a computer readable code for the medium, for specifying a microprocessor, The microprocessor supports an ISA that specifies a plurality of processing modes and specifies a complex architecture register, and the architectural registers are associated with each processing mode, and a load multiple instruction is specified, the loading The multi-instruction instruction instructs the microprocessor to load data from the memory and pass in one or more architectural registers designated for loading the multi-instruction, the computer-loadable code comprising: a first code, Used to specify a direct storage having information associated with a first portion of one of the architecture registers and coupled to at least one execution unit of the processor to provide the data to the execution a second code that is assigned to an indirect storage having a second portion associated with one of the architectural registers The indirect storage is incapable of directly providing the data associated with the second portion of the architecture register to the execution unit; wherein the architectural registers are based on the current processing in the processing modes a mode, dynamically distributed in the first portion of the architectural register and the second portion of the architectural register; wherein each architectural register is assigned to the load multiple instruction: if the architectural register Located in the first portion, the microprocessor loads data from the memory and is passed to the direct storage; and if the architecture register is located in the second portion, the microprocessor is self-memory The data is loaded and passed to the direct storage, and then the data of the direct storage is transferred to the indirect storage. 如申請專利範圍第41項之電腦程式產品,其中,該至少一電腦可讀取儲存媒介係選自由碟片、磁帶、或是其他磁性、光學或電子之儲存媒介以及網路、纜線、無線或其他通訊媒介所構成之一群組。 The computer program product of claim 41, wherein the at least one computer readable storage medium is selected from the group consisting of a disc, a magnetic tape, or other magnetic, optical or electronic storage medium and a network, a cable, a wireless device. Or a group of other communication media.
TW101112253A 2011-04-07 2012-04-06 Emulation of execution mode banked registers TWI478065B (en)

Applications Claiming Priority (14)

Application Number Priority Date Filing Date Title
US201161473069P 2011-04-07 2011-04-07
US201161473067P 2011-04-07 2011-04-07
US201161473062P 2011-04-07 2011-04-07
US13/224,310 US8880851B2 (en) 2011-04-07 2011-09-01 Microprocessor that performs X86 ISA and arm ISA machine language program instructions by hardware translation into microinstructions executed by common execution pipeline
US201161537473P 2011-09-21 2011-09-21
US201161541307P 2011-09-30 2011-09-30
US201161547449P 2011-10-14 2011-10-14
US201161555023P 2011-11-03 2011-11-03
US13/333,520 US9032189B2 (en) 2011-04-07 2011-12-21 Efficient conditional ALU instruction in read-port limited register file microprocessor
US13/333,572 US8880857B2 (en) 2011-04-07 2011-12-21 Conditional ALU instruction pre-shift-generated carry flag propagation between microinstructions in read-port limited register file microprocessor
US13/333,631 US8924695B2 (en) 2011-04-07 2011-12-21 Conditional ALU instruction condition satisfaction propagation between microinstructions in read-port limited register file microprocessor
US201261604561P 2012-02-29 2012-02-29
US13/413,314 US9176733B2 (en) 2011-04-07 2012-03-06 Load multiple and store multiple instructions in a microprocessor that emulates banked registers
US13/413,300 US20120260073A1 (en) 2011-04-07 2012-03-06 Emulation of execution mode banked registers

Publications (2)

Publication Number Publication Date
TW201250597A TW201250597A (en) 2012-12-16
TWI478065B true TWI478065B (en) 2015-03-21

Family

ID=48139302

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101112253A TWI478065B (en) 2011-04-07 2012-04-06 Emulation of execution mode banked registers

Country Status (1)

Country Link
TW (1) TWI478065B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI663544B (en) * 2017-03-02 2019-06-21 宏碁股份有限公司 Fault tolerant operating metohd and electronic device using the same
US10592329B2 (en) 2017-03-02 2020-03-17 Acer Incorporated Method and electronic device for continuing executing procedure being aborted from physical address where error occurs

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0747808A2 (en) * 1995-06-07 1996-12-11 International Business Machines Corporation Processor capable of supporting two distinct instruction set architectures
US6438679B1 (en) * 1997-11-03 2002-08-20 Brecis Communications Multiple ISA support by a processor using primitive operations
TW200506721A (en) * 2003-08-13 2005-02-16 Via Tech Inc Processor and method for pre-fetching out-of-order instructions
CN101116053A (en) * 2005-02-09 2008-01-30 先进微装置公司 Data processor adapted for efficient digital signal processing and method therefor
US20080104376A1 (en) * 1995-08-16 2008-05-01 Microunity Systems Engineering, Inc. Method and Apparatus for Performing Group Instructions
US20080189519A1 (en) * 2006-06-02 2008-08-07 Michael Karl Gschwind Implementing instruction set architectures with non-contiguous register file specifiers

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0747808A2 (en) * 1995-06-07 1996-12-11 International Business Machines Corporation Processor capable of supporting two distinct instruction set architectures
US20080104376A1 (en) * 1995-08-16 2008-05-01 Microunity Systems Engineering, Inc. Method and Apparatus for Performing Group Instructions
US6438679B1 (en) * 1997-11-03 2002-08-20 Brecis Communications Multiple ISA support by a processor using primitive operations
TW200506721A (en) * 2003-08-13 2005-02-16 Via Tech Inc Processor and method for pre-fetching out-of-order instructions
CN101116053A (en) * 2005-02-09 2008-01-30 先进微装置公司 Data processor adapted for efficient digital signal processing and method therefor
US20080189519A1 (en) * 2006-06-02 2008-08-07 Michael Karl Gschwind Implementing instruction set architectures with non-contiguous register file specifiers

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI663544B (en) * 2017-03-02 2019-06-21 宏碁股份有限公司 Fault tolerant operating metohd and electronic device using the same
US10592329B2 (en) 2017-03-02 2020-03-17 Acer Incorporated Method and electronic device for continuing executing procedure being aborted from physical address where error occurs

Also Published As

Publication number Publication date
TW201250597A (en) 2012-12-16

Similar Documents

Publication Publication Date Title
TWI474191B (en) Control register mapping in heterogeneous instruction set architecture processor
TWI450196B (en) Conditional store instructions in an out-of-order execution microprocessor
TWI450188B (en) Efficient conditional alu instruction in read-port limited register file microprocessor
US9898291B2 (en) Microprocessor with arm and X86 instruction length decoders
US9317301B2 (en) Microprocessor with boot indicator that indicates a boot ISA of the microprocessor as either the X86 ISA or the ARM ISA
US9176733B2 (en) Load multiple and store multiple instructions in a microprocessor that emulates banked registers
US9336180B2 (en) Microprocessor that makes 64-bit general purpose registers available in MSR address space while operating in non-64-bit mode
US9317288B2 (en) Multi-core microprocessor that performs x86 ISA and ARM ISA machine language program instructions by hardware translation into microinstructions executed by common execution pipeline
US9141389B2 (en) Heterogeneous ISA microprocessor with shared hardware ISA registers
US9146742B2 (en) Heterogeneous ISA microprocessor that preserves non-ISA-specific configuration state when reset to different ISA
US9292470B2 (en) Microprocessor that enables ARM ISA program to access 64-bit general purpose registers written by x86 ISA program
US20120260073A1 (en) Emulation of execution mode banked registers
TWI569205B (en) A microprocessor and an operating method thereof
EP2631786B1 (en) Load multiple and store multiple instructions in a microprocessor that emulates banked registers
TWI478065B (en) Emulation of execution mode banked registers
EP2704001B1 (en) Microprocessor that makes 64-bit general purpose registers available in MSR address space while operating in non-64-bit mode