GB2461849A - Push immediate instruction with several operands - Google Patents

Push immediate instruction with several operands Download PDF

Info

Publication number
GB2461849A
GB2461849A GB0812663A GB0812663A GB2461849A GB 2461849 A GB2461849 A GB 2461849A GB 0812663 A GB0812663 A GB 0812663A GB 0812663 A GB0812663 A GB 0812663A GB 2461849 A GB2461849 A GB 2461849A
Authority
GB
United Kingdom
Prior art keywords
instruction
stack
operand
processor
push
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.)
Withdrawn
Application number
GB0812663A
Other versions
GB0812663D0 (en
Inventor
Alistair Guy Morfey
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.)
Cambridge Consultants Ltd
Original Assignee
Cambridge Consultants 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 Cambridge Consultants Ltd filed Critical Cambridge Consultants Ltd
Priority to GB0812663A priority Critical patent/GB2461849A/en
Publication of GB0812663D0 publication Critical patent/GB0812663D0/en
Priority to PCT/GB2009/001313 priority patent/WO2010004242A2/en
Priority to PCT/GB2009/001318 priority patent/WO2010004245A1/en
Priority to PCT/GB2009/001309 priority patent/WO2010004240A1/en
Priority to PCT/GB2009/001314 priority patent/WO2010004243A2/en
Priority to US13/003,432 priority patent/US9645949B2/en
Publication of GB2461849A publication Critical patent/GB2461849A/en
Withdrawn legal-status Critical Current

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/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • 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
    • 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/30181Instruction operation extension or modification
    • G06F9/30189Instruction operation extension or modification according to execution mode, e.g. mode flag
    • 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, look ahead
    • G06F9/3861Recovery, e.g. branch miss-prediction, exception handling

Abstract

A processor has an instruction to push multiple data values onto the program stack, where the data values are given in the instruction. It may have several different instructions, each of which pushes a different number of values of onto the stack. The values may be of different sizes in the different instructions. The values in a single instruction may all be of the same size. Before the data is written, the values may be sign extended or zero extended to match the size of data stored on the stack. It may be possible to interrupt the instruction and resume it after the completion of the interrupt. The state of the instruction may be stored in a register to allow the instruction to be resumed.

Description

Processor with push instruction The present invention relates to a processor adapted to execute a push instruction.
Many processors utilise stacks as temporary data storage, for example when passing data from one code portion to another, for example to a subroutine. Stacks are also used, for example, to store the program counter (PC) when branching to a subroutine to allow execution to be resumed at the correct point on return from the subroutine, to store processor state whilst handling events such as interrupts and exceptions, and to store local variables for a subroutine (for example in a stack frame).
A processor architecture may permit a stack to be accessed directly by use of standard load and store instructions. Such loads and stores may be specified relative to a stack pointer (SP), which may be explicitly modified by a program (by incrementing or decrementing). However, to simplify stack manipulation, processor instruction sets often include special-purpose stack manipulation instructions, in particular to place values onto the stack ("push") and remove values from the stack ("pop"). These instructions combine a memory access (load or store) and stack pointer update into a single operation.
However, a conventional way of storing values to a stack involves first placing the values in registers and then pushing the registers to the stack, and this can be inefficient, especially where many values are to be placed on the stack.
The present invention seeks to alleviate some problems and limitations associated with
prior art processor designs and instruction sets.
In a first aspect of the invention, there is provided a processor adapted (or configured) to execute (or having means for executing) a push immediate instruction specifying a plurality of immediate values (or operands) to be pushed to a stack.
By providing a multi-operand push immediate instruction, code density and execution efficiency can be improved.
The processor is preferably adapted or configured to execute the instruction by way of instruction decoding and executing circuitry in the processor, which may be provided as a hardware circuit and/or may include a microcode engine for executing the instruction in accordance with a microcode program stored, for example, in a read-only-memory forming part of the processor.
The terms "immediate value" and "immediate operand" refer to an operand of an instruction having a value which is specified directly in the instruction (i.e. the operand value is known at compile or link time, for example being written as a literal value in the source code, and is encoded directly as a binary representation of the value in the machine code instruction). By way of comparison, non-immediate operands typically take the form of register or memory references. The term "immediate instruction" correspondingly refers to an instruction having at least one immediate operand.
The processor is preferably adapted to execute multiple formats (or variants) of the push immediate instruction, each instruction format having a different data format for the immediate values to be pushed to the stack. This can provide greater flexibility. Each data format is preferably defined by the number of immediate operands included in the instruction format and/or an operand data size for each immediate operand included in the instruction format. Thus, different instruction formats have different numbers of operands and/or different operand data sizes.
For example, the instruction formats may include a plurality of formats having respective different numbers of operands, and/or may include a plurality of formats having respective different operand data sizes. The term "data size" preferably refers to the number of bits used to encode an operand or other data element (the term "width" is also used herein to refer to the size of a data item).
The instruction formats preferably include a plurality of formats having an operand data field of a common size, each of the plurality of formats corresponding to a distinct partitioning of the data field into one or more data elements for holding respective immediate operands to be pushed to the stack.
In other words, the instruction variants have the same size data field for holding the operands, but divide this fixed data field into different numbers of operands (for example, a first variant may have two operands, whilst a second variant has four correspondingly smaller operands). Some formats may not use all the space available in the data field.
By using different variants of the instruction with the same data field size, a standardized instruction encoding can be provided, which can improve instruction encoding, decoding and instruction fetch efficiency. The instruction formats may include two or more instruction families, each family having a different common size for the data field which is common to the instruction formats in that family, the instructions in each family dividing the data field into different numbers/sizes of operands. Thus, for example, a first family of instruction formats may include a 16-bit data field, with individual instructions providing one 16-bit operand, two 8-bit operands and four 4-bit operands. A second family of instruction formats may include a 32-bit data field, with individual instructions providing one 32-bit operand, two 16-bit operands and four 8-bit operands.
Preferably, for each instruction format having multiple data elements, each data element is of equal size. The formats preferably include a first format having a single operand of a given data size, and one or more further formats having multiple operands of a size smaller than the given data size. In particular, the formats preferably include a first format having a single operand of a given data size S, and one or more further formats each including N operands of a data size S/N for a respective value of N. For example, the formats may include a first format having a single operand of a given data size, a second format having two operands of half the given size, and preferably a third data format having four operands of a quarter the given size. The formats may further comprise a further data format having three operands of a quarter the given size (the format may include unused space corresponding to the fourth quarter of the operand
data field).
The size of the data field for holding the one or more operands of an instruction format (S in the above example) preferably corresponds to the size of data items stored on the stack (which is typically but not necessarily the processor word-size) or a multiple of that size. Thus, in some embodiments the given size is the processor's word size. This may, for example, be one of: 8 bits, 1 6bits, 32bits, 64bits or 1 28bits.
The size (typically measured in bits) of the data items (or data elements) stored on a stack is referred to herein as the stack element size or stack width. A stack typically stores zero or more data elements, each of a fixed data element size. Thus, the term "16-bit stack" refers to a stack storing 16-bit values. Different processor architectures may support different stack widths (stack sizes), e.g. 16-bit, 32-bit and 64-bit stacks.
Preferably, the processor is adapted to perform a push operation for each immediate value to push each immediate value to the stack.
The stack preferably stores elements of a given data size, the processor being adapted to extend an operand having a size smaller than the given data size to the given data size when pushing the operand to the stack.
Preferably, each push operation pushes a full word of data to the stack (or alternatively an amount of data that is a multiple of the word size), regardless of the operand size.
Thus, for example, in a 16-bit architecture using a 16-bit stack, a 4-bit operand would be pushed as a 16-bit value. To obtain this value, the operand may be sign-extended or zero-extended.
By extending operands to the stack element size (typically the word size), stack integrity can be ensured and stack management simplified.
The instruction preferably specifies a sequence of immediate values, the processor being adapted to perform the push operations in accordance with the sequence specified in the instruction.
The processor is preferably adapted to execute the instruction as a non-atomic operation, meaning that execution of the instruction can be interrupted by an interrupt or exception.
Each individual push operation, on the other hand, is preferably an atomic operation, meaning that execution of the individual push operation cannot be interrupted by interrupts or exceptions. Typically, each push operation comprises a stack pointer update and a memory write to the stack memory, which together form an atomic, non-interruptible operation (also referred to herein as an instruction atom).
As used herein, the term "exception" preferably refers to internal synchronous events (that is to say, events that are internal and synchronous to a program, for example error conditions caused by the program, such as memory access violations, division-by-zero errors, and the like). The term "interrupt" preferably refers to external asynchronous events, such as external hardware interrupts. However, more generally, the terms interrupt/exception may refer to any interrupt-like or exception-like events which may be used to interrupt the execution of a program or instruction.
The processor is thus preferably adapted to process an interrupt or exception during execution of the instruction, wherein processing the interrupt or exception preferably comprises invoking an interrupt or exception handling routine. As mentioned, this can preferably only be done between instruction atoms (or in other words at atom boundaries).
By allowing interrupt/exception handling during the execution of the instruction, interrupt latency can be reduced. Also, exceptions arising during execution of a push operation (for example, a memory exception) can be dealt with before the next push operation is carried out. However, to ensure stack integrity, the processor is preferably adapted to prevent an interrupt or exception from being processed during an individual push operation.
The processor preferably comprises a register field for storing an indication of the execution progress of the instruction, the processor adapted to update the register field after completion of each individual push operation. The register field may operate as a counter, being incremented (or decremented) after each push operation. Alternatively, the register field may indicate the next operand to be pushed in some other way. The processor is preferably adapted, in response to detecting an interrupt or exception after completion of a push operation, to save the value of the register field to a stack, execute an interrupt or exception handling routine, and return the saved value to the register field from the stack after completion of the interrupt or exception handling routine. The processor is preferably adapted to resume execution of the instruction after handling an interrupt or exception in accordance with the register field.
The ability described herein to interrupt a push immediate instruction, in response to an interrupt or exception, during execution of the instruction (between pushes of individual operands) may also be provided for any other instructions involving multiple operands which are processed in separate steps. For example, these features may be provided for other stack manipulation instructions, such as other types of push instructions (with non-immediate operands, e.g. register pushes) and also pop instructions.
The plurality of immediate values may be binary values. The processor may be adapted, for each binary value, to push to the stack a multi-bit value (typically stack width or word width) representing a truth value corresponding to the binary value (e.g. a byte or word corresponding to the binary value).
In a further aspect of the invention, there is provided a processor adapted to execute a push instruction for pushing a data value to a stack, wherein the stack has a given stack element size, and wherein the instruction comprises an immediate operand of a data size smaller than the stack element size, the processor being adapted to extend the immediate operand to the stack element size, and to store the extended operand on the stack. The processor is preferably adapted to sign-extend or to zero-extend the immediate operand. The given stack element size may be equal to the processor's word size.
In a further aspect of the invention, there is provided a processor adapted to execute a push immediate instruction for pushing a value specified in an operand of the instruction to a stack, wherein the operand is a binary operand. The term "binary operand" preferably refers to an operand having only two possible values, typically represented as "0" and "1". The operand is preferably encoded using a single bit. The processor is preferably adapted to push a multi-bit value (preferably of full stack or word width as discussed above) to the stack corresponding to the binary operand. The value pushed to the stack preferably represents a truth value corresponding to the binary operand. The push immediate instruction preferably comprises a plurality of binary operands, the processor adapted to push a value (preferably of full stack or word width) corresponding to each operand to the stack.
In a further aspect, the invention provides a processor adapted to execute a stack manipulation instruction having a plurality of operands (or other multi-operand instruction), wherein the processor is adapted to process an interrupt or exception during execution of the instruction. The processor is preferably adapted to perform a stack manipulation operation (or other operation) for each operand, wherein the instruction is interruptible by interrupts or exceptions between individual stack manipulation operations (or other operations) but preferably not during individual stack manipulation operations (or other operations). The stack manipulation instruction may be a push instruction or pop instruction, preferably a push immediate instruction as described elsewhere herein.
In a further aspect of the invention, there is provided a method of executing a push immediate instruction for pushing data to a stack, the instruction comprising a plurality of immediate operands, the method comprising pushing a data element corresponding to each immediate operand to the stack. The method may comprise determining a data format of the instruction, the data format selected from a plurality of data formats of the instruction, the plurality of data formats corresponding to different numbers and/or sizes of operands, and executing the instruction in accordance with the determined data format.
The data element pushed to the stack preferably has a value corresponding to the value of the operand but may have a different data size (e.g. a binary value pushed as a whole word). In particular, where the operand size differs from the stack element size (typically the processor word size), the method preferably comprises extending (e.g. zero-extending or sign-extending) the operand to the stack element size (e.g. the word size).
Thus, for example, in a 16-bit architecture with a 16-bit stack, 4-bit or 8-bit operands would be zero-extended or sign-extended to 16 bits, while 16 bit operands would not need to be extended.
In some cases, the operand size may be larger than the stack element size, in which case the operand may be truncated or otherwise reduced in size, or may be placed on the stack as multiple stack elements.
The method may comprise processing an interrupt or exception during execution of the instruction, preferably between push operations performed for respective operands.
In a further aspect, the invention provides a method of executing a push instruction for pushing a data value to a stack, wherein the stack has a given stack element size, and wherein the instruction comprises an immediate operand of a data size different (preferably smaller) than the stack element size, the method comprising adjusting (preferably extending) the immediate operand to the stack element size, and storing the adjusted (preferably extended) operand on the stack.
In a further aspect, the invention provides a method of executing a push immediate instruction for pushing a value specified in an operand of the instruction to a stack, wherein the operand is a binary operand, the method comprising storing a value corresponding to the binary operand on the stack.
In a further aspect of the invention, there is provided a method of executing a stack manipulation instruction having a plurality of operands, comprising: performing a stack manipulation operation for each operand; determining, after completion of each stack manipulation operation, whether an interrupt or exception is waiting to be processed; and, if it is determined that an interrupt or exception is waiting to be processed, processing the interrupt or exception. The method preferably comprises resuming execution of the stack manipulation instruction with the next operand after the interrupt or exception has been processed. The stack manipulation instruction may be a push instruction or pop instruction, preferably a push immediate instruction as described elsewhere herein.
In a further aspect of the invention, there is provided a computer program or computer program product comprising software code for execution on a processor, the software code including a push immediate instruction having a plurality of immediate operands each specifying a value to be pushed to a stack. The software code preferably includes a plurality of push immediate instructions, at least two of the instructions having distinct (different) data formats. The at least two instructions preferably comprise corresponding data fields of the same size for holding one or more operands, the corresponding data fields being divided into respective different numbers of operands. Thus, for each instruction, the sum of its operand data sizes equals the size of the data field, which is common to two or more instructions. Is some instructions, the data field may be divided into operand subfields of equal size, in which case the total data field size is equal to the number of operands times the individual operand size.
In a further aspect, the invention provides a computer program or computer program product comprising software code for execution on a processor, the processor providing access to a stack having a given stack element size, the software code including a push instruction for pushing a data value to the stack, wherein the instruction comprises an immediate operand of a data size different (preferably smaller) than the stack element size.
In a further aspect of the invention, there is also provided a computer program or computer program product comprising software code for execution on a processor, the software code including a push immediate instruction having a binary immediate operand.
The invention also provides an assembler or compiler comprising means for generating a computer program as set out above or more generally for generating a push immediate -10-instruction as set out herein.
The invention also provides a processor adapted to perform any method as set out herein and/or adapted to execute any computer program as set out herein.
As set out above, the push immediate instruction described herein may form part of the instruction set of a hardware processor. Alternatively, the instruction may form part of the instruction set of a software-simulated processor or virtual machine. Accordingly, the invention also provides a virtual machine (implemented by a computer program) adapted to execute a push immediate instruction as set out herein.
The invention also provides a computer program and a computer program product comprising software code adapted, when executed on a data processing apparatus, to perform any of the methods described herein, including any or all of their component steps.
The invention also provides a computer program and a computer program product comprising software code which, when executed on a data processing apparatus, comprises any of the apparatus features described herein.
The invention also provides a computer program and a computer program product having an operating system which supports a computer program for carrying out any of the methods described herein and/or for embodying any of the apparatus features described herein.
The invention also provides a computer readab'e medium having stored thereon the computer program as aforesaid.
The invention also provides a signal carrying the computer program as aforesaid, and a method of transmitting such a signal.
The invention extends to methods and/or apparatus substantially as herein described -11 -with reference to the accompanying drawings.
Any feature in one aspect of the invention may be applied to other aspects of the invention, in any appropriate combination. In particular, method aspects may be applied to apparatus aspects, and vice versa.
Furthermore, features implemented in hardware may be implemented in software, and vice versa. Any reference to software and hardware features herein should be construed accordingly. The terms "adapted to", "configured to" and "having means for" doing something are used interchangeably herein.
The following documents are hereby incorporated by reference: GB2294137, GB2294138, GB0509738.1, GB0706918.0 and W09609583. Also incorporated by reference are the GB Patent Applications filed the same day and having the following Agent references: P32694, P32696 and P32698. Any feature in any of these documents may be combined with any feature described herein in any appropriate combination.
The invention will now be described, purely by way of example, with reference to the following drawings, in which:-Figure 1 illustrates a data processing apparatus in overview, including a processor; Figure 2 shows the processor core; Figure 3 illustrates interconnection between the processor core, memory management unit and interrupt vector controller; Figure 4 illustrates a flags register of the processor; Figures 5A -5E illustrate different formats of a push immediate instruction; Figures 6A and 6B illustrate encoding of the push immediate instruction; Figures 7A and 7B illustrate the execution of the push immediate instruction; Figure 8 illustrates the division of the push immediate instruction into instruction atoms; and Figure 9 illustrates modes and states of the processor.
Overview Figure 1 shows a data processing apparatus 1 implemented in the form of an ASIC (application specific integrated circuit) semiconductor device, comprising a central processing unit or processor 10, for running user programs, connected via a data bus 12 to analogue circuitry 14 and digital circuitry 16, and also to random-access memory (RAM) 18 and read-only memory (ROM) 20.
Processor 10 may be, for example, one of the XAP range of processors as supplied by Cambridge Consultants Ltd, Cambridge, England, such as the XAP5, which is a 16-bit RISC processor with von Neumann architecture, the 16-bit XAP4 or the 32-bit XAP3.
Further details relating to these processors and their associated instruction sets can be found in GB 2427722, WO 2006/120470 and PCT/GB2007/001323, which are incorporated herein by reference. The processor 10 may be described to those skilled in the art as an IP-core using a hardware description language such as Verilog or VHDL in RTL (register transfer level) code.
The processor 10 further comprises a memory management unit 22 (MMU), for interfacing with the RAM 18, ROM 20, custom analogue circuits 14, and custom digital circuits 16; a serial interface (SIF) 24, to facilitate debugging and/or control of the processor 10; and an interrupt vector controller (IVC) 26, for handling interrupts (external asynchronous events), including both maskable interrupts and non-maskable interrupts.
Analogue circuitry 14 and digital circuitry 16 are custom built for specific applications; likewise, the MMU 22 and IVC 26 may be customised as required. The processor core 11 is intended to be fixed and unchanged from one ASIC to another. RAM 18 and ROM may comprise on-chip or off-chip memory.
Persons skilled in the art will appreciate that the data processing unit 1 may be implemented, for example, in a semiconductor material such as silicon, for example, CMOS, and be suitable for ASIC or FPGA applications. -13-
Architecture Processor 10 uses a load-store architecture, as will be familiar to those skilled in the art of processor design.
Figure 2 shows a block diagram of the hardware architecture of the processor core 11.
Processor core 11 can be seen to comprise an arithmetic logic unit (ALU) 100, serial interlace unit (SIF) 24, interrupt and exception controller 27 and a bank of registers 120.
The ALU 100 is connected to an address generator unit 160. The processor 10 is also provided with an instruction fetch unit 150 and an instruction decode unit 152. A plurality of data input and output lines are shown, both between the constituent units of the processor 10 and to/from the processor itself, as will be familiar to those skilled in the art.
For example, in Figure 2, the data lines and opcodes (op) use the following notation: Rd destination register Rs primary source register Rt secondary source register Rx index register Ra base address register Memory management unit (MMU) and interrupt vector controller (JVC) Figure 3 shows the interconnection between the processor core 11, the MMU 22 and the IVC 26 in more detail. As can be seen from Figure 3, the processor core 11 may be packaged together with the IVC and the MMU, which are implemented as part of an ASIC or FPGA.
The MMU 22 is used to interface with various memories connected to the processor 10, for example, RAM, ROM, Flash and 10 registers. The IVC 26 is used to prioritise interrupt sources and provide interrupt numbers and priority levels for the interrupts to the processor core 11.
-14 -ReQisters Processor core 11 includes a small amount of on-chip storage in the form of registers, which provides fast-accessible working memory for the processor.
Figure 2 shows some of the registers used by the processor 10. These comprise several different types according to function, including: * general purpose registers 130 -used for the normal operands for the majority of tasks of the instruction set * address registers 132 -used to hold memory addresses * special registers 134 -used, for example, to indicate processor status * breakpoint registers 136 -used in debugging As shown, one possible example comprises eight 16-bit general purpose registers 130 (R0-R7); four 24-bit address registers 132; three 16-bit "special" registers 134 and four 24-bit breakpoint registers 136. Examples of address registers include the program counter register (PC), which normally points to the next instruction to be executed; vector pointer register (VP), for pointing to the base of a vector table, the vector table containing a set of pointers (vectors) to software interrupt/exception handlers; and at least one stack pointer (SP), for providing access to a stack.
An "operational flags" or FLAGS special register may also be provided for storing various flags and fields, for example, "carry" (C), "mode" (M) and "interrupt" (I) flags. A "state" (S) field in the FLAGS register is also provided for recording the execution progress of an instruction, to allow interrupts and exceptions to be processed during execution of certain instructions, as explained in more detail below. Figure 4 illustrates the FLAGS register, showing the bit ranges of various fields, including, for example, the "state" field S at bit positions [11:7].
Stacks Temporary working storage for the processor 10 is provided by means of conventional stacks, as will be familiar to those skilled in the art, which are last-in first-out (LIFO) data structures, wherein register values may be pushed' onto, and subsequently popped' off, the stacks. A stack pointer register (SP) is used to refer to locations in the stack.
In one example, the processor 10 is provided with two stack pointer registers, one (SP1) which points to Stackl, used when the processor is in a User or Trusted mode, the other (SPO) which points to StackO, used when the processor is in a Supervisor or Interrupt mode. Additionally, in this embodiment, StackO is also used when the processor is in a recovery state used to handle errors arising in Supervisor or Interrupt mode, and in a non-maskable interrupt state for handling non-maskable interrupts (e.g. hardware errors).
Modes and states of the processor, and transitions between them, are summarised in Figure 9.
Embodiments of the present invention relate to instructions for pushing data to a stack.
Such instructions may be provided in the context of the exemplary processor architecture described above, but may also be provided in different processor architectures. The following detailed description of push instructions assumes a 1 6-bit architecture using 16-bit stacks, unless the context requires otherwise. The description further assumes that the stack grows downwards from a stack base address (though alternatively an upwards- growing stack could be used), and assumes a memory architecture based on byte-addressing (where a byte is an 8-bit entity).
Furthermore, in the following description, the prefix "Ox" is used to denote a hexadecimal number (for example "Ox5B").
PushinQ data to a stack A common mechanism for transferring data from one software component to another (e.g. from a code segment to a subroutine) is via a stack.
As a typical example, a program may place arguments for a subroutine on the stack, before calling the subroutine with a branch instruction (e.g. a branch-to-subroutine -16-instruction). The format of this data is determined by what is expected by the called subroutine, and the calling program must prepare the transferred data in the same format.
Another example is when a software handler prepares data on the stack before executing a return instruction to return from a subroutine In all such cases the value to be pushed to the stack is sometimes a constant that is known at software compile or link time. The traditional way of dealing with such cases is to perform a "move" type instruction to move the constant to a register, and then push that register to the stack: mov.i %rO, #Oxl 234 push {%rO}, #0 In this code example, %rO references register RO. The "mov.i" instruction moves an immediate value (#0x1234) to register RO. The symbol "#" denotes a numeric literal value, in this case specifying an immediate operand. The push instruction then pushes the content of that register to the stack.
In the present architecture, the assembler syntax for the push instruction is as follows: push RegList, #offset The RegList operand specifies a list of one or more registers, the contents of which are to be pushed to the stack. The offset can take values in the range 0, 2, ..., 252, 254 (for a 16-bit stack; for a 32-bit stack the possible offsets would increase in four byte steps).
The result of the execution of the push instruction is: * The stack pointer is decreased by #offset+2n, where n is the number of normal selected registers in RegList.
* The selected registers are stored to memory, as specified in RegList. Higher numbered registers are stored first and to high memory addresses. Lower numbered registers are stored last and to lower stack addresses.
The offset is typically used to decrease the stack pointer by a further amount to create a stack frame for the called subroutine's local variables. However, in the examples given herein, the offset is always 0. Corresponding "pop" instructions are also provided for reading stored values back from the stack and increasing the stack pointer to thereby remove the values from the stack.
Push immediate instruction Preferred embodiments of the present invention provide a specialised type of push instruction having immediate operands. An example of this instruction will now be described, which is referred to herein as the "push.i" (push immediate) instruction.
The "push.i" instruction pushes one to four constants (immediate values) directly to the stack. Different variants of the instruction are provided with different operand data formats, to push different numbers of operands with different operand data sizes.
In this example, the present processor architecture preferably utilises 1 6-bit stacks, and provides the following 32-bit instructions, each having a total operand size of 16 bits: push.i {#0x1234}, #0 I/One 16-bit number. -32768 to +32767 push.i {#120, #-67), #0 I/Two 8-bit signed numbers. -128 to +127.
push.i {#0, #2, #-7}, #0 II Three 4-bit signed numbers. -8 to �7.
push.i {#5, #-7, #5, #-6}, #0 II Four 4-bit signed numbers. -8 to �7.
In a preferred example, the offset (the second operand) can only be #0, and is included for consistency with the syntax of the standard "push" instruction set out above (and corresponding "pop" instruction). It indicates that there is no additional adjustment to the stack pointer (SP), whereas the regular push and pop instructions can make additional adjustments to SP. The "push.i" instruction simply decrements SP by 2 for every word it pushes to the stack. -18-
Each immediate value specified in the instructions is pushed to the stack in a push operation. The values are preferably pushed in the order specified in the instruction, i.e. preferably from left to right. Preferably, every push is for a full 16-bit word (or multiple words in the examples below) since, in the described architecture, stack pushes and pops can only be in word-sized quanta (though alternative implementations could provide for push and pop operations with different data sizes). Thus, operands which are smaller than 16 bits are sign-extended (or alternatively zero extended) to the full 16-bit stack width.
Similarly, in an alternative architecture having a 32-bit stack, the data size for every push and pop is 32 bits, and push immediate instructions are provided for pushing 32 bits of data to the stack. For example, the following four 48-bit instructions may be provided, that allow larger operands to be used (where the total operand size of the instructions is 32 bits): push.i {#0x12345678}, #0 I/One 32-bit number. -2G to +2G-1.
push.i {#1 20, #-67}, #0 II Two 16-bit signed numbers. -32768 to +32767.
push.i {#0, #12, #-9}, #0 I/Three 8-bit signed numbers. -128 to +127.
push.i (#5, #-7, #15, #-16}, #0 II Four 8-bit signed numbers. -128 to +127.
A preferred 32-bit implementation may provide both the 16-bit and 32-bit variants of the push instructions set out above (with all operands, including those of the 16-bit variants, extended to the full 32 bit stack width).
It is common for the immediate values to be 0 or 1 (often used to represent Boolean values or truth values, i.e. "True" or "False", in software). Preferably, the instruction set therefore includes 16-bit instruction variants for "pushi" with one, two, three or four operands, where the operands are all binary values, i.e. 0 or 1. This can enable compact code to be generated, for example, when Boolean values are to be passed in a function call, e.g.: push.i {0, 1, 1,0), #0 This instruction performs four 16-bit stack pushes, but is only a 16-bit instruction. -19-
The "push.i" instruction can be used when the operand values are known at compile/link time. The benefits of using the "push.i" instruction (compared to the previous example of a "mov.i" instruction followed by a standard register "push" instruction) include: * No registers are corrupted. Therefore the programmer is less likely to need to temporarily store register contents to the stack (save then restore later). This can lead to higher code density, faster execution, lower energy (for a given function), and less memory usage.
* Code density is improved since fewer instructions are used.
The "push.i" instruction can be particularly useful in embedded applications, where code is targeted towards a specific hardware platform and is often designed for efficiency rather than flexibility. As a result, operand values are more likely to be known or resolvable at compile/link time. By way of comparison, code written for general-purpose processors is often designed to be general-purpose, portable, and relocatable, and therefore values are less likely to be known at compile/link time.
When designing processor instruction sets, to reduce instruction size and complexity, it is often found to be desirable that a given instruction should not be allowed to contain more than one large immediate operand. This can be particularly relevant for RISC processors. For example, to store a specific large immediate to a particular address, instruction sequence (A) below is often considered to be preferable to instruction (B): (A) mov.i %rO, #Oxl 234 // First big immediate = #Oxl 234 st.i %rO, @ (#OxABCD, %r2) // Second big immediate = #OxABCD (B) st.i #0x1234, @(#OxABCD, %r2) In these examples, the notation "@(offset, base address)" represents displacement addressing, in this case using an offset of #OxABCD and a base address taken from register R2. Example (B) would require a very large instruction encoding to contain these two large immediate operands, #Oxl 234 and #OxABCD.
* -20-However, for the "push.i" instruction, this limitation is less problematic, since push instructions do not need to pass an immediate value for the target memory address -the target address is implicit and is given by the stack pointer (SP), which is automatically decremented by push instructions and incremented by pop instructions. The "pushi" instruction therefore only needs to describe one large immediate operand (for the value to be pushed to the stack): push.i {#0x1234), #0 As mentioned above, the #0 in this notation is given for consistency with the regular "push" instruction (where it represents an offset) but in the preferred implementation is always zero for the "push.i" instruction, and so is not a second immediate operand.
Preferably, the instruction set does allow multiple immediate operands to be specified, to push between two and four values to the stack, but only for constrained value ranges, so that the total data size of the immediate operands is still constrained to a certain size (e.g. 16-bit or 32-bit, depending on the architecture). So the instruction still conforms to good design principles and enables good code density, despite allowing multiple immediate operands to be specified.
The "push.i" instruction (like regular "push" and "pop" instructions in the present architecture) is preferably an interruptible instruction, i.e. interrupts and exceptions can be processed during execution of the instruction. This ensures that, although multiple push operations may be carried out based on a single instruction, interrupt latency is not increased unduly. Specifically, each individual push operation (consisting of a stack memory write and a stack pointer update) is preferably atomic (i.e. cannot be interrupted by interrupts or exceptions), but the instruction as a whole can be interrupted in between each individual push operation. After the interrupt or exception has been handled, the instruction returns to complete from the correct point (stored in the FLAGS[S] register, as described in more detail below).
-21 -Instruction formats Examples of different instruction formats that may be provided will now be described with reference to Figures 5A to 5E. Each instruction format represents a variation of the "push.i" instruction with a different data format, i.e. having different numbers of operands and/or different operand data sizes.
Format 1: Pushes one 16-bit immediate as a 16-bit push: push.i {#OxABCD), #0 This instruction format is illustrated in Fig. 5A, where "10" represents the 16-bit immediate operand.
Format 2: Pushes two 8-bit signed immediates. Each one is a 16-bit push. Each one can have value -128 to 127: push.i {#120, #-67}, #0 This instruction format is illustrated in Fig. 5B. The 8-bit immediate operands are "iO" and "ii,,.
Format 3: Pushes three 4-bit immediates. Each one is a 16-bit push. Each one can have value -8 to 7: push.i {#0, #-6, #5), #0 This instruction format is illustrated in Fig. 50. The 4-bit immediate operands are "10", "ii", and "12". The remaining bits of the operand data field are unused ("0000").
Format 4: Pushes four 4-bit immediates. Each one is a 16-bit push. Each one can have value -810 7: push.i {#0, #6, #5, #-7), #0 This instruction format is illustrated in Fig. 50. The 4-bit immediate operands are "10", "ii ", "12", and Format 5: Pushes 1 to 4 immediates. Each one is a 16-bit push. Each one can have value 0 or 1.
-22 -push.i {#0, #0, #0, #1}, #0 This instruction format is illustrated in Fig.5E. The 1 -bit immediate binary operands are "10", "ii", "12", and "13". Unlike the previous instruction formats, this format is a 16-bit instruction.
Thus, for each of the 32-bit instruction formats (formats 1-4 described above), the* instruction comprises a data field of fixed size (bits [31:16]), which is subdivided into different numbers of operands with different individual operand sizes. In particular, format 1 provides a single operand using the full data field (16 bits), whilst format 2 divides the data field into two 8-bit operands, and format 4 divides the data field into four 4-bit operands (format 3 corresponds to format 4 but with one of the 4-bit operand fields unused). In this way, a standard instruction size can be provided, which can improve encoding and execution efficiency. The number of operands used is preferably specified
in a separate field of the instruction.
The formats described above are merely examples, and other instruction formats can be provided depending on requirements. For example, instruction formats with different operand numbers and/or sizes may be provided. Also, variants with unsigned integer operands may be provided instead of or in addition to the signed integer variants described above. Variants for floating point numbers or other data formats may also be provided.
Assembler syntax The following gives an example of an assembler syntax for a "push.i" instruction for use with a 16-bit stack: push.i {lmmediateList}, #offset Syntax rules are: * ImmediateList can contain 1 to 4 immediates.
* If ImmediateList contains 1 immediate, it can be any 16-bit value.
* If immediate list contains 2 immediates, they can only have values -12810 127.
* If immediate list contains 3 or 4 immediates, they can only have values -8 to 7.
-23 -Offset can only be 0.
Syntax examples are:
push.i (#OxABCD}, #0 II 32-bit instruction push.i {#Ox5B, #115), #0 II 32-bit instruction push.i {#6, #-4, #0}, #0 II 32-bit instruction push.i {#6, #4, #0, #-5}, #0 II 32-bit instruction push.i {#0, #0, #0, #1}, #0 /116-bit instruction The result of the execution of the instruction is: * The stack pointer (%sp) is decreased by (offset � 2w), where w is the number of 16-bit pushes. In practice, the offset is always 0.
* The immediates are stored to memory, left-most first to the highest address, right-most last to the lowest address (i.e. the list is interpreted in the same order as the RegisterList in the standard push instruction).
As mentioned previously, the instruction is executed in a number of steps, one for each immediate operand, with each step decreasing the stack pointer by two and storing a respective operand to the stack.
Encoding details The detailed encoding used in one embodiment is shown in Figure 6A for a 32b1t encoding covering formats 1-4 described above, and Figure 6B for format 5 having binary operands.
In the 32-bit instruction encoding illustrated in Figure 6A, the number of immediate operands is specified in the "lmmNum" field. In this example, a maximum of 4 immediates can be supplied.
The immediate operands themselves are contained in the "immlist" field. The "immlist" field is split into separate immediates in the following way, depending on the value of field -24 -"lmmNum": lmmNum Format of #immlist 0 {iO[15:0]} 1 { il[7:0]s, iO[7:0]s} 2 { 0000, i2[3:0]s, il[3:0]s, iO[3:Ols} 3 { i3[3:0]s, i2[3:0]s, il[3:O]s, iO[3:0]s} The range of the immediates depends on the number of immediates used: Number of Range of each immediates immediate 1 -32768 to 32767 2 -128to 127 3 -8to7 4 -8to7 The 16-bit instruction encoding is illustrated in Figure 6B. This is used for lists of between one and four 1-bit (binary) immediate operands. Here, immlist[4:O] is encoded as follows: immlist[4:O] Immediates 000la {#a} 001 ba {#a, #b} Olcba (#a, #b, #c} ldcba {#a, #b, #c, #d} Thus, the first "1" in the bit field signals the start of the list of immediate binary operands.
The following bits are the binary values which are to be pushed to the stack. Each binary operand is thus encoded with a single bit, and the instruction allows up to four such operands. This provides for a particularly compact encoding of an instruction for pushing Boolean-type values to a stack.
-25 -
Detailed example
The following is an example of a "push.i" instruction for pushing multiple binary values to the stack: push.i {#0, #1, #1, #1}, #0 II Pushes 0, then 1, then 1, then 1 to the stack II and adjusts SP accordingly.
On execution, the four immediate binary values specified in the instruction are placed on the stack and the stack pointer is decreased accordingly. This is illustrated in Figure 7A, which shows the stack 50 with the four newly added values #0, #1, #1, #1.
Since in the preferred example, a word is the smallest unit of data that can be placed on the stack, the binary operands are interpreted as words, e.g. Ox0000 and Ox000l.
Alternatively, in this special case ot binary values, an alternative encoding of the truth values could be used, e.g. #1 could be placed on the stack as OxFFFF. Nevertheless, in the encoded machine code instruction, each operand is represented by a single bit (as described above), thus giving a compact encoding.
The above "push.i" instruction example is equivalent to the following sequence of instructions, in which "add.32.i" is a 32-bit add instruction with an immediate operand, "st.i" is a store immediate instruction and "sp" is the stack pointer: add.32.i %sp, %sp, #-2 II Decrease Stack Pointer for 1 word st.i #0, @(0, %sp) II Store #0 to stack memory add.32.i %sp, %sp, #-2 II Decrease Stack Pointer for 1 word st.i #1, @(0, %sp) I/Store #1 to stack memory add.32.i %sp, %sp, #-2 II Decrease Stack Pointer for 1 word st.i #1, @(0, %sp) I/Store #1 to stack memory add.32.i %sp, %sp, #-2 II Decrease Stack Pointer for 1 word st.i #1, @(0, %sp) I/Store #1 to stack memory * 26 -Events during "push.i" Instruction execution The "push.i" instruction is split into multiple atomic push operations in order to reduce interrupt latency and to check for exceptions after each memory write (for example data errors or null pointer errors), each push operation performing a stack push for a respective immediate operand. Each individual push operation is thus preferably non-interruptible. Such non-interruptible units of instruction execution are referred to herein as "atoms".
For any multi-atom instruction, after each atom (in the case of "push.i", a stack memory write and SP update), register FLAGS[S] is incremented by 1 (or some other value depending on implementation) and the processor checks to see if there is an event (interrupt or exception) pending. If there is, the processor suspends the instruction, does a context push to the appropriate stack to save the processor state (this may be StackO or Stackl in the described architecture, depending on the mode the processor is in) and vectors to the relevant event handler. The context push includes the FLAGS register.
When the event handler completes with an "i-tie" (return from interrupt or exception) instruction, the original processor state including the FLAGS register is popped from the stack, thus returning to the FLAGS register the value of FLAGS[S] prior to the interrupt/exception handler being invoked. FLAGS[S] thus indicates the atom boundary at which the interrupt/exception was processed, allowing execution of the interrupted instruction to be resumed from that point. FLAGS[S] is set to 0 at the end of a multi-atom instruction and at the end of a context push.
Thus, in the case of the "push.i" instruction, the FLAGS register is used to maintain a progress indicator for the push instruction, in the form of a counter counting the completed push operations. On return from the event handler, the processor is able to determine which operands have already been pushed to the stack from the counter, and resume execution of the instruction with the next operand that has not yet been processed.
-27 -The subdivision of the execution of a "push.i" instruction into multiple atoms is illustrated in Figure 8, for the example: push.i {#6, #4, #0, #-5}, #0 Figure 8 illustrates the execution of the instruction 60, divided into atoms 62 corresponding to each individual push operation (one for each value to be pushed to the stack). Interrupts or exceptions may be processed at atom boundaries 64, but not during the execution of an atom 62. Thus, interrupt latency can be reduced whilst ensuring the correct execution of the instruction and maintaining the integrity of the stack.
In preferred embodiments, a "push.i" instruction takes a maximum of 6 clocks if there is an event pending.
The result of the execution of this instruction is illustrated in Figure 7B.
It will be understood that the present invention has been described above purely by way of example, and modifications of detail can be made within the scope of the invention.
For example, the "push.i" instruction described may form part of an instruction set for a virtual machine or simulated processor instead of a physical processor.
Each feature disclosed in the description, and (where appropriate) the claims and drawings may be provided independently or in any appropriate combination.

Claims (51)

  1. * 28 -CLAIMS: 1. A processor adapted to execute a push immediate instruction specifying a plurality of immediate values to be pushed to a stack.
  2. 2. A processor according to claim 1, wherein the processor is adapted to execute multiple formats of the push immediate instruction, each instruction format having a different data format for the immediate values to be pushed to the stack.
  3. 3. A processor according to claim 2, wherein each data format is defined by the number of immediate operands included in the instruction format and/or an operand data size for each immediate operand included in the instruction format.
  4. 4. A processor according to claim 2 or 3, wherein the instruction formats include a plurality of formats having an operand data field of a common size, each of the plurality of formats corresponding to a distinct partitioning of the data field into one or more data elements for holding respective immediate operands to be pushed to the stack.
  5. 5. A processor according to claim 4, wherein, for each instruction format having multiple data elements, each data element is of equal size.
  6. 6. A processor according to any of claims 2 to 5, wherein the formats include a first format having a single operand of a given data size S, and one or more further formats each including N operands of a data size S/N for a respective value of N.
  7. 7. A processor according to claim 6, wherein the formats include a first format having a single operand of a given data size, a second format having two operands of half the given size, and preferably a third data format having four operands of a quarter the given size.
  8. 8. A processor according to claim 7, wherein the formats further include a further data format having three operands of a quarter the given size.-29 -
  9. 9. A processor according to any of claims 6 to 8, wherein the given size is the stack width or processor word size, preferably one of: 8 bits, 1 6bits, 32bits, 64bits or 1 28bits.
  10. 10. A processor according to any of the preceding claims, adapted to perform a push operation for each immediate value to push each immediate value to the stack.
  11. 11. A processor according to claim 10, wherein the stack stores elements of a given data size, the processor being adapted to extend an operand having a size smaller than the given data size to the given data size when pushing the operand to the stack.
  12. 12. A processor according to claim 10 or 11, wherein the instruction specifies a sequence of immediate values, the processor being adapted to perform the push operations in accordance with the sequence specified in the instruction.
  13. 13. A processor according to any of claims 10 to 12, adapted to execute the instruction as a non-atomic operation, wherein each push operation is preferably an atomic operation.
  14. 14. A processor according to any of claims 10 to 13, adapted to process an interrupt or exception during execution of the instruction.
  15. 15. A processor according to claim 14, wherein processing the interrupt or exception comprises invoking an interrupt or exception handling routine.
  16. 16. A processor according to claim 14 or 15, adapted to prevent an interrupt or exception from being processed during a push operation.
  17. 17. A processor according to any of claims 10 to 16, comprising a register field for storing an indication of the execution progress of the instruction, the processor adapted to update the register field after completion of each push operation.-30 -
  18. 18. A processor according to claim 17, adapted, in response to detecting an interrupt or exception after completion of a push operation, to save the value of the register field to a stack, execute an interrupt or exception handling routine, and return the saved value to the register field from the stack after completion of the interrupt or exception handling routine.
  19. 19. A processor according to claim 17 or 18, adapted to resume execution of the instruction after handling an interrupt or exception in accordance with the register field.
  20. 20. A processor according to any of the preceding claims, wherein the plurality of immediate values are binary values.
  21. 21. A processor according to claim 20, adapted, for each binary value, to push to the stack a multi-bit value representing a truth value corresponding to the binary value.
  22. 22. A processor adapted to execute a push instruction for pushing a data value to a stack, wherein the stack has a given stack element size, and wherein the instruction comprises an immediate operand of a data size smaller than the stack element size, the processor being adapted to extend the immediate operand to the stack element size, and to store the extended operand on the stack.
  23. 23. A processor according to claim 22, wherein the processor is adapted to sign-extend the immediate operand.
  24. 24. A processor according to claim 22, wherein the processor is adapted to zero-extend the immediate operand.
  25. 25. A processor according to any of claims 22 to 24, wherein the given stack element size is equal to the processor's word size.
  26. 26. A processor adapted to execute a push immediate instruction for pushing a value specified in an operand of the instruction to a stack, wherein the operand is a binary operand.
  27. 27. A processor according to claim 26, wherein the processor is adapted to push a multi-bit value (preferably of stack or word width) to the stack corresponding to the binary operand.
  28. 28. A processor according to claim 26 or 27, wherein the value pushed to the stack represents a truth value corresponding to the binary operand.
  29. 29. A processor according to any of claims 26 to 28, wherein the push immediate instruction comprises a plurality of binary operands, the processor adapted to push a value corresponding to each operand to the stack.
  30. 30. A processor adapted to execute a stack manipulation instruction having a plurality of operands, wherein the processor is adapted to process an interrupt or exception during execution of the instruction.
  31. 31. A processor according to claim 30, adapted to perform a stack manipulation operation for each operand, wherein the instruction is interruptible by interrupts or exceptions between individual stack manipulation operations but preferably not during individual stack manipulation operations.
  32. 32. A processor according to claim 30 or 31, wherein the stack manipulation instruction is a push instruction or pop instruction, preferably a push immediate instruction.
  33. 33. A method of executing a push immediate instruction for pushing data to a stack, the instruction comprising a plurality of immediate operands, the method comprising pushing a data element corresponding to each immediate operand to the stack.
  34. 34. A method according to claim 33, comprising determining a data format of the instruction, the data format selected from a plurality of data formats of the instruction, the -32 -plurality of data formats corresponding to different numbers and/or sizes of operands, and executing the instruction in accordance with the determined data format.
  35. 35. A method according to claim 33 or 34, wherein the data element pushed to the stack has a value corresponding to the value of the operand but a different data size.
  36. 36. A method according to any of claims 33 to 35, wherein the stack stores elements of a given size, the method comprising, for an immediate operand having a smaller data size than the given size, extending the operand to the given size.
  37. 37. A method according to any of claims 33 to 36, comprising processing an interrupt or exception during execution of the instruction, preferably between push operations performed for respective operands.
  38. 38. A method of executing a push instruction for pushing a data value to a stack, wherein the stack has a given stack element size, and wherein the instruction comprises an immediate operand of a data size smaller than the stack element size, the method comprising extending the immediate operand to the stack element size, and storing the extended operand on the stack.
  39. 39. A method of executing a push immediate instruction for pushing a value specified in an operand of the instruction to a stack, wherein the operand is a binary operand, the method comprising storing a value corresponding to the binary operand on the stack.
  40. 40. A method of executing a stack manipulation instruction having a plurality of operands, comprising: performing a stack manipulation operation for each operand; determining, after completion of each stack manipulation operation, whether an interrupt or exception is waiting to be processed; and, if it is determined that an interrupt or exception is waiting to be processed, processing the interrupt or exception.
  41. 41. A method according to claim 40, comprising resuming execution of the stack manipulation instruction with the next operand after the interrupt or exception has been -33 -processed.
  42. 42. A computer program or computer program product comprising software code for execution on a processor, the software code including a push immediate instruction having a plurality of immediate operands each specifying a value to be pushed to a stack.
  43. 43. A computer program or computer program product according to claim 42, the software code including a plurality of push immediate instructions, at least two of the instructions having distinct data formats.
  44. 44. A computer program or computer program product according to claim 43, wherein the at least two instructions comprise corresponding data fields of the same size for holding one or more operands, the corresponding data fields being divided into respective different numbers of operands.
  45. 45. A computer program or computer program product comprising software code for execution on a processor, the processor providing access to a stack having a given stack element size, the software code including a push instruction for pushing a data value to the stack, wherein the instruction comprises an immediate operand of a data size smaller than the stack element size.
  46. 46. A computer program or computer program product comprising software code for execution on a processor, the software code including a push immediate instruction having a binary immediate operand.
  47. 47. An assembler or compiler comprising means for generating a computer program as claimed in any of claims 42 to 46.
  48. 48. A processor adapted to perform a method as claimed in any of claims 33 to 41 or adapted to execute a computer program as claimed in any of claims 42 to 46.-34 -
  49. 49. A processor substantially as described herein with reference to and/or as illustrated in any of the accompanying drawings.
  50. 50. A processor adapted to execute a push immediate instruction substantially as described herein with reference to and/or as illustrated in any of the accompanying drawings.
  51. 51. A method of executing a push immediate instruction substantially as described herein with reference to and/or as illustrated in any of the accompanying drawings.
GB0812663A 2008-07-10 2008-07-10 Push immediate instruction with several operands Withdrawn GB2461849A (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
GB0812663A GB2461849A (en) 2008-07-10 2008-07-10 Push immediate instruction with several operands
PCT/GB2009/001313 WO2010004242A2 (en) 2008-07-10 2009-05-27 Data processing apparatus, for example using vector pointers
PCT/GB2009/001318 WO2010004245A1 (en) 2008-07-10 2009-05-27 Processor with push instruction
PCT/GB2009/001309 WO2010004240A1 (en) 2008-07-10 2009-05-27 Data processing apparatus, for example using modes
PCT/GB2009/001314 WO2010004243A2 (en) 2008-07-10 2009-05-27 Interrupt processing
US13/003,432 US9645949B2 (en) 2008-07-10 2009-05-27 Data processing apparatus using privileged and non-privileged modes with multiple stacks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB0812663A GB2461849A (en) 2008-07-10 2008-07-10 Push immediate instruction with several operands

Publications (2)

Publication Number Publication Date
GB0812663D0 GB0812663D0 (en) 2008-08-20
GB2461849A true GB2461849A (en) 2010-01-20

Family

ID=39722086

Family Applications (1)

Application Number Title Priority Date Filing Date
GB0812663A Withdrawn GB2461849A (en) 2008-07-10 2008-07-10 Push immediate instruction with several operands

Country Status (1)

Country Link
GB (1) GB2461849A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7948429B2 (en) 2008-05-05 2011-05-24 Raytheon Company Methods and apparatus for detection/classification of radar targets including birds and other hazards
US8344937B2 (en) 2009-04-17 2013-01-01 Raytheon Company Methods and apparatus for integration of distributed sensors and airport surveillance radar to mitigate blind spots

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9477453B1 (en) * 2015-06-24 2016-10-25 Intel Corporation Technologies for shadow stack manipulation for binary translation systems

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0180157A2 (en) * 1984-10-27 1986-05-07 Nec Corporation Information processing unit
WO2000070446A2 (en) * 1999-05-13 2000-11-23 Arc International U.S. Holdings Inc. Method and apparatus for loose register encoding within a pipelined processor
WO2002077806A1 (en) * 2001-03-27 2002-10-03 Sun Microsystems, Inc. Enhanced java machine instructions
GB2427722A (en) * 2005-05-12 2007-01-03 Cambridge Consultants Computer system, processor and interface to other processors.

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0180157A2 (en) * 1984-10-27 1986-05-07 Nec Corporation Information processing unit
WO2000070446A2 (en) * 1999-05-13 2000-11-23 Arc International U.S. Holdings Inc. Method and apparatus for loose register encoding within a pipelined processor
WO2002077806A1 (en) * 2001-03-27 2002-10-03 Sun Microsystems, Inc. Enhanced java machine instructions
GB2427722A (en) * 2005-05-12 2007-01-03 Cambridge Consultants Computer system, processor and interface to other processors.

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7948429B2 (en) 2008-05-05 2011-05-24 Raytheon Company Methods and apparatus for detection/classification of radar targets including birds and other hazards
US8344937B2 (en) 2009-04-17 2013-01-01 Raytheon Company Methods and apparatus for integration of distributed sensors and airport surveillance radar to mitigate blind spots

Also Published As

Publication number Publication date
GB0812663D0 (en) 2008-08-20

Similar Documents

Publication Publication Date Title
WO2010004245A1 (en) Processor with push instruction
US4992934A (en) Reduced instruction set computing apparatus and methods
JP4485198B2 (en) Processor system with Java accelerator
RU2292581C2 (en) Loading/moving and copying commands for processor
US7516308B2 (en) Processor for performing group floating-point operations
US6748521B1 (en) Microprocessor with instruction for saturating and packing data
US8458677B2 (en) Generating code adapted for interlinking legacy scalar code and extended vector code
EP1102163A2 (en) Microprocessor with improved instruction set architecture
US7346881B2 (en) Method and apparatus for adding advanced instructions in an extensible processor architecture
US7487338B2 (en) Data processor for modifying and executing operation of instruction code according to the indication of other instruction code
US20190065201A1 (en) Implicit global pointer relative addressing for global memory access
US20050283589A1 (en) Data processor
US5748515A (en) Data processing condition code flags
KR19980069856A (en) Scalable Width Vector Processor Architecture
CN114662048A (en) Apparatus and method for conjugate transpose and multiplication
EP0954791A1 (en) Eight-bit microcontroller having a risc architecture
US20020138712A1 (en) Data processing device with instruction translator and memory interface device
EP1582974A2 (en) Apparatus and method for executing instructions of variable length
GB2461849A (en) Push immediate instruction with several operands
US6757819B1 (en) Microprocessor with instructions for shifting data responsive to a signed count value
US20060075208A1 (en) Microprocessor instruction using address index values to enable access of a virtual buffer in circular fashion
EP0927390B1 (en) Processing of conditional select and move instructions
JP2001501001A (en) Input operand control in data processing systems
US6834338B1 (en) Microprocessor with branch-decrement instruction that provides a target and conditionally modifies a test register if the register meets a condition
US6408380B1 (en) Execution of an instruction to load two independently selected registers in a single cycle

Legal Events

Date Code Title Description
WAP Application withdrawn, taken to be withdrawn or refused ** after publication under section 16(1)