CN1957326A - 指令对齐的微处理器和方法 - Google Patents

指令对齐的微处理器和方法 Download PDF

Info

Publication number
CN1957326A
CN1957326A CNA2005800170745A CN200580017074A CN1957326A CN 1957326 A CN1957326 A CN 1957326A CN A2005800170745 A CNA2005800170745 A CN A2005800170745A CN 200580017074 A CN200580017074 A CN 200580017074A CN 1957326 A CN1957326 A CN 1957326A
Authority
CN
China
Prior art keywords
instruction
byte
padding
speed cache
data
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CNA2005800170745A
Other languages
English (en)
Other versions
CN1957326B (zh
Inventor
J·霍格布鲁格
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nytell Software LLC
Original Assignee
Koninklijke Philips Electronics NV
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 Koninklijke Philips Electronics NV filed Critical Koninklijke Philips Electronics NV
Publication of CN1957326A publication Critical patent/CN1957326A/zh
Application granted granted Critical
Publication of CN1957326B publication Critical patent/CN1957326B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/3802Instruction prefetching
    • G06F9/3814Implementation provisions of instruction buffers, e.g. prefetch buffer; banks
    • 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/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/3016Decoding the operand specifier, e.g. specifier format
    • 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/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/3016Decoding the operand specifier, e.g. specifier format
    • G06F9/30167Decoding the operand specifier, e.g. specifier format of immediate specifier, e.g. constants
    • 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/3017Runtime instruction translation, e.g. macros
    • 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/3802Instruction prefetching
    • 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/3802Instruction prefetching
    • G06F9/3816Instruction alignment, e.g. cache line crossing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)
  • Communication Control (AREA)

Abstract

提供一种用于处理指令的微处理器。所述微处理器包括:用于高速缓存要处理的指令和/或数据的高速缓冲存储器,所述指令和/或数据被安排在高速缓存字中;以及对齐单元,用于相对于所述高速缓冲存储器的高速缓存字边界通过引入填充字节(padd1、padd2)将指令对齐到预定的位置。至少一个所述填充字节(padd1、padd2)包括在一个所述指令的处理中所需要的静态数据。因此,对于处理指令期间所需要的数据,可以利用对齐指令所需的填充字节,以使得这些字节不浪费并且有效地使用可用的存储容量。

Description

指令对齐的微处理器和方法
发明领域
本发明涉及一种指令对齐的微处理器、方法以及一种数据处理系统。
背景技术
相对于解压缩硬件的临界定时路径和硅面积,基于可变长度、压缩指令格式的微处理器或者数据处理系统能够以适中的成本提供有效的指令压缩(类似TriMedia指令)。指令可以是不对齐的并且可以具有可变长度。特别的是,相对于指令高速缓存字边界、指令高速缓存块边界或者主存储器字或者决边界,指令可以不对齐。然而,指令还可以是在字节边界上对齐的。
US 6,240,506涉及将具有可变长度操作数的x86指令扩展成固定的长度。微处理器接收具有变化的地址和操作数大小的指令并将它们预译码为单一的固定大小格式。特别的是,指令字节是从主存储器系统接收的,并且通过扩展较短的操作数和地址,然后用0把它们填充一个预定的长度用以增强地址和操作数字段的一致性,这样可以对所述指令字节进行预译码。
在处理指令期间,通常扫描、对齐并且译码指令。扫描包括从微处理器中的指令高速缓存或者从外存储器读取一组指令字节并且确定那些指令的边界。对齐是通过屏蔽不想要的指令字节并移位那些字节以使得这些字节的第一位处于期望的位置来实现的。最后,通过识别指令内的每个字段而实现译码,并且译码是在指令已经从指令高速缓存中取出并被扫描和对齐之后进行的。
通常,将要由微处理器处理的指令还可以包括分支,该分支形成执行期间所带来的附加问题。对分支流程的良好理解可以提高处理速度。然而,由于未对齐的高速缓存访问将引入额外的等待时间,因此必需提供对齐的指令高速缓存访问。在对齐处理内,分支目标-即处理流程可以跳转到的程序位置应该仔细地定位。
相应地,分支目标必须与某些位置对齐或者不可以跨越高速缓存行边界,即,完全地落入高速缓存的一个字内使得它能够只从一个高速缓存字读取分支目标指令。通常这是通过在分支目标前面填充字节以将分支目标完全地移动到接下来的高速缓存字而进行的。然而,如果分支目标在高速缓存字内开始而没有扩展到所述高速缓存字的外部,那么不必填充。
例如,在Intel体系结构中和在TriMedia体系结构中,分支目标的对齐是通过插入虚字节以将该分支目标移位到允许的位置或者移位到它能够导致更快的代码的位置来执行的。由于虚字节(也称为填充字节)对于处理当前指令是不需要的,所以为了跳过该虚字节而达到特定的分支目标,就要生成一个跳转。
特别的是,对于Intel体系结构,如果循环入口标记距离16字节高速缓存边界少于8字节,那么分支目标对齐建议(http://www.intel.com/design/PentiumII/manuals/242816.htm)是将循环入口标记对齐到16字节;而不对齐随后是条件分支的循环入口标记;并且如果它们距离16字节边界小于8字节,那么将随后是非条件分支或者函数的循环入口标记按照16字节对齐。
尽管利用插入的虚字节或者填充字节的这种对齐处理改善了某些指令的处理,但该优势却伴随着存储器需求增大的成本。
因此,本发明的目的在于提供一种指令对齐的微处理器、方法,以及一种以改善的存储器利用率实现充分的指令处理的数据处理系统。
该目的是通过如权利要求1所述的微处理器、如权利要求4所述的方法以及通过如权利要求5所述的数据处理系统实现的。
因此,提供一种用于处理指令的微处理器。所述微处理器包括:用于高速缓存要处理的指令和/或数据的高速缓冲存储器,所述指令和/或数据被安排在高速缓存字中;以及对齐单元,用于相对于所述高速缓冲存储器的高速缓存字边界通过引入填充字节将指令对齐到预定的位置。至少一个所述填充字节包括在其中一个所述指令的处理中所需要的静态数据。
相应地,对于处理指令期间所需要的数据而言,可以利用对于对齐指令所需的填充字节,以使得字节不浪费并且有效地使用可用的存储容量。
根据本发明的一个方面,所述对齐单元通过引入填充字节对齐分支目标。因此,能够改善处理速度而不牺牲高效的存储容量利用率。
根据本发明的优选方面,所述静态数据包括全局变量、常量或者文本串。
本发明还涉及一种用于在处理指令期间指令对齐的方法。高速缓存要处理的指令和/或数据,其中所述指令被安排在高速缓存字中。相对于所述高速缓存字边界通过引入填充字节而把这些指令对齐到预定的位置。至少一个所述填充字节包括在其中一个所述指令的处理中所需要的静态数据。
本发明进一步涉及一种数据处理系统,包括如上所述的微处理器。
现将参照下文所描述的实施例来阐明本发明的这些以及其他方面,并且使本发明更加显而易见。
附图说明
图1A-1C示出了高速缓冲存储器中多个高速缓存字的示意表示;以及
图2示出了高速缓存字内容的表的图示。
具体实施方式
图1A-1C示出了高速缓冲存储器内高速缓存字的示意表示。在图1A中,三个未对齐的指令i1、i2和i3存在于高速缓存字cw1、cw2中。例如,i1的分支目标完全地落入高速缓存字cw1内,而指令i3穿过高速缓存字cw1的高速缓存字边界并扩展到高速缓存字cw2中。因此,在这里所表示的情况要加以避免。
图1B示出了具有指令i1和i2的情况,其中指令i1穿过了高速缓存字cw1和高速缓存字cw2之间的边界。指令i2完全地落入高速缓存字cw2内。为了避免指令i1穿过字边界,在指令i1之前插入字节填充padd以将该指令完全地移位到下一个高速缓存字,即高速缓存字cw2。因此,指令i1和指令i2现在都存在于高速缓存字cw2中。特别的是,不希望的情况-指令i1的分支目标落到字边界上被通过插入填充字节padd而阻止了。
图1C示出了这样一种情况:其中i1的分支目标落在高速缓存字的末尾从而必须被移位到下一个。这也是通过插入填充字节padd而执行的。
尽管根据现有技术,虚字节作为填充字节被插入而跳转指令被另外插入以使得处理流程不处理该插入的虚字节,但是根据本发明,把在指令处理期间所需要的静态数据用作填充字节。这些静态数据可以是全局变量,像常量等等。因此,取代插入与处理不相关的字节,而是将处理期间实际使用的数据用作填充字节,以使得填充字节不浪费并且改善了可用存储容量的利用率。
图2示出了高速缓存字内容的表的图示。作为位置1,如果满足分支指令,那么条件分支指令使条件分支对齐存储单元或者位置8,即如果满足条件,那么执行跳转到位置8。另外,包括第二指令instr2的存储单元8是存在的并且能够从位置4通过跳转而到达(跳到)。填充字节padd1和padd2被插入到存储单元6和7以将第二和第三指令instr2、instr3移位到存储单元8和9,以使得该跳转将与第二指令instr2对齐。因此,将对齐的位置8提供在指令序列开始之前。在存储单元12,存在取指令,其取出位于存储单元6的数据,即填充数据padd1。特别的是,在存储单元6和7存储填充数据、静态数据而不是利用虚字节。这些静态数据可以是全局变量常量等等。静态数据的其它例子是编译器(用于编译指令)生成为利用C++实现异常和虚拟函数的文本串和数据结构。
特别的是,存储为填充数据的至少某些静态数据可以构成用于执行缓冲器中的指令的数据。作为选择,填充数据还可以与相同高速缓存字中的其他指令相关联。换言之,填充空间前后的指令可以使用分配于填充空间内的数据。然而,作为选择,程序中的任何指令都能够引用填充空间中的数据。
应该注意的是,上述实施例是为举例说明了而不是为了限制本发明,并且本领域技术人员在不脱离所附权利要求的范围的情况下,将能设计出许多替代性的实施例。在权利要求书中,不应该将置于括号内的任何附图标记理解为是对权利要求的限制。词语“包括”不排除存在不同于权利要求中列出的元件或步骤。元件前面的词语“一”或者“一个”不排除存在多个这种元件的可能。在列举了几个装置的设备权利要求中,这些装置的若干个可以通过一个相同硬件项来实现。在相互不同的从属权利要求中记载某些措施这一纯粹的事实并不表明这些措施的组合不能得到有利的使用。
此外,权利要求中的任何附图标记都不应该被认为是对权利要求范围的限制。

Claims (5)

1.一种用于处理指令的微处理器,包括:
至少一个高速缓冲存储器,用于高速缓存要处理的并且安排在高速缓存字中的指令和/或数据,以及
对齐单元,用于相对于所述高速缓冲存储器的高速缓存字边界通过引入填充字节(padd1、padd2)而将指令对齐到预定的位置,
其中,至少一个所述填充字节(padd1、padd2)包括在一个所述指令的处理中所需要的静态数据。
2.如权利要求1所述的微处理器,其中
所述对齐单元进一步适用于通过引入填充字节来对齐分支目标。
3.如权利要求2所述的微处理器,其中
所述静态数据包括全局变量或者常量。
4.一种用于在处理指令期间指令对齐的方法,包括如下步骤:
高速缓存要被处理的并且安排在高速缓存字中的指令和/或数据,并且
相对于高速缓存字边界通过引入填充字节(padd1、padd2)将指令对齐到预定的位置,
其中,至少一个所述填充字节(padd1、padd2)包括在一个所述指令的处理期间所需的静态数据。
5.一种数据处理系统,包括根据权利要求1到3任一项所述的至少一个微处理器。
CN2005800170745A 2004-05-27 2005-05-18 指令对齐的微处理器和方法 Active CN1957326B (zh)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
EP04102357 2004-05-27
EP04102357.3 2004-05-27
PCT/IB2005/051617 WO2005116819A1 (en) 2004-05-27 2005-05-18 Microprocessor and method of instruction alignment

Publications (2)

Publication Number Publication Date
CN1957326A true CN1957326A (zh) 2007-05-02
CN1957326B CN1957326B (zh) 2010-07-28

Family

ID=34967382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2005800170745A Active CN1957326B (zh) 2004-05-27 2005-05-18 指令对齐的微处理器和方法

Country Status (7)

Country Link
US (1) US20080028189A1 (zh)
EP (1) EP1754142B1 (zh)
JP (1) JP2008500626A (zh)
CN (1) CN1957326B (zh)
AT (1) ATE397247T1 (zh)
DE (1) DE602005007216D1 (zh)
WO (1) WO2005116819A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014139466A3 (en) * 2013-03-15 2015-08-27 Shanghai Xinhao Microelectronics Co. Ltd. Data cache system and method

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7376815B2 (en) 2005-02-25 2008-05-20 Qualcomm Incorporated Methods and apparatus to insure correct predecode
US8006238B2 (en) * 2006-09-26 2011-08-23 International Business Machines Corporation Workload partitioning in a parallel system with hetergeneous alignment constraints
JP4968930B2 (ja) * 2007-08-03 2012-07-04 キヤノン株式会社 画像処理装置、画像補正方法、画像処理方法及びプログラム
US9032154B2 (en) * 2007-12-13 2015-05-12 Sandisk Technologies Inc. Integration of secure data transfer applications for generic IO devices
US10423353B2 (en) 2016-11-11 2019-09-24 Micron Technology, Inc. Apparatuses and methods for memory alignment
US11836035B2 (en) 2021-08-06 2023-12-05 Western Digital Technologies, Inc. Data storage device with data verification circuitry

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6081884A (en) * 1998-01-05 2000-06-27 Advanced Micro Devices, Inc. Embedding two different instruction sets within a single long instruction word using predecode bits
US6192465B1 (en) * 1998-09-21 2001-02-20 Advanced Micro Devices, Inc. Using multiple decoders and a reorder queue to decode instructions out of order
US6240506B1 (en) * 1998-10-02 2001-05-29 Advanced Micro Devices, Inc. Expanding instructions with variable-length operands to a fixed length
US6247097B1 (en) * 1999-01-22 2001-06-12 International Business Machines Corporation Aligned instruction cache handling of instruction fetches across multiple predicted branch instructions
US6421696B1 (en) * 1999-08-17 2002-07-16 Advanced Micro Devices, Inc. System and method for high speed execution of Fast Fourier Transforms utilizing SIMD instructions on a general purpose processor
US6715062B1 (en) * 2000-07-26 2004-03-30 International Business Machines Corporation Processor and method for performing a hardware test during instruction execution in a normal mode
WO2002061574A1 (en) * 2001-01-30 2002-08-08 Koninklijke Philips Electronics N.V. Computer instruction with instruction fetch control bits
US7376815B2 (en) * 2005-02-25 2008-05-20 Qualcomm Incorporated Methods and apparatus to insure correct predecode

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014139466A3 (en) * 2013-03-15 2015-08-27 Shanghai Xinhao Microelectronics Co. Ltd. Data cache system and method
US9785443B2 (en) 2013-03-15 2017-10-10 Shanghai Xinhao Microelectronics Co. Ltd. Data cache system and method

Also Published As

Publication number Publication date
EP1754142B1 (en) 2008-05-28
ATE397247T1 (de) 2008-06-15
JP2008500626A (ja) 2008-01-10
DE602005007216D1 (de) 2008-07-10
CN1957326B (zh) 2010-07-28
US20080028189A1 (en) 2008-01-31
WO2005116819A1 (en) 2005-12-08
EP1754142A1 (en) 2007-02-21

Similar Documents

Publication Publication Date Title
CN1957326A (zh) 指令对齐的微处理器和方法
KR100567937B1 (ko) 프로세서용 명령 압축 및 압축 해제 시스템 및 방법
JP6591978B2 (ja) 命令セット変換システム及び方法
US5983337A (en) Apparatus and method for patching an instruction by providing a substitute instruction or instructions from an external memory responsive to detecting an opcode of the instruction
US6161172A (en) Method for concurrently dispatching microcode and directly-decoded instructions in a microprocessor
US5838945A (en) Tunable software control of harvard architecture cache memories using prefetch instructions
US5423048A (en) Branch target tagging
US7480783B2 (en) Systems for loading unaligned words and methods of operating the same
US6499097B2 (en) Instruction fetch unit aligner for a non-power of two size VLIW instruction
US9201798B2 (en) Processor instruction based data prefetching
CN101884025B (zh) 用于使过程返回序列加速的方法和系统
KR100385495B1 (ko) 워드정렬브랜치타겟을가지는처리시스템
US6684319B1 (en) System for efficient operation of a very long instruction word digital signal processor
US5933629A (en) Apparatus and method for detecting microbranches early
KR100601745B1 (ko) 다중 데이터형 결과를 발생하는 컴퓨터 명령
KR0146059B1 (ko) 미참조 선인출 캐쉬를 이용한 명령어 선인출 방법 및 그 회로
US6654873B2 (en) Processor apparatus and integrated circuit employing prefetching and predecoding
JPH08161169A (ja) Vliw方式の計算機システム及びvliwの解釈・実行方法
US6321325B1 (en) Dual in-line buffers for an instruction fetch unit
KR20120070292A (ko) 에뮬레이션 방지 바이트 제거에 기초하여 순차적으로 비트 스트림을 파싱하는 장치 및 방법
JPH0877021A (ja) 割込処理装置および方法
CN100343798C (zh) 用于处理vliw指令的处理器和方法
JPH1153188A (ja) 命令キャッシュ制御方式
JPH0553807A (ja) 条件分岐命令先行制御方式
JPH05173786A (ja) 自己変更コード実行方式

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: NXP CO., LTD.

Free format text: FORMER OWNER: KONINKLIJKE PHILIPS ELECTRONICS N.V.

Effective date: 20070824

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20070824

Address after: Holland Ian Deho Finn

Applicant after: Koninkl Philips Electronics NV

Address before: Holland Ian Deho Finn

Applicant before: Koninklijke Philips Electronics N.V.

C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: NITAI SOFTWARE CO., LTD.

Free format text: FORMER OWNER: KONINKL PHILIPS ELECTRONICS NV

Effective date: 20120321

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20120321

Address after: Delaware

Patentee after: Nytell Software LLC

Address before: Holland Ian Deho Finn

Patentee before: Koninkl Philips Electronics NV