WO2024113838A1 - Processor setting method and apparatus, electronic device, and storage medium - Google Patents

Processor setting method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2024113838A1
WO2024113838A1 PCT/CN2023/104067 CN2023104067W WO2024113838A1 WO 2024113838 A1 WO2024113838 A1 WO 2024113838A1 CN 2023104067 W CN2023104067 W CN 2023104067W WO 2024113838 A1 WO2024113838 A1 WO 2024113838A1
Authority
WO
WIPO (PCT)
Prior art keywords
valid
identification value
instruction item
instruction
field
Prior art date
Application number
PCT/CN2023/104067
Other languages
French (fr)
Chinese (zh)
Inventor
商家玮
李祖松
Original Assignee
北京微核芯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京微核芯科技有限公司 filed Critical 北京微核芯科技有限公司
Publication of WO2024113838A1 publication Critical patent/WO2024113838A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3854Instruction completion, e.g. retiring, committing or graduating
    • G06F9/3858Result writeback, i.e. updating the architectural state or memory
    • G06F9/38585Result writeback, i.e. updating the architectural state or memory with result invalidation, e.g. nullification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • G06F9/3012Organisation of register space, e.g. banked or distributed register file
    • G06F9/3013Organisation of register space, e.g. banked or distributed register file according to data content, e.g. floating-point registers, address registers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a processor setting method, device, electronic device and storage medium.
  • a processor eg, cache memory, register
  • cache memory e.g., cache memory, register
  • a processor is an important unit in the hierarchical structure of a computer storage system. During the application of the processor, it is necessary to perform invalid settings on the processor.
  • the present disclosure aims to solve one of the technical problems in the related art at least to some extent.
  • the purpose of the present disclosure is to propose a processor setting method, device, electronic device and storage medium, which can combine invalid setting information and valid identification values to efficiently invalidate instruction items in the processor, thereby effectively ensuring the processor setting effect while effectively saving the processor's functional overhead, thereby effectively improving the processor's performance.
  • the processor setting method proposed in the embodiment of the first aspect of the present disclosure includes: determining a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width; reading a valid identification value corresponding to the instruction item from a target register; and invalidating the instruction item according to the bit width, the valid field and the valid identification value.
  • the processor setting method proposed in the embodiment of the first aspect of the present disclosure determines the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and reads the valid identification value corresponding to the instruction item from the target register, and then invalidates the instruction item according to the bit width, the valid field and the valid identification value.
  • the bit width, the valid field and the valid identification value it is possible to combine the bit width, the valid field and the valid identification value to efficiently invalidate the instruction item in the processor, thereby effectively ensuring the processor setting effect while effectively saving the functional overhead of the processor, thereby effectively improving the performance of the processor.
  • the processor setting device proposed in the second aspect embodiment of the present disclosure includes: a determination module, used to determine the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width; a reading module, used to read the valid identification value corresponding to the instruction item from the target register; and a setting module, used to invalidate the instruction item according to the bit width, the valid field and the valid identification value.
  • the processor setting device proposed in the second aspect of the embodiment of the present disclosure determines a valid field corresponding to an instruction item in the processor, wherein the valid field has a corresponding bit width, and reads a valid identification value corresponding to the instruction item from a target register, and then invalidates the instruction item according to the bit width, the valid field and the valid identification value.
  • the bit width, the valid field and the valid identification value it is possible to combine the bit width, the valid field and the valid identification value to efficiently invalidate the instruction item in the processor, thereby effectively ensuring the processor setting effect while effectively saving the functional overhead of the processor, thereby effectively improving the processor's performance.
  • the third aspect of the present disclosure provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor.
  • the processor executes the program, the processor setting method provided in the first aspect of the present disclosure is implemented.
  • the fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium, on which a computer program is stored.
  • the processor setting method proposed in the first aspect embodiment of the present disclosure is implemented.
  • the fifth aspect embodiment of the present disclosure proposes a computer program product.
  • the instructions in the computer program product are executed by a processor
  • the processor setting method proposed in the first aspect embodiment of the present disclosure is executed.
  • FIG1 is a schematic flow chart of a processor setting method according to an embodiment of the present disclosure
  • FIG2 is a flowchart of a processor setting method according to another embodiment of the present disclosure.
  • FIG3 is a schematic diagram of the structure of a processor setting device proposed in an embodiment of the present disclosure.
  • FIG4 is a schematic diagram of the structure of a processor setting device proposed in another embodiment of the present disclosure.
  • FIG5 shows a block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure.
  • FIG. 1 is a schematic flow chart of a processor setting method according to an embodiment of the present disclosure.
  • the executor of the processor setting method of this embodiment is a processor setting device, which can be implemented by software and/or hardware.
  • the device can be configured in an electronic device, and the electronic device can include but is not limited to a terminal, a server, etc.
  • the processor setting method includes steps S101 to S103 .
  • S101 Determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width.
  • the processor can be specifically, for example, a translation lookaside buffer (TLB), a cache, a register stack, etc.
  • TLB translation lookaside buffer
  • the processor can be specifically, for example, a translation lookaside buffer (TLB), a cache, a register stack, etc.
  • the embodiment of the present disclosure will specifically explain the processor setting method by assuming that the processor is configured as a cache memory.
  • the instruction item may specifically be, for example, an instruction memory (icache) in a cache, and the instruction item may be one item or multiple items.
  • icache instruction memory
  • the instruction item in the memory may have a corresponding valid field (valid field), and the field may have a corresponding bit width (bit).
  • the bit width (bit) is 1, the value of the valid field is 1, indicating that the corresponding instruction item is valid, and the value is 0, indicating that the corresponding instruction item is invalid.
  • the bit width (bit) is not 1, the instruction item may be set invalid based on the bit width, the valid field and the valid identification value. For details, please refer to the subsequent embodiments, which will not be repeated here.
  • determining the valid field corresponding to the instruction item in the memory may be determining the usage status corresponding to the processor, and determining the valid field corresponding to the instruction item in the memory based on the usage status corresponding to the processor determined above, without limitation.
  • the processor can be determined whether the processor is in the startup state. If the processor is in the startup state, then all instruction items in the processor are in an invalid state. Accordingly, it can be determined that the valid field value corresponding to the instruction item in the memory is 0.
  • determining the valid field corresponding to an instruction item in the processor may also be performed by directly identifying the value of a corresponding status bit (valid bit) for each instruction item in the processor to obtain the valid field corresponding to the instruction item in the processor, and there is no limitation on this.
  • the valid identification value corresponding to the instruction item can be read from the target register.
  • the effective identification value refers to the real identification value in the effective field corresponding to the instruction item, and the effective identification value can be stored in the register corresponding to the corresponding instruction item (the register can be called the target register).
  • reading a valid identification value corresponding to an instruction item from a target register may be performed by storing the valid identification value corresponding to the instruction item in the processor in a corresponding target register before executing a processor setting method, and then, during the execution of the processor setting method, reading the valid identification value corresponding to the instruction item from the target register, and then, based on the valid identification value, performing an invalid setting on the instruction item in the processor.
  • the instruction item in the processor may refer to an instruction memory (icache) in the memory, and the instruction item may be one or multiple items.
  • the instruction item is set according to the invalid setting information and the valid identification value. It can be that a certain instruction memory (icache) in the memory is set according to the invalid setting information and the valid identification value, or multiple instruction memories (icache) in the memory are set.
  • the instruction item is set according to the invalid setting information and the valid identification value, which may be a result.
  • the invalid setting information and the valid identification value are combined to invalidate the instruction item, that is, when the bit width, the valid field and the valid identification value meet the set conditions, an item in the memory, or multiple instruction memories (icache) can be invalidated.
  • invalid setting is performed on a certain item or multiple instruction memories (icache) in the memory according to the invalid setting information and the valid identification value.
  • the instruction item is invalidated based on the bit width, valid field and valid identification value.
  • the bit width is 1, the valid field is adjusted to 0 to invalidate the instruction item.
  • the bit width is greater than 1, the instruction item is invalidated based on the valid field and the valid identification value.
  • the bit width of the valid field corresponding to the instruction item in the processor can be judged. If the bit width is 1, the valid field is adjusted to 0 to invalidate the instruction item. If the bit width is greater than 1, the instruction item is invalidated based on the valid field and the valid identification value.
  • the bit width is greater than 1 and when the valid field of the instruction item is 0, the corresponding instruction item can be determined to be invalid.
  • the instruction item is set to be invalid based on the valid field and the valid identification value, and the valid field can be adjusted to 0 to set the instruction item to be invalid.
  • FIG. 2 is a schematic flow chart of a processor setting method according to another embodiment of the present disclosure.
  • the processor setting method includes steps S201 to S205 .
  • S201 configuring a corresponding target register for an instruction item in a processor, where the target register is used to store a valid identification value corresponding to the instruction item.
  • a corresponding register in the initial stage of executing the processor setting method, can be configured for the instruction item in the processor, and the register can be called a target register.
  • the target register can be used to store a valid identification value corresponding to the instruction item.
  • S202 Determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width.
  • the single instruction item is an instruction item to be invalidated among the multiple instruction items.
  • a single instruction item is invalidated based on a valid field and a valid identification value.
  • the single instruction item can be determined from multiple instruction items based on the valid identification value, and the valid field is adjusted to a target field value to invalidate the single instruction item.
  • the preset field predetermined for the valid field The value can be called the target field value, and the target field value is different from the effective identification value.
  • the instruction item to be invalidated can be determined from multiple instruction items as a single instruction item based on the valid identification value, that is, the instruction item whose valid identification value is not the target field value can be determined from multiple instruction items as a single instruction item, and then, the valid field can be adjusted to adjust the valid field to a target field value different from the valid identification value, thereby achieving invalidation of the single instruction item.
  • the number of processor instruction items may be multiple, and thus, all instruction items may be set to be invalid according to the valid fields and valid identification values.
  • an invalidation identification condition may be determined according to the bit width, wherein the invalidation identification condition is used to invalidate the instruction items.
  • corresponding invalidation identification conditions when invalidating all instruction items, corresponding invalidation identification conditions may be set for valid identification values of corresponding instruction items, and then the instruction items may be invalidated in combination with the invalidation identification conditions.
  • the invalid identification condition can be determined as 2N-1 according to the bit width, where N is the bit width of the valid field.
  • the valid identification value and the valid field may have corresponding reset values.
  • the reset value of the valid identification value may be 1, and the reset value of the valid field may be 0.
  • all instruction items are invalidated based on the valid field and the valid identification value. It can be determined whether the valid identification value satisfies the invalid identification condition, and when the valid identification value satisfies the invalid identification condition, the valid identification value is adjusted to the first preset identification value, and the valid field of each instruction item is adjusted to the first preset field to invalidate the instruction item. When the valid identification value does not satisfy the invalid identification condition, the valid identification value is increased by 1 to invalidate the instruction item.
  • the identification value pre-set for the valid identification value can be called the first preset identification value (the first identification value can be specifically, for example, 1), and accordingly, the field pre-set for the valid field of each instruction item can be called the first preset field (the first preset field can be specifically, for example, 0).
  • the valid identification value may be adjusted to 1 and the valid field of each instruction item may be adjusted to 0 to invalidate the instruction item when the valid identification value satisfies 2N-1.
  • the target register is used to store a valid identification value corresponding to the instruction item, and determine a valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and then read the valid identification value corresponding to the instruction item from the target register, and according to the valid field and the valid identification value, invalidate a single instruction item, wherein the single instruction item is an instruction item to be invalidated among multiple instruction items, and then invalidate all instruction items according to the valid field and the valid identification value, thereby achieving efficient invalidation of instruction items in the processor by combining the bit width, the valid field and the valid identification value, thereby effectively ensuring the setting effect of the processor while effectively saving the functional overhead of the processor, thereby effectively improving the performance of the processor.
  • FIG. 3 is a schematic diagram of the structure of a processor setting device proposed in an embodiment of the present disclosure.
  • the processor setting device 30 includes:
  • a determination module 301 is used to determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width;
  • a reading module 302 used for reading a valid identification value corresponding to an instruction item from a target register
  • the setting module 303 is used to set the instruction item to be invalid according to the bit width, the valid field and the valid identification value.
  • FIG. 4 is a processor device according to another embodiment of the present disclosure.
  • the first setting submodule 3031 is used to adjust the valid field to 0 when the bit width is 1, so as to perform invalid setting on the instruction item;
  • the second setting submodule 3032 is used to set the instruction item to be invalid according to the valid field and the valid identification value when the bit width is greater than 1.
  • the number of instruction items is multiple;
  • the second setting submodule 3032 is further used for:
  • the second setting submodule 3032 is further used to:
  • the valid field is adjusted so that the adjusted valid field and the valid identification value are different, so as to invalidate the setting of a single instruction item.
  • the second setting submodule 3032 is further used to:
  • the valid identification value is adjusted to the first preset identification value, and the valid field of each instruction item is adjusted to the first preset field, so as to set the instruction item invalid;
  • the valid identification value is increased by 1 to invalidate the instruction item.
  • the processor setting device 30 further includes:
  • the configuration module 304 is used to configure a corresponding target register for the instruction item in the processor before determining the valid field corresponding to the instruction item in the processor, and the target register is used to store the valid identification value corresponding to the instruction item.
  • the present disclosure further provides a processor setting device. Since the processor setting device provided in the embodiments of the present disclosure corresponds to the processor setting method provided in the embodiments of Figures 1 to 2 above, the implementation method of the processor setting method is also applicable to the processor setting device provided in the embodiments of the present disclosure, and will not be described in detail in the embodiments of the present disclosure.
  • the valid field corresponding to the instruction item in the processor by determining the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and reading the valid identification value corresponding to the instruction item from the target register, and then setting the instruction item invalid according to the bit width, the valid field and the valid identification value, it is possible to combine the bit width, the valid field and the valid identification value to efficiently set the instruction item in the processor invalid, thereby effectively ensuring the setting effect of the processor while effectively saving the functional overhead of the processor, thereby effectively improving the performance of the processor.
  • the present disclosure further proposes an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the above embodiments of the present disclosure are implemented.
  • a processor setting method is proposed in an embodiment.
  • the present disclosure further proposes a non-temporary computer-readable storage medium on which a computer program is stored.
  • the program is executed by a processor, the processor setting method proposed in the above embodiments of the present disclosure is implemented.
  • the present disclosure further proposes a computer program product.
  • the instruction processor in the computer program product executes, the processor setting method proposed in the above embodiments of the present disclosure is executed.
  • Fig. 5 shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure.
  • the electronic device 12 shown in Fig. 5 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 12 is in the form of a general purpose computing device.
  • the components of the electronic device 12 may include, but are not limited to: one or more memories or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
  • Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a memory or a local bus using any of a variety of bus structures.
  • these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
  • ISA Industry Standard Architecture
  • MAC Micro Channel Architecture
  • VESA Video Electronics Standards Association
  • PCI Peripheral Component Interconnection
  • the electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
  • the memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32.
  • the electronic device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 5 , commonly referred to as a “hard drive”).
  • a disk drive for reading and writing to a removable nonvolatile disk e.g., a “floppy disk”
  • an optical disk drive for reading and writing to a removable nonvolatile optical disk e.g., a Compact Disc Read Only Memory (hereinafter referred to as CD-ROM), a Digital Video Disc Read Only Memory (hereinafter referred to as DVD-ROM), or other optical media
  • each drive may be connected to the bus 18 via one or more data medium interfaces.
  • the memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
  • a program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
  • the program modules 42 generally perform the functions and/or methods of the embodiments described in the present disclosure.
  • the electronic device 12 may also be connected to one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24 ).
  • the electronic device 12 may communicate with one or more devices that enable a user to interact with the electronic device 12, and/or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input/output (I/O) interface 22.
  • the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter 20.
  • networks e.g., a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet
  • the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and/or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
  • the processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the processor setting method mentioned in the above embodiment.
  • Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing module or may be Each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
  • the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

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)

Abstract

Provided in the present disclosure are a processor setting method and apparatus, an electronic device, and a storage medium. The specific solution is as follows: determining a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width; reading from a target register a valid identification value corresponding to the instruction item; and then, according to the bit width, the valid field and the valid identification value, setting the instruction item invalid.

Description

处理器设置方法、装置、电子设备及存储介质Processor setting method, device, electronic device and storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于申请号为202211498291.2、申请日为2022年11月28日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with application number 202211498291.2 and application date November 28, 2022, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference.
技术领域Technical Field
本公开涉及计算机技术领域,尤其涉及一种处理器设置方法、装置、电子设备及存储介质。The present disclosure relates to the field of computer technology, and in particular to a processor setting method, device, electronic device and storage medium.
背景技术Background technique
处理器(例如,高速缓冲存储器(Cache),寄存器)是在计算机存储系统的层次结构中的重要单元,在处理器的应用过程中,需要对处理器进行无效设置。A processor (eg, cache memory, register) is an important unit in the hierarchical structure of a computer storage system. During the application of the processor, it is necessary to perform invalid settings on the processor.
相关技术中,在对处理器进行无效设置时,需要进行较为繁琐的设置操作,且需要较大功能开销,从而会影响处理器的使用性能。In the related art, when invalid settings are performed on a processor, a relatively cumbersome setting operation is required, and a large functional overhead is required, which will affect the performance of the processor.
发明内容Summary of the invention
本公开旨在至少在一定程度上解决相关技术中的技术问题之一。The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
为此,本公开的目的在于提出一种处理器设置方法、装置、电子设备及存储介质,能够实现结合无效设置信息和有效标识值,高效地对处理器中指令项进行无效设置,从而能够在有效地保障处理器设置效果的同时,有效地节约处理器的功能开销,进而有效地提升处理器的使用性能。To this end, the purpose of the present disclosure is to propose a processor setting method, device, electronic device and storage medium, which can combine invalid setting information and valid identification values to efficiently invalidate instruction items in the processor, thereby effectively ensuring the processor setting effect while effectively saving the processor's functional overhead, thereby effectively improving the processor's performance.
本公开第一方面实施例提出的处理器设置方法,包括:确定处理器中指令项对应的有效字段,其中,所述有效字段具有对应的位宽;从目标寄存器中读取与所述指令项相应的有效标识值;根据所述位宽,所述有效字段以及所述有效标识值,对所述指令项进行无效设置。The processor setting method proposed in the embodiment of the first aspect of the present disclosure includes: determining a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width; reading a valid identification value corresponding to the instruction item from a target register; and invalidating the instruction item according to the bit width, the valid field and the valid identification value.
本公开第一方面实施例提出的处理器设置方法,通过确定处理器中指令项对应的有效字段,其中,所述有效字段具有对应的位宽,并从目标寄存器中读取与所述指令项相应的有效标识值,再根据所述位宽,所述有效字段以及所述有效标识值,对所述指令项进行无效设置,由此,能够实现结合所述位宽,所述有效字段以及所述有效标识值,高效地对处理器中指令项进行无效设置,从而能够在有效地保障处理器设置效果的同时,有效地节约处理器的功能开销,进而有效地提升处理器的使用性能。The processor setting method proposed in the embodiment of the first aspect of the present disclosure determines the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and reads the valid identification value corresponding to the instruction item from the target register, and then invalidates the instruction item according to the bit width, the valid field and the valid identification value. Thus, it is possible to combine the bit width, the valid field and the valid identification value to efficiently invalidate the instruction item in the processor, thereby effectively ensuring the processor setting effect while effectively saving the functional overhead of the processor, thereby effectively improving the performance of the processor.
本公开第二方面实施例提出的处理器设置装置,包括:确定模块,用于确定处理器中指令项对应的有效字段,其中,所述有效字段具有对应的位宽;读取模块,用于从目标寄存器中读取与所述指令项相应的有效标识值;设置模块,用于根据所述位宽,所述有效字段以及所述有效标识值,对所述指令项进行无效设置。 The processor setting device proposed in the second aspect embodiment of the present disclosure includes: a determination module, used to determine the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width; a reading module, used to read the valid identification value corresponding to the instruction item from the target register; and a setting module, used to invalidate the instruction item according to the bit width, the valid field and the valid identification value.
本公开第二方面实施例提出的处理器设置装置,通过确定处理器中指令项对应的有效字段,其中,所述有效字段具有对应的位宽,并从目标寄存器中读取与所述指令项相应的有效标识值,再根据所述位宽,所述有效字段以及所述有效标识值,对所述指令项进行无效设置,由此,能够实现结合所述位宽,所述有效字段以及所述有效标识值,高效地对处理器中指令项进行无效设置,从而能够在有效地保障处理器设置效果的同时,有效地节约处理器的功能开销,进而有效地提升处理器的使用性能。The processor setting device proposed in the second aspect of the embodiment of the present disclosure determines a valid field corresponding to an instruction item in the processor, wherein the valid field has a corresponding bit width, and reads a valid identification value corresponding to the instruction item from a target register, and then invalidates the instruction item according to the bit width, the valid field and the valid identification value. Thus, it is possible to combine the bit width, the valid field and the valid identification value to efficiently invalidate the instruction item in the processor, thereby effectively ensuring the processor setting effect while effectively saving the functional overhead of the processor, thereby effectively improving the processor's performance.
本公开第三方面实施例提出了一种电子设备,包括处理器、存储器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时,实现如本公开第一方面实施例提出的处理器设置方法。The third aspect of the present disclosure provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the processor setting method provided in the first aspect of the present disclosure is implemented.
本公开第四方面实施例提出了一种非临时性计算机可读存储介质,其上存储有计算机程序,该程序被存储器执行时实现如本公开第一方面实施例提出的处理器设置方法。The fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by the memory, the processor setting method proposed in the first aspect embodiment of the present disclosure is implemented.
本公开第五方面实施例提出了一种计算机程序产品,当计算机程序产品中的指令被处理器执行时,执行如本公开第一方面实施例提出的处理器设置方法。The fifth aspect embodiment of the present disclosure proposes a computer program product. When the instructions in the computer program product are executed by a processor, the processor setting method proposed in the first aspect embodiment of the present disclosure is executed.
本公开附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本公开的实践了解到。Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
本公开上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
图1是本公开一实施例提出的处理器设置方法的流程示意图;FIG1 is a schematic flow chart of a processor setting method according to an embodiment of the present disclosure;
图2是本公开另一实施例提出的处理器设置方法的流程示意图;FIG2 is a flowchart of a processor setting method according to another embodiment of the present disclosure;
图3是本公开一实施例提出的处理器设置装置的结构示意图;FIG3 is a schematic diagram of the structure of a processor setting device proposed in an embodiment of the present disclosure;
图4是本公开另一实施例提出的处理器设置装置的结构示意图;FIG4 is a schematic diagram of the structure of a processor setting device proposed in another embodiment of the present disclosure;
图5示出了适于用来实现本公开实施方式的示例性电子设备的框图。FIG5 shows a block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure.
具体实施方式Detailed ways
下面详细描述本公开的实施例,实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本公开,而不能理解为对本公开的限制。相反,本公开的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and should not be construed as limitations on the present disclosure. On the contrary, the embodiments of the present disclosure include all changes, modifications, and equivalents that fall within the spirit and connotation of the appended claims.
图1是本公开一实施例提出的处理器设置方法的流程示意图。FIG. 1 is a schematic flow chart of a processor setting method according to an embodiment of the present disclosure.
其中,需要说明的是,本实施例的处理器设置方法的执行主体为处理器设置装置,该装置可以由软件和/或硬件的方式实现,该装置可以配置在电子设备中,电子设备可以包括但不限于终端、服务器端等。It should be noted that the executor of the processor setting method of this embodiment is a processor setting device, which can be implemented by software and/or hardware. The device can be configured in an electronic device, and the electronic device can include but is not limited to a terminal, a server, etc.
如图1所示,该处理器设置方法,包括步骤S101至步骤S103。 As shown in FIG. 1 , the processor setting method includes steps S101 to S103 .
S101:确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽。S101: Determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width.
其中,处理器可以具体例如为转译后备缓冲器(Translation Lookaside Buffer,TLB),高速缓冲存储器(Cache),寄存器堆等。Among them, the processor can be specifically, for example, a translation lookaside buffer (TLB), a cache, a register stack, etc.
本公开实施例将以处理器被配置为高速缓冲存储器(Cache)对处理器设置方法做具体的解释说明。The embodiment of the present disclosure will specifically explain the processor setting method by assuming that the processor is configured as a cache memory.
其中,指令项可以具体例如是Cache中的指令存储器(icache),该指令项可以是一项,也可以是多项。The instruction item may specifically be, for example, an instruction memory (icache) in a cache, and the instruction item may be one item or multiple items.
其中,存储器中指令项可以具有对应的有效字段(valid字段),该字段可以具有对应的位宽(bit),当位宽(bit)为1时,有效字段的值为1代表相应指令项有效,值为0代表相应指令项无效,当位宽(bit)不为1时,可以是根据位宽,有效字段以及有效标识值,对指令项进行无效设置,具体可以参见后续实施例,在此不再赘述。Among them, the instruction item in the memory may have a corresponding valid field (valid field), and the field may have a corresponding bit width (bit). When the bit width (bit) is 1, the value of the valid field is 1, indicating that the corresponding instruction item is valid, and the value is 0, indicating that the corresponding instruction item is invalid. When the bit width (bit) is not 1, the instruction item may be set invalid based on the bit width, the valid field and the valid identification value. For details, please refer to the subsequent embodiments, which will not be repeated here.
在一些实施例中,确定存储器中指令项对应的有效字段,可以是确定处理器对应的使用状态,并根据前述确定的处理器对应的使用状态确定与确定存储器中指令项对应的有效字段,对此不做限制。In some embodiments, determining the valid field corresponding to the instruction item in the memory may be determining the usage status corresponding to the processor, and determining the valid field corresponding to the instruction item in the memory based on the usage status corresponding to the processor determined above, without limitation.
例如,可以确定处理器是否处于启动状态,若处理器处于启动状态,此时,处理器中的指令项是处于全部无效状态,相应的,可以确定存储器中指令项对应的有效字段值为0。For example, it can be determined whether the processor is in the startup state. If the processor is in the startup state, then all instruction items in the processor are in an invalid state. Accordingly, it can be determined that the valid field value corresponding to the instruction item in the memory is 0.
在另一些实施例中,确定处理器中指令项对应的有效字段,还可以是直接对处理器中的每一个指令项都可以具有对应的状态位(valid bit)的值进行识别,以得到与处理器中指令项对应的有效字段,对此不做限制。In other embodiments, determining the valid field corresponding to an instruction item in the processor may also be performed by directly identifying the value of a corresponding status bit (valid bit) for each instruction item in the processor to obtain the valid field corresponding to the instruction item in the processor, and there is no limitation on this.
S102:从目标寄存器中读取与指令项相应的有效标识值。S102: Read the valid identification value corresponding to the instruction item from the target register.
本公开实施例在确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽后,可以从目标寄存器中读取与指令项相应的有效标识值。In the embodiment of the present disclosure, after determining the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, the valid identification value corresponding to the instruction item can be read from the target register.
其中,有效标识值是指指令项相应的有效字段中真实的标识值,该有效标识值可以存储在相应指令项对应的寄存器(该寄存器即可以被称为目标寄存器)中。The effective identification value refers to the real identification value in the effective field corresponding to the instruction item, and the effective identification value can be stored in the register corresponding to the corresponding instruction item (the register can be called the target register).
在本公开实施例中,从目标寄存器中读取与指令项相应的有效标识值,可以是在执行处理器设置方法之间,将处理器中指令项相应的有效标识值存储在相应目标寄存器中,而后,可以在执行处理器设置方法过程中,从目标寄存器中读取与指令项相应的有效标识值,而后,可以基于有效标识值,对处理器中的指令项进行无效设置。In an embodiment of the present disclosure, reading a valid identification value corresponding to an instruction item from a target register may be performed by storing the valid identification value corresponding to the instruction item in the processor in a corresponding target register before executing a processor setting method, and then, during the execution of the processor setting method, reading the valid identification value corresponding to the instruction item from the target register, and then, based on the valid identification value, performing an invalid setting on the instruction item in the processor.
S103:根据位宽,有效字段以及有效标识值,对指令项进行无效设置。S103: Invalidate the instruction item according to the bit width, the valid field and the valid identification value.
其中,处理器中指令项可以是指存储器中的指令存储器(icache),该指令项可以是一项,也可以是多项。The instruction item in the processor may refer to an instruction memory (icache) in the memory, and the instruction item may be one or multiple items.
也即是说,本公开实施例中,根据无效设置信息和有效标识值,对指令项进行设置,可以是根据无效设置信息和有效标识值,对存储器中的某一项指令存储器(icache)进行设置,还可以是对存储器中的多项指令存储器(icache)进行设置。That is to say, in the embodiments of the present disclosure, the instruction item is set according to the invalid setting information and the valid identification value. It can be that a certain instruction memory (icache) in the memory is set according to the invalid setting information and the valid identification value, or multiple instruction memories (icache) in the memory are set.
在一些实施例中,根据无效设置信息和有效标识值,对指令项进行设置,可以是结 合无效设置信息和有效标识值对指令项进行无效设置,即可以在位宽,有效字段以及有效标识值满足设定条件时,对存储器中的某一项,或者多项指令存储器(icache)进行无效设置。In some embodiments, the instruction item is set according to the invalid setting information and the valid identification value, which may be a result. The invalid setting information and the valid identification value are combined to invalidate the instruction item, that is, when the bit width, the valid field and the valid identification value meet the set conditions, an item in the memory, or multiple instruction memories (icache) can be invalidated.
举例而言,接收到无效设置指令(例如,fencei指令)后,根据无效设置信息和有效标识值,对存储器中的某一项,或者多项指令存储器(icache)进行无效设置。For example, after receiving an invalid setting instruction (eg, fencei instruction), invalid setting is performed on a certain item or multiple instruction memories (icache) in the memory according to the invalid setting information and the valid identification value.
在一些实施例中,根据位宽、有效字段以及有效标识值,对指令项进行无效设置,可以是在位宽为1时,将有效字段调整为0,以对指令项进行无效设置,在位宽大于1时,根据有效字段以及有效标识值,对指令项进行无效设置。In some embodiments, the instruction item is invalidated based on the bit width, valid field and valid identification value. When the bit width is 1, the valid field is adjusted to 0 to invalidate the instruction item. When the bit width is greater than 1, the instruction item is invalidated based on the valid field and the valid identification value.
也即是说,本公开实施例中,可以是对处理器中指令项对应的有效字段的位宽进行判断,如果位宽为1,则将有效字段调整为0,以对指令项进行无效设置,如果位宽大于1,则根据有效字段以及有效标识值,对指令项进行无效设置。That is to say, in the embodiments of the present disclosure, the bit width of the valid field corresponding to the instruction item in the processor can be judged. If the bit width is 1, the valid field is adjusted to 0 to invalidate the instruction item. If the bit width is greater than 1, the instruction item is invalidated based on the valid field and the valid identification value.
本公开实施例中,如果位宽大于1,且当指令项的有效字段为0时,即可以确定相应指令项无效,由此,根据有效字段以及有效标识值,对指令项进行无效设置,可以是将有效字段调整为0,以对指令项进行无效设置。In an embodiment of the present disclosure, if the bit width is greater than 1 and when the valid field of the instruction item is 0, the corresponding instruction item can be determined to be invalid. Thus, the instruction item is set to be invalid based on the valid field and the valid identification value, and the valid field can be adjusted to 0 to set the instruction item to be invalid.
在本实施例中,通过确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽,并从目标寄存器中读取与指令项相应的有效标识值,再根据位宽,有效字段以及有效标识值,对指令项进行无效设置,由此,能够实现结合位宽,有效字段以及有效标识值,高效地对处理器中指令项进行无效设置,从而能够在有效地保障处理器设置效果的同时,有效地节约处理器的功能开销,进而有效地提升处理器的使用性能。In this embodiment, by determining the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and reading the valid identification value corresponding to the instruction item from the target register, and then setting the instruction item invalid according to the bit width, the valid field and the valid identification value, it is possible to combine the bit width, the valid field and the valid identification value to efficiently set the instruction item in the processor invalid, thereby effectively ensuring the processor setting effect while effectively saving the processor's functional overhead, thereby effectively improving the processor's performance.
图2是本公开另一实施例提出的处理器设置方法的流程示意图。FIG. 2 is a schematic flow chart of a processor setting method according to another embodiment of the present disclosure.
如图2所示,该处理器设置方法,包括步骤S201至S205。As shown in FIG. 2 , the processor setting method includes steps S201 to S205 .
S201:针对处理器中指令项配置相应的目标寄存器,目标寄存器用于存储指令项相应的有效标识值。S201: configuring a corresponding target register for an instruction item in a processor, where the target register is used to store a valid identification value corresponding to the instruction item.
本公开实施例中,在处理器设置方法执行的初始阶段,可以针对处理器中指令项配置相应的寄存器,该寄存器即可以被称为目标寄存器,该目标寄存器可以用于存储指令项相应的有效标识值。In the embodiment of the present disclosure, in the initial stage of executing the processor setting method, a corresponding register can be configured for the instruction item in the processor, and the register can be called a target register. The target register can be used to store a valid identification value corresponding to the instruction item.
S202:确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽。S202: Determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width.
S203:从目标寄存器中读取与指令项相应的有效标识值。S203: Read the valid identification value corresponding to the instruction item from the target register.
S202-S203的描述说明可以具体参见上述实施例,在此不再赘述。The description of S202 - S203 can be specifically referred to the above embodiment, which will not be repeated here.
S204:根据有效字段和有效标识值,对单一指令项进行无效设置,其中,单一指令项是多个指令项中待进行无效设置的指令项。S204: invalidate a single instruction item according to the valid field and the valid identification value, wherein the single instruction item is an instruction item to be invalidated among the multiple instruction items.
其中,单一指令项是多个指令项中待进行无效设置的指令项。The single instruction item is an instruction item to be invalidated among the multiple instruction items.
在一些实施例中,根据有效字段和有效标识值,对单一指令项进行无效设置,可以是根据有效标识值从多个指令项中确定单一指令项,并将所述有效字段调整为目标字段值,以对所述单一指令项进行无效设置。In some embodiments, a single instruction item is invalidated based on a valid field and a valid identification value. The single instruction item can be determined from multiple instruction items based on the valid identification value, and the valid field is adjusted to a target field value to invalidate the single instruction item.
其中,在对单一指令项进行无效设置的过程中,针对有效字段预先确定的预设字段 值即可以被称为目标字段值,该所述目标字段值和所述有效标识值不相同。Among them, in the process of invalidating a single instruction item, the preset field predetermined for the valid field The value can be called the target field value, and the target field value is different from the effective identification value.
本公开实施例中,可以根据有效标识值从多个指令项中确定待进行无效设置的指令项作为单一指令项,即可以是从多个指令项中确定有效标识值不为目标字段值的指令项作为单一指令项,而后,可以对有效字段进行调整,以将有效字段调整为与有效标识值不相同的目标字段值,从而实现对单一指令项进行无效设置。In the embodiment of the present disclosure, the instruction item to be invalidated can be determined from multiple instruction items as a single instruction item based on the valid identification value, that is, the instruction item whose valid identification value is not the target field value can be determined from multiple instruction items as a single instruction item, and then, the valid field can be adjusted to adjust the valid field to a target field value different from the valid identification value, thereby achieving invalidation of the single instruction item.
S205:根据有效字段和有效标识值,对全部指令项进行无效设置。S205: Invalidate all instruction items according to the valid fields and valid identification values.
本公开实施例中,处理器指令项的数量可以是多项,由此,可以根据有效字段和有效标识值,对全部指令项进行无效设置。In the embodiment of the present disclosure, the number of processor instruction items may be multiple, and thus, all instruction items may be set to be invalid according to the valid fields and valid identification values.
在一些实施例中,在根据有效字段和有效标识值,对全部指令项进行无效设置之前,可以根据位宽,确定无效标识条件,其中,无效标识条件用于对指令项进行无效设置。In some embodiments, before invalidating all instruction items according to the valid fields and valid identification values, an invalidation identification condition may be determined according to the bit width, wherein the invalidation identification condition is used to invalidate the instruction items.
本公开实施例中,在对全部指令项进行无效设置时,可以针对相应指令项的有效标识值设置相应的无效标识条件,而后可以结合无效标识条件,对指令项进行无效设置。In the disclosed embodiment, when invalidating all instruction items, corresponding invalidation identification conditions may be set for valid identification values of corresponding instruction items, and then the instruction items may be invalidated in combination with the invalidation identification conditions.
本公开实施例中,可以根据位宽,确定无效标识条件为2N-1,N为有效字段的位宽。In the embodiment of the present disclosure, the invalid identification condition can be determined as 2N-1 according to the bit width, where N is the bit width of the valid field.
本公开实施例中,有效标识值和有效字段可以具有相应的复位值。例如,有效标识值的复位值可以为1,有效字段的复位值可以为0。In the embodiment of the present disclosure, the valid identification value and the valid field may have corresponding reset values. For example, the reset value of the valid identification value may be 1, and the reset value of the valid field may be 0.
在一些实施例中,根据有效字段和有效标识值,对全部指令项进行无效设置,可以是判断有效标识值是否满足无效标识条件,并在有效标识值满足无效标识条件时,将有效标识值调整为第一预设标识值,且将每个指令项的有效字段调整为第一预设字段,以对指令项进行无效设置,再在有效标识值不满足无效标识条件时,对有效标识值加1,以对指令项进行无效设置。In some embodiments, all instruction items are invalidated based on the valid field and the valid identification value. It can be determined whether the valid identification value satisfies the invalid identification condition, and when the valid identification value satisfies the invalid identification condition, the valid identification value is adjusted to the first preset identification value, and the valid field of each instruction item is adjusted to the first preset field to invalidate the instruction item. When the valid identification value does not satisfy the invalid identification condition, the valid identification value is increased by 1 to invalidate the instruction item.
其中,在有效标识值满足无效标识条件时,针对有效标识值预先设定的标识值,即可以被称为第一预设标识值(第一标识值可以具体例如为1),相应的,针对每个指令项的有效字段预先设定的字段,即可以被称为第一预设字段(第一预设字段可以具体例如为0)。Among them, when the valid identification value meets the invalid identification condition, the identification value pre-set for the valid identification value can be called the first preset identification value (the first identification value can be specifically, for example, 1), and accordingly, the field pre-set for the valid field of each instruction item can be called the first preset field (the first preset field can be specifically, for example, 0).
也即是说,本公开实施例中,可以是在有效标识值是否满足2N-1,并在有效标识值满足2N-1时,将有效标识值调整为1,且将每个指令项的有效字段调整为0,以对指令项进行无效设置。That is to say, in the embodiment of the present disclosure, the valid identification value may be adjusted to 1 and the valid field of each instruction item may be adjusted to 0 to invalidate the instruction item when the valid identification value satisfies 2N-1.
其中,在有效标识值不满足无效标识条件时,针对有效标识值加1,且保持有效字段不变,以对指令项进行无效设置。Among them, when the valid identification value does not meet the invalid identification condition, 1 is added to the valid identification value and the valid field is kept unchanged to invalidate the instruction item.
举例而言,当位宽N为2时,在对指令项进行无效设置时,有效标识值(vid)和有效字段(valid)的取值具体可以如表1所示: For example, when the bit width N is 2, when the instruction item is set invalid, the values of the valid identification value (vid) and the valid field (valid) can be specifically as shown in Table 1:
表1
Table 1
可以理解的是,上述表1中的每一个元素都是独立存在的,这些元素被示例性的列在同一张表格中,但是并不代表表格中的所有元素必须根据表格中所示的同时存在。其中每一个元素的值,是不依赖于表1中任何其他元素值。因此本领域内技术人员可以理解,该表1中的每一个元素的取值都是一个独立的实施例。It is understood that each element in the above Table 1 exists independently. These elements are exemplarily listed in the same table, but it does not mean that all elements in the table must exist at the same time as shown in the table. The value of each element is independent of the value of any other element in Table 1. Therefore, those skilled in the art can understand that the value of each element in Table 1 is an independent embodiment.
本公开实施例中,通过针对处理器中指令项配置相应的目标寄存器,目标寄存器用于存储指令项相应的有效标识值,并确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽,再从目标寄存器中读取与指令项相应的有效标识值,并根据有效字段和有效标识值,对单一指令项进行无效设置,其中,单一指令项是多个指令项中待进行无效设置的指令项,再根据有效字段和有效标识值,对全部指令项进行无效设置,由此,能够实现结合位宽,有效字段以及有效标识值,高效地对处理器中指令项进行无效设置,从而能够在有效地保障处理器设置效果的同时,有效地节约处理器的功能开销,进而有效地提升处理器的使用性能。In the disclosed embodiment, by configuring a corresponding target register for an instruction item in a processor, the target register is used to store a valid identification value corresponding to the instruction item, and determine a valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and then read the valid identification value corresponding to the instruction item from the target register, and according to the valid field and the valid identification value, invalidate a single instruction item, wherein the single instruction item is an instruction item to be invalidated among multiple instruction items, and then invalidate all instruction items according to the valid field and the valid identification value, thereby achieving efficient invalidation of instruction items in the processor by combining the bit width, the valid field and the valid identification value, thereby effectively ensuring the setting effect of the processor while effectively saving the functional overhead of the processor, thereby effectively improving the performance of the processor.
图3是本公开一实施例提出的处理器设置装置的结构示意图。FIG. 3 is a schematic diagram of the structure of a processor setting device proposed in an embodiment of the present disclosure.
如图3所示,该处理器设置装置30,包括:As shown in FIG3 , the processor setting device 30 includes:
确定模块301,用于确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽;A determination module 301 is used to determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width;
读取模块302,用于从目标寄存器中读取与指令项相应的有效标识值;A reading module 302, used for reading a valid identification value corresponding to an instruction item from a target register;
设置模块303,用于根据位宽,有效字段以及有效标识值,对指令项进行无效设置。The setting module 303 is used to set the instruction item to be invalid according to the bit width, the valid field and the valid identification value.
在本公开的一些实施例中,如图4所示,图4是本公开另一实施例提出的处理器设 置装置的结构示意图,其中,设置模块303,包括:In some embodiments of the present disclosure, as shown in FIG. 4 , FIG. 4 is a processor device according to another embodiment of the present disclosure. The structural diagram of the setting device, wherein the setting module 303 includes:
第一设置子模块3031,用于在位宽为1时,将有效字段调整为0,以对指令项进行无效设置;The first setting submodule 3031 is used to adjust the valid field to 0 when the bit width is 1, so as to perform invalid setting on the instruction item;
第二设置子模块3032,用于在位宽大于1时,根据有效字段以及有效标识值,对指令项进行无效设置。The second setting submodule 3032 is used to set the instruction item to be invalid according to the valid field and the valid identification value when the bit width is greater than 1.
在本公开的一些实施例中,指令项的数量是多个;In some embodiments of the present disclosure, the number of instruction items is multiple;
其中,第二设置子模块3032,还用于:The second setting submodule 3032 is further used for:
根据有效字段以及有效标识值,对单一指令项进行无效设置,其中,单一指令项是多个指令项中待进行无效设置的指令项;和/或Invalidate a single instruction item according to the valid field and the valid identification value, wherein the single instruction item is the instruction item to be invalidated among the multiple instruction items; and/or
根据有效字段以及有效标识值,对全部指令项进行无效设置。Invalidate all instruction items based on valid fields and valid identification values.
在本公开的一些实施例中,第二设置子模块3032,还用于:In some embodiments of the present disclosure, the second setting submodule 3032 is further used to:
根据有效标识值从多个指令项中确定单一指令项;Determine a single instruction item from a plurality of instruction items according to a valid identification value;
对有效字段进行调整,使得调整后的有效字段和有效标识值不相同,以对单一指令项进行无效设置。The valid field is adjusted so that the adjusted valid field and the valid identification value are different, so as to invalidate the setting of a single instruction item.
在本公开的一些实施例中,第二设置子模块3032,还用于:In some embodiments of the present disclosure, the second setting submodule 3032 is further used to:
在根据有效字段以及有效标识值,对全部指令项进行无效设置之前,根据位宽,确定无效标识条件,其中,无效标识条件用于对指令项进行无效设置;Before invalidating all instruction items according to the valid fields and the valid identification values, determining an invalid identification condition according to the bit width, wherein the invalid identification condition is used to invalidate the instruction items;
判断有效字段是否满足无效标识条件;Determine whether the valid field meets the invalid identification condition;
如果有效字段满足无效标识条件,则将有效标识值调整为第一预设标识值,且将每个指令项的有效字段调整为第一预设字段,以对指令项进行无效设置;If the valid field meets the invalid identification condition, the valid identification value is adjusted to the first preset identification value, and the valid field of each instruction item is adjusted to the first preset field, so as to set the instruction item invalid;
如果有效字段不满足无效标识条件,则对有效标识值加1,以对指令项进行无效设置。If the valid field does not satisfy the invalid identification condition, the valid identification value is increased by 1 to invalidate the instruction item.
在本公开的一些实施例中,处理器设置装置30,还包括:In some embodiments of the present disclosure, the processor setting device 30 further includes:
配置模块304,用于在确定处理器中指令项对应的有效字段之前,针对处理器中指令项配置相应的目标寄存器,目标寄存器用于存储指令项相应的有效标识值。The configuration module 304 is used to configure a corresponding target register for the instruction item in the processor before determining the valid field corresponding to the instruction item in the processor, and the target register is used to store the valid identification value corresponding to the instruction item.
与上述图1至图2实施例提供的处理器设置方法相对应,本公开还提供一种处理器设置装置,由于本公开实施例提供的处理器设置装置与上述图1至图2实施例提供的处理器设置方法相对应,因此在处理器设置方法的实施方式也适用于本公开实施例提供的处理器设置装置,在本公开实施例中不再详细描述。Corresponding to the processor setting method provided in the embodiments of Figures 1 to 2 above, the present disclosure further provides a processor setting device. Since the processor setting device provided in the embodiments of the present disclosure corresponds to the processor setting method provided in the embodiments of Figures 1 to 2 above, the implementation method of the processor setting method is also applicable to the processor setting device provided in the embodiments of the present disclosure, and will not be described in detail in the embodiments of the present disclosure.
本公开实施例中,通过确定处理器中指令项对应的有效字段,其中,有效字段具有对应的位宽,并从目标寄存器中读取与指令项相应的有效标识值,再根据位宽,有效字段以及有效标识值,对指令项进行无效设置,由此,能够实现结合位宽,有效字段以及有效标识值,高效地对处理器中指令项进行无效设置,从而能够在有效地保障处理器设置效果的同时,有效地节约处理器的功能开销,进而有效地提升处理器的使用性能。In the disclosed embodiment, by determining the valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width, and reading the valid identification value corresponding to the instruction item from the target register, and then setting the instruction item invalid according to the bit width, the valid field and the valid identification value, it is possible to combine the bit width, the valid field and the valid identification value to efficiently set the instruction item in the processor invalid, thereby effectively ensuring the setting effect of the processor while effectively saving the functional overhead of the processor, thereby effectively improving the performance of the processor.
为了实现上述实施例,本公开还提出一种电子设备,包括:处理器、存储器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时,实现如本公开前述 实施例提出的处理器设置方法。In order to implement the above embodiments, the present disclosure further proposes an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the above embodiments of the present disclosure are implemented. A processor setting method is proposed in an embodiment.
为了实现上述实施例,本公开还提出一种非临时性计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开前述实施例提出的处理器设置方法。In order to implement the above embodiments, the present disclosure further proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the processor setting method proposed in the above embodiments of the present disclosure is implemented.
为了实现上述实施例,本公开还提出一种计算机程序产品,当计算机程序产品中的指令处理器执行时,执行如本公开前述实施例提出的处理器设置方法。In order to implement the above embodiments, the present disclosure further proposes a computer program product. When the instruction processor in the computer program product executes, the processor setting method proposed in the above embodiments of the present disclosure is executed.
图5示出了适于用来实现本公开实施方式的示例性电子设备的框图。图5显示的电子设备12仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Fig. 5 shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure. The electronic device 12 shown in Fig. 5 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
如图5所示,电子设备12以通用计算设备的形式表现。电子设备12的组件可以包括但不限于:一个或者多个存储器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。5 , the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more memories or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,存储器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry Standard Architecture;以下简称:ISA)总线,微通道体系结构(Micro Channel Architecture;以下简称:MAC)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association;以下简称:VESA)局域总线以及外围组件互连(Peripheral Component Interconnection;以下简称:PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a memory or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
电子设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory;以下简称:RAM)30和/或高速缓存存储器32。电子设备12可以进一步包括其他可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图5未显示,通常称为“硬盘驱动器”)。The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 5 , commonly referred to as a “hard drive”).
尽管图5中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如:光盘只读存储器(Compact Disc Read Only Memory;以下简称:CD-ROM)、数字多功能只读光盘(Digital Video Disc Read Only Memory;以下简称:DVD-ROM)或者其他光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本公开各实施例的功能。Although not shown in FIG. 5 , a disk drive for reading and writing to a removable nonvolatile disk (e.g., a “floppy disk”) and an optical disk drive for reading and writing to a removable nonvolatile optical disk (e.g., a Compact Disc Read Only Memory (hereinafter referred to as CD-ROM), a Digital Video Disc Read Only Memory (hereinafter referred to as DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其他程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本公开所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and/or methods of the embodiments described in the present disclosure.
电子设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24 等)通信,还可与一个或者多个使得用户能与该电子设备12交互的设备通信,和/或与使得该电子设备12能与一个或多个其他计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,电子设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(Local Area Network;以下简称:LAN),广域网(Wide Area Network;以下简称:WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与电子设备12的其他模块通信。应当明白,尽管图中未示出,可以结合电子设备12使用其他硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 12 may also be connected to one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24 The electronic device 12 may communicate with one or more devices that enable a user to interact with the electronic device 12, and/or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input/output (I/O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and/or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
处理单元16通过运行存储在系统存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现前述实施例中提及的处理器设置方法。The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the processor setting method mentioned in the above embodiment.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
需要说明的是,在本公开的描述中,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本公开的描述中,除非另有说明,“多个”的含义是两个或两个以上。It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本公开的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本公开的实施例所属技术领域的技术人员所理解。Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
应当理解,本公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
此外,在本公开各个实施例中的各功能单元可以集成在一个处理模块中,也可以是 各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing module or may be Each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
尽管上面已经示出和描述了本公开的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本公开的限制,本领域的普通技术人员在本公开的范围内可以对上述实施例进行变化、修改、替换和变型。 Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are illustrative and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.

Claims (15)

  1. 一种处理器设置方法,包括:A processor setting method, comprising:
    确定处理器中指令项对应的有效字段,其中,所述有效字段具有对应的位宽;Determining a valid field corresponding to the instruction item in the processor, wherein the valid field has a corresponding bit width;
    从目标寄存器中读取与所述指令项相应的有效标识值;Reading a valid identification value corresponding to the instruction item from a target register;
    根据所述位宽、所述有效字段以及所述有效标识值,对所述指令项进行无效设置。The instruction item is invalidated according to the bit width, the valid field and the valid identification value.
  2. 如权利要求1所述的方法,其中,所述根据所述位宽、所述有效字段以及所述有效标识值,对所述指令项进行无效设置,包括:The method of claim 1, wherein the invalidating the instruction item according to the bit width, the valid field, and the valid identification value comprises:
    响应于所述位宽为1,将所述有效字段调整为0,以对所述指令项进行无效设置;In response to the bit width being 1, adjusting the valid field to 0 to invalidate the instruction item;
    响应于所述位宽大于1,根据所述有效字段以及所述有效标识值,对所述指令项进行无效设置。In response to the bit width being greater than 1, the instruction item is invalidated according to the valid field and the valid identification value.
  3. 如权利要求2所述的方法,其中,所述指令项的数量是多个;The method according to claim 2, wherein the number of the instruction items is multiple;
    其中,所述根据所述有效字段以及所述有效标识值,对所述指令项进行无效设置,包括:The step of setting the instruction item to be invalid according to the valid field and the valid identification value includes:
    根据所述有效字段以及所述有效标识值,对单一指令项进行无效设置,其中,所述单一指令项是多个所述指令项中待进行无效设置的所述指令项;和/或According to the valid field and the valid identification value, invalidate a single instruction item, wherein the single instruction item is the instruction item to be invalidated among the multiple instruction items; and/or
    根据所述有效字段以及所述有效标识值,对全部所述指令项进行无效设置。According to the valid field and the valid identification value, all the instruction items are set to be invalid.
  4. 如权利要求3所述的方法,其中,所述根据所述有效字段以及所述有效标识值,对单一指令项进行无效设置,包括:The method of claim 3, wherein the step of setting a single instruction item invalid according to the valid field and the valid identification value comprises:
    根据所述有效标识值从多个所述指令项中确定所述单一指令项;Determine the single instruction item from the plurality of instruction items according to the effective identification value;
    将所述有效字段调整为目标字段值,以对所述单一指令项进行无效设置,其中,所述目标字段值和所述有效标识值不相同。The valid field is adjusted to a target field value to invalidate the single instruction item, wherein the target field value is different from the valid identification value.
  5. 如权利要求3所述的方法,其中,在所述根据所述有效字段以及所述有效标识值,对全部所述指令项进行无效设置之前,还包括:The method according to claim 3, wherein, before the step of setting all the instruction items to be invalid according to the valid field and the valid identification value, further comprising:
    根据所述位宽,确定无效标识条件,其中,所述无效标识条件用于对所述指令项进行无效设置;Determining an invalid flag condition according to the bit width, wherein the invalid flag condition is used to invalidate the instruction item;
    其中,所述根据所述有效字段以及所述有效标识值,对全部所述指令项进行无效设置,包括:The step of setting all the instruction items to be invalid according to the valid field and the valid identification value includes:
    判断所述有效标识值是否满足所述无效标识条件;Determining whether the valid identification value satisfies the invalid identification condition;
    响应于所述有效标识值满足所述无效标识条件,将所述有效标识值调整为第一预设标识值,且将每个所述指令项的有效字段调整为第一预设字段,以对所述指令项进行无效设置;In response to the valid identification value satisfying the invalid identification condition, adjusting the valid identification value to a first preset identification value, and adjusting the valid field of each of the instruction items to the first preset field, so as to invalidate the instruction item;
    响应于所述有效标识值不满足所述无效标识条件,对所述有效标识值加1,以对所述指令项进行无效设置。In response to the valid identification value not satisfying the invalid identification condition, the valid identification value is increased by 1 to invalidate the instruction item.
  6. 如权利要求1所述的方法,其中,在所述确定处理器中指令项对应的有效字段之前,还包括:The method of claim 1, wherein, before determining the valid field corresponding to the instruction item in the processor, the method further comprises:
    针对所述处理器中所述指令项配置相应的所述目标寄存器,所述目标寄存器用于存 储所述指令项相应的所述有效标识值。The corresponding target register is configured for the instruction item in the processor, and the target register is used to store Store the valid identification value corresponding to the instruction item.
  7. 一种处理器设置装置,包括:A processor setting device, comprising:
    确定模块,用于确定处理器中指令项对应的有效字段,其中,所述有效字段具有对应的位宽;A determination module, configured to determine a valid field corresponding to an instruction item in a processor, wherein the valid field has a corresponding bit width;
    读取模块,用于从目标寄存器中读取与所述指令项相应的有效标识值;A reading module, used for reading a valid identification value corresponding to the instruction item from a target register;
    设置模块,用于根据所述位宽,所述有效字段以及所述有效标识值、对所述指令项进行无效设置。A setting module is used to set the instruction item to be invalid according to the bit width, the valid field and the valid identification value.
  8. 如权利要求7所述的装置,其中所述设置模块包括:The apparatus according to claim 7, wherein the setting module comprises:
    第一设置子模块,用于响应于所述位宽为1,将所述有效字段调整为0,以对所述指令项进行无效设置;A first setting submodule, configured to adjust the valid field to 0 in response to the bit width being 1, so as to perform an invalid setting on the instruction item;
    第二设置子模块,用于响应于所述位宽大于1,根据所述有效字段以及所述有效标识值,对所述指令项进行无效设置。The second setting submodule is used for, in response to the bit width being greater than 1, performing invalid setting on the instruction item according to the valid field and the valid identification value.
  9. 如权利要求8所述的装置,其中,所述指令项的数量是多个;The apparatus according to claim 8, wherein the number of the instruction items is multiple;
    其中,所述第二设置子模块,还用于:Wherein, the second setting submodule is further used for:
    根据所述有效字段以及所述有效标识值,对单一指令项进行无效设置,其中,所述单一指令项是多个所述指令项中待进行无效设置的所述指令项;和/或According to the valid field and the valid identification value, invalidate a single instruction item, wherein the single instruction item is the instruction item to be invalidated among the multiple instruction items; and/or
    根据所述有效字段以及所述有效标识值,对全部所述指令项进行无效设置。According to the valid field and the valid identification value, all the instruction items are set to be invalid.
  10. 如权利要求9所述的装置,其中,所述第二设置子模块,还用于:The apparatus according to claim 9, wherein the second setting submodule is further used to:
    根据所述有效标识值从多个所述指令项中确定所述单一指令项;Determine the single instruction item from the plurality of instruction items according to the effective identification value;
    将所述有效字段调整为目标字段值,以对所述单一指令项进行无效设置,其中,所述目标字段值和所述有效标识值不相同。The valid field is adjusted to a target field value to invalidate the single instruction item, wherein the target field value is different from the valid identification value.
  11. 如权利要求9所述的装置,其中,所述第二设置子模块,还用于:The apparatus according to claim 9, wherein the second setting submodule is further used to:
    在所述根据所述有效字段以及所述有效标识值,对全部所述指令项进行无效设置之前,根据所述位宽,确定无效标识条件,其中,所述无效标识条件用于对所述指令项进行无效设置;Before performing invalid setting on all the instruction items according to the valid field and the valid identification value, determining an invalid identification condition according to the bit width, wherein the invalid identification condition is used to perform invalid setting on the instruction item;
    判断所述有效字段是否满足所述无效标识条件;Determine whether the valid field satisfies the invalid identification condition;
    响应于有效字段满足所述无效标识条件,将所述有效标识值调整为第一预设标识值,且将每个所述指令项的有效字段调整为第一预设字段,以对所述指令项进行无效设置;In response to the valid field satisfying the invalid identification condition, adjusting the valid identification value to a first preset identification value, and adjusting the valid field of each of the instruction items to the first preset field, so as to set the instruction item to be invalid;
    响应于有效字段不满足所述无效标识条件,对所述有效标识值加1,以对所述指令项进行无效设置。In response to the valid field not satisfying the invalid identification condition, the valid identification value is increased by 1 to invalidate the instruction item.
  12. 如权利要求7所述的装置,还包括:The apparatus of claim 7, further comprising:
    配置模块,用于在确定处理器中指令项对应的有效字段之前,针对所述处理器中所述指令项配置相应的所述目标寄存器,所述目标寄存器用于存储所述指令项相应的所述有效标识值。A configuration module is used to configure the corresponding target register for the instruction item in the processor before determining the valid field corresponding to the instruction item in the processor, and the target register is used to store the valid identification value corresponding to the instruction item.
  13. 一种电子设备,包括:An electronic device, comprising:
    至少一个处理器;以及 at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6中任一项所述的方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
  14. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行权利要求1-6中任一项所述的方法。A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
  15. 一种计算机程序产品,其中当所述计算机程序产品中的指令被处理器执行时,执行权利要求1-6中任一项所述的方法。 A computer program product, wherein when instructions in the computer program product are executed by a processor, the method according to any one of claims 1 to 6 is performed.
PCT/CN2023/104067 2022-11-28 2023-06-29 Processor setting method and apparatus, electronic device, and storage medium WO2024113838A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211498291.2 2022-11-28
CN202211498291.2A CN115543449B (en) 2022-11-28 2022-11-28 Processor setting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2024113838A1 true WO2024113838A1 (en) 2024-06-06

Family

ID=84722566

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/104067 WO2024113838A1 (en) 2022-11-28 2023-06-29 Processor setting method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN115543449B (en)
WO (1) WO2024113838A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543449B (en) * 2022-11-28 2023-03-14 北京微核芯科技有限公司 Processor setting method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5815695A (en) * 1993-10-28 1998-09-29 Apple Computer, Inc. Method and apparatus for using condition codes to nullify instructions based on results of previously-executed instructions on a computer processor
US6973561B1 (en) * 2000-12-04 2005-12-06 Lsi Logic Corporation Processor pipeline stall based on data register status
CN102841857A (en) * 2012-07-25 2012-12-26 龙芯中科技术有限公司 Processor, device and method for carrying out cache prediction
CN115543449A (en) * 2022-11-28 2022-12-30 北京微核芯科技有限公司 Processor setting method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0651324B1 (en) * 1993-10-29 2006-03-22 Advanced Micro Devices, Inc. Speculative instruction queue for variable byte length instructions
US9672044B2 (en) * 2012-08-01 2017-06-06 Nxp Usa, Inc. Space efficient checkpoint facility and technique for processor with integrally indexed register mapping and free-list arrays
US10198263B2 (en) * 2015-09-19 2019-02-05 Microsoft Technology Licensing, Llc Write nullification
US10031756B2 (en) * 2015-09-19 2018-07-24 Microsoft Technology Licensing, Llc Multi-nullification
US10061584B2 (en) * 2015-09-19 2018-08-28 Microsoft Technology Licensing, Llc Store nullification in the target field
CN106095631B (en) * 2016-06-03 2020-01-03 中国科学技术大学 Multi-cycle non-pipeline CPU dynamic debugging method based on finite state machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5815695A (en) * 1993-10-28 1998-09-29 Apple Computer, Inc. Method and apparatus for using condition codes to nullify instructions based on results of previously-executed instructions on a computer processor
US6973561B1 (en) * 2000-12-04 2005-12-06 Lsi Logic Corporation Processor pipeline stall based on data register status
CN102841857A (en) * 2012-07-25 2012-12-26 龙芯中科技术有限公司 Processor, device and method for carrying out cache prediction
CN115543449A (en) * 2022-11-28 2022-12-30 北京微核芯科技有限公司 Processor setting method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115543449B (en) 2023-03-14
CN115543449A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
US10019181B2 (en) Method of managing input/output(I/O) queues by non-volatile memory express(NVME) controller
US20190163364A1 (en) System and method for tcp offload for nvme over tcp-ip
US7769918B2 (en) Apparatus and method for high performance volatile disk drive memory access using an integrated DMA engine
US10002085B2 (en) Peripheral component interconnect (PCI) device and system including the PCI
JP4928100B2 (en) Controller apparatus and method for improved data transfer
US7089391B2 (en) Managing a codec engine for memory compression/decompression operations using a data movement engine
US8607003B2 (en) Memory access to a dual in-line memory module form factor flash memory
US20080082755A1 (en) Administering An Access Conflict In A Computer Memory Cache
EP3608790B1 (en) Modifying nvme physical region page list pointers and data pointers to facilitate routing of pcie memory requests
US7734842B2 (en) Computer-implemented method, apparatus, and computer program product for managing DMA write page faults using a pool of substitute pages
WO2024113838A1 (en) Processor setting method and apparatus, electronic device, and storage medium
US10642740B2 (en) Methods for performing a memory resource retry
US10055366B2 (en) Method for data transmission and server for implementing the method
KR20170013882A (en) A multi-host power controller (mhpc) of a flash-memory-based storage device
US10552349B1 (en) System and method for dynamic pipelining of direct memory access (DMA) transactions
US7779172B2 (en) Activator, DMA transfer system, DMA transfer method
US7403936B2 (en) Optimizing database access for record linkage by tiling the space of record pairs
US20130019052A1 (en) Effective utilization of flash interface
US9405472B2 (en) Tracking ownership of memory in a data processing system through use of a memory monitor
US20200159680A1 (en) Programming and controlling compute units in an integrated circuit
US20140333634A1 (en) Image processing apparatus and image processing method
US10853299B2 (en) Hot-plugged PCIe device configuration system
US20100058024A1 (en) Data Transfer Apparatus, Data Transfer Method And Processor
US20060277326A1 (en) Data transfer system and method
US10169235B2 (en) Methods of overriding a resource retry