WO2009114961A1 - 一种支持x86虚拟机的risc处理器装置及方法 - Google Patents
一种支持x86虚拟机的risc处理器装置及方法 Download PDFInfo
- Publication number
- WO2009114961A1 WO2009114961A1 PCT/CN2008/002023 CN2008002023W WO2009114961A1 WO 2009114961 A1 WO2009114961 A1 WO 2009114961A1 CN 2008002023 W CN2008002023 W CN 2008002023W WO 2009114961 A1 WO2009114961 A1 WO 2009114961A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- instruction
- register
- virtual machine
- address
- bit
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/3017—Runtime instruction translation, e.g. macros
- G06F9/30174—Runtime instruction translation, e.g. macros for non-native instruction set, e.g. Javabyte, legacy code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30076—Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30094—Condition code generation, e.g. Carry, Zero flag
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30181—Instruction operation extension or modification
- G06F9/30185—Instruction operation extension or modification according to one or more bits in the instruction, e.g. prefix, sub-opcode
Definitions
- the present invention relates to the field of cross-platform compatibility technology of a microprocessor architecture, and more particularly to a reduced instruction set computer (RISC) processor apparatus and method for supporting an X86 virtual machine.
- RISC reduced instruction set computer
- the central processing unit (CPU), referred to as the microprocessor, is the core unit of the computer.
- the instruction set and design specification (architecture) used by the microprocessor is the primary feature of the computer, which determines the type of peripherals and applications that the computer needs.
- RISC Reduced Instruction Set Computing
- MIPS MIPS32/64 instruction set
- CISC Complex Instruction Set Computing
- Program software running on processors with different architectures needs to be written specifically for the architecture of the processor.
- the application software on the X86 usually cannot be run on the computer of the RSIPS processor of the MIPS instruction set, which is often said to be incompatible. .
- a processor (CPU) computer having one type of architecture is referred to as a host; and a processor (CPU) environment that requires host emulation, an unrelated architecture type is referred to as a target machine, and an application is required.
- a program can cause the host to execute one or more host instructions, and in response to a given target machine instruction, run software written for the target machine, which is called a virtual machine.
- the existing virtual machines are: SimOS, QEMU, Transmeta, etc.
- the virtual machine running overhead is too large, and the execution efficiency is too low. It is difficult to apply to actual work.
- a RISC processor supporting an X86 virtual machine for the purpose of the present invention includes an instruction module, a decoder, a lookup table, a fixed point operation component, and a floating point operation component, wherein:
- the instruction module is configured to store a virtual machine instruction set supporting an X86 virtual machine
- the decoder is configured to distinguish the virtual machine instruction set mode of the instruction in the virtual machine instruction set instruction decoding process, and output the instruction to the fixed point operation according to the differentiated virtual machine instruction set mode.
- Component or floating point arithmetic component
- the lookup table is configured to store a jump address and a MIPS jump address in the X86 program, and support fast translation of the translation of the jump address to the MIPS jump address in the X86 program according to the output of the decoder. Improve virtual machine performance;
- the fixed point computing component is configured to perform corresponding processing on the fixed point instruction of the virtual machine instruction set according to the output of the decoder, and output an execution result;
- the floating point operation unit is configured to perform corresponding processing on the floating point instruction of the virtual machine instruction set according to the output of the decoder, and output an execution result.
- the RISC processor supporting the X86 virtual machine further includes a memory access execution unit, a memory, and a data path;
- the memory access execution unit performs data transmission between the register and the memory through the data path according to the output of the decoder.
- the RISC processor supporting the X86 virtual machine further includes a general physical register file, the general physical register file including an overflow check register, an upper bound, a lower bound address register, and an analog target Register, and virtual machine mode control register;
- the overflow check register is configured to store a result of a stack overflow exception check when floating point access is performed to a stack register simulated by the RISC processor;
- the upper bound and lower bound address registers are used to store the effective address of the upper boundary and the lower bound when simulating the bounded memory access mechanism of the X86 processor;
- the analog flag register is used to simulate a flag register flag bit of the X86 processor; the virtual machine mode control register includes a control bit flag, and when the control bit flag is 1, it indicates that the corresponding instruction is running in the X86 virtual state. In the machine instruction set mode; when the control bit flag is 0, it means that the corresponding instruction runs in the non-X86 virtual machine instruction set mode.
- the RISC processor supporting the X86 virtual machine further includes a floating point register file; the floating point register file includes a floating point control register; a floating point register stack, and first to third floating point registers.
- the virtual machine instruction set includes one or a combination of one of a memory access extension instruction, a prefix instruction, an EFLAG flag bit related instruction, a floating point stack related instruction, and a lookup table related instruction.
- the decoder includes an instruction processing module, and a pattern recognition module, wherein:
- the instruction processing module is configured to decode an instruction of a virtual machine instruction set, and then output a given point operation component or a floating point operation component;
- the pattern recognition module is configured to distinguish the virtual machine instruction set mode of the instruction during the instruction decoding process, and perform corresponding processing.
- the mode recognition module includes a multiple storage decoding module and/or a multiple reading decoding module, and the multiple storage decoding module is configured to: when the input instruction is a storage operation instruction in the memory expansion instruction, The source register is expanded from one to a plurality of adjacent registers, and then output to the memory access execution unit;
- the multiple reading and decoding module is configured to decode the read operation instruction into a plurality of internal operation instructions when the input instruction is a read operation instruction in the memory expansion instruction, and expand the target register by one extension A plurality of adjacent registers are then allocated to the plurality of internal operations, and the output is executed by the memory access execution unit.
- the pattern recognition module further includes a prefix instruction decoding module and a flag bit instruction decoding module;
- the flag bit instruction decoding module is configured to process an EFLAG flag bit related instruction in an analog EFLAGS working mode, and decode the analog flag register into a source register of the instruction according to different EFLAG flag related instructions. Or target register;
- the prefix instruction decoding module is configured to indicate that the multiple instructions after the prefix instruction are in the X86 virtual machine instruction set mode.
- the decoder further includes a prefix instruction counter for recording the number of instructions of the sequence of instructions affected by the prefix instruction and without the branch instruction, the number of instructions being equal to the range parameter.
- the decoder further includes a TOP pointer register, and a lookup table module, wherein:
- the TOP pointer register is configured to maintain a floating point stack operation pointer, and store a value of the floating point stack operation pointer
- the lookup table module is configured to implement conversion from an X86 source instruction address to a MIPS target instruction address by using a lookup table according to a lookup table related instruction.
- the fixed point operation component includes a flag read/write module, a flag operation module, an exception processing module, and a prefix exception control register;
- the flag reading and writing module is configured to read and write a value of an analog flag register flag bit
- the flag operation module is configured to: when the RISC processor is in the X86 virtual machine working mode, obtain the analog flag register flag according to the operation result, or according to one or more bits in the analog flag register flag bit, Executing a branch jump instruction;
- the exception processing module is configured to: when the prefix instruction only affects an instruction immediately following, if an execution exception occurs, the bd bit of the Cause register is set in the same manner as the delay slot exception, and the EPC is pointed to the prefix.
- the instruction re-executing the prefix instruction after the exception service program is completed; the prefix exception control register is configured to record whether the instruction that the exception occurs is affected by the prefix instruction; and the current instruction count is stored when the exception occurs and the process is interrupted. When the abnormal end returns to the interrupted process, the interrupted process is resumed according to the count.
- the floating point operation component includes a pointer operation module, a stack overflow determination module, and a conversion module; the pointer operation module is configured to operate the TOP pointer register, and simulate the operation of the floating point register stack, The stack operation of the stack operation pointer, modifying and monitoring the state of the operation pointer;
- the stack overflow judging module is configured to check a chirp register in a specified floating point register stack, and The overflow check register is operated according to the value of the stack register, and the stack overflow exception check is performed during floating point access;
- the conversion module is configured to perform mutual conversion between extended double precision floating point data and double precision floating point data.
- a data processing method for a RISC processor device supporting an X86 virtual machine which includes the following steps:
- Step A setting the working mode of the RISC processor in the RISC processor to the X86 virtual machine working mode
- Step B reading an instruction to distinguish the virtual machine instruction set mode of the instruction; in the instruction decoding process, decoding the instruction according to the differentiated virtual machine instruction set mode according to the virtual machine instruction set mode of the differentiated instruction After output
- Step c according to the output, perform corresponding calculation or access processing, and output the executed result.
- the RISC processor supports the data processing of the X86 virtual machine as support for using the EFLAG instruction
- the step A is specifically:
- Step A1 setting the working mode of the RISC processor in the RISC processor to the X86 virtual machine working mode, indicating that the analog flag register is available;
- the step B is specifically:
- Step Bl the decoder recognizes that the operation is in the analog EFLAGS working mode, and then decodes the analog flag register into a source register and/or a target register according to different instructions;
- the step C is specifically:
- Step C1 during the operation of the RISC processor, when the working mode of the RISC processor is the X86 virtual machine working mode, the value of the analog flag register flag bit is read/written to realize the acquisition/storage of the operation state, and according to the operation result
- the analog flag register flag or the branch jump instruction is executed according to one or more bits in the analog flag register flag.
- the step A is specifically:
- Step A2 determine whether the floating point register is selected for simulating the floating point register stack operation; or set a general purpose register, the lower 8 bits of which represent the floating point register stack from low to high respectively The state of the stack register of 0 ⁇ 7; or select any three general-purpose registers as the first floating-point register, the second floating-point register and the third floating-point register, and perform format conversion of 64-bit floating-point number and 80-bit floating-point number. jobs;
- the step B is specifically:
- Step B2 storing the value of the stack operation pointer in the 3-bit TOP pointer register in the decoder; or decoding the newly added stack overflow judgment instruction; or converting the extended double-precision floating-point data and the double-precision floating-point data Instruction decoding
- the step C is specifically:
- Step C2 when simulating the floating-point register operation, operating the pointer register, simulating the stack operation of the stack operation pointer, modifying and monitoring the state of the stack operation pointer; or checking the stack register in the specified floating-point register stack, and
- the overflow check register is operated according to the value of the stack register to perform a floating-point stack overflow check; or the data conversion between the extended double-precision floating-point data and the double-precision floating-point data is performed.
- the step A is specifically:
- Step A3 in the X86 virtual machine of the RISC processor, setting two general-purpose registers as an upper bound address register and a lower bound address register;
- the step B is specifically:
- Step B3 when performing the X86 virtual machine instruction set to the MPS instruction set translation, the decoder decodes the instruction to obtain a binary code that can be processed by the RISC processor;
- the step C is specifically:
- Step C3 The fixed-point operation unit determines the validity of the instruction operand address and the instruction address according to the upper bound address stored in the upper bound address register and/or the lower bound address stored in the lower bound address register in the decoded memory fetch instruction. ; When the instruction operand address and the instruction address are both valid, the memory access operation is performed; otherwise, the address error exception is caused.
- step A is specifically:
- Step A4 reading the prefix instruction to distinguish the virtual machine instruction set mode of the instruction; or the processor fetching the multiple data width instruction input to the decoder; or in the X86 virtual machine of the RISC processor
- Step A4 initialize the lookup table, and fill in the lookup table with the contents of the obtained X86 virtual machine instruction address to the MDPS instruction address;
- the step B is specifically:
- Step B4 in the instruction decoding process, according to the virtual machine instruction set mode of the differentiated instruction, the instruction is decoded according to the differentiated virtual machine instruction set mode, and the decoder determines the instruction type, and identifies Decoding a multiple data width instruction; or the decoder identifies a lookup table related instruction for decoding;
- the step C is specifically:
- Step C4 the fixed point operation component executes the instruction affected by the prefix instruction, and calculates a corresponding EFLAG flag bit according to the operation result; or sends the decoded multiple data width instruction to the memory access execution unit to perform the operation; or performs a lookup table correlation
- the instruction gets the value of the target instruction address or jumps to the target address for execution.
- FIG. 1 is a schematic structural diagram of a RISC processor device supporting an X86 virtual machine according to the present invention
- FIG. 2 is a flow chart of a data processing method for a RISC processor supporting an X86 virtual machine according to the present invention. The best way to implement the invention
- the RISC processor of the MIPS64 instruction set is taken as an example to describe the RISC processor device and method for supporting the X86 virtual machine in the present invention.
- the present invention is not limited thereto. The scope of protection requested is subject to the claims.
- the RISC processor device and method supporting the X86 virtual machine of the present invention in order to solve the semantic gap between the X86 and RISC processor architectures, implement X86 processor compatibility support on the RISC processor, and need to be solved on the RISC processor.
- the RISC processor supporting the X86 virtual machine of the present invention includes an instruction module 1, a decoder 2, a lookup table (not shown), a fixed point operation unit 3, a general physical register file 7, and a floating point operation.
- Component 4 floating point physical register file 8, fetch execution unit 5, memory and data path 6, etc.
- the instruction module 1 is configured to store a virtual machine instruction set supporting an X86 virtual machine, where the virtual machine instruction set may include a memory access extension instruction, a prefix instruction, an EFLAG flag bit related instruction, a floating point stack related instruction, and a lookup table correlation. One or more combinations of instructions.
- the decoder 2 is configured to distinguish the virtual machine instruction set mode of the instruction in the virtual machine instruction set instruction decoding process, and decode the instruction according to the differentiated virtual machine instruction set mode, and output the given point.
- the lookup table is configured to store a jump address and a MIPS jump address in the X86 program, and support fast translation of the jump address to the MIPS jump address in the X86 program according to the output of the decoder.
- the fixed point arithmetic unit 3 is for processing the fixed point instruction of the virtual machine instruction set based on the output of the decoder 2, and outputs the execution result.
- the floating point arithmetic unit 4 is configured to process a floating point instruction of the virtual machine instruction set according to the output of the decoder 2, and output an execution result.
- the memory access execution unit 5 is configured to perform data transmission between the register and the memory through the data path according to the output of the decoder.
- the decoder 2 includes an instruction processing module 21, a pattern recognition module 24, a TOP pointer register 22, and a lookup table module 23.
- the instruction processing module is configured to perform instruction decoding on the instruction of the virtual machine instruction set, and then output the given point operation component 3 or the floating point operation component 4 or the memory access execution unit 5;
- the pattern recognition module 24 is configured to distinguish the virtual machine instruction set mode of the instruction during the instruction decoding process, and perform corresponding processing.
- the pattern recognition module 24 includes a multiple storage decoding module 244 and/or a multiple reading decoding module
- the multiple storage decoding module 244 is configured to expand the source register into one of a plurality of adjacent registers when the input instruction is a memory operation instruction in the memory expansion instruction, and then output the result to the memory access execution unit 5 carried out;
- the multiple read decoding module 245 is configured to decode the read operation instruction into a plurality of internal operation instructions when the input instruction is a read operation instruction in the memory expansion instruction, and set the target register by The expansion is performed into a plurality of adjacent registers, and then distributed to the plurality of internal operations, and the output is executed to the memory access execution unit 5.
- the pattern recognition module 24 further includes a prefix instruction decoding module 241 and a flag bit instruction decoding module 243.
- the flag bit instruction decoding module 243 is configured to be in an analog EFLAGS working mode.
- the EFLAG flag related instruction is processed, and the analog flag register 71 is decoded into the source register and/or the target register of the instruction according to different EFLAG flag related instructions;
- the prefix instruction decoding module 241 is configured to indicate that multiple instructions after the prefix instruction are in the X86 virtual machine instruction set mode; further, when the range parameter of the prefix instruction is n, the decoder 2 further includes a prefix instruction. a counter 242, configured to record an instruction sequence of the instruction sequence affected by the prefix instruction and not having a branch instruction, the instruction number being equal to the range parameter;
- the TOP pointer register 22 is configured to maintain a floating point operation pointer, and store a value of a floating point stack operation pointer
- the lookup table module 23 is configured to use a lookup table to implement conversion from an X86 source instruction address to a MIPS target instruction address according to a lookup table related instruction.
- the fixed point arithmetic unit 3 includes a flag read/write module 31, a flag operation module 32, an exception processing module 34, and a prefix exception control register 33.
- the flag read/write module 31 is configured to read and write the value of the flag of the analog flag register 71;
- the flag operation module 32 is configured to perform the operation result, when the RISC processor is in the X86 virtual machine working mode, according to the operation result Obtaining an analog flag register flag bit, or executing a branch jump instruction according to one or more bits in the analog flag register flag bit;
- the exception processing module 34 is configured to: when the prefix instruction affects only one instruction immediately following, if an execution exception occurs, the bd bit of the Cause register is set in the same manner as the delay slot exception, and the EPC is pointed at the same time.
- the prefix instruction re-executes the prefix instruction after the exception service program is completed.
- the prefix exception control register 33 is configured to record whether an instruction that generates an exception is affected by the prefix instruction; store a count of the current instruction when an exception occurs and interrupt the process, and return to the interrupted process when the abnormal end is returned, according to the Counting resumes the interrupted process.
- the general physical register file 7 includes an overflow check register 72, an upper bound, a lower bound address register 74, an analog flag register 71, and a virtual machine mode control register 73.
- the overflow check register 72 is configured to store a result of checking for an overflow exception when performing floating point access to the RISC processor emulated ⁇ register;
- the upper bound and lower bound address register 74 is configured to simulate an effective address of the upper boundary and the lower bound when simulating the bounded memory access mechanism of the X86 processor;
- the analog flag register 71 is configured to simulate a flag register flag bit of the X86 processor; the virtual machine mode control register 73 includes a control bit flag. When the control bit flag is 1, it indicates that the corresponding instruction is running at this time. In the X86 virtual machine instruction set mode; when the control bit flag is 0, it means that the corresponding instruction runs in the non-X86 virtual machine instruction set mode.
- the floating point arithmetic unit 4 includes a pointer operation module 41, a stack overflow judgment module 43, and a conversion module 42.
- the pointer operation module 41 is configured to operate the TOP pointer register, simulate the stack operation of the stack operation pointer, and modify and monitor the state of the stack operation pointer when the floating point register ⁇ 83 is simulated;
- the stack overflow judging module 43 is configured to check a stack register in the specified floating point register stack 83, and operate the overflow check register 72 according to the value of the stack register to perform an overflow exception check when performing floating point access;
- the conversion module 42 is configured to perform mutual conversion between extended double precision floating point data and double precision floating point data.
- the floating point register file 8 includes a floating point control register 81; a floating point register stack 0-7; and a 1 ⁇ 3 floating point register 82.
- the three registers of the first to third floating point registers 82 can be overlapped and applied to the floating point register stacks 0 to 7.
- the memory access execution unit 5 includes a merging unit, an upper and lower boundary determining module.
- the merging unit is configured to merge the multiple internal operations before the execution unit performs after the multiple read decoding module 244 decodes the read memory operation instruction.
- the upper and lower bound determination module is configured to support validity determination of an address included in the access command by the upper bound and the lower bound address when the bounded memory access instruction is supported.
- a data processing method for a RISC processor device supporting an X86 virtual machine is provided, which includes the following steps:
- Step A setting the working mode of the RISC processor in the RISC processor to the X86 virtual machine working mode
- Step B reading an instruction to distinguish the virtual machine instruction set mode of the instruction; in the instruction decoding process, decoding the instruction according to the differentiated virtual machine instruction set mode according to the virtual machine instruction set mode of the differentiated instruction After output
- Step C Perform corresponding calculation or access processing according to the output, and output an execution result.
- the step A is specifically:
- Step A setting the working mode of the RISC processor in the RISC processor to the X86 virtual machine working mode, indicating that the analog flag register 71 is available;
- the step B is specifically:
- Step Bl the decoder recognizes that the operation is in the analog EFLAGS mode of operation, and then decodes the analog flag register 71 into a source register and/or a destination register according to different instructions;
- the step C is specifically:
- Step C1 During the operation of the RISC processor, when the working mode of the RISC processor is the X86 virtual machine working mode, the value of the flag of the analog flag register 71 is read and written to realize the acquisition/storage of the operation state, and/or according to the simulation. The value of the flag register 71 flag is controlled.
- the RISC processor supports the data processing of the X86 virtual machine for X86 floating point format and floating point ⁇ support,
- the step A is specifically:
- Step A2 determine whether the floating point register is selected for simulating the floating point register ⁇ 83 operation; or set a general purpose register, the lower 8 bits of which represent the floating point register ⁇ 83 from 0 to 0
- the status of the stack register of the 7th; or any three general-purpose registers, as the 1 ⁇ 3 floating-point register 82, is used for the format conversion of 64-bit floating-point numbers and 80-bit floating-point numbers;
- the step B is specifically:
- Step B2 storing the value of the stack operation pointer in the 3-bit TOP pointer register in the decoder; or decoding the newly added stack overflow judgment instruction; or converting the extended double-precision floating-point data and the double-precision floating-point data Instruction decoding
- the step C is specifically:
- Step C2 when the floating point register stack 83 is operated, the pointer register is operated, the stack operation of the operation pointer is simulated, the state of the operation pointer is modified and monitored, or the stack register in the specified floating point register stack 83 is checked.
- the overflow check register 72 is operated according to the value of the ⁇ register to perform a floating point ⁇ overflow check; or data conversion between the extended double precision floating point data and the double precision floating point data is performed.
- the step A is specifically:
- Step A3 in the X86 virtual machine of the RISC processor, set two general-purpose registers as upper bound and lower bound address registers 74;
- the step B is specifically:
- Step B3 when performing the X86 virtual machine instruction set to the MIPS instruction set translation, the decoder decodes the instruction to obtain a binary code that can be processed by the RISC processor;
- the step C is specifically:
- Step C3 The fixed-point operation unit determines the instruction operand according to the upper bound address stored in the upper bound address register and/or the lower bound address stored in the lower bound address register in the decoded memory access instruction. The validity of the address and instruction address; when the instruction operand address and the instruction address are both valid, the memory access operation is performed; otherwise, the address error exception is caused.
- the step A is specifically:
- Step A4 reading the prefix instruction, distinguishing the virtual machine instruction set mode of the instruction; or the processor extracting the multiple data width instruction input to the decoder; or initializing the lookup table when the X86 virtual machine of the RISC processor is started, The X86 virtual machine instruction address to the contents of the MIPS instruction address to fill in the lookup table;
- the step B is specifically:
- Step B4 in the instruction decoding process, according to the virtual machine instruction set mode of the differentiated instruction, the instruction is decoded and output according to the differentiated virtual machine instruction set mode; or the decoder determines the instruction type, identifies and Decoding a multiple data width instruction; or the decoder identifies a lookup table related instruction; the step C is specifically:
- Step C4 the fixed point operation component executes the instruction affected by the prefix instruction, and calculates the corresponding EFLAG flag bit according to the operation result.
- the decoded multiple data width instruction is sent to the memory access execution unit to perform the operation.
- execute the lookup table related instruction to get the value of the target instruction address or jump to the target address for execution.
- EFLAG instructions In order to support the use of EFLAG instructions, two methods are provided: one is to expand each physical register in the physical register file to 72 bits, including 64-bit data bits and 8-bit flag bits. When the operation is performed, the data portion of the operation result and the flag portion are written back to the target register. At the same time, a new flag bit pointer Reflag is set in the decoder 2 to indicate the general register logical number combined with the latest flag bit. The other is to add an internal logic register to the physical register file to implement the X86 EFLAG flag. For each instruction that modifies EFLAG, a new related instruction is added to specifically modify the EFLAG.
- the first is to increase the EFLAG bit "horizontal" in each register; the second method is to add a register in the "vertical" of all registers to specifically save the EFLAG bit.
- the analog flag register 71 is used to simulate the CISC implementing the X86 instruction set.
- the processor's flag register (EFLAGS) flag bits which indicate the CF bit, PF bit, A bit, ZF bit, SF bit, and OF bit, respectively, from low to high.
- Step 110 setting the working mode of the RISC processor in the RISC processor to the X86 virtual machine working mode, that is, the analog flag register 71 is available, and the decoder 2 recognizes that the operation is in the X86 virtual machine working mode of the RISC processor, that is, In the analog EFLAGS mode of operation, the analog flag register 71 is then decoded into a source register and/or a destination register according to different instructions;
- the analog flag register emulates the flag register (EFLAGS) flag of the X86 instruction set.
- the lower six bits of the register represent the CF bit, PF bit, AF bit, ZF bit, SF bit and low, respectively. OF bit.
- the analog flag register 71 When the analog flag register 71 is available, it is recognized that the operation is in the X86 virtual machine working mode of the RISC processor, that is, in the analog EFLAGS working mode, the value of the corresponding analog flag register 71 is modified according to the execution result, and then according to different instructions, The analog flag register is decoded as a source register and/or a destination register, and the result may not be saved in the original destination register.
- the instruction associated with the analog flag register modifies the flag bit of the analog flag register
- the instruction is preceded by a prefix instruction SETFLAG indicating that the instruction is in the X86 virtual machine working mode of the RISC processor. If the subsequent instruction is in X86 virtual machine mode.
- the instruction format is: SETFLAG / Analog EFLAGS working mode prefix instruction
- the instruction to modify the flag of the analog flag register 71 is:
- the input set of decoder 2 is all possible 32-bit codes, including all legal and illegal instructions.
- decoder 2 adds a legal input, SETFLAG, indicating that an instruction following the instruction is in the X86 virtual machine operating mode of the RISC processor, ie, the simulated EFLAGS mode of operation.
- the decoder 2 outputs an instruction according to the analog EFLAGS working mode, and adjusts the internal operation code to the fixed-point operation unit 3 according to the prefix instruction.
- the destination register of the instruction is decoded.
- the analog flag register M-EFLAGS
- one of the source registers is also the analog flag register (M-EFLAGS). Since some operations only modify a part of the analog flag register (M-EFLAGS), the original analog flag register (M-EFLAGS) needs to be sent to the fixed point arithmetic unit 3.
- the instruction After decoding by the decoder 2, the instruction is output to the fixed-point arithmetic unit 3, and the fixed-point arithmetic unit 3 judges the internal operation code. If it is a normal command, it operates according to the normal procedure; if it is in the simulated EFLAGS working mode, the result is calculated first, and then According to the calculation result and the intermediate result, the analog flag register (M-EFLAGS) flag is set, and the calculation result may not be saved in the target register.
- M-EFLAGS analog flag register
- Step 120 During the operation of the RISC processor, when the RISC processor is in the X86 virtual machine operating mode, the analog flag register flag is read and written. The value, and/or control is based on the value of the analog flag register flag.
- reading and writing the value of the analog flag register flag includes the following steps: Step 121: When the RISC processor is in the X86 virtual machine working mode, extract the value of one or more bits of the analog flag register flag, according to The 8-bit mask value is used to control one or several bits in the analog flag register, and the value of the extracted analog flag register 71 flag is stored in the target register;
- Step 122 When the RISC processor is in the X86 virtual machine working mode, modify the value of one or more bits of the analog flag register flag, and control one bit in the analog flag register according to the 8-bit mask value. Or a few bits, modify the analog flag register using the value in the source register.
- the embodiment of the present invention modifies or reads the value of the analog flag register flag by two instructions MTFLAG and MFFLAG, and uses an 8-bit mask to modify or read the corresponding of the analog flag register.
- Flag bits which respectively write the value of the analog flag register flag and read the value of the analog flag register flag into a specified general-purpose register.
- the MTFLAG instruction implements the extraction of the value of one or more bits of the analog flag register (M-EFLAGS) flag, and controls the extraction of one of the analog flag registers according to the 8-bit mask value (represented by the immediate value) in the instruction. Bit or number, the value of the extracted analog flag register (M-EFLAGS) flag is stored in the destination register GPR[rt].
- the analog flag register will be fetched.
- the second bit is the contents of the AF bit and is placed in the destination register GPR[rt].
- the MTFLAG instruction directly modifies the value of one or more bits of the analog flag register (M-EFLAGS) flag, and controls the modification of the analog flag register (M- according to the 8-bit mask value (indicated by the immediate value) in the instruction.
- One or more bits in EFLAGS modify the analog flag register (M-EFLAGS) using the value in the GPR[rs] source register.
- this instruction repairs the CF, PF, SF, and OF bits in the analog flag register (M-EFLAGS). Set the values of these four bits to 0, 1, 1, and 0, respectively.
- the control process includes the following steps - step 121', and the analog flag register (M-EFLAG) flag bit is obtained according to the operation result; for example, according to the analog flag register (M-EFLAG) flag bit, directly operated Instructions such as the X86ADD instruction.
- M-EFLAG analog flag register
- the X86ADD instruction implements the 32-bit integer in the GPR [rs] register and the 32-bit integer in the GPR [rt] register to produce a 32-bit result.
- the result is not saved. Only the OF of the analog flag register (M-EFLAGS) is modified according to the result. /SF/ZF/AF/PF bit.
- Step 122 Perform a branch jump instruction according to one or more bits in the analog flag register (M-EFLAG) flag bit.
- M-EFLAG analog flag register
- the X86J instruction implements comparing certain bits of EFLAGS and performs processor-related jumps according to the corresponding conditions.
- the upper 6 bits (31bit: 26bit) of the 32-bit instruction code of the MIPS64 instruction set are opcode fields.
- the SPECIAL2 (opcode is 011100) instruction slot can be defined by the user according to the MIPS specification.
- the new instructions in the embodiment of the present invention are all implemented by using the value of the SPECIAL2 empty slot reserved in the existing MIPS64 instruction set.
- the RISC processor device supports the data processing method process of the X86 virtual machine when the data processing process of the processor supporting the X86 virtual machine is supported for X86 floating point format and floating point ⁇ in detail.
- X86 provides a special arithmetic component that supports 80-bit floating-point precision and is a stack operation, which is quite different from RISC processors.
- the invention realizes support for the floating point format and the floating point stack, and adds a conversion instruction between three 64-bit floating point numbers and 80-bit floating point numbers, and sets an instruction from 80-bit floating-point number to 64-bit floating-point number, from Convert 64-bit floating-point numbers to 80-bit floating-point numbers and set two instructions.
- 32 general-purpose floating-point registers of the RISC physical register file including the MIPS instruction set are dynamically selected as any of the first-to-three floating-point registers 82 for the conversion work. After the conversion is completed, these three general-purpose registers can be used separately from other general-purpose registers.
- the first floating point register is configured to store a sign bit and a step of the extended double precision floating point data, occupying the lower 16 bits of the register;
- the second floating point register is configured to store a mantissa portion of the extended double precision floating point data, which is 64 bits in total;
- the third floating point register is configured to store double precision floating point data.
- the RISC processor device supports the data processing method process of the X86 virtual machine, including the following steps.
- Step 210 dividing the 80-bit extended double-precision floating-point data in the memory into a sign bit and a step part, and a mantissa part, respectively storing them in different first floating point registers and second floating point registers, by using floating point arithmetic parts 4 is converted to 64-bit double-precision floating-point data and stored in the third floating-point register.
- Step 210 specifically includes the following steps:
- Step 211 the 80-bit extended double-precision floating-point data in the memory is divided into a sign bit and a step part, and a mantissa part.
- the 80th to the 64th are the first part, a total of 16 bits, and the 63rd to the 0th are the second part, a total of 64 bits.
- the user selects an existing read-in method (MIPS provides multiple read-in methods), and reads the two parts into two floating-point registers $f (i) , $f (j );
- Step 212 The floating point register $f (i) stores the sign bit and the order of the 80-bit extended double-precision floating-point data, occupying the lower 16 bits of the register;
- Step 213 the floating-point register $f (j) stores the mantissa portion of the 80-bit extended double-precision floating-point data, which is 64 bits in total;
- Step 214 using the floating point register $f (i) and the floating point register $f (j ) as the source register, the floating point register $f (t) as the target register, the floating point register $f (i) and the floating point
- the 80-bit extended double-precision floating-point data stored in register $f (j) is converted to 64-bit double-precision floating-point data.
- the conversion can be performed by the instruction (1).
- the upper 6 bits (31 bits: 26 bits) of the 32-bit instruction code of the MIPS64 instruction set are opcode fields.
- the SPECIALS (opcode 011100) instruction slot can be defined by the user according to the MIPS specification.
- the embodiment of the present invention is defined by the value of the SPECIAL2 empty slot reserved in the existing MIPS64 instruction set.
- Equation (1) shows that $f ⁇ 3 ⁇ 4, $f (the extended double-precision data represented by the two stack registers is converted to a double-precision number and stored in the stack register $ ⁇ ).
- the output 64-bit data is stored in the floating-point register $£ (t) to obtain 64-bit double-precision floating-point data.
- Step 220 Extract 64-bit double-precision floating-point data in the third floating-point register, extract the sign bit and the step part, and the mantissa part, and convert the symbol bit and the step part of the 80-bit floating-point data by the floating-point arithmetic component 4, and
- the mantissa portion of the 80-bit floating-point data is stored in the first floating-point register and the second floating-point register, respectively, and the 80-bit extended double-precision floating-point data is represented by two registers to obtain 80-bit floating-point data.
- Step 220 specifically includes the following steps: Step 221, storing a 64-bit double-precision floating-point data into the floating-point register $f (t); Step 222, extracting the sign bit and the step part of the double-precision floating-point data in the floating-point register $£ (t)
- the conversion can be performed by the instruction (2).
- the converted step is expanded by 0 to obtain 64-bit floating point data. Since the destination register is 64-bit, only 16-bit data is needed here, but in order to store it in a 64-bit target register $f (i), it is necessary to perform 0-expansion for 48 bits of 16 bits or more. Stored in floating point register f (i);
- Step 223 extracting the mantissa portion of the floating point register $(t) by 53 bits, converting to the mantissa portion of the 80-bit floating point data, 64 bits, and storing it in the floating point register $f (D).
- the extraction is done in floating-point arithmetic unit 4, which converts the extracted 53-bit data into 64-bit parts of the 80-bit floating-point data.
- the conversion can be performed by the instruction (3).
- the extraction and conversion may be performed in accordance with the relevant provisions of the IEEE 754 standard, and those skilled in the art may implement the conversion of the present invention according to the instruction (2), and therefore, will not be described in detail in the present invention.
- Step 224 the value of the floating point register $ f (i) is used as the sign bit and the order, the floating point register $ f
- (j ) The value of (j ) is used as the mantissa to obtain 80-bit extended double-precision floating-point data.
- the floating point data conversion of the invention enables the processor of the non-X86 architecture to support the special 80-bit floating point data type in the X86, thereby facilitating the binary translation work of the virtual machine, improving the efficiency of the virtual machine and enhancing the compatibility of the processor.
- the floating-point register number given by the partial floating-point instruction is a relative value, which must be added to the top-of-stack pointer TOP of the floating-point loop stack in the floating-point status word to be the true floating-point register. number.
- the present invention sets the TOP pointer register 22 in the decoder 2, and maintains a stack enable signal in the floating-point control register 81 in the floating-point physical register file to determine whether or not eight floating-point registers are selected.
- a stack enable signal used to simulate floating point ⁇ , if the stack enable is set, in the corresponding floating point instruction operation, any register with register number less than 8 will modify its own source or destination logical register number according to the value of TOP during decoding. And modify the TOP value according to the content of the instruction; then send it to the processor; if the stack enable bit is cleared, then in the operation, the register emulation stack is considered to be absent, and the normal work step is performed normally.
- the floating point control register 81 is configured to control the use of the floating point register file 8 to enable or disable the analog floating point register ⁇ 83.
- the processor When the enable bit is set, the processor will simulate the floating-point register stack operation of the X86 processor; when the enable bit is set to 0, the processor will not emulate the floating-point register of the X86 processor. ⁇ Operation, the processor operates in accordance with the normal process.
- 32 floating-point registers of the X86 processor are simulated by using 32 existing floating-point registers numbered 0-31 in the RISC processor.
- the TOP pointer register 22 is used to maintain a TOP pointer, that is, a stack operation pointer, and stores a value of the TOP pointer.
- the TOP pointer can be read, written, incremented by 1, or decremented by one.
- the pointer operation module 41 is configured to operate on the pointer register, simulate the stack operation of the pointer operation of the pointer register when simulating the floating-point register stack operation, and modify and monitor the state of the operation pointer.
- the serial number is 0 ⁇ 7.
- the stack enable bit in the floating-point control register 81 is set to 1, it is used in the operation, indicating that the floating-point register stack of the register emulation exists, then any register with a number less than 8 used in the floating-point operation instruction, Both are used as stack registers for floating point registers ⁇ 83 to emulate the floating point register stack of the X86 processor.
- the pointer operation module then uses the TOP pointer to convert the stack register number, that is, the floating point register number seen by the user is converted with the floating point register number used by the program. For example, the register number refers to the register ST of the i-th unit from the top. (i) Add the TOP pointer value.
- the floating-point register stack 83 is composed of eight floating-point registers of the RISC processor, passes through the floating-point control register 81, and is simulated.
- the TOP pointer function of X86 that is, the stack pointer operation function, completes the stack operation of the analog floating point register.
- the method for simulating floating point chirp operation of the RISC processor supporting the X86 virtual machine of the present invention comprises the following steps:
- Step 2100 determine whether 8 floating point registers are selected for simulating 8 stack registers in the floating point register stack, simulate floating point register stack operations, and set a pointer register; the step 2100 includes the following steps :
- Step 2110 selecting one bit in the floating-point control register 81 as a floating-point stack enable bit; when the enable bit is 1, indicating that the floating-point stack of the X86 processor is to be simulated, performing a floating-point stack operation; when the enable position is 0 When it is, it means that the floating-point stack of the X86 processor is not simulated, the floating-point stack operation cannot be performed, and the processor works according to the normal process;
- Step 2120 setting a pointer register of at least 3 bits, and storing the value of the TOP pointer.
- the value of the TOP pointer can be read, written, incremented by 1, or decremented by 1.
- the TOP pointer ranges from 0 to 7.
- the TOP pointer is pushed into register No. 7 when the stack is pushed, and the value of the TOP pointer is set to 6; if the TOP pointer value is 7, during the impeachment, the TOP pointer value is set to 0 after the stack.
- the stack grows from top to bottom, that is, the TOP pointer value is decremented by one when the stack is pushed, and the TOP pointer value is incremented by one when popping up, so when the data is stored in the 7th register (that is, to 7)
- the number of registers is pushed, and the value of the TOP pointer should be decremented by one to six.
- the TOP pointer value should be incremented by 1 to 8, but since there are only 8 registers from 0 to 7 Therefore, the TOP pointer value is a maximum of 7.
- the TOP pointer should point to the next register, that is, the 0th register in the loop stack, and the TOP pointer value should become 0.
- Step 2200 when the floating-point register stack operation is simulated, the pointer register is operated to simulate the stack operation of the stack operation pointer. , modify and monitor the status of the operation pointer.
- the step 2200 includes the following steps:
- Step 2210 setting the operation mode, the floating-point stack enable position 1, allowing the user to simulate the floating-point register stack for the floating-point stack operation;
- setting the analog floating-point stack mode to set the X86 floating-point stack mode can be performed by the following instructions.
- the memory access extension instruction provided by the present invention uses the reserved value of the empty slot of SPECIAL2 in the MIPS instruction set to define the extended instruction.
- the enable position 1 operation is completed by the instruction, which sets the X86 floating-point stack mode, allowing the user to use the x86 floating-point stack for floating-point operations.
- Step 2220 clearing the stack operation mode, the floating-point stack enable position is 0, and the user is not allowed to simulate the floating-point register stack to perform a floating-point stack operation;
- the embodiment of the present invention clears the floating-point stack mode, and the instruction format of the X86 floating-point stack mode is set to 0: CLRTM
- the set and clear stack pointer operation instructions can complete the activation and deactivation of the floating point register.
- step 2230 the value of the stack operation pointer is increased by 1, that is, the value of the TOP pointer is increased by one;
- the value of the stack pointer is increased by 1, that is, the instruction format of the value of the TOP pointer is increased by one: INCTOP Step 2240, the value of the operation pointer is decremented by 1, that is, the value of the TOP pointer is decreased by 1;
- the stack pointer value is decreased by 1, that is, the instruction format of the value of the TOP pointer minus 1 is: DECTOP
- the value of the TOP pointer is increased by one, and the minus one instruction can simulate the stacking and popping work of the X86 processor floating point ⁇ ;
- Step 2250 reading the operation pointer value, that is, reading the value of the TOP pointer
- the instruction format for reading the TOP pointer value operation in the embodiment of the present invention is - MFTOP rd
- Its instruction function is to read the value of the X86 floating-point stack top pointer into the register GPR[rd].
- step 2260 the write operation pointer value is written, that is, the value of the current TOP pointer is written in the pointer register.
- the instruction format of the TOP pointer value operation in the embodiment of the present invention is: MTTOP imm
- Its command function is to write the three-digit immediate imm to the x86 floating-point stack top pointer.
- the read and write TOP pointer instructions can conveniently control the operation of the floating point stack.
- the analog X86 floating point stack operation is activated, even if it can be set to 1;
- $f(9) does not need to be converted; // 9>7 so no conversion is needed, directly use register $9)
- the final expression for the actual operation is add.s $f(0), $f(3), $f(9 ).
- the floating-point register stack 83 is composed of 8 stack registers that can directly perform floating-point operations, and is numbered sequentially according to the order, respectively 0 ⁇ 7;
- the overflow check register 72 is configured to implement the function of the TAG in the floating point flag register of the X86, and to detect floating point access to the stack register in the floating point register stack 83.
- a ⁇ overflow exception occurs, which is a multi-bit register of at least 8 bits representing the TAG bit, that is, the overflow check function bit, which indicates the state of stack registers 0 to 7 of the floating-point register stack 83, respectively.
- a general-purpose register r(i) is selected, and the lower 8 bits of the low-to-high state respectively indicate the state of the stack register 0 ⁇ 7 of the floating-point register ⁇ 83.
- each bit corresponds to a stack register in the floating-point register stack 83, and the value of each bit represents a different state, wherein 0 means empty, can be pushed, cannot be popped, otherwise Overflow; 1 means valid, no more pressure, otherwise it will overflow.
- the RISC processor of the present invention includes a floating-point register stack 83 consisting of a total of 32 multi-bit floating-point registers of 0 ⁇ 31, wherein 0 ⁇ 7, a total of 8 stack registers , emulating 8 stack registers of X86 floating-point register stack 83; in RISC processor, it also includes a 32-bit general-purpose register (fixed point) r(i), whose low 8 bits represent low-to-high floating-point registers respectively
- the state of the stack register 0 ⁇ 7 of the stack 83 completes the TAG function in the X86 floating point stack mechanism.
- the stack overflow judging module 43 is configured to check the stack register in the specified floating point register stack 83, and operate the overflow check register 72 according to the value of the stack register to perform a floating point stack overflow check.
- the floating stack register stack 83 is composed of 8 stack registers of the RISC processor; Register 72, whose lower 8 bits emulate the X86 TAG function, each bit corresponds to a different state of a stack register.
- a method for performing a floating-point stack overflow check on a RISC processor supporting an X86 virtual machine includes the following steps:
- Step 21000 checking the stack register in the specified floating-point register stack, and operating the overflow check register 72 according to the value of the ⁇ register to perform a floating-point stack overflow check;
- the step 21000 includes the following steps:
- Step 21100 Determine whether the specified stack register in the floating-point register stack is empty. If it is empty, set the corresponding position of the TAG bit of the specified overflow check register 72 to 1 and continue execution; otherwise, raise a floating-point stack overflow exception. ; Step 21200: determining whether the specified stack register in the floating-point register stack is valid. If valid, the corresponding position of the TAG bit of the specified overflow check register 72 is 0, and continues to execute; otherwise, a floating-point ⁇ overflow exception is triggered;
- Step 21300 Determine whether the two stack registers specified in the floating-point register stack are valid. If both are valid, and the data in the buffer does not need to be popped, the value of the TAG bit of the specified overflow check register 72 is maintained. And continue to execute; otherwise, raise a floating-point stack overflow exception;
- Step 21400 Determine whether the two stack registers specified in the floating-point register stack are valid. If both are valid, and there is a stack register, the data in the stack register needs to be popped, and the overflow check register corresponding to the stack register of the data is popped. The position of the TAG bit corresponds to 0, and then continues to execute; otherwise, the floating-point stack overflow exception is raised;
- Step 21500 determining whether the two stack registers specified in the floating-point register stack are valid, if all are valid, and the data in the ⁇ register needs to be popped, the two corresponding TAG bits of the overflow check register 72 are corresponding. Bits are set to 0 and then resume; otherwise, a floating-point stack overflow exception is raised.
- the following takes the operation of the floating-point register as an example to further explain the method of floating-point stack overflow check on the RISC processor.
- the RISC processor determines the dome of the floating point register and reads the TAG bit of the overflow check register 72 corresponding to the stack register of the top of the stack;
- the RISC processor determines the dome of the floating-point register stack according to the floating-point register of the present invention, and determines the TAG bit of the overflow check register 72 corresponding to the stack register of the corresponding stack top of the present invention, which is an existing
- the invention is not the invention of the present invention.
- the above operations can be implemented by those skilled in the art according to the description of the embodiments of the present invention. Therefore, the detailed description is not described in detail in the present invention.
- the general register r(3) is selected as the lower 8 bits of the overflow check register r(3), that is, bit r(3)_0 ⁇ bit r(3)_7 respectively Corresponds to the state of the stack registers f(0) ⁇ f(7) in the floating-point register ⁇ .
- bit r(3)—4 of the overflow check register is cleared first, then the data is popped and stored in the specified floating point register.
- the fifth bit of the overflow check register r(3) is judged, that is, whether bit r(3)-4 is 1;
- bit r(3)_4 If it is 1, the 5th bit of the overflow check register, that is, bit r(3)_4 is cleared, and then the operation operation is continued;
- the present invention provides an access operation that supports determining whether an access address is out of bounds, that is, a source register of load and store operations, and a bound register is neither used to calculate an address nor to store data, but is used for accessing The address is compared. If the access address is found to be beyond the boundary specified by the bound register, the address is out of bounds.
- the address boundary is divided into the upper boundary or the lower boundary.
- the effective address of the memory access must be guaranteed not to be greater than the upper boundary or not lower than the lower boundary.
- the upper boundary address register of the physical register file in the embodiment of the present invention is used to store an effective address as an upper bound; and a lower bound address register is used to store an effective address as a lower bound.
- the upper and lower bound address registers may be any of the general purpose registers in the physical registers.
- the upper and lower bound determination module is configured to determine, in the memory access instruction, the validity of the instruction operand address according to the upper bound address stored in the upper bound address register and/or the lower bound address stored in the lower bound address register.
- the judgment of the limit is added. If the access address satisfies the condition, the instruction fetches normally, otherwise the address exception in the MPS is triggered. After the instruction is decoded, the address limit in the register is used as a register operand of the instruction.
- the effective address is first compared with the address boundary in the register, if the semantic condition of the instruction is met, If the register is an upper bound address register, the effective address is less than or equal to the address limit in the register, or if the register is a lower bound address register, the effective address is greater than or equal to the address limit in the register, then the normal save operation is completed; The address is wrong.
- a total of 24 access instructions in the MIPS instruction set including a load instruction and a store instruction, are added to the boundary judgment.
- 12 load instructions including 8 fixed-point instructions, 4 floating-point instructions, and addressing modes are base mode.
- These instructions are byte fetch with upper boundary condition, fetch byte with lower boundary condition, halfword with upper boundary condition, halfword with lower boundary condition, fetch with boundary condition, take down
- the word boundary condition, the double word with the upper boundary condition, the double word with the lower boundary condition, the single precision floating point number with the upper boundary condition, the single precision floating point number with the lower boundary condition, and the upper boundary condition One or more combinations of double precision floating point numbers and double precision floating point numbers with lower boundary conditions.
- GPR[bound] The content in GPR[bound] is the exception of the address exception; otherwise, the 8-bit byte data is fetched from the memory according to the effective address, and the data is extended by the sign bit and stored in GPR[rt].
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs. gsLHGT rt, base, bound
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs. gsLWLE rt, base, bound
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- gsLDLE rt, base, bound First get the effective address from the content of GPR[base]. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued: Otherwise, the 64-bit double word is taken out from the memory according to the aligned effective address to GPR [ Rt].
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs. gsLWLECl ft, base, bound
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- gsLDLECl ft, base, bound First get the effective address from the content of GPR[ba S e]. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued: Otherwise, 64-bit data is fetched from the memory according to the aligned effective address. FPR[ft].
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs.
- Embodiments of the present invention are defined using the values of the LWC2 and SWC2 slots reserved in the existing MIPS64 instruction set.
- the upper 6 bits (31 bits: 26 bits) of the 32-bit instruction code of the MIPS64 instruction set are opcode fields.
- LWC2 (opcode is 110010) and SWC2 (opcode is 111010) instruction slots are user-defined by MIPS.
- These instructions are memory bytes with upper boundary conditions, memory bytes with lower boundary conditions, halfwords with upper boundary conditions, halfwords with lower boundary conditions, stored words with upper boundary conditions, and tapes.
- Words with boundary conditions double words with upper boundary conditions, double words with lower boundary conditions, deposit-precision floating-point numbers with upper boundary conditions, deposit-precision floating-point numbers with lower boundary conditions, and storage with upper boundary conditions
- gsSBLE rt, base, bound First, get the effective address from the content of GPR[base]. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued; otherwise, the 8-bit data content in GPR[rt] is saved to the memory. This is the effective address.
- gsSBGT rt, base, bound
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs. gsSWLE rt, base, bound
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs. gsSDGT rt, base, bound
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs. gsSWLECl ft, base, bound
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- gsSWGTCl ft, base, bound First get the effective address from the content of GPR[base]. If the effective address is not greater than the content in GPR[bound], the address exception is issued; otherwise, the lower 32-bit data content in FPR[ft] is saved to the memory. The valid address of this alignment.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs.
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs.
- the address In the instruction that judges the upper and lower bounds at the same time, the address must satisfy both the upper bound condition and the lower bound condition, and a boundary violation exception will be issued once a boundary is not satisfied.
- the upper and lower bound determination module is configured to determine, in the memory access instruction, the validity of the instruction address according to the upper bound address stored in the upper bound address register and/or the lower bound address stored in the lower bound address register.
- two instructions are added to the RISC processor MIPS instruction set for register value comparison. These two instructions are used to determine whether the address is out of bounds. If the address satisfies the condition, the operation is empty, otherwise RISC is triggered. The exception is the address in the processor.
- the invention supports the bounded memory access process of the RISC processor of the X86 virtual machine, and includes the following steps: Step 31: In the X86 virtual machine of the RISC processor, set two general-purpose registers in the physical register file to be upper and lower bound addresses respectively. Register 74.
- the upper bound address register stores the effective address as the upper bound; the lower bound address register stores the effective address as the lower bound.
- Step 32 When performing the X86 virtual machine instruction set to the MIPS instruction set translation, the decoder decodes the instruction to obtain a binary code that can be processed by the RISC processor.
- Step 33 The fixed-point arithmetic unit 3 determines the validity of the instruction operand address based on the upper bound address stored in the upper bound address register and/or the lower bound address stored in the lower bound address register in the decoded memory access instruction.
- the step 33 includes the following steps:
- the address limit in the register is used as a register operand of the instruction, and the operation content data forms an effective address according to the base method;
- Step 332 the effective address is first compared with an address boundary in the register
- Step 333 if the semantic condition of the instruction is met, that is, if the register is an upper address register, the effective address is less than or equal to the address limit in the register; or if the register is a lower address register, the effective address is greater than or equal to the address boundary in the register , then complete the normal save operation; otherwise, the address exception is raised.
- step 333 for the operation of taking a load instruction, the shell IJ:
- the effective address is first obtained from the content of GPR[base]. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued; otherwise, it is valid according to this.
- the address takes the 8-bit byte data from the memory, and the data is extended by the sign bit and stored in GPR[rt], ie gsLBLE rt, base, bound. If it is a byte-order instruction with a lower boundary condition, the effective address is first obtained from the content of GPR[ba S e].
- the address exception is issued; otherwise, according to this
- the effective address takes the 8-bit byte data from the memory, and the data is extended by the sign bit and stored in GPR[rt], ⁇ P gsLBGT rt, base, bound 0. If it is a half-word instruction with a boundary condition, then Get the effective address from the content of GPR[base]. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued; otherwise, the 16-bit halfword data is taken out from the memory according to the aligned effective address. This data is extended by sign bit and stored in GPR[rt], which is gsLHLE rt, base, bound.
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs. If the half-word is taken with the lower boundary condition, the effective address is first obtained from the content of GPR[ba Se ]. If the effective address is not greater than the content in GPR[boimd], the address exception is issued; otherwise, according to the effective address
- the 16-bit halfword data is taken out of the memory, and the data is extended by the sign bit and stored in GPR[rt], which is gsLHGT rt, base, bound.
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs.
- the effective address is first obtained from the content of GPR[ba S e], and if the effective address is not less than or equal to the content in GPR[b 0 imd], an address exception is issued; otherwise
- the 32-bit word data is fetched from the memory according to the aligned effective address, and the data is bit-symbol-extended and stored in GPR[rt], which is gsLWLE rt, base, bound.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If it is a fetching instruction with a lower boundary condition, the effective address is first obtained from the content of GPR[ba S e]. If the effective address is not greater than the content in GPR[bound], the address exception is issued; otherwise, according to this alignment The effective address is taken out of the 32-bit word data, and the data is extended by the sign bit and stored in GPR[rt], S ⁇ gsLWGT rt, base, boimd.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If it is a double-word instruction with a boundary condition, the effective address is obtained from the content of GPR[base] first. If the effective address is not less than or equal to the content in GPR[bound], an address exception is issued: otherwise, according to this alignment
- the effective address takes the 64-bit double word from memory to GPR[rt], which is gsLDLE rt, base, bound.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs. If the double-word instruction is taken with the lower boundary condition, the effective address is first obtained from the content of GPR[ba Se ]. If the effective address is not greater than the content in GPR[boimd], the address exception is issued: otherwise, according to this alignment The effective address takes the 64-bit double word from memory to GPR[rt], which is gsLDGT rt, base, bound.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs. If it is a single-precision floating-point number with a boundary condition, the effective address is obtained from the content of GPR[ba Se ]. If the effective address is not less than or equal to the content in GPR[bomid], the address is sent out. Otherwise, 32-bit data is fetched from memory according to the aligned effective address and stored in the lower 32 bits of FPR[ft], ie gsLWLECl ft, base, bound.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If the number is a single-precision floating-point number with a lower boundary condition, the effective address is obtained from the content of GPRCbase]. If the effective address is not greater than the content in GPR[bound], the address exception is issued; otherwise, the alignment is valid. The address is taken from the memory and 32 bits of data are stored in the lower 32 bits of FPR[ft], ⁇ P gsLWGTCl ft, base, bound.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If the double-precision floating-point number is taken with the upper boundary condition, the effective address is obtained from the content of GPR[ba S e] first. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued: otherwise This aligned valid address fetches 64-bit data from memory to FPR[ft], which is gsLDLECl ft, base, bound.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs. If the double-precision floating-point number is taken with the lower boundary condition, the effective address is first obtained from the content of GPR[b aSe ]. If the effective address is not greater than the content in GPR[boimd], the address exception is issued: otherwise, according to this alignment The effective address is taken from memory and stored in 64-bit data to FPR[ft], which is gsLDGTC 1 ft, base, bound.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs.
- the shell If it is a byte instruction with a boundary condition, the effective address is first obtained from the content of GPR[ba Se ]. If the effective address is not less than or equal to the content in GPR[boimd], an address exception is issued; otherwise, GPR is issued.
- the 8-bit byte data content in [rt] is saved to the effective address in memory, ie gsSBLE rt, base, bound. If it is a byte instruction with a lower boundary condition, the effective address is first obtained from the content of GPRtbase].
- GPR[rt] is The 8-bit byte data content is saved to the effective address in memory, ie gsSBGT rt, base, bound. If it is a half-word instruction with a boundary condition, the effective address is obtained from the content of GPR[ba S e]. If the effective address is not less than or equal to the content in GPR[bound], the exception is issued; otherwise, the 16-bit half-word data content in GPR[rt] is saved to the aligned effective address in memory, ⁇ gsSHLE rt, Base, bound.
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs. If it is a half-word instruction with a lower boundary condition, the effective address is first obtained from the content of GPR[base]. If the effective address is not greater than the content in GPR[boimd], the address exception is issued; otherwise, GPR[rt The 16-bit half-word data content in ] is saved to the aligned effective address in memory, ie gsSHGT rt, base, bound.
- the effective address is aligned, and if any one of the lower 1-bit addresses is non-zero, an address error exception occurs. If it is a stored word instruction with a boundary condition, the effective address is first obtained from the content of GPR[base]. If the effective address is not less than or equal to the content in GPR[boimd], the address exception is issued; otherwise, GPR[rt The 32-bit word data content in ] is saved to the aligned effective address in memory, ie gsSWLE rt, base, bound.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If it is a word-sending instruction with a lower boundary condition, the effective address is first obtained from the content of GPR[ba S e]. If the effective address is not greater than the content in GPR[boimd], an address exception is issued; otherwise, GPR is [ The 32-bit word data content in rt] is saved to the aligned effective address in memory, ie gsSWGT rt, base, bound.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If it is a double word instruction with a boundary condition, the effective address is obtained from the content of GPRCbase] first. If the effective address is not less than or equal to the content in GPR[bound], the address exception is issued; otherwise, GPR[rt] The 64-bit double word content is saved to the aligned valid address in memory, ie gsSDLE rt, base, bound.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs. If it is a double word instruction with a lower boundary condition, the effective address is first obtained from the content of GPR[ba S e]. If the effective address is not greater than the content in GPR[bound], the address exception is issued; otherwise, GPR is issued.
- the 64-bit double word content in [rt] is saved to the aligned effective address in memory. That is gsSDGT rt, base, bound.
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs. If it is a deposit-precision floating-point number with a boundary condition, the effective address is obtained from the content of GPR[base] first. If the effective address is not less than or equal to the content in GPR[boimd], an address exception is issued; otherwise, FPR is [ The lower 32-bit word data content in ft] is saved to the aligned effective address in memory, gs gs gsSWLECl ft, base, boundo
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If it is a deposit-precision floating-point number with a lower boundary condition, the effective address is first obtained from the content of GPR[ba Se ]. If the effective address is not greater than the content in GPR[bound], an address exception is issued; otherwise, FPR is [ The lower 32-bit word data content in ft] is saved to the aligned effective address in memory, ie gsSWGTCl ft, base, bound.
- the effective address is aligned, and if any one of the lower 2-bit addresses is non-zero, an address error exception occurs. If it is a double-precision floating-point number with a boundary condition, the effective address is obtained from the content of GPR[ba Se ] first. If the effective address is not less than or equal to the content in GPR[bound], the address is sent out by mistake; Otherwise, the 64-bit double word content in FPR[ft] is saved to the aligned effective address in memory, ie gsSDLECl ft, base, bound.
- the effective address is aligned, and if any one of the lower 3 bit addresses is non-zero, an address error exception occurs. If it is a double-precision floating-point number with a lower boundary condition, the effective address is first obtained from the content of GPR[ba Se ]. If the effective address is not greater than the content in GPR[bound], an address exception is issued; otherwise, FPR is issued. The 64-bit double word content in [ft] is saved to the aligned effective address in memory, ie gsSDGTC 1 ft, base, bound.
- the effective address is aligned, and if any one of the lower 3-bit addresses is non-zero, an address error exception occurs.
- the step 33 further includes the following steps:
- step 334 in the instruction for simultaneously determining the upper and lower bounds, the address satisfies both the upper bound condition and the lower bound condition, and an out-of-bounds exception is issued once a boundary is not satisfied. More preferably, after the step S300, the following steps are further included:
- Step 34 In the memory access instruction, determine the validity of the instruction address according to the upper bound address stored in the upper bound address register and/or the lower bound address stored in the lower bound address register.
- the step 34 includes the following steps: Step 341, in the fetch operand (load) instruction, compare the general-purpose register GPR [rs], that is, the upper bound address register and the general-purpose register GPR [rt], that is, the value in the lower bound address register, if the value in GPR [rs] Less than or equal to the value in GPR [rt], the next instruction is executed sequentially; otherwise, adel is generated, ⁇ gsLE rs, rt.
- Step 342 In the write operation (store) instruction, compare the general-purpose register GPR [rs], that is, the upper bound address register and the general-purpose register GPR [rt], that is, the value in the lower bound address register, if the value in GPR [rs] Greater than the value in GPR [rt], the next instruction is executed sequentially; otherwise, the add exception is raised, ie gsGT rs, rt.
- the bounded memory access method of the RISC processor of the present invention in the virtual machine supported by the RISC processor, translates from the X86 virtual machine instruction to the binary code of the MIPS instruction set, and improves the running speed when running on the RISC processor, and The impact on the speed of the virtual machine will be reduced, and the operating efficiency of the virtual machine will be improved.
- the RISC processor device supports the data processing method process of the X86 virtual machine when the processor supports the data processing of the X86 virtual machine to support the virtual mechanism.
- the X86 general-purpose registers have been mapped to the fixed MIPS registers, but when the virtual machine code and the translated MIPS code are switched between contexts, the values of these fixed MIPS registers need to be saved or restored to ensure These registers are free to use in both contexts without interfering with each other.
- the present invention provides a memory access extension instruction having a data width of twice the original data width, which can also be used to improve performance while speeding up virtual machine context switching.
- the RISC processor pattern recognition module 24 supporting the X86 virtual machine of the present invention includes a memory access instruction for multiple data widths.
- the multiple data width memory access instruction includes a read data memory of multiple data widths, a write memory, and a read data memory of a multiple data width of the floating point register, and a total of four types of data width write memory. Save the extension instruction.
- W 200 is an implementable manner, and the present invention proposes four multiple data width memory access extension instructions, including double data width read memory, write memory instruction, and double data width to floating point register. Read memory, write memory instructions.
- the multiple data width extension instruction provided by the present invention utilizes the values of the LWC2 and SWC2 slots reserved in the existing MPS64 instruction set, wherein the upper 6 bits of the 32-bit instruction Olbit: 26 bits are opcode fields.
- the LWC2 (opcode is 110010) and SWC2 (opcode is 111010) instruction slots are MIPS-defined and can be defined by the user.
- the addressing mode of the memory access is the addressing mode of base+8 bits offset.
- the 5-bit base field represents the base address
- the 5-bit rt (Register Target (Source/Destination)) field represents the source/destination register
- the offset represents the offset address
- the last 6-bit fonc field is used to distinguish each extended instruction.
- the four extended instructions of the present invention are custom instructions that are extended to the user in the MIPS64 instruction set.
- the decoder outputs an internal sq operation;
- the decoder For the fetch instruction LQ, the decoder outputs two adjacent internal operations lql and lq2, where lql has the lower 64-bit logical register number of the LQ instruction and lq2 has the high 64-bit logical register number of the LQ instruction.
- the decoder 2 decodes the instruction and sends it to the transmission queue (not shown) of the memory access execution unit 5, and the transmission queue selects the operation prepared by the operand, and transmits it to the memory access unit of the memory access execution unit 5 (not show) .
- the fetch unit of the fetch execution unit 5 merges the two internal operations as they enter the transmit queue.
- the method of merging is to find that if the two operations that are to enter the queue are four-word 128-bit fetch instructions, the latter operation does not enter the transmit queue, but the destination physical register number is stored before The upper 64 bits of the physical register number of an operation.
- the merged fetch operation has two destination physical register numbers that are transmitted to the fetch unit of the fetch execution unit 5 when the address is determined (corresponding to the source physical register ready).
- the fetch execution unit 5 is a component that executes access data, which fetches data from the memory or stores the data in the memory according to the instruction. This process is an existing standard technology and will be apparent to those skilled in the art, and therefore, it will not be described in detail in the embodiments of the present invention.
- the following describes the double data width read memory, the write memory instruction, and the read data memory and write memory instructions of the double data width of the floating point register:
- rt If rt is even, it is stored in registers rt and rt+1; if rt is odd, it is stored in registers rt-1 and rt.
- ft If ft is even, it is stored in registers ft and ft+1; if ft is odd, it is stored in registers ft-1 and ft.
- the effective address is aligned. If any of the lower 4 bits is non-zero, an address error occurs.
- the signed 8-bit offset and the contents of GPR[ba Se ] are first added to obtain the effective address, and then the four words in the adjacent two general-purpose registers are stored in the effective address in the memory.
- the effective address is aligned. If any of the lower 4-bit addresses is non-zero, an address error exception occurs. gsSQCl ft, offset(base) / save four words from the floating point register to the memory The signed 8-bit offset and GPR[bas e ] contents are first added to obtain the effective address, and then the four words in the adjacent two floating-point registers are stored in the effective address in the memory. If ft is even, the values in registers ft and ft+1 are fetched into memory; if ft is odd, the values in registers ft-1 and ft are fetched into memory.
- the effective address must be aligned. If any of the lower 4-bit addresses is non-zero, an address exception exception occurs.
- the data fetching method of the RISC processor supporting the X86 virtual machine of the present invention comprises the following steps:
- Step N110 the processor first takes out an instruction input to the decoder
- Step N120 the decoder determines the instruction type, identifies and decodes the multiple data width instruction; if it is an instruction in the existing MIPS instruction set, the decoder translates it into an internal operation, such as giving a corresponding OP, source Registers and target registers, etc.
- the decoder automatically expands the source/or destination register into one of two pairs of registers
- rt If rt is even, it is stored in registers rt and rt+1; if rt is odd, it is stored in registers rt-1 and rt.
- the decoder automatically expands the target register from one adjacent register to a plurality of adjacent registers, and allocates the read operation to multiple internal operations, multiple pairs
- the registers are the target registers for these multiple internal operations.
- the decoder expands the source register from one to a plurality of adjacent registers.
- the processor first takes an instruction input to the decoder, and the decoder determines the instruction type. If it is an instruction in the original MIPS instruction set, the decoder translates it into an internal operation, for example, giving a corresponding operation (OP). The source register device and the target register are output to the storage operation unit for execution; if the input instruction is a storage operation in the memory access extension instruction proposed by the present invention, the decoder automatically expands the source/target register from one to two. The pair of registers is then output to the storage arithmetic unit for execution.
- the decoder determines the instruction type. If it is an instruction in the original MIPS instruction set, the decoder translates it into an internal operation, for example, giving a corresponding operation (OP).
- the source register device and the target register are output to the storage operation unit for execution; if the input instruction is a storage operation in the memory access extension instruction proposed by the present invention, the decoder automatically expands the source/target register from one to two. The pair of registers is then output
- the processor first takes an instruction input to the decoder, and the decoder determines the type of the instruction and converts it into an internal operation.
- the coding of internal operations is more regular than the instructions of the processor's features, which helps to simplify internal logic.
- usually external instructions to internal operations are one-to-one mapping.
- the internal operation of the decoder output consists of several fields, such as opcode (op), extended opcode (felt), source register number, destination register number, immediate value, and so on.
- Step N130 the decoded multiple data width instruction is sent to the memory access execution unit 5 to perform an operation.
- the decoder After the decoder decodes the input instruction, it sends it to the memory access execution unit 5.
- the memory access execution unit 5 if it is a read operation instruction, the two internal operations lql and lq2 of the read operation instruction LQ are merged into one. The operation is sent to the memory access unit of the memory access execution unit 5 for execution.
- the decoder 3 expands the source register number from one to two pairs of register numbers. For example, the 4th register is expanded into 4 and 5 register numbers; the 7th register is expanded into 6, 7 and 2. The two source register numbers as internal operations are sent to the transmit queue of the fetch execution unit 5.
- the decoder decodes the read operation into two internal operations, and the target register is also automatically extended from one to two pairs of registers. Then, it is assigned to the above two internal operations, and the output is executed to the memory access execution unit 5, and then merged into one operation and sent to the memory access unit of the memory access execution unit 5 for execution.
- the decoder expands the target register number from one to two pairs of register numbers. And split into two adjacent internal operations lql, lq2, respectively with these two target register numbers, sent to the transmit queue of the memory access execution unit 5.
- the fetch execution unit 5 receives the internal operations from the decoder and selects those fetched components that are prepared to the fetch execution unit 5 in which the source physical registers are prepared.
- the LQ instruction is transmitted to the fetching component as a fetch operation, so the merge of the two internal operations is completed by the merge module of the fetch execution unit 5.
- the method is to store the destination physical register of lq2 in the high 64-bit physical register of the lql operation, and lq2 itself does not enter the transmit queue.
- the memory access unit performs a memory access operation. For lql, there are two value fields in the result, which are respectively written into the corresponding physical registers.
- Support for X86 virtual machines on RISC processors requires an instruction to distinguish whether it is in the original instruction set mode or in X86 mode.
- the processing of the addition in the PS instruction set is to perform the addition operation of two numbers.
- the addition instruction not only calculates the addition of two operands, but also modifies the flag bits in the corresponding EFLAG according to the result of the addition.
- the present invention is directed to the above problem and provides a method for distinguishing whether a RISC instruction is operating in an X86 virtual machine mode.
- the present invention provides three different ways of distinguishing:
- Control bit flag execution method The present invention sets a special control bit x86mode flag in the RISC processor. When the bit is 1, it indicates that the corresponding instruction runs at x86 mode at this time; when the flag is 0, it indicates an instruction. Run in non-X86 mode.
- Prefix instruction execution method The present invention adds a prefix instruction SETFLAG, indicating that the subsequent instruction is in X86 mode.
- SETFLAG indicating that the subsequent instruction is in X86 mode.
- Dedicated instruction method In the present invention, for an X86 instruction having a particularly high command frequency, it is necessary to set a special instruction in the instruction set to perform one-to-one correspondence to improve efficiency.
- the set instructions can be classified into two categories: one for the X86 instruction set and the EFLAG flag related instructions, and the other for the special structure of the X86 instruction set, such as floating point.
- the instruction of the stack operation performs the corresponding instruction, and the newly added instruction provides a special instruction to partially support the X86 instruction to reduce the corresponding overhead.
- the pattern recognition module 24 of the RISC processor device supporting the X86 virtual machine of the present invention is used to distinguish the virtual machine instruction set mode of the instruction.
- the decoder in addition to the prior art data path, the decoder includes a decoded input and output, and an instruction decoding function, and can also distinguish the virtual machine instruction set mode of the instruction according to the pattern recognition module 24. Then, the decoder decodes the instruction according to the differentiated virtual machine instruction set mode and outputs it to the fixed point operation unit 3, which enhances the function of the existing decoder and directly decodes, thereby improving the operation speed of the processor.
- the fixed point arithmetic unit 3 After receiving the decoding command, the fixed point arithmetic unit 3 performs processing and outputs the result of the execution.
- the fixed point operation unit 3 can also distinguish the instruction set mode by the decoder 2, and the fixed point operation unit 3 performs the corresponding according to different instruction modes. The calculation, the output is executed as a result. (One)
- the pattern recognition module 24 of the RISC processor device of the present invention is a virtual machine mode control register 73, and the virtual machine mode control register 73 includes a control bit flag X86MODE1 when the bit is 1 The time indicates that the corresponding instruction runs in the X86 virtual machine instruction set mode; when the flag is 0, it indicates that the corresponding instruction is running in the non-X86 virtual machine instruction set mode.
- some CoprocessorO (CP0) control registers are reserved for user-defined.
- the 22nd register is reserved for the user in the case of all Sel bits.
- the embodiment of the present invention utilizes one of these control registers (CP0) to perform the X86 mode control flag bit X86MODE1. When it is necessary to distinguish the mode in which the instruction is located, it can be judged by reading the corresponding bit of the control register. When the flag is 1, it indicates that the corresponding instruction is running in the X86 virtual machine instruction set mode. When the flag is 0, it indicates that the corresponding instruction is running in the non-X86 virtual machine instruction set mode.
- the decoder 2 When the RISC processor fetches instructions and is decoded and executed by the decoder 2, the decoder 2 first reads the control bit flag X86MODE1 of the virtual machine mode control register 73, according to the virtual value of the flag bit being 0 or 1. The machine instruction set mode is decoded in its virtual machine instruction set mode until the control bit flag X86MODE1 of the virtual machine mode control register 73 is overwritten.
- the RISC processor determines the corresponding control register to distinguish it from the X86 virtual machine instruction set mode or the non-X86 virtual machine instruction set mode.
- the flag operation module 32 of the fixed point operation unit 3 is configured to perform an operation according to the input instruction, and then calculate a corresponding EFLAG flag bit according to the operation result.
- the RISC processor device of the present invention is a prefix instruction decoding module 241 included in the decoder, and the prefix instruction decoding module 241 includes a prefix instruction.
- SETFLAG is used to indicate that multiple instructions after the prefix instruction are in the X86 virtual machine instruction set mode.
- the prefix instruction in the prefix instruction decoding module 241 of the embodiment of the present invention is implemented by using the reserved value of the empty slot of the SPECIAL2 in the MIPS instruction set.
- the prefix instruction decoding module 241 of the decoder 2 sets a flag when decoding the prefix instruction, and the instruction following the instruction is translated into an X86 virtual machine instruction set mode, and then the prefix instruction is translated into a null operation NOP.
- the prefix instruction SETFLAG includes a range parameter for indicating a range of influence of the prefix instruction SETFLAG, which may be 1, indicating that the prefix instruction only affects one subsequent instruction; or n, indicating the prefix instruction Affects the subsequent n instructions.
- a range parameter for indicating a range of influence of the prefix instruction SETFLAG which may be 1, indicating that the prefix instruction only affects one subsequent instruction; or n, indicating the prefix instruction Affects the subsequent n instructions.
- the prefix instruction counter 242 of the decoder 2 is used to record the instruction number ⁇ of the instruction sequence affected by the prefix instruction and without the branch instruction;
- ⁇ is decremented by 1 when the next instruction enters the decoder 2.
- the branch instruction is not allowed in the instruction sequence, that is, the instruction sequence starting from the branch instruction is not affected by the prefix instruction once the branch instruction occurs.
- the exception processing module 34 of the fixed-point arithmetic component 3 is configured to use an exception with the delay slot if the prefix instruction only affects one instruction immediately after the prefix instruction.
- the bd bit of the Cause register is set, and the EPC is pointed to the prefix instruction, and the prefix instruction is re-executed after the exception service program is completed.
- the prefix exception control register 33 of the fixed point operation component 3 is configured to record whether an instruction in which an exception occurs is affected by the prefix instruction.
- the count of the current instruction is stored in the prefix exception control register 33; when the interrupted process is returned to the abnormal end, the count recovery according to the previous prefix exception control register 33 is interrupted according to the count. The state of the process.
- the flag operation module 32 of the fixed point operation unit 3 is configured to perform an operation according to the input instruction for the instruction in the virtual machine instruction set mode, and then calculate a corresponding EFLAG flag according to the operation result. (three)
- the pattern recognition module 24 is an instruction processing module 21 for marking a virtual machine instruction set mode of the instruction in the MIPS instruction of the RISC processor.
- the instruction is the X86 virtual machine instruction set mode, which is directly executed by the RISC processor's MIPS instruction set to reduce the corresponding overhead.
- the instruction affected by the instruction processing module 21 can only affect the decoding execution of the instruction, but does not affect other instructions. Other instructions are executed according to their original virtual instruction set mode.
- the MIPS instruction of the RISC processor includes a virtual machine instruction corresponding to an instruction related to the EFLAG flag in the X86 instruction set, and an instruction corresponding to a special structure such as floating point ⁇ in the X86 instruction set. Virtual machine instructions.
- the add instruction (Add) of the instruction processing module 21 to the RISC processor indicates that the virtual machine instruction set mode of the instruction is the X86 virtual machine instruction set mode X86Add, which can utilize the reserved value of the empty slot of the SPECIAL2 in the RISC processor MIPS instruction set. achieve.
- This instruction is not the same as the original Add instruction. It only provides partial support for the original instruction. It adds the values in the register and also modifies the corresponding EFLAGS flag according to the result. , but the result of the calculation is not stored in the register, ie the value of the register does not change.
- the multi-mode data processing method of the RISC processor device supporting the X86 virtual machine of the present invention comprises the following steps:
- Step N210 When reading the instruction, distinguish the virtual machine instruction set mode of the instruction.
- the step N210 includes the following steps:
- Step N211 the decoder reads a prefix instruction SETFLAG, indicating that the plurality of instructions after the instruction are in the X86 virtual machine instruction set mode, and distinguishes the virtual machine instruction set mode of the instruction;
- the prefix instruction SETFLAG further includes a range parameter indicating the range of influence of the prefix instruction SETFLAG, which may be 1, indicating that the prefix instruction only affects one subsequent instruction; or n (n ⁇ 1), indicating that the prefix instruction affects The next n instructions.
- a range parameter indicating the range of influence of the prefix instruction SETFLAG, which may be 1, indicating that the prefix instruction only affects one subsequent instruction; or n (n ⁇ 1), indicating that the prefix instruction affects The next n instructions.
- the flag is set when the prefix instruction is decoded.
- the instruction following this instruction is translated into the X86 virtual machine instruction set mode, and then the prefix instruction is translated as a null operation NOP.
- the step N210 includes the following steps:
- Step N210' when the instruction enters the decoder 2, the control bit flag of the virtual machine mode control register 73 X86MODE1 distinguishes the virtual machine instruction set mode of the instruction.
- the step N210' includes the following steps:
- Step ⁇ 21 ⁇ determining the control bit flag X86MODE of the virtual machine mode control register 73; Step N212', when the flag bit is 1, it indicates that the corresponding instruction is running in the X86 virtual machine instruction set mode;
- Step N213' when the flag is 0, it means that the corresponding instruction is running in the non-X86 virtual machine instruction set mode.
- the step N210 includes the following steps:
- Step N211 the decoder reads the instruction, and according to the virtual machine instruction set mode of the flag in the instruction, distinguishes the virtual machine instruction set mode of the instruction.
- Step N220 During the instruction decoding process, the decoder outputs the instruction to the fixed-point operation component of the RISC processor according to the differentiated virtual machine instruction set mode according to the virtual machine instruction set mode of the differentiated instruction. 3 ;
- the step N220 further includes the following steps:
- Step N222 the prefix instruction counter 242 in the decoder records the instruction number n of the instruction sequence affected by the prefix instruction and does not appear the conversion instruction ;
- n is decremented by 1.
- the branch instruction is not allowed in the instruction sequence, that is, the instruction sequence starting from the branch instruction is not affected by the prefix instruction once the branch instruction occurs.
- step N220 decoder performs decoding, including the following steps:
- Step ⁇ 22 ⁇ when the RISC processor fetches instructions and is decoded and executed by the decoder 2, the decoder first reads the control bit flag X86MODE1 of the virtual machine mode control register 73, and the value according to the flag bit is 0 or 1.
- the virtual machine instruction set mode is decoded in its virtual machine instruction set mode until the control bit flag X86MODE1 of the virtual machine mode control register 73 is overwritten.
- Step N230 the fixed-point arithmetic unit of the RISC processor performs processing according to the output of the decoder, and outputs the result of the execution.
- Step SN231 since the decoder decodes the prefix instruction into an internal null operation NOP, the fixed point operation component executes the NOP instruction;
- the step N230 comprises the following steps:
- Step N232 When the prefix instruction affects only one instruction immediately after the prefix instruction, if an execution exception occurs, the bd (Branch delay) bit of the Cause register is set in the same manner as the delay slot exception, and the EPC is simultaneously (The Exception Program Counter) points to the prefix instruction, and the exception service is re-executed after the exception service is completed.
- the EPC register holds the entry address where the processor continues its original operation when the exception service is executed.
- Step N233 the fixed point operation unit uses the prefix exception control register 33 to record whether the instruction in which the exception occurred is affected by the prefix instruction when the prefix instruction affects n instructions.
- the count of the current instruction is stored in the prefix exception control register 33 when an abnormality occurs and the process is interrupted.
- the interrupted process is returned to the abnormal end, the state of the interrupted process is restored based on the count, that is, based on the count held by the previous prefix exception control register 33.
- Step N234 the fixed point operation unit performs an operation according to the input instruction, and then calculates a corresponding EFLAG flag bit output according to the operation result.
- the data processing method of the RISC processor device of the present invention is multi-mode by means of a prefix instruction:
- a prefix instruction enters the decoder
- the next instruction that is, when the addition instruction enters the decoder, judges whether the prefix flag bit exists.
- the decoder normally decodes the source register and the destination register with the instruction itself and the internal Operation opcode (op); If the addition instruction is within the prefix instruction parameter range, that is, the addition instruction in X86 mode, the EFLAGS flag is modified according to the calculation result according to the X86 virtual machine instruction set mode, so the decoder The EFLAGS flag is decoded into one of the source registers, and the EFLAGS flag is decoded into the target register. The source and destination registers of the addition instruction itself and the internal operation opcode (op) are also added.
- the fixed-point arithmetic component takes the output of the decoder as an input, and if it is an instruction in the normal MIPS instruction set, performs an addition calculation; if it is an addition instruction affected by the prefix instruction, the fixed-point arithmetic component performs the addition calculation first, and then adds according to the addition. The result of the operation computes the value of the new EFLAGS flag.
- the core is a process of translation or interpretation, that is, a process that can be executed on a local processor by translating or interpreting the cost code from the target code.
- the virtual machine encounters the jump instruction, and needs to convert the instruction address of the X86 source program into the instruction address of the corresponding PS target program, and then implement the jump according to the instruction address of the target program.
- the invention adds a structure capable of resolving a source instruction address (X86 instruction address) to a target instruction address (MIPS instruction address) mapping lookup table in the RISC processor, speeding up conversion from a source instruction address to a target instruction address, thereby improving the virtual machine. performance.
- the lookup table module 23 of the RISC processor supporting the X86 virtual machine in the embodiment of the present invention is configured to implement conversion from an X86 source instruction address to a MIPS target instruction address by using a lookup table.
- the invention has a lookup table on the hardware, which can quickly search for the translation of the jump address to the MIPS jump address in the X86 program, and improve the performance of the virtual machine.
- the lookup table may be a content-addressable lookup table, and is implemented by a content-addressable memory/random access memory (CAM/RAM).
- CAM/RAM content-addressable memory/random access memory
- the RAM inputs an address and outputs the data in the corresponding address;
- the CAM is the input content, and outputs the index number of the unit storing the content or the content of another unit associated with the index number.
- the lookup table may be a content-addressed lookup table that implements X86 jump address translation to MIPS transfer address translation, ie, conversion from an X86 source instruction address to a MIPS target instruction address in an X86 virtual machine of a RISC processor. Its entries are shown in Table 1. Table 1 lookup table entries
- the X86 Source Instruction (SPC) to MIPS Target Instruction Address (TPC) conversion uses three domains: the ASID field, the SPC domain, and the TPC domain.
- the ASID field is used to store the ID number of multiple X86 VM processes started on the operating system. When these X86 virtual machine processes need to use the lookup table, they use the operating system to assign their assigned ID numbers (ASIDs) so that they do not interfere with each other;
- the SPC domain is used to store the X86 source instruction address
- the TPC domain is used to store the MIPS target instruction address
- the ASID and SPC fields are located in the address portion (CAM) of the lookup table, and the TPC is located in the storage portion (RAM) of the lookup table.
- the lookup table module 23 searches, the ASID of the current X86 virtual machine process and the SPC given by the table lookup instruction form the "address" part of the lookup table, and are sent to all the entries, and each entry stores its own stored ASID, SPC and The input is compared, and if it matches, the TPC stored therein is output. Therefore, as far as the X86 virtual machine process of the RISC processor is concerned, as long as the X86 source instruction address that it wants to find is input, the corresponding MIPS target instruction address can be found from the lookup table 23.
- the values of the SPC domain and the TPC domain in the lookup table are initialized by the virtual machine at initialization, and the value of the ASID field is given by the local operating system.
- the lookup table module 23 is implemented by four instructions for accessing or modifying the lookup table structure.
- Instruction one CAMPV instruction.
- the instruction queries the lookup table RAM table entry value;
- the content in RAM is obtained.
- the lookup table is indexed according to the content in the general register GPR [rs]. If it hits, the contents of the corresponding RAM are stored in the destination register GPR [rd]; if the entry is not hit, the entry address of the missed service program is stored in the destination register GPR [rd].
- the execution process of the instruction is the flow of execution of the entire processor instruction, including instruction fetching execution, etc., and the component it accesses is the lookup table mentioned above.
- Instruction 2 CAMPI instruction.
- the format of the instruction is as follows:
- the index (index) of the entry of the content is obtained.
- the lookup table is indexed according to the contents of the general register GPR [rs]. If it hits, the index of the corresponding entry is stored in the destination register GPR [rd]; if the entry is not hit, the highest position of the destination register rd is set to 1.
- the execution process of the instruction is the flow of execution of the entire processor instruction, including instruction fetching execution, etc., and the component it accesses is the lookup table mentioned above.
- Instruction three CAMWI instruction.
- the instruction fills in the lookup table based on the index (index) of the lookup table RAM entry.
- the format of the instruction is as follows:
- the execution process of the instruction is the flow of execution of the entire processor instruction, including instruction fetching execution, etc., and the component it accesses is the lookup table mentioned above.
- Instruction four RAMRI instruction. The instruction reads the contents of the lookup table RAM table entry according to an index (index) of the lookup table RAM entry;
- the contents of the RAM of the lookup table are read according to the value of GPR [rs].
- the contents of the RAM of the lookup table are read according to the index value in the general register GPR [rs] and stored in the destination register GPR [rd].
- search miss that is, when the lookup table is unsuccessful, that is, the pair of SPC-TPCs in the lookup table does not have the corresponding process expectation; the corresponding processing.
- the miss service routine is an existing routine and is an existing standard technology of the RISC processor of the MIPS instruction set, and thus will not be described in detail in the embodiment of the present invention.
- the entry address of the miss service program is saved by using a CP0 register CAM.default, and a default value is provided by the virtual machine, and is stored in the CP0 register CAM.default as a miss service program. Entrance address.
- the lookup table is not hit, the default value stored in CAM.default is sent to the target register, so that the table lookup program can jump to the MIPS instruction address in the case of a hit; In the case, jump to the entry address of the missed service program, and then fill in the lookup table with the corresponding address found by the miss service program. This also avoids adding a branch instruction after the table lookup to determine whether it hits.
- the jump can be realized by using the direct jump instruction JR rs in the existing MIPS64.
- rs is the register placed by the target address.
- the entry address of the miss service program may be stored in item 0 of the lookup table entry instead of a control register in the first embodiment.
- VJR a new instruction
- the content of the general-purpose register No. 31 is used as the SPC look-up table.
- the instruction function of VJR is similar to the function of the two instructions of CAMPV+JR in the first method.
- the contents of the RAM of the lookup table are read according to the value of the general-purpose register No. 31.
- the contents of the RAM of the lookup table (that is, the translated target address) are read according to the value in the general register GPR [31].
- the search is successful, it is stored in the destination register GPR [rt].
- the instruction then jumps to the target address based on the value of the rt register; otherwise, the RAM contents of the 0th entry in the lookup table are stored in the destination register GPR [rt].
- the instruction jumps to the miss service routine according to the value of the rt register.
- the execution process of the instruction is the flow of execution of the entire processor instruction, including instruction fetching execution, etc., and the component it accesses is the lookup table mentioned above.
- the value of the source instruction address is placed in a fixed register (such as register No. 31) by an instruction before the instruction, such as the JMP mx instruction in X86;
- the VJ instruction looks up the table according to the value in the fixed register. If it hits, it directly converts to the code segment pointed to by the target instruction address. If it does not hit, it directly jumps to the 0th of the lookup table. Item, then jump to miss the server.
- the instruction address conversion lookup process of the RISC processor device supporting the X86 virtual machine of the present invention is described in detail below, including the following steps:
- Step N310 when the X86 virtual machine of the RISC processor is started, initialize the lookup table, and fill in the lookup table by using the obtained X86 virtual machine instruction address to the content of the MIPS instruction address;
- the missed service program is used to initialize the corresponding X86 instruction address to the MIPS instruction address by the CAMPI instruction and the CAMWI instruction according to the contents of the hash table maintained by the miss service program. table.
- the jump instruction of the X86 virtual machine of the RISC processor accesses the lookup table because it needs to complete the conversion from the X86 source instruction address to the target instruction address;
- the step N320 includes the following steps:
- Step N321 using the CAMPV instruction of querying the table entry value, searching the lookup table according to the source instruction address in the register to obtain the target instruction address;
- Step N322 if the search hits, the value of the directly obtained target instruction address is stored in the target register, and the program is jumped by the jump instruction to the code segment pointed by the target address; Step N323, if the lookup misses, it will get the address of the miss service program, the address is given by the virtual machine, stored in the target register, and the program jumps to the miss service program execution. Step N330, the miss service program refills the lookup table according to the content of the hash table maintained by the virtual machine;
- the step N330 includes the following steps:
- Step N331 using the CAMPI instruction of querying the index of the table entry, obtaining an index (index) of the entry of the value according to the value of the source instruction address, and storing the index in the target register;
- Step N332 using the search according to the The index of the table entry fills in the CAMWI instruction of the lookup table, and fills the table with the ASID of the process, the source instruction address, and the corresponding target instruction address according to the index value in the target register.
- the process of the instruction address translation search method further includes the following steps:
- Step N340 invalidating one item in the lookup table; or reading the contents of the lookup table RAM.
- Fill in the CAMWI instruction of the lookup table according to the index of the lookup table RAM table entry fill in a fixed value to the item of the specified index (index), and the fixed value cannot match the source instruction address of the program. , that is, the item is invalid.
- the RAMRI instruction for reading the contents of the lookup table RAM table according to the index of the lookup table RAM table entry is read, and the value of the lookup table RAM of the specified index table entry is read and stored in the destination register for debugging. .
- the RISC processor device of the present invention and its instruction address conversion search method add a structure of a lookup table capable of solving the mapping of the X86 source instruction address to the MIPS target instruction address in the RISC processor, and accelerate in the X86 virtual machine of the RISC processor.
- the conversion from the X86 source instruction address to the MIPS target instruction address is used to improve the performance of the virtual machine.
- the RISC processor and data processing method of the present invention provides support for using EFLAG instructions, support for X86 floating point format and floating point ⁇ , support for X86 storage structure, and support for virtual mechanisms, thereby narrowing X86 and RISC systems.
- the semantic gap in the structure enables the support of the X86 virtual machine on the RISC processor, improves the processing speed of the X86 virtual machine in the RISC processor, and improves the performance of the RISC processor.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Executing Machine-Instructions (AREA)
- Devices For Executing Special Programs (AREA)
- Advance Control (AREA)
Description
Claims
Priority Applications (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020107020814A KR101232343B1 (ko) | 2008-03-17 | 2008-12-17 | X86 가상머신을 지원하는 risc 프로세서 장치 및 방법 |
JP2011500028A JP5501338B2 (ja) | 2008-03-17 | 2008-12-17 | X86の仮想機をサポートするriscプロセッサ装置及び方法 |
US12/922,949 US8949580B2 (en) | 2008-03-17 | 2008-12-17 | RISC processor apparatus and method for supporting X86 virtual machine |
CA2718724A CA2718724C (en) | 2008-03-17 | 2008-12-17 | Risc processor apparatus and method for supporting x86 virtual machine |
EP08873507.1A EP2267598B1 (en) | 2008-03-17 | 2008-12-17 | Risc processor apparatus and method for supporting x86 virtual machine |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810102086 CN100555225C (zh) | 2008-03-17 | 2008-03-17 | 一种支持x86虚拟机的risc处理器装置及方法 |
CN200810102086.3 | 2008-03-17 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2009114961A1 true WO2009114961A1 (zh) | 2009-09-24 |
Family
ID=39891348
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2008/002023 WO2009114961A1 (zh) | 2008-03-17 | 2008-12-17 | 一种支持x86虚拟机的risc处理器装置及方法 |
Country Status (7)
Country | Link |
---|---|
US (1) | US8949580B2 (zh) |
EP (1) | EP2267598B1 (zh) |
JP (1) | JP5501338B2 (zh) |
KR (1) | KR101232343B1 (zh) |
CN (1) | CN100555225C (zh) |
CA (1) | CA2718724C (zh) |
WO (1) | WO2009114961A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101247259B1 (ko) | 2009-12-17 | 2013-04-01 | 한국전자통신연구원 | 가상화 장치 및 그 처리 방법 |
CN108369508A (zh) * | 2016-01-05 | 2018-08-03 | 英特尔公司 | 使用处理器指令前缀的二进制转换支持 |
Families Citing this family (55)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5193624B2 (ja) | 2008-02-19 | 2013-05-08 | ルネサスエレクトロニクス株式会社 | データプロセッサ |
CN100555225C (zh) * | 2008-03-17 | 2009-10-28 | 中国科学院计算技术研究所 | 一种支持x86虚拟机的risc处理器装置及方法 |
CN101819517B (zh) * | 2009-05-19 | 2013-05-22 | 威盛电子股份有限公司 | 适用于微处理器的装置及方法 |
US8880851B2 (en) * | 2011-04-07 | 2014-11-04 | Via Technologies, Inc. | Microprocessor that performs X86 ISA and arm ISA machine language program instructions by hardware translation into microinstructions executed by common execution pipeline |
US9378019B2 (en) | 2011-04-07 | 2016-06-28 | Via Technologies, Inc. | Conditional load instructions in an out-of-order execution microprocessor |
US9336180B2 (en) * | 2011-04-07 | 2016-05-10 | Via Technologies, Inc. | Microprocessor that makes 64-bit general purpose registers available in MSR address space while operating in non-64-bit mode |
US9317288B2 (en) | 2011-04-07 | 2016-04-19 | Via Technologies, Inc. | Multi-core microprocessor that performs x86 ISA and ARM ISA machine language program instructions by hardware translation into microinstructions executed by common execution pipeline |
US9292470B2 (en) | 2011-04-07 | 2016-03-22 | Via Technologies, Inc. | Microprocessor that enables ARM ISA program to access 64-bit general purpose registers written by x86 ISA program |
US9898291B2 (en) | 2011-04-07 | 2018-02-20 | Via Technologies, Inc. | Microprocessor with arm and X86 instruction length decoders |
US9645822B2 (en) | 2011-04-07 | 2017-05-09 | Via Technologies, Inc | Conditional store instructions in an out-of-order execution microprocessor |
US20130086359A1 (en) * | 2011-09-29 | 2013-04-04 | Qualcomm Incorporated | Processor Hardware Pipeline Configured for Single-Instruction Address Extraction and Memory Access Operation |
CN102508635B (zh) * | 2011-10-19 | 2014-10-08 | 中国科学院声学研究所 | 一种处理器装置及其循环处理方法 |
US9335993B2 (en) | 2011-12-29 | 2016-05-10 | International Business Machines Corporation | Convert from zoned format to decimal floating point format |
US9329861B2 (en) | 2011-12-29 | 2016-05-03 | International Business Machines Corporation | Convert to zoned format from decimal floating point format |
TWI569205B (zh) * | 2012-08-31 | 2017-02-01 | 威盛電子股份有限公司 | 一種微處理器及其操作方法 |
CN104598196A (zh) * | 2014-12-30 | 2015-05-06 | 杭州中天微系统有限公司 | 一种浮点处理装置及方法 |
US9335982B1 (en) * | 2015-04-28 | 2016-05-10 | Microsoft Technology Licensing, Llc | Processor emulation using multiple translations |
GB2546465B (en) * | 2015-06-05 | 2018-02-28 | Advanced Risc Mach Ltd | Modal processing of program instructions |
US9817642B2 (en) * | 2015-06-25 | 2017-11-14 | Intel Corporation | Apparatus and method for efficient call/return emulation using a dual return stack buffer |
CN105159651B (zh) * | 2015-08-31 | 2017-11-07 | 中国航天科技集团公司第九研究院第七七一研究所 | 一种risc处理器的单/双/四精度浮点数据相关电路及操作数获取方法 |
US10761852B2 (en) | 2015-09-30 | 2020-09-01 | International Business Machines Corporation | Extending data range addressing |
US10394568B2 (en) | 2015-09-30 | 2019-08-27 | International Business Machines Corporation | Exception handling for applications with prefix instructions |
US10877759B2 (en) | 2015-09-30 | 2020-12-29 | International Business Machines Corporation | Managing the capture of information in applications with prefix instructions |
US9870305B2 (en) | 2015-09-30 | 2018-01-16 | International Business Machines Corporation | Debugging of prefixed code |
US10169043B2 (en) * | 2015-11-17 | 2019-01-01 | Microsoft Technology Licensing, Llc | Efficient emulation of guest architecture instructions |
CN105677298B (zh) * | 2015-12-30 | 2018-03-27 | 李朝波 | 一种将计算机指令中立即数扩展的方法和装置 |
US9996329B2 (en) | 2016-02-16 | 2018-06-12 | Microsoft Technology Licensing, Llc | Translating atomic read-modify-write accesses |
US10514913B2 (en) | 2017-06-23 | 2019-12-24 | International Business Machines Corporation | Compiler controls for program regions |
US10379851B2 (en) | 2017-06-23 | 2019-08-13 | International Business Machines Corporation | Fine-grained management of exception enablement of floating point controls |
US10684852B2 (en) * | 2017-06-23 | 2020-06-16 | International Business Machines Corporation | Employing prefixes to control floating point operations |
US10481908B2 (en) | 2017-06-23 | 2019-11-19 | International Business Machines Corporation | Predicted null updated |
US10740067B2 (en) | 2017-06-23 | 2020-08-11 | International Business Machines Corporation | Selective updating of floating point controls |
US10310814B2 (en) | 2017-06-23 | 2019-06-04 | International Business Machines Corporation | Read and set floating point control register instruction |
US10725739B2 (en) | 2017-06-23 | 2020-07-28 | International Business Machines Corporation | Compiler controls for program language constructs |
CN107291425B (zh) * | 2017-06-23 | 2020-11-24 | 上海兆芯集成电路有限公司 | 合并解决重命名尺寸问题的部分写入结果的系统和方法 |
US11762566B2 (en) | 2018-01-22 | 2023-09-19 | Arm Limited | Programmable mapping of guard tag storage locations |
GB2570326B (en) * | 2018-01-22 | 2020-06-10 | Advanced Risc Mach Ltd | Multiple guard tag setting instruction |
CN108415728B (zh) * | 2018-03-01 | 2020-12-29 | 中国科学院计算技术研究所 | 一种用于处理器的扩展浮点运算指令执行方法及装置 |
CN110874259A (zh) * | 2018-08-31 | 2020-03-10 | 龙芯中科技术有限公司 | 程序执行方法、装置、设备和存储介质 |
EP4009183A1 (en) | 2018-10-18 | 2022-06-08 | Shanghai Cambricon Information Technology Co., Ltd | Network-on-chip data processing method and device |
CN111210012B (zh) * | 2018-11-21 | 2022-12-09 | 上海寒武纪信息科技有限公司 | 数据处理方法、装置及相关产品 |
CN109788352A (zh) * | 2018-12-25 | 2019-05-21 | 深圳市纽格力科技有限公司 | 一种基于mips架构的机顶盒异常确认方法和系统 |
CN110362501B (zh) * | 2019-07-05 | 2021-09-24 | 北京大学 | 一种执行饱和寻址加载和存储操作的设备和方法 |
CN110780925B (zh) * | 2019-09-02 | 2021-11-16 | 芯创智(北京)微电子有限公司 | 一种指令流水线的预译码系统及方法 |
CN111090465B (zh) * | 2019-12-19 | 2022-08-19 | 四川长虹电器股份有限公司 | 一种rv32ic指令集的译码系统及其译码方法 |
JP7487535B2 (ja) * | 2020-04-08 | 2024-05-21 | 富士通株式会社 | 演算処理装置 |
US11119777B1 (en) | 2020-04-22 | 2021-09-14 | International Business Machines Corporation | Extended prefix including routing bit for extended instruction format |
CN111782269B (zh) * | 2020-06-04 | 2023-12-12 | 珠海格力电器股份有限公司 | 一种中断处理方法及中断处理设备 |
CN114077424A (zh) * | 2020-08-14 | 2022-02-22 | 上海芯联芯智能科技有限公司 | 扩展mips指令集处理器支持risc指令集多模系统的方法和装置 |
TWI764311B (zh) * | 2020-10-08 | 2022-05-11 | 大陸商星宸科技股份有限公司 | 記憶體存取方法及智慧處理裝置 |
CN112860320A (zh) * | 2021-02-09 | 2021-05-28 | 山东英信计算机技术有限公司 | 基于risc-v指令集进行数据处理的方法、系统、设备及介质 |
US11922055B2 (en) | 2021-04-28 | 2024-03-05 | Seagate Technology Llc | Stack register having different ferroelectric memory element constructions |
CN113220300A (zh) * | 2021-04-29 | 2021-08-06 | 麒麟软件有限公司 | 一种应用于Android系统x86架构上的ARM指令集转换方法 |
CN114116003B (zh) * | 2021-11-25 | 2024-10-15 | 中国人民解放军国防科技大学 | 支持多指令集体系结构的程序运行方法、计算机设备及系统 |
CN116501451B (zh) * | 2023-06-25 | 2023-10-17 | 中国科学院计算技术研究所 | 二进制翻译方法、翻译控制方法、指令执行方法及装置 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6751737B1 (en) * | 1999-10-07 | 2004-06-15 | Advanced Micro Devices | Multiple protected mode execution environments using multiple register sets and meta-protected instructions |
CN1607503A (zh) * | 2003-10-14 | 2005-04-20 | 微软公司 | 在虚拟机器中使用合成指令的系统和方法 |
US20060005200A1 (en) * | 2004-06-30 | 2006-01-05 | Microsoft Corporation | Systems and methods for running a legacy 32-bit x86 virtual machine on a 64-bit x86 processor |
CN101256504A (zh) * | 2008-03-17 | 2008-09-03 | 中国科学院计算技术研究所 | 一种支持x86虚拟机的risc处理器装置及方法 |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA1278382C (en) * | 1986-12-15 | 1990-12-27 | Brian J. Sprague | Reduced instruction set computing apparatus and methods |
JPH03150633A (ja) * | 1989-11-07 | 1991-06-27 | Matsushita Electric Ind Co Ltd | 命令解読装置 |
CA2045735A1 (en) * | 1990-06-29 | 1991-12-30 | Richard Lee Sites | Computer performance by eliminating branches |
JPH06131197A (ja) * | 1992-10-21 | 1994-05-13 | Toshiba Corp | 最適化処理装置 |
JPH06202903A (ja) | 1992-12-29 | 1994-07-22 | Nec Corp | Cpuシミュレーション方法およびcpuシミュレータ |
JP2788839B2 (ja) * | 1993-05-15 | 1998-08-20 | 日本電気株式会社 | Cpuシミュレータ |
US5450607A (en) * | 1993-05-17 | 1995-09-12 | Mips Technologies Inc. | Unified floating point and integer datapath for a RISC processor |
EP0651320B1 (en) * | 1993-10-29 | 2001-05-23 | Advanced Micro Devices, Inc. | Superscalar instruction decoder |
US5574927A (en) * | 1994-03-25 | 1996-11-12 | International Meta Systems, Inc. | RISC architecture computer configured for emulation of the instruction set of a target computer |
US5685009A (en) | 1994-07-20 | 1997-11-04 | Exponential Technology, Inc. | Shared floating-point registers and register port-pairing in a dual-architecture CPU |
JP3451595B2 (ja) * | 1995-06-07 | 2003-09-29 | インターナショナル・ビジネス・マシーンズ・コーポレーション | 二つの別個の命令セット・アーキテクチャへの拡張をサポートすることができるアーキテクチャ・モード制御を備えたマイクロプロセッサ |
US6076155A (en) * | 1995-10-24 | 2000-06-13 | S3 Incorporated | Shared register architecture for a dual-instruction-set CPU to facilitate data exchange between the instruction sets |
WO1997027537A2 (en) * | 1996-01-24 | 1997-07-31 | Sun Microsystems, Inc. | A processor for executing instruction sets received from a network or from a local memory |
EP2275930B1 (en) | 1999-01-28 | 2017-06-14 | Advanced Silicon Technologies, LLC | Executing programs for a first computer architecture on a computer of a second architecture |
GB0202728D0 (en) * | 2002-02-06 | 2002-03-27 | Transitive Technologies Ltd | Condition code flag emulation for program code conversion |
-
2008
- 2008-03-17 CN CN 200810102086 patent/CN100555225C/zh active Active
- 2008-12-17 CA CA2718724A patent/CA2718724C/en active Active
- 2008-12-17 WO PCT/CN2008/002023 patent/WO2009114961A1/zh active Application Filing
- 2008-12-17 EP EP08873507.1A patent/EP2267598B1/en active Active
- 2008-12-17 JP JP2011500028A patent/JP5501338B2/ja active Active
- 2008-12-17 US US12/922,949 patent/US8949580B2/en active Active
- 2008-12-17 KR KR1020107020814A patent/KR101232343B1/ko active IP Right Grant
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6751737B1 (en) * | 1999-10-07 | 2004-06-15 | Advanced Micro Devices | Multiple protected mode execution environments using multiple register sets and meta-protected instructions |
CN1607503A (zh) * | 2003-10-14 | 2005-04-20 | 微软公司 | 在虚拟机器中使用合成指令的系统和方法 |
US20060005200A1 (en) * | 2004-06-30 | 2006-01-05 | Microsoft Corporation | Systems and methods for running a legacy 32-bit x86 virtual machine on a 64-bit x86 processor |
CN101256504A (zh) * | 2008-03-17 | 2008-09-03 | 中国科学院计算技术研究所 | 一种支持x86虚拟机的risc处理器装置及方法 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101247259B1 (ko) | 2009-12-17 | 2013-04-01 | 한국전자통신연구원 | 가상화 장치 및 그 처리 방법 |
US8589143B2 (en) | 2009-12-17 | 2013-11-19 | Electronics And Telecommunications Research Institute | Virtualization apparatus and processing method thereof |
CN108369508A (zh) * | 2016-01-05 | 2018-08-03 | 英特尔公司 | 使用处理器指令前缀的二进制转换支持 |
Also Published As
Publication number | Publication date |
---|---|
US8949580B2 (en) | 2015-02-03 |
KR101232343B1 (ko) | 2013-02-13 |
EP2267598B1 (en) | 2018-07-18 |
CA2718724C (en) | 2016-01-19 |
JP2011515750A (ja) | 2011-05-19 |
EP2267598A4 (en) | 2013-03-27 |
US20110035745A1 (en) | 2011-02-10 |
CN101256504A (zh) | 2008-09-03 |
JP5501338B2 (ja) | 2014-05-21 |
CN100555225C (zh) | 2009-10-28 |
EP2267598A1 (en) | 2010-12-29 |
CA2718724A1 (en) | 2009-09-24 |
KR20100125331A (ko) | 2010-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2009114961A1 (zh) | 一种支持x86虚拟机的risc处理器装置及方法 | |
US10664269B2 (en) | Function virtualization facility for function query of a processor | |
JP5357181B2 (ja) | コンピュータ・システム、その動作方法、及び、コンピュータ・プログラム | |
US6898697B1 (en) | Efficient method for mode change detection and synchronization | |
US9250904B2 (en) | Modify and execute sequential instruction facility and instructions therefor | |
US11809870B2 (en) | Function virtualization facility for blocking instruction function of a multi-function instruction of a virtual processor | |
JP5039905B2 (ja) | 2つのオペランドに対して演算を行い、その後オペランドの元の値を格納するための命令 | |
US7124286B2 (en) | Establishing an operating mode in a processor | |
JP5052678B2 (ja) | コンピュータを動作させる方法及びシステム | |
JP5657074B2 (ja) | 命令が利用可能な汎用レジスタの数を拡張するための上位ワード・ファシリティ | |
US6965984B2 (en) | Data processing using multiple instruction sets | |
KR101139395B1 (ko) | Risc 프로세서 및 그의 레지스터 플래그 비트 처리방법 | |
KR20120026104A (ko) | 다수의 레인 내의 패킹된 데이터의 언패킹 | |
CN112631657B (zh) | 用于字符串处理的字节比较方法以及指令处理装置 | |
JP2011509475A5 (zh) | ||
US7089539B2 (en) | Program instruction interpretation | |
JP2011509474A (ja) | コンピュータを動作させる方法及びシステム | |
JP2004538556A (ja) | 複数命令セットシステムにおける非処理操作処理 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 08873507 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 20107020814 Country of ref document: KR Kind code of ref document: A |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2011500028 Country of ref document: JP Ref document number: 2718724 Country of ref document: CA |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2008873507 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
WWE | Wipo information: entry into national phase |
Ref document number: 12922949 Country of ref document: US |