[go: up one dir, main page]

JPH02195431A - Address operation control device - Google Patents

Address operation control device

Info

Publication number
JPH02195431A
JPH02195431A JP1397689A JP1397689A JPH02195431A JP H02195431 A JPH02195431 A JP H02195431A JP 1397689 A JP1397689 A JP 1397689A JP 1397689 A JP1397689 A JP 1397689A JP H02195431 A JPH02195431 A JP H02195431A
Authority
JP
Japan
Prior art keywords
address
bit
operand
selector
access address
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.)
Pending
Application number
JP1397689A
Other languages
Japanese (ja)
Inventor
Mitsuyuki Kubo
光之 久保
Ikuya Kawasaki
川崎 郁也
Atsushi Hasegawa
淳 長谷川
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.)
Hitachi Microcomputer System Ltd
Hitachi Ltd
Original Assignee
Hitachi Ltd
Hitachi Microcomputer Engineering Ltd
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 Hitachi Ltd, Hitachi Microcomputer Engineering Ltd filed Critical Hitachi Ltd
Priority to JP1397689A priority Critical patent/JPH02195431A/en
Publication of JPH02195431A publication Critical patent/JPH02195431A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To prevent the execution time of a bit operating instruction from being increased by controlling the substitution of a prescribed bit for the lower bit side of an access address so that the operand of a specified size does not exceed the word boundary of a memory in accordance with the access address and the specified data size information of the operand. CONSTITUTION:A base address BA for specifying data obtained by setting up the set of plural bits as a minimum unit is inputted from an input circuit 2 to one input terminal of an adder 1 in an address operation control device and an OFFSET for applying the bit operating position of data based upon the base address BA is applied to the other input terminal through an input circuit 3 and a shift circuit 4. The adder 1 forms the access address AA of data including a bit to be operated by using the OFFSET and the lower bits and upper bits are respectively inputted to a selector 5 and an output circuit 6. The prescribed bit is substituted for the lower bit side of the access address AA by a selector 5 so that the operand does not exceed the word boundary of the memory and controlled by a substitution control unit 12.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、ビット操作命令によって操作されるべきビッ
トを含むオペランドのアクセスアドレスを生成するため
の技術に関し、例えばビッグエンデイアン方式を採用す
るマイクロプロセッサにおいてビット操作命令の対象オ
ペランドサイズが複数種類に亘るような場合に適用して
有効な技術に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a technology for generating an access address for an operand containing bits to be manipulated by a bit manipulation instruction, and relates to a technology for generating an access address for an operand that includes a bit to be manipulated by a bit manipulation instruction, and for example, The present invention relates to a technique that is effective when applied to a processor where a plurality of operand sizes are subject to bit manipulation instructions.

〔従来技術〕[Prior art]

ピックエンデイアン方式を採用するマイクロプロセッサ
において、命令実行に必要とされるオペランドはそのサ
イズに拘らず最下位ビットを基準に、言い換えるなら、
最下位ビットを揃えるようにして取り扱われる。一方、
ビット操作命令の実行に際してその対象となるオペラン
ドのビット操作位置を示すオフセットは、オペランドの
最上位ビットを基準に与えられる。
In a microprocessor that uses the pick-endian system, the operands required for instruction execution are based on the least significant bit, regardless of its size, in other words,
It is handled so that the least significant bits are aligned. on the other hand,
When a bit manipulation instruction is executed, an offset indicating the bit manipulation position of the target operand is given based on the most significant bit of the operand.

このようなプロセッサにおいて、ビット操作命令で操作
されるべきビットを含むオペランドのアクセスアドレス
の演算は、ベースアドレスと、ベースアドレスを基準に
ビット操作位置を示すオフセットとによって求められる
。即ち、プロセッサから出力されるアドレスがバイトア
ドレスとされる場合、オフセットを右に3ビットだけシ
フトしてこれをバイトアドレスに変換し、変換したバイ
トアドレスとベースアドレスを加算してオペランドのア
クセスアドレスを算出する。
In such a processor, the access address of an operand containing a bit to be manipulated by a bit manipulation instruction is calculated using a base address and an offset indicating the bit manipulation position based on the base address. That is, if the address output from the processor is a byte address, shift the offset by 3 bits to the right, convert it to a byte address, and add the converted byte address and base address to determine the access address of the operand. calculate.

ところで、従来ビット操作命令で取り扱われるオペラン
ドサイズは通常バイト(8ビット)固定とされていたが
、例えば32ビットプロセツサのほとんどの命令のオペ
ランドにはハーフワード(16ビット)やワード(32
ビット)などのデータサイズも認められているため、ビ
ット操作命令のオペランドに対しても、バイト、ハーフ
ワード、ワードをいったデータサイズを任意に許して自
由度を増すことを本発明者は検討した。
Incidentally, conventionally, the operand size handled by bit manipulation instructions was usually fixed to a byte (8 bits), but for example, the operand size of most instructions for a 32-bit processor is halfword (16 bits) or word (32 bits).
Since data sizes such as bits are also allowed, the inventor is considering increasing the degree of freedom by allowing arbitrary data sizes such as bytes, halfwords, and words for the operands of bit manipulation instructions. did.

例えばデータを8ビット単位で指定するようなバイトア
ドレスが32ビット構成とされ、メモリに対するデータ
の入出力が32ビット単位で行われるとき、メモリアク
セスアドレスは、32ビット構成のバイトアドレスのう
ち実質的に上位30ビットとされる。したがって、上記
オペランドのアクセスアドレスがバイトアドレスで指定
されるとき、このアクセスアドレスを基準にハーフワー
ド又はワード構成のオペランドをアクセスする場合に、
バイトアドレスで与えられるオペランドのアクセスアド
レスの下位2ビットの値如何により、メモリのワード境
界を超えてメモリを複数回アクセスしなければならない
ことがある。さらに詳述すれば、メモリ空間におけるア
ドレスマツピングの一例が示される第6図において、操
作対象ピッ1−を含むバイトデータアクセスアドレスが
11番地(01,03゜・・・1,0,111゜)のと
き、オペランドのデータサイズがワードと指定されてい
ると、必要なオペランドは、11番地からメモリのワー
ド境界を超えた12fi地(031,030・・・13
1□○工0、)、13番地(03,03o−1,1□0
.1.)。
For example, when a byte address that specifies data in 8-bit units has a 32-bit configuration, and data input/output to and from memory is performed in 32-bit units, the memory access address is essentially the 32-bit byte address. The upper 30 bits are assumed to be the upper 30 bits. Therefore, when the access address of the above operand is specified by a byte address, when accessing a halfword or word-configured operand based on this access address,
Depending on the value of the lower two bits of the access address of the operand given as a byte address, it may be necessary to access the memory multiple times beyond the word boundary of the memory. More specifically, in FIG. 6, which shows an example of address mapping in memory space, the byte data access address containing operation target pin 1- is at address 11 (01,03°...1,0,111°). ), and the data size of the operand is specified as word, the required operand is located at 12fi beyond the memory word boundary from address 11 (031,030...13).
1□○ 工 0, ), 13th address (03,03o-1,1□0
.. 1. ).

14番地(Oi□03o・=13121□Oo)に亘っ
ているから、当該オペランドをアクセスするには、11
番地(03□030・・・1,0□1□1o)を指定す
るアドレスの内の下位2ビットを無視した実質的に8番
地を指定するようなアドレス(0,10,、・・・13
0、)によるアクセスと、12番番地上4番地を指定す
るアドレスの内の下位2ビットを無視した実質的に12
番地を指定するようなアドレス(0□、0.。・・・1
31□)とによって2回行うことが必要とされる。尚、
各ビットに付されたサフィックス〜、よけ下位側からの
アドレスのビット番号を意味する。
14 address (Oi□03o・=13121□Oo), so to access the operand, 11
An address (0, 10, . . . 13
0, ), and the lower 2 bits of the address specifying address 12 and 4 are ignored, effectively 12
An address that specifies a street address (0□, 0.....1
31□), it is necessary to perform it twice. still,
The suffix attached to each bit means the bit number of the address from the lower order side.

このように、メモリをアクセスしてビット操作命令のた
めのオペランドを取得する場合に、指定されているオペ
ランドサイズと演算されたオペランドのアクセスアドレ
スとの関係によっては、指定サイズのオペランドを読み
出すときにメモリのワード境界を超えて複数回メモリを
アクセスしなければならない場合のあることが見出され
た。
In this way, when accessing memory to obtain an operand for a bit manipulation instruction, depending on the relationship between the specified operand size and the access address of the operated operand, when reading an operand of the specified size, It has been found that there are cases in which memory must be accessed multiple times across memory word boundaries.

なお、アドレス演算装置に関して記載されたものの例と
しては特願昭61−197146号がある。
An example of an address arithmetic device described is Japanese Patent Application No. 197146/1983.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、メモリのワード境界を超えて複数回のメ
モリアクセスが必要になると、その分ビット操作命令の
実行時間が長くなってしまう。例えばフレームバッファ
に対するグラフィック描画においてビット操作命令を用
いて各画素データの特定ビットに対して色演算を施した
リマスクしたりすようなとき、ビット操作命令の実行時
間増大はグラフィック描画の処理効率低下をもたらす。
However, if multiple memory accesses are required across memory word boundaries, the execution time of the bit manipulation instruction increases accordingly. For example, when drawing graphics to a frame buffer, when bit manipulation instructions are used to perform color operations on specific bits of each pixel data to remask, the increased execution time of the bit manipulation instructions will reduce the processing efficiency of graphics drawing. .

ところで、ビット操作命令の実行において必要とされる
オペランドには操作対象ビットが含まれていればよい。
By the way, the operands required in the execution of a bit manipulation instruction only need to include the bit to be manipulated.

そこで本発明者は、ベースアドレスとオフセットに基づ
いて演算されたオペランドのアクセスアドレスとオペラ
ンドサイズに従って、当該指定サイズのオペランドがメ
モリのワード境界を超えないようにそのアクセスアドレ
スを変換する技術について検討した。この場合、オペラ
ンドサイズと演算されたオペランドのアクセスアドレス
に従ってそのアクセスアドレスを順次更新するような演
算を何回も繰り返すというような専らソフトウェアに依
存するような処理を最初に検討したが、このような手段
ではアドレス演算のための加算やシフト演算を複数回行
うためにプログラムの実行ステップ数が増大してしまう
。そこで本発明者は、ベースアドレスとオフセットに基
づいて演算されたオペランドのアクセスアドレスとオペ
ランドサイズに従って、当該指定サイズのオペランドが
メモリのワード境界を超えないようにするための手段を
ハードウェア的に講する手段を検討したものである。
Therefore, the present inventor investigated a technique for converting the access address so that the operand of a specified size does not exceed the word boundary of the memory, according to the access address and operand size of the operand calculated based on the base address and offset. . In this case, we first considered a process that relies exclusively on software, such as repeating an operation many times that sequentially updates the access address of the operand according to the operand size and the access address of the calculated operand. In this method, since addition and shift operations for address operations are performed multiple times, the number of execution steps of the program increases. Therefore, the present inventor devised a hardware method to prevent an operand of a specified size from exceeding the memory word boundary, according to the operand access address and operand size calculated based on the base address and offset. This study examines ways to do so.

本発明の目的は、ビット操作命令で扱われるオペランド
サイズを任意に指定しても、オペランドのアクセスアド
レスをソフトウェアに負担をかけずに短時間で取得する
ことができるアドレス演算制御装置を提供することにあ
る。
An object of the present invention is to provide an address arithmetic control device that can obtain the access address of an operand in a short time without placing a burden on software even if the operand size handled by a bit manipulation instruction is arbitrarily specified. It is in.

本発明の前記ならびにそのほかの目的と新規な特徴は本
明細書の記述及び添付図面から明らかになるであろう。
The above and other objects and novel features of the present invention will become apparent from the description of this specification and the accompanying drawings.

〔課題を解決するための手段〕[Means to solve the problem]

本願において開示される発明のうち代表的なものの概要
を簡単に説明すれば下記の通りである。
A brief overview of typical inventions disclosed in this application is as follows.

すなわち、ビット操作命令により操作対象とされるビッ
トを含むオペランドのアドレスを演算る演算手段にて得
られたオペランドのアクセスアドレスに対し、そのアク
セスアドレスとオペランドに対して指定されるデータサ
イズ情報とに従って、当該指定サイズのオペランドがメ
モリのワード境界を超えないようにそのオペランドのア
クセスアドレスの下位ビット側を所定ビットに入れ替え
制御すセレクタを設けたものである。
In other words, for the access address of the operand obtained by the arithmetic means that calculates the address of the operand that includes the bit to be manipulated by the bit manipulation instruction, the data size information specified for the operand and the access address are , a selector is provided for controlling and replacing the lower bit side of the access address of the operand with a predetermined bit so that the operand of the specified size does not exceed the word boundary of the memory.

例えば、アドレスによって指定されるデータの最小単位
がバイトとされ、指定可能なオペランドサイズがバイト
、ハーフワード、ワードとされ、データをワード単位で
指定するアドレスの境界がワード境界とされるとき、上
記セレクタは、オペランドサイズがバイトであることに
呼応して上記オペランドのアクセスアドレスをそのまま
出力し、オペランドサイズがハーフワードであるときオ
ペランドアドレスの最下位ビットをビット「Ojに置き
換えて、オペランドサイズがワードであるときオペラン
ドのアクセスアドレスの下位2ビットをビットro、O
Jに置き換えて出力するように構成することができる。
For example, when the minimum unit of data specified by an address is a byte, the operand size that can be specified is a byte, halfword, or word, and the boundary of an address that specifies data in words is a word boundary, the above The selector outputs the access address of the operand as it is in response to the operand size being a byte, and when the operand size is a halfword, it replaces the least significant bit of the operand address with the bit "Oj" and changes the operand size to a word. , the lower two bits of the access address of the operand are set to bits ro and O.
It can be configured so that it is output in place of J.

このようなセレクタの追加によるソフトウェアの変更を
最小限にするには、セレクタの動作を可能とする制御情
報を生成するためのマイクロ命令をビット操作命令に応
するマイクロプログラム系列に含め、ビット操作命令に
含まれるオペランドサイズ情報のデコード結果に基づい
て上記セレクタによる所定ビットの入れ替え用制御信号
を生成するための制御手段を設ければよい。また、ビッ
ト操作命令のオペレーションコードとオペランドサイズ
情報とに基づいて、セレクタの動作を可能とする制御情
報並びにセレクタによる所定ビットの入れ替え用制御信
号を生成する論理をインスラクションデコーダに持たせ
てもよい。
In order to minimize software changes due to the addition of such selectors, microinstructions for generating control information that enable selector operations are included in the microprogram series corresponding to the bit manipulation instructions, and the bit manipulation instructions It is sufficient to provide a control means for generating a control signal for replacing a predetermined bit by the selector based on the decoding result of the operand size information included in the operand size information. Furthermore, the instruction decoder may have logic that generates control information that enables the selector to operate and a control signal for replacing a predetermined bit by the selector, based on the operation code and operand size information of the bit manipulation instruction. .

〔作 用〕[For production]

上記した手段によれば、セレクタは、ベースアドレスと
オフセットに基づいて演算されたオペランドのアクセス
アドレスの所定ビットを、オペランドサイズに従ってハ
ードウェア的に所定ビットでマスクし、これにより、当
該指定サイズのオペランドがメモリのワード境界を超え
ないようにされる。このことにより、ビット操作命令で
扱われるオペランドサイズを任意に指定しても、オペラ
ンドのアクセスアドレスをソフトウェアに負担をかけず
に短時間で取得することを達成するものである。
According to the above means, the selector masks a predetermined bit of the access address of the operand calculated based on the base address and the offset with a predetermined bit in hardware according to the operand size, thereby masking the operand of the specified size. is prevented from exceeding memory word boundaries. As a result, even if the operand size handled by the bit manipulation instruction is arbitrarily specified, the access address of the operand can be obtained in a short time without placing a burden on the software.

〔実施例〕〔Example〕

第1図には本発明の一実施例であるアドレス演算制御装
置のブロック図が示される。このアドレス演算制御装置
は、プロセッサなどの演算実行部及び命令制御部に含ま
れる。このアドレス演算制御装置を含むプロセッサは、
特に制限されないが、32ビットCPU (セントラル
・プロセッシング・ユニット)を含み、32ビットで各
種データやアドレスの演算を行うことができるようにな
っている。そして、このプロセッサによる命令実行に用
いられるオペランドのサイズは、ワード(32ビット)
、ハーフワード(16ビット)、及びバイト(8ビット
)の何れをも自由に選択可能になっている。また、上記
プロセッサは、特に制限されないが、アドレスによって
指定されるデータの最小単位をバイトとして把握し、こ
のバイトアドレスは32ビットで構成される。したがっ
て、32ビットのバイトアドレスの最下位ビットを無視
するとメモリ空間をハーフワード単位で把握することが
でき、また、下位2ビットを無視するとメモリ空間をワ
ード単位で把握することができる。本実施例において、
ビット操作命令の対象とされるようなオペランドは、特
に制限されないが、データの入呂力を32ビット単位で
行うメモリに格納されている。従ってこのメモリのアク
セスアドレスは、32ビットのバイトアドレスの下位2
ビットを実質的に無視した30ビットのワードアドレス
とされる。このようなメモリにおいて、ワード境界は、
データをワード単位で指定するアドレスの境界、すなわ
ち32ビットのバイトアドレスの上位30ビットが変化
されるデータの境界とされる。
FIG. 1 shows a block diagram of an address arithmetic control device which is an embodiment of the present invention. This address arithmetic control device is included in an arithmetic execution unit and an instruction control unit of a processor or the like. A processor including this address arithmetic control device is
Although not particularly limited, it includes a 32-bit CPU (central processing unit), and is capable of performing various data and address operations using 32 bits. The size of the operand used for instruction execution by this processor is a word (32 bits).
, halfword (16 bits), and byte (8 bits) can be freely selected. Further, although not particularly limited, the processor recognizes the minimum unit of data specified by an address as a byte, and this byte address is composed of 32 bits. Therefore, if the least significant bit of the 32-bit byte address is ignored, the memory space can be understood in halfword units, and if the lower two bits are ignored, the memory space can be understood in word units. In this example,
Operands that are the targets of bit manipulation instructions are stored in a memory that inputs data in units of 32 bits, although there are no particular restrictions. Therefore, the access address of this memory is the lower 2 of the 32-bit byte address.
It is a 30-bit word address that essentially ignores bits. In such memories, word boundaries are
The boundaries of addresses that specify data in units of words, that is, the upper 30 bits of a 32-bit byte address, are the boundaries of data to be changed.

第1図において、1は32ビットの加算回路であり、そ
の一方の入力端子には入力回路2が結合され、他方の入
力端子には入力回路3及びシフト回路4が直列に結合さ
れている。加算口″N11における32ビットの出力端
子は、下位2ビットがセレクタを通して出力回路6に、
そして残りの30ビットが直接出力回路6に結合され、
この出力回路6は1図示しないアドレスバスにつながる
アドレス出力レジスタ7に32ビットのアドレスを与え
る。
In FIG. 1, 1 is a 32-bit adder circuit, one input terminal of which is coupled with an input circuit 2, and the other input terminal of which is coupled with an input circuit 3 and a shift circuit 4 in series. The 32-bit output terminal of the addition port "N11" has the lower 2 bits passed through the selector to the output circuit 6.
The remaining 30 bits are then directly coupled to the output circuit 6,
This output circuit 6 provides a 32-bit address to an address output register 7 connected to an address bus (not shown).

ビット操作命令を実行するために操作対象ビットを含む
データのアクセスアドレスを演算する場合、上記入力回
路2にはベースアドレスBAが与えられ、他方の入力回
路3にはベースアドレスBAを基準にデータに対するビ
ット操作位置を与えるためのオフセット0FFSETが
与えられる。
When calculating the access address of data including the bit to be manipulated in order to execute a bit manipulation instruction, the input circuit 2 is given the base address BA, and the other input circuit 3 is given the access address for the data based on the base address BA. An offset 0FFSET is provided to provide the bit operation position.

シフト回路4は、オフセット○FF5ETを右すなわち
下位側に3ビットシフトしてバイトアドレスに変換する
。例えば第5図に示されるようにベース7ドレスBAが
10番地(OazOao−130z1.0.)のとき、
オフセット0FFSETが10ビット目(0,,03゜
・・・13021,0゜)として与えられるとき、シフ
ト回路4の出力は(03□O1゜・・・0.0□011
゜)とされ、加算回路1は双方のデータを加算すること
により、アクセスアドレスAAとして11番地(o31
o3゜・・・130.1□1゜)を得る。
The shift circuit 4 shifts the offset FF5ET to the right, that is, to the lower order, by 3 bits and converts it into a byte address. For example, as shown in FIG. 5, when the base 7 dress BA is address 10 (OazOao-130z1.0.),
When the offset 0FFSET is given as the 10th bit (0,,03°...13021,0°), the output of the shift circuit 4 is (03□O1°...0.0□011
By adding both data, the adder circuit 1 sets address 11 (o31) as the access address AA.
o3°...130.1□1°) is obtained.

セレクタ5は、オペランドサイズがバイトであるときに
はアクセスアドレスAAの下位2ビットをそのままにし
て出力回路6に与える。オペランドサイズがハーフワー
ドであるときにはアクセスアドレスAAの最下位ビット
をビット「O」にマスクして出力回路6に与える。オペ
ランドサイズがワードであるときにはアクセスアドレス
AAの下位2ビットをro、OJにマスクして出力回路
6に与える。
When the operand size is a byte, the selector 5 applies the lower two bits of the access address AA to the output circuit 6 without changing them. When the operand size is a half word, the least significant bit of the access address AA is masked to bit "O" and provided to the output circuit 6. When the operand size is a word, the lower two bits of the access address AA are masked as ro and OJ and provided to the output circuit 6.

アクセスアドレスAAの下位2ビットに対するデータサ
イズに応じたマスク処理は、指定データサイズのオペラ
ンドに対するアクセスアドレスがメモリのワード境界を
超えないようにする意義を有する。すなわち、オペラン
ドサイズがバイトである場合には、加算回路1で演算さ
れたアクセスアドレスAAの上位30ビットを用いてメ
モリをアクセスすれば1回のメモリアクセスによってバ
イトサイズのオペランドを取得することができるが、オ
ペランドサイズがハーフワードである場合に、アクセス
アドレスAAが第6図に示されるような11番地、15
番地といったワード境界に位置すると、そのアクセスア
ドレスAAの上位30ビットによる1回のメモリアクセ
スだけではハーフワードサイズのオペランドを取得する
ことができない。このようなときにそのアクセスアドレ
スAAの最下位ビットを「0」にマスクすると、そのア
クセスアドレスAAがメモリのワード境界に位置してい
る場合にそのアクセスアドレスAAの1つ前の番地を新
たなアクセスアドレスAA’として生成するように作用
する。
The mask processing according to the data size for the lower two bits of the access address AA has the meaning of preventing the access address for the operand of the specified data size from exceeding the word boundary of the memory. That is, when the operand size is a byte, by accessing the memory using the upper 30 bits of the access address AA calculated by the adder circuit 1, a byte-sized operand can be obtained with one memory access. However, when the operand size is halfword, the access address AA is address 11, 15 as shown in FIG.
When located at a word boundary such as an address, a halfword-sized operand cannot be obtained with just one memory access using the upper 30 bits of the access address AA. In such a case, if the least significant bit of the access address AA is masked to "0", if the access address AA is located on a word boundary of the memory, the address immediately before the access address AA will be changed to a new address. It acts to generate the access address AA'.

また、オペランドサイズがワードである場合に。Also, if the operand size is words.

アクセスアドレスAAが第6図に示されるような8番地
、12番地といったワード境界意外の番地に位置すると
、そのアクセスアドレスAAの上位30ビットによる1
回のメモリアクセスだけではワードサイズのオペランド
を取得することができない。このようなときにそのアク
セスアドレスAAの下位2ビットをro、OJにマスク
すると、そのアクセスアドレスAAが実質的にメモリの
ワードアドレス意外に位置している場合にそのアクセス
アドレスAAをメモリのワードアドレスに対応する新た
なアクセスアドレスAA’に変換するように作用する。
If the access address AA is located at an address other than the word boundary, such as address 8 or 12 as shown in FIG.
It is not possible to obtain a word-sized operand with only one memory access. In such a case, if the lower two bits of the access address AA are masked to ro and OJ, if the access address AA is actually located outside the word address of the memory, the access address AA will be changed to the word address of the memory. The access address AA' is converted into a new access address AA' corresponding to the access address AA'.

尚、アクセスアドレスがAAからAA’に、成いはAA
’に変化された場合に、メモリアクセスされるオペラン
ドの最上位ビット位置に対してビット操作対象とされる
目的ビットの位置は変更されるが、ビット操作のための
データ演算上必要とされるその変更位置はオペランドの
サイズ情報から得ることができる。
Note that the access address changes from AA to AA', or from AA
', the position of the target bit to be bit manipulated is changed relative to the most significant bit position of the operand to be accessed in memory, but the The change position can be obtained from the operand size information.

第1図において、セレクタ5に対するマスク制御は、プ
ロセッサの命令制御系に含まれる。この命令制御系は、
特に制限されないが、マイクロプログラム制御を行うよ
うにされ、マクロ命令を命令デコーダ10で解読し、そ
の解読結果に応じてマイクロプログラム11からシーケ
ンシャルに読み出されるマイクロ命令を制御ユニット1
2が解読して各部の制御信号を生成する。ビット操作命
令には対応するインストラクションコードが含まれると
共に、オペランドのサイズ情報などが含まれている。ビ
ット操作命令に応するオペレーションコードのデコード
結果に従って、マイクロプログラム11から読み出され
るマイクロ命令には、セレクタ5によるマスク処理動作
を行う旨の制御コードが含まれている。この制御コード
と命令デコーダ10からオペランドのサイズに応する情
報とが制御ユニット12に与えられると、制御ユニット
12は、セレクタ5に対し、オペランドサイズに従って
アクセスアドレスAAの下位2ビットに対してビットr
OJの入れ替えを行う所定のマスク処理を指示する。
In FIG. 1, mask control for the selector 5 is included in the instruction control system of the processor. This command control system is
Although not particularly limited, the control unit 1 performs microprogram control, decodes macroinstructions with an instruction decoder 10, and sequentially reads out microinstructions from the microprogram 11 according to the decoding results.
2 decodes and generates control signals for each part. A bit manipulation instruction includes a corresponding instruction code, and also includes operand size information and the like. The microinstruction read out from the microprogram 11 in accordance with the decoding result of the operation code corresponding to the bit manipulation instruction includes a control code that causes the selector 5 to perform a mask processing operation. When this control code and information corresponding to the size of the operand are given to the control unit 12 from the instruction decoder 10, the control unit 12 instructs the selector 5 to select bit r for the lower two bits of the access address AA according to the operand size.
Instructs a predetermined masking process to replace OJ.

セレクタSに対するマスク制御は、第2図に示されるよ
うに直接命令デコーダ13の出力を用いて行うようにし
てもよい。この場合には、ビット操作命令のオペレーシ
ョンコードと、オペランドサイズ情報をデコードして、
セレクタ5の動作を可能とする制御情報並びにセレクタ
による所定ビットの入れ替え用制御信号を生成する論理
を命令デコーダ13に持たせることが必要になる。
Mask control for the selector S may be performed using the output of the direct command decoder 13, as shown in FIG. In this case, decode the operation code of the bit manipulation instruction and the operand size information,
It is necessary for the instruction decoder 13 to have logic for generating control information that enables the operation of the selector 5 and a control signal for replacing predetermined bits by the selector.

尚、セレクタ5に対する動作制御の説明から明らかなよ
うに、本実施例のアドレス演算制御回路はビット操作命
令のためのアクセスアドレスの演算に専用されるもので
はなく、セレクタの動作が非選択とされているときには
、加算回路1から出力されるアドレスは全ビットそのま
ま出力回路6に与えられるようになっており、その他の
アドレス演算にも兼用されるようになっている。
As is clear from the explanation of the operation control for the selector 5, the address operation control circuit of this embodiment is not dedicated to the operation of access addresses for bit manipulation instructions, and the operation of the selector is not selected. When the adder circuit 1 is running, all bits of the address output from the adder circuit 1 are directly applied to the output circuit 6, and are also used for other address operations.

上記セレクタ5を設ける位置は、第1図及び第2図に示
される位置に限定されるものではなく、第3図のように
アドレス出力レジスタ7の後段に設けたり、また第4の
ように出力回路6とアドレス出力レジスタ7との間に設
けるようにしてもよい。
The position where the selector 5 is provided is not limited to the position shown in FIGS. 1 and 2, but may be provided after the address output register 7 as shown in FIG. It may also be provided between the circuit 6 and the address output register 7.

上記実施例によれば以下の作用効果を得るものである。According to the above embodiment, the following effects can be obtained.

(1)セレクタ5は、ベースアドレスBAとオフセット
0FFSETに基づいて加算回路1で演算されたオペラ
ンドのアクセスアドレスAAの所定ビットを、オペラン
ドサイズに従ってハードウェア的に所定ビットでマスク
し、目的ビットを含む当該指定サイズのオペランドがメ
モリのワード境界を超えないようにするから、ビット操
作命令で扱われるオペランドサイズを任意に指定しても
、オペランドのアクセスアドレスをソフトウェアに負担
をかけずに短時間で取得することができる。
(1) The selector 5 masks the predetermined bits of the access address AA of the operand calculated by the adder circuit 1 based on the base address BA and the offset 0FFSET with predetermined bits in hardware according to the operand size, and includes the target bit. Since operands of the specified size are prevented from exceeding memory word boundaries, even if the operand size handled by a bit manipulation instruction is specified arbitrarily, the access address of the operand can be obtained in a short time without putting a burden on the software. can do.

(2)上記作用効果より、ビット操作命令の実行時間増
大を抑えつつ、ビット操作命令で扱われるオペランドサ
イズの自由度を増すことができる(3)ビット操作命令
に含まれるオペランドサイズ情報のデコード結果に基づ
いて上記セレクタによる所定ビットの入れ替え用制御信
号を生成するための制御手段を設けることにより、ビッ
ト操作命令に応するマイクロプログラム系列には、オペ
ランドサイズに従ってセレクタの動作を可能とする制御
情報を生成するためのマイクロ命令を追加するだけでよ
く、これにより、セレクタ5の追加によるソフトウェア
の変更を最小限にすることができる。
(2) From the above effects, it is possible to increase the degree of freedom in the operand size handled by bit manipulation instructions while suppressing the increase in execution time of bit manipulation instructions. (3) Decoding results of operand size information included in bit manipulation instructions By providing a control means for generating a control signal for replacing a predetermined bit by the selector based on the above, the microprogram series corresponding to the bit manipulation instruction is provided with control information that enables the selector to operate according to the operand size. It is only necessary to add a microinstruction for generating the selector 5, thereby minimizing software changes due to the addition of the selector 5.

(4)ビット操作命令のオペレーションコードとオペラ
ンドサイズに基づいて、セレクタの動作を可能とする制
御情報並びにセレクタによる所定ビットの入れ替え用制
御信号を生成する論理を命令デコーダ13に持たせるこ
とにより、命令デコーダ13自体のハードウェア構成は
相対的に複雑になるがその反面ソフトウェアに対する負
担を更に軽減することができる。
(4) Based on the operation code and operand size of the bit manipulation instruction, the instruction decoder 13 is provided with logic that generates control information that enables the operation of the selector and a control signal for replacing a predetermined bit by the selector. Although the hardware configuration of the decoder 13 itself becomes relatively complex, on the other hand, the burden on the software can be further reduced.

以上本発明者によってなされた発明を実施例に基づいて
具体的に説明したが、本発明はそれに限定されるもので
はなく、その要旨を逸脱しない範囲において種々変更す
ることができる。
Although the invention made by the present inventor has been specifically described above based on examples, the present invention is not limited thereto, and various changes can be made without departing from the gist thereof.

例えば、上記実施例ではビット操作命令で処理するオペ
ランドサイズをワード、ハーフワード。
For example, in the above embodiment, the operand size processed by a bit manipulation instruction is a word or a halfword.

及びバイトの3種類として説明したが、その3種類に限
定されず、そけらデータサイズの任意組合せ、さらには
その他のサイズであってもよい。
Although the description has been made based on three types of data size and byte, the data size is not limited to these three types, and may be any combination of data sizes or other sizes.

以上の説明では主として本発明者によって成された発明
をその背景となった利用分野であるピックエンデイアン
方式を採用する32ビットプロセツサに適用した場合に
ついて説明したが、本発明はそれに限定されず、リトル
エンデイアン方式を採用するプロセッサ、16ビットプ
ロセツサ、さらにはその他ビット操作を行うコントロー
ラなどの各種データ処理装置に広く適用することができ
る。本発明は少なくともビット操作対象とされるデータ
のアクセスアドレスを演算する条件のものに適用するこ
とができる。
In the above explanation, the invention made by the present inventor was mainly applied to a 32-bit processor that adopts the pick-endian system, which is the field of application that formed the background of the invention, but the present invention is not limited thereto. The present invention can be widely applied to various data processing devices such as processors that employ the little endian system, 16-bit processors, and controllers that perform other bit operations. The present invention can be applied at least to conditions for calculating the access address of data subject to bit manipulation.

〔発明の効果〕〔Effect of the invention〕

本願において開示される発明のうち代表的なものによっ
て得られる効果を簡単に説明すれば下記の通りである。
A brief explanation of the effects obtained by typical inventions disclosed in this application is as follows.

すなわち、ビット操作命令により操作対象とされるビッ
トを含むオペランドのアクセスアドレスに対し、そのア
クセスアドレスとオペランドサイズに従って、当該指定
サイズのオペランドがメモリのワード境界を超えないよ
うにそのアクセスアドレスの下位側ビットを所定ビット
に入れ替え制御すセレクタを設けたから、ビット操作命
令で扱われるオペランドサイズを任意に指定しても、オ
ペランドのアクセスアドレスをソフトウェアに負担をか
けずに短時間で取得することができるという効果がある
In other words, for the access address of the operand that includes the bit to be manipulated by a bit manipulation instruction, the lower side of the access address is Since a selector is provided to control the replacement of bits with predetermined bits, even if the operand size handled by a bit manipulation instruction is arbitrarily specified, the access address of the operand can be obtained in a short time without putting any burden on the software. effective.

また、セレクタによる動作を可能とする指示をマイクロ
プログラムで与えると共に、オペランドサイズに応じた
セレクタによるマスク制御をマイクロプログラムで定義
せずにオペランドサイズ情報のデコード結果に従って行
うようにすることにより、セレクタを設けることによる
マイクロプログラムの変更を少なくすることができると
共に、マイクロプログラム容量の増大を抑えることがで
きる。
In addition, the microprogram provides instructions that enable the selector to operate, and the mask control by the selector according to the operand size is performed according to the decoded result of the operand size information without defining it in the microprogram. By providing this, changes in the microprogram can be reduced, and an increase in the microprogram capacity can be suppressed.

そして、ビット操作命令のオペレーションコードとオペ
ランドサイズ情報に基づいて、セレクタの動作を可能と
する制御情報並びにセレクタによる所定ビットの入れ替
え用制御信号を生成する論理を命令デコーダに持たせる
ことにより、ビット操作対象オペランドのアクセスアド
レスを演算するときのソフトウェア依存性を更に低減す
ることができるという効果がある。
Based on the operation code and operand size information of the bit manipulation instruction, the instruction decoder is provided with logic that generates control information that enables the selector to operate, as well as a control signal for replacing a predetermined bit by the selector. This has the effect that software dependence when calculating the access address of the target operand can be further reduced.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例であるアドレス演算制御装置
のブロック図、 第2図は本発明の他の実施例であるアドレス演算制御装
置のブロック図、 第3図は第1図及び第2図の構成に対してセレクタの位
置を変更した実施例を示すブロック図、第4図はさらに
セレクタの位置を変更したその他の実施例を示すブロッ
ク図、 第5図はベースアドレスとオフセットから演算されるア
クセスアドレスの一例説明図、第6図はメモリのアドレ
ス空間におけるワード境界の説明図である。 1・・・加算回路、2,3・・・入力回路、4・・・シ
フト回路、5・・・セレクタ、6・・・出力回路、7・
・・アドレス出力レジスタ、10・・・命令デコーダ、
11・・・マイクロプログラム、12・・・制御ユニッ
ト、13・・・命令デコーダ、BA・・・ベースアドレ
ス、0FFSET・・・オフセット、A、A’、A?・
・・アクセスアドレス。 第  2 図 第  1  図
FIG. 1 is a block diagram of an address arithmetic control device which is an embodiment of the present invention, FIG. 2 is a block diagram of an address arithmetic control device which is another embodiment of the present invention, and FIG. 3 is a block diagram of an address arithmetic control device which is an embodiment of the present invention. A block diagram showing an embodiment in which the position of the selector is changed from the configuration in Fig. 2, Fig. 4 is a block diagram showing another embodiment in which the position of the selector is further changed, and Fig. 5 is a block diagram showing an example in which the position of the selector is changed. FIG. 6 is an explanatory diagram of an example of an access address to be accessed. FIG. 6 is an explanatory diagram of word boundaries in the memory address space. DESCRIPTION OF SYMBOLS 1... Addition circuit, 2, 3... Input circuit, 4... Shift circuit, 5... Selector, 6... Output circuit, 7...
...Address output register, 10...Instruction decoder,
11...Microprogram, 12...Control unit, 13...Instruction decoder, BA...Base address, 0FFSET...Offset, A, A', A?・
...Access address. Figure 2 Figure 1

Claims (1)

【特許請求の範囲】 1、複数ビットの集合を最小単位とするデータを指定す
るベースアドレスと、このベースアドレスのデータに対
するビット操作位置を与えるためのオフセットとによっ
てその操作対象ビットを含むデータのアクセスアドレス
を生成する演算手段と、この演算手段で得られたアクセ
スアドレスとオペランドに対して指定されるデータサイ
ズ情報に従って、当該指定サイズのオペランドがメモリ
のワード境界を超えないようにそのアクセスアドレスの
下位ビット側を所定ビットに入れ替え制御すセレクタと
を含んで成るアドレス演算制御装置。 2、上記ベースアドレスはバイトデータを指定、し、指
定可能なオペランドサイズはバイト、ハーフワード、ワ
ードとされ、上記メモリのワード境界はデータをワード
単位で指定するアドレスの境界とされ、上記セレクタは
、オペランドサイズがバイトであることに呼応して上記
アクセスアドレスをそのまま出力し、オペランドサイズ
がハーフワードであるときアクセスアドレスの最下位ビ
ットをビット「0」に置き換えて出力し、オペランドサ
イズがワードであるときアクセスアドレスの下位2ビッ
トをビット「0、0」に置き換えて出力するものとされ
る請求項1記載のアドレス演算制御装置。 3、上記セレクタの動作を可能とする制御情報を生成す
るためのマイクロ命令を、ビット操作命令に応するマイ
クロプログラム系列に含む制御記憶と、ビット操作命令
に含まれるオペランドサイズ情報のデコード結果に基づ
いて上記セレクタによる所定ビットの入れ替え用制御信
号を生成するための制御手段とを含む請求項1又は2記
載のアドレス演算制御装置。 4、ビット操作命令のオペレーションコードとオペラン
ドサイズ指定情報とに基づいて、上記セレクタの動作を
可能とする制御信号及び上記セレクタによる所定ビット
の入れ替え用制御信号を生成するための論理を含む命令
デコーダを備えて成る請求項1又は2記載のアドレス演
算制御装置。
[Claims] 1. Accessing data that includes the bit to be manipulated using a base address that specifies data whose minimum unit is a set of multiple bits and an offset that provides a bit manipulation position for the data at this base address. According to the arithmetic means that generates the address and the data size information specified for the access address and operand obtained by this arithmetic means, the lower order of the access address is An address arithmetic control device comprising a selector for controlling the bit side to be replaced with a predetermined bit. 2. The above base address specifies byte data, the operand sizes that can be specified are byte, halfword, and word, the word boundary of the memory above is the boundary of the address that specifies data in word units, and the selector above is , the above access address is output as is in response to the operand size being a byte, and when the operand size is a halfword, the least significant bit of the access address is replaced with bit "0" and output, and the operand size is a word. 2. The address arithmetic control device according to claim 1, wherein the lower two bits of the access address are replaced with bits "0, 0" and outputted at some time. 3. Control memory that includes microinstructions for generating control information that enables the operation of the selector in a microprogram series corresponding to bit manipulation instructions, and based on the decoding result of operand size information included in the bit manipulation instructions. 3. The address arithmetic control device according to claim 1, further comprising control means for generating a control signal for replacing a predetermined bit by said selector. 4. An instruction decoder including logic for generating a control signal that enables the operation of the selector and a control signal for replacing a predetermined bit by the selector, based on the operation code of the bit manipulation instruction and the operand size specification information. The address arithmetic control device according to claim 1 or 2, comprising:
JP1397689A 1989-01-25 1989-01-25 Address operation control device Pending JPH02195431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1397689A JPH02195431A (en) 1989-01-25 1989-01-25 Address operation control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1397689A JPH02195431A (en) 1989-01-25 1989-01-25 Address operation control device

Publications (1)

Publication Number Publication Date
JPH02195431A true JPH02195431A (en) 1990-08-02

Family

ID=11848257

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1397689A Pending JPH02195431A (en) 1989-01-25 1989-01-25 Address operation control device

Country Status (1)

Country Link
JP (1) JPH02195431A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5559730A (en) * 1994-02-18 1996-09-24 Matsushita Electric Industrial Co., Ltd. Shift operation unit and shift operation method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5559730A (en) * 1994-02-18 1996-09-24 Matsushita Electric Industrial Co., Ltd. Shift operation unit and shift operation method

Similar Documents

Publication Publication Date Title
EP0220684B1 (en) Data processing system
US4839797A (en) Microprocessor compatible with any software represented by different types of instruction formats
KR100266337B1 (en) Information processing circuits, semiconductor integrated circuit devices, microcomputers, and electronic devices
JP2554050B2 (en) Data processing method
JPS6339931B2 (en)
KR19980069757A (en) Microprocessor and Multiprocessor Systems
JP2845433B2 (en) Integrated circuit device
KR20170099855A (en) Method and apparatus for variably expanding between mask and vector registers
JP2970821B2 (en) Data processing device
JP4988082B2 (en) Microprocessor and data processing system
JPH0683582A (en) Data arithmetic operation unit
JPS63261449A (en) data processing equipment
US5077659A (en) Data processor employing the same microprograms for data having different bit lengths
CN107851022B (en) Vector length query instruction
JPH02195431A (en) Address operation control device
JPS6217773B2 (en)
US4813019A (en) Semiconductor integrated circuit
JPS6049335B2 (en) Branch address determination method in microprogram controlled data processing equipment
JPH0150934B2 (en)
JPS62174833A (en) data processing system
JPH01134621A (en) Off-setting quantity indirect specifying control system
JPS62297940A (en) Data processor
JP2002073326A (en) Program executing device and program executing method
JPS62259139A (en) Microprogram controller
JPS63156234A (en) Operation system for microprocessor