Title of Invention

AN APPARATUS FOR PROCESSING DATA

Abstract Apparatus for processing data, said apparatus comprising an instruction decoder responsive to program instructions to control data processing operations and an address offset generating circuit controlled by said instruction decoder and operable to generate an N-bit address offset having a value specified by an address offset generating instruction including an offset value sign specifying bit S wherein said address offset generating circuit generates said N-bit address offset with bit values B; when expressed as a two's complement number, where (N-l)>.i>Z and (N-1)>Z>:0, said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit includes L offset-extending bits Pk, where (N-Z)>L>1 and L>k>0, and (i) said address offset generating circuit is operable to generate bits Bj of said N-bit address offset with values given by Bj - S for all values of j such that (N-l)>j>:(N-L-l) if all of said offset-extending bits Pk of said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit have respective predetermined values Dk; and said address offset generating circuit is operable to generate bits Bj of said N-bit address offset, where (N-l)>j>.(N-L-l), by performing a predetermined one-to-one mapping from combinations of values of said offset-extending bits Pk and said offset value sign specifying bit S of said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit to combinations of values of Bj other than the combination Bj - 1 for all values of j such that (N-l)>j>(N-L-l) and the combination Bj = 0 for all values of j such that (N-l)>j>(N-L-l), said address offset generating circuit performing said mapping if any of said offset-extending bits Pk does not have said predetermined value Dk.
Full Text The present invention relates to an apparatus for • processing data.
This invention relates to the field of data processing systems. More particularly, this invention relates to the generation of an address offset in response to an' address offset generating instruction.
It is known to provide data processing systems of the form illustrated in Figure 1 of the accompanying drawings. This data processing system comprises a processor core including a register bank 4, a multiplier 6, a shifter 8, an adder 10, an instruction pipeline 12 and an instruction decoder 14. It will be understood by those skilled in this technical field that the processor core 2 will typically include many further circuit elements, which have been omitted from Figure 1 for the sake of clarity. In operation, the processor core 2 fetches program instructions to the instruction pipeline 12 wherein they are decoded by the instruction decoder 14 to generate control signals that act upon the register bank 4, the multiplier 6, the shifter 8 and the adder 10 as well as other circuit elements to control the desired data processing operations as specified by the program instruction being decoded. The processor core 2 is provided with a data bus, an address bus and an instruction bus.
One type of processing operation that can be required is the generation of an address offset value. One example of this type of operation is the BL/BLX instruction which is present in the Thumb mode of operation of Thumb enabled processors produced by ARM Limited of Cambridge, England. Figure 2 of the accompanying drawings schematically illustrates such instructions. It will be seen that these instructions can be considered as two 16-bit instructions or one 32-bit instruction. The leading five bits (namely 11110) are decoded as indicating that a BL/BLX instruction is present with the remaining eleven bits within the first two bytes being an offset value, including a leading sign bit S, this being offset field 2. This offset value is then followed by a bit pattern 11 1tl and a further eleven bits of offset, this being offset field 1. The "t" bit indicates to the instruction decoder 14 whether the instruction is a BL instruction or a


BLX instraction. A BL instruction is a branch with link staying witbin the Thumb mode of operation. A BLX instruction is a branch with linie combined with a switch to the ARM mode of operation.
It will be appreciated that the offset values illustrated in Figure 2 provide twenty two bits. This offset value is sign-extended as required and then added to the branch instruction's address. This offset value range is able to support branch jumps of plus or minus 4MB to 16-bit halfword-aligned targets.
As application programs increase in complexity, they also tend to increase ui size. It is desirable that it should be possible to make an end-to-end branch within a program image if this is required. Accordingly, as application images are becoming larger and greater in size than 4MB, a problem arises in that the address offset values which are supported in the instructions have an insuffîcient range.
Figure 3 schematicaUy illustrates the action of a BL instruction in jumping the program execution flow to a new point. The maximum jump that can be commanded is constrained by the maximum address offset value which may be specified.
A further problem which should be addressed is the need to provide backwards compatibility in any modified form of the instruction. Thus, whilst adopting completely new instruction encodings for the BL/BLX instead of the old encodings might overcome the address offset range problem, it would suffer from the disadvantage of a lack of backwards compatibility with the existing software written using the legacy instructions. Alternatively, adding new encodings in addition to the existing encodings would be disadvantageously wasteful of instruction encoding bit space.
Viewed from one aspect the present invention provides apparatus for pfocessing data, said apparatus comprismg:
an instruction decoder responsive to program instructions to control data processing operations; and
an address ofîset generating circuit controlled by said instruction decoder
i
and operable to generate an N-bit address offset having a value specified by an address offset generating instruction including an ofîset value sign specifying bit S; wherein
said N-bit address offset has bit values Bj when expressed as a rwo's complement number, where (M-l)>i>7, and (N-l^Z^O, said address ofîset generating instruction includes L high order field bits Pk, where (N-Z)>L>1 and L>k>0, and said address offset generating circuit is operable such that:
(i) if all of said high order field bits Pk have respective predetennined values Dk, then bits Bj of said N-bit address offset are given by Bj = S for all values of j such that (N-l)>j£(N-L-l); and
(ii) if any of said high order field bits Pk does not have said predetennined value Dk, then bits Bj of said N-bit address offset, where (N-l)^jă:(N-L-l), are given by a predetermined one-to-one mapping from combinations of values of said high order field bits Pk and said ofîset value sign specifying bit S to combinations of values of Bj other than the combination Bj = l for all values of j such that (N-l)5:j>(N-L~l) and the combination Bj - O for all values of j such that (
The invention recognises that some bits within the existing address ofîset generating instructions may be redundant in that they are not required to positively identify and accordingly decode the instruction concerned (e.g. once the first 16 bits of a BL/BLX have been identified the following 16 bits are constrained to be the second half of either a BL instruction or a BLX instruction) and accordingly those bits may be used to instead encode additional address offset information thereby extending the address offset range. However, in order to support backwards compatibih'ty with existing software the encoding used to represent the extra bits of the address offset value must be such that when legacy code is executed in which the extra bits have fixed values (the respective predetermined values), then those fixed values will be decoded in a way that
generates the same offset value as was origioallv intended when the legacy software was written, Le. appropriately sign extended. This is achieved by the encoding of the present technique as specifîed above. It will be appreciated that the fîxed bits in the legacy code which are being reused to represent additional bits of address offset with the present technique could have hâd previously fîxed values of either "O" or "l".
In order to provide backwards compatibility with a previous instruction set a preferred encoding is one ui which said respective predetermined values of said high order field bits Pt are all equal to l.
In preferred embodiments said address offset generating circuit is operable to generate bit Bj values of said N-bit address offset each bit value Bj having a value given by a respective predetermined one of:
Bj = S for one directly sign bit specifîed value of j;
Bj = S XOR PkQ) XOR Dk(j) where k(j) is a one-to-one index mapping from values of j, excluding said directly sign bit specified value of j, to values of k.
This has the advantage that copying the sign bit to one bit position, and use of exclusive-OR function (when the predetermined value is 0) or an exclusive-NOR function (when the predetermined value is 1) for the others is an especially simple way to generate Bj values that meet the required conditions.
Li preferred embodiments said directly sign bit specified value of j is N-1. It is advantageous if the sign bit of the final offset can be obtained directly from the instruction encoding, without requiring an exclusive-(N)OR function to be evaluated. As an example, this may be advantageous because the sign bit of the final offset may need to be replicated, in which case putting the buffering delay in parallel with the exclusive-(N)OR delay rather than in series with it reduces criticai paths. Another reason why it may be advantageous is that some branch prediction schemes pay attention to the direction of a branch instruction, and so may want to know the sign of the offset without knowing its exact value.
It will be appreciated that because Dk is a predetennined value, the formula may be implemented with a single exclusive-OR or exclusive-NOR gate, since the formula simplifîes to Bj = S XOR P^-) if the predetennined value is O and to Bj = NOT(S XOR Pk®) if the predetermined value is 1. (If, Dk were not a predetermined value, two exclusive-(N)OR gates in series to an equivalent circuit would be required.)
It will be appreciated that the address offset generating instraction could have a variety of different forms and is not necessarily limited to branch instructions. However, the present invention is particularly well suited for use in branch instructions.
When using a branch instraction, preferred embodiments combine the branch target address offset with the current program address to generate a branch target address to which the program jumps.
Whilst the invention is suitable to various different sizes of instructions, it is particularly useful in embodiments in which k = 2, N = 25 and Z = l or 2. These advantageously balance bit space allocated to the offset value specifîcation and bit space allocated to the opcode and other parameters.
The bits of the address offset value not being specifîed by the new technique also need to be specifîed within the address ofiset generating instruction. These could be encoded in a variety of different ways, but it is advantageously simple when these are directly specifîed by fields within the address offset generating instraction.
Viewed from another aspect the present invention provides a method of processing data, said method comprising the steps of:
controlling data processing operations using an instraction decoder responsive to program instructions; and
generating an N-bit address offset having a value specifîed by an address offset generating instruction including an offset value sign specifying bit S using an address offset generating circuit controlled by said instruction decoder; wherein
said N-bit address offset nas bit values B» when expressed as a two's complement number, where (N-l)ăd>Z and (N-1)>Z>0, said address ofîset generating instraction includes L high order field bits Pk, where (N-Z)>L^1 and L>k>0, and said address offset generating circuit is operable such. that:
(i) if all of said high order field bits Pk have respective predetermined values Dk, then bits Bj of said N-bit address ofîset are given by Bj = S for all values of j such that (N-l)^jâ(N-L-l); and
(ii) if any of said high order field bits Pk does not have said predetermined value Dk, then bits Bj of said N-bit address offset, where (N-l)Sj;>(N-L-l), are given by a predetermined one-to-one mapping from combinations of values of said high order field bits P^ and said ofîset value sign specifying bit S to combinations of values of Bj other thau the combination Bj = l for all values of j such that (N-l)ărj>(N-L-l) and the combination Bj = O for all values of j such that (
Viewed from a further aspect the present invention provides a computer program product including a computer program for controlling a computer to perfonn the steps of:
controlling data processing operations using an instruction decoder responsive to program instructions; and
generating an N-bit address ofifset having a value specified by an address offset generating instruction including an offset value sign specifying bit S using an address offset generating circuit controlled by said instruction decoder; wherein
said N-bit address ofîset has bit values Bj when expressed as two's complement number, where (N-1)>i>Z and (N-1)>Z£0, said address ofîset generating instruction includes L high order field bits Pk, where (N-Z)>L>1 and L>k>0, and said address offset generating circuit is operable such that:
(i) if all of said high order fîeld bits Py- have respective predetermined values Dfo then bits Bj of said N-bit address offeet are given by Bj = S for all values of j such that (N-l)ă3>(N-L-l); and
(ii) if any of said high order field bits Pk does not have said predetermined value Dk, then bits Bj of said N-bit address offeet, where (N-l)ăg2^N-L-l), are given by a predetermined one-to-one mapping from combinations of values of said high order field bits Pk and said offeet value sign specifying bit S to combinations of values of Bj other than the combination Bj = l for all values of j such that (N-l)>jă:(N-L-l) and the combination Bj = O for all values of j such that (
It will be appreciated that the computer program product can take a wide variety of different forms, such as a storage medium or a download from a data connection or the like. Within the computer program product the computer program concerned should include one or more address offeet generating instructions utilizing the present technique.
Embodiments of the invention will now be described, by way of example only, with reference to the accompanying drawings in which:
Figure l schematicaUy illustrates a data processing system of the type in which the present technique may be used;
Figure 2 schematically illustrates a known branch instruction which includes an address offset generating capability,
Figure 3 illustrates the action of a branch instruction such as that of Figure 2;
Figure 4 illustrates an address offset value to be generated;
Figure 5 schematically illustrates an address offset generating instruction for generating the address offset value of Figure 4;
Figure 6 schematically illustrates example logic for decoding the additional bits from the address generating instruction so as to provide a greater number of bits within the address offset value generated;
Figure 7 schematically represents an example generalised relationsbip between the sign and high order field bits with the instruction and the coiresponding high order offset value bits that are generated; and
Figure 8 schematically illustrates the architecture of a general purpose computer which may implement program instructions in accordance with the current techniques.
Figure 4 illustrates an address offeet value being an N-bit value. The least significant Z bits of this address offset value need not be represented by the fields within the address generating instruction since they have a fixed value determined by the instruction word size of the program concerned. If the instruction words are 32-bit words and are word-aligned within the memory, then the least significant two bits of the address offset value may be constrained to be "00" and need not be specified within the fields of the address offset generating instruction. Similarly, with 16-bit instructions that are halfword-aligned (16-bit halfwords), the least significant bit of the address offset value may be constrained to be "O" and again this need not be specified within the offset field of the offset generating instruction.
In this example the range [Bîw.'BiJ encompass the bits Bj extending between:
the least significant end of the address offset value starting at the position which needs to be specified taking account of the instruction word size; and
a position one bit position below the most significant end which was the maximum position which could be specified in tibe legacy instructions.
In order to extend the addressing range of the address offset value in this example two further bits have been inserted into the address offset value, namely bits BN-2 and BN-S, with the original sign bit S being moved up to become BN-I. These additional bits are derived from the address ofîset generating instruction in the manner illustrated. More particularly, these additional bits are! specifîed by a respective one of the additional bits which are being reused to provide the encoding when combined using a logica! expression with the most significant bit of the address value which could be specified using the legacy instruction. It will be appreciated that the expression illustrated in Figure 4 shows the desired relationship but this expression could be rewritten in many different forms. The present technique encompasses all such alternative forms of representing the relationship illustrated in Figure 4.
Figure 5 schematically illustrates an address ofîset generating instruction (a new BL/BLX instruction in the ARM/Thumb type of system). Comparing this instruction with Figure 2, it will be seen that the two bits adjacent to the "t" value have been reused to encode additional information regarding the address offset value in accordance with the logical expression shown in Figure 4. Thus, the full address offset value is given by the legacy address offset fields together with the two additional bit values interpreted as described above.
Figure 6 illustrates more directly how the address ofîset value can be derived from the address ofîset generating instruction of Figure 5. Firstly, other than the S bit, the legacy address ofîset fields are taken directly and put in the same places as before. Then, the two additional bit values encoding the additional address ofîset information namely PI and P0 are combined with the sign bit S which is the most significant bit of the legacy offset value using respective logic gates as shown to generate the bits BN.2 and B^.2 of the extended address offset value. The sign bit S is used directly to provide BN-I of the extended address offset value. The extended address offset value so produced is a 25-bit value (a LSB value of "O" is also incorporated in view of halfword (16-bit hâlfwords in this example) alignment). The 25-bit value is further sign extended to produce a 32-bit value to be combined with a 32-bit address value
(e. g. as part of a branch operation). This combination may be by adding to the branch instruction's PC vahie, which is its address plus a constant offset (4 in Thumb/Wrist). Other processing operations and combinations of operations which give the same result are also encompassed within the present technique. Thus, in the case of an address offset range which was previously limited to plus or minus 4MB, this may be extended to plus or minus 16MB, which is a significant advantage. This extended range is achieved in a manner which is backwards compatible with existing code.
Figure 7 is a table illustrating a more general relationship between the high order field bits P) and PO, the sign bit of the offset S and the result three most significant bits BN-I and BN-Z and BN-S of the resulting offset value. When PI = PO = l , this corresponds to the legacy encoding and so all three values BN-I and BN-2 and BN-S equal S. This leaves six other possible combinations of S, PI
and PO which are subject to a one-to-one mapping to the remaining possible 3-bit
i
combinations of BN-I andBwj and BN-S- One example of such a mapping is the one shown in Figures 4 and 6.
This mapping is also shown in the following table:
(Table Removed)

Figure 8 schematically illustrates a general purpose computer 200 which may implement program instructions in accordance with the above described techniques. The general purpose computer 200 includes a central processing
unit 202, a random access memory 204, a read only memory 206, a network interface cârd 208, a nard disk drive 210, a display driver 212 and monitor 214 and a user input/output circuit 216 with a keyboard 218 and mouse 220 all connected via a common bus 222. In operation the central processing unit 202 will execute computer program instructions that may be stored in one oj: more of the random access memory 204, the read only memory 206 and the nard disk drive 210 or dynamically downloaded via the network interface cârd 208. The results of the processing performed may be displayed to a user via the display driver 212 and the monitor 214. User inputs for controlling the operation of the general purpose computer 200 may be received via the user input output circuit 216 from the keyboard 218 or the mouse 220. It will be appreciated that the computer program could be written in a variety of difîerent computer languages. The computer program may be stored and distributed on a recording medium or dynamically downloaded to the general purpose computer 200. When operating under control of an appropriate computer program, the general purpose computer 200 can perform the above described techniques and can be considered to fonn an apparatus for performing the above described technique. The architecture of the general purpose computer 200 could vary considerably and Figure 8 is only one example.






claim:
Apparatus (2)for processing data, said apparatus comprising:
an instruction decoder (14) responsive to program instructions to control data processing operations; and
an address offset generating circuit (4,6,8,10) controlled by said instruction decoder (14) and having logic configured to generate an N-bit address offset having a value specified by an address offset generating instruction including an offset value sign specifying bit S; wherein
said address offset generating circuit generates said N-bit address offset with bit values B; when expressed as a two's complement number, where (N-1)>i>Z and (N-l)>Z>0;
said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit includes L offset-extending bits Pk, where (N-Z)>L>1 and L>k>0, and;
(i) said address offset generating circuit has logic configured to generate bits Bj of said N-bit address offset with values given by Bj = S for all values of j such that (N-l)>j>;(N-L-l) if all of said offset-extending bits Pk of said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit have respective predetermined values Dk; and
(ii) said address offset generating circuit has logic configured to generate bits Bj of said N-bit address offset, where (N-l)>j>(N-L-l), by performing a predetermined one-to-one mapping from combinations of values of said offset- extending bits Pk and said offset value sign specifying bit S of said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit to combinations of values of Bj other than the combination Bj - 1 for all values of j such that (N-l)>j>(N-L-l) and the combination Bj = 0 for all values of j such that (N-1)>J>(N-L-1), said address offset generating circuit performing said mapping if any of said offset-extending bits Pk does not have said predetermined value Dk.
Apparatus as claimed in claim 1, wherein said address offset generating circuit is configured such that said predetermined values Dk are all equal to 1.
Apparatus as claimed in any one of claims 1 and 2, wherein said address offset generating circuit is configured to generate bit values Bj of said N-

bit address offset each bit value Bj being generated by said address offset generating circuit with a value given by a respective predetermined one of:
Bj = S for one directly sign bit specified value j;
Bj = S XOR Pk(j) XOR Dk(j) where k(j) is a one-to-one index mapping from
values of j, excluding said directly sign bit specified value of j, to values of k.
4. Apparatus as claimed in claim 3, wherein said address offset generating
circuit is configured such that said directly sign bit specified value of j is
N-l.
5. Apparatus as claimed in any one of the preceding claims, wherein said address offset generating instruction decoded by said instruction decoder to control said address offset generating circuit is a branch instruction and said N bit address offset generated by said address offset generating circuit is an N-bit branch target address offset.
6. Apparatus as claimed in claim 5, wherein said apparatus for processing data combines said N-bit branch target address offset generated by said address offset generating circuit with a program address of said branch instruction to generate a branch target address.
7. Apparatus as claimed in any one of the preceding claims, wherein said instruction decoder decodes said address offset generating instruction such that said N-bit address offset generated by said address offset generating circuit is further sign extended by said address offset generating instruction prior to use.
8. Apparatus as claimed in any one of the preceding claims, wherein said address offset generating circuit is configured such that said L=2.
9. Apparatus as claimed in any one of the preceding claims, wherein said address offset generating circuit is configured such that said N=25.
10. Apparatus as claimed in any one of the preceding claims, wherein said address offset generating circuit is configured such that said Z is one of 1 and 2.

11. Apparatus as claimed in any one of the preceding claims, wherein said address offset generating circuit is configured to generate bits BN-2-L to Bz of said N-bit address outlet with values directly specified in said address offset generating instruction.

Documents:

4823-DELNP-2005-Abstract-(05-03-2008).pdf

4823-delnp-2005-abstract-(21-11-2008).pdf

4823-delnp-2005-abstract.pdf

4823-DELNP-2005-Claims-(05-03-2008).pdf

4823-delnp-2005-claims-(21-11-2008).pdf

4823-delnp-2005-claims.pdf

4823-delnp-2005-complete specification (granted).pdf

4823-DELNP-2005-Correspondence-Others-(05-03-2008).pdf

4823-delnp-2005-correspondence-others.pdf

4823-DELNP-2005-Description (Complete)-(05-03-2008).pdf

4823-delnp-2005-description (complete)-(21-11-2008).pdf

4823-delnp-2005-description (complete).pdf

4823-delnp-2005-drawings.pdf

4823-DELNP-2005-Form-1-(05-03-2008).pdf

4823-delnp-2005-form-1-(21-11-2008).pdf

4823-delnp-2005-form-1.pdf

4823-delnp-2005-form-18.pdf

4823-DELNP-2005-Form-2-(05-03-2008).pdf

4823-delnp-2005-form-2-(21-11-2008).pdf

4823-delnp-2005-form-2.pdf

4823-DELNP-2005-Form-3-(05-03-2008).pdf

4823-delnp-2005-form-3.pdf

4823-delnp-2005-form-5.pdf

4823-DELNP-2005-GPA-(05-03-2008).pdf

4823-delnp-2005-gpa.pdf

4823-DELNP-2005-Others-(05-03-2008).pdf

4823-delnp-2005-pct-101.pdf

4823-delnp-2005-pct-210.pdf

4823-DELNP-2005-Petition-137-(05-03-2008).pdf


Patent Number 234441
Indian Patent Application Number 4823/DELNP/2005
PG Journal Number 25/2009
Publication Date 19-Jun-2009
Grant Date 28-May-2009
Date of Filing 21-Oct-2005
Name of Patentee ARM LIMITED
Applicant Address 110 FULBOURN ROAD, CHERRY HINTON, COMBRIDGE CB1 9NJ, ENGLAND.
Inventors:
# Inventor's Name Inventor's Address
1 DAVID JAMES SEAL 14 HIGH STREET, CHERRY HINTON, CAMBRIDGE CB1 9HZ, ENGLAND.
PCT International Classification Number G06F 9/32
PCT International Application Number PCT/GB2003/005680
PCT International Filing date 2003-12-30
PCT Conventions:
# PCT Application Number Date of Convention Priority Country
1 0313510.0 2003-06-11 U.K.