This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: Help needed for porting opcodes for CISC architecture
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Usha Gupta <usha dot nitt at gmail dot com>
- Cc: cgen <cgen at sourceware dot org>
- Date: Mon, 10 Feb 2014 16:31:27 -0500
- Subject: Re: Help needed for porting opcodes for CISC architecture
- Authentication-results: sourceware.org; auth=none
- References: <CANcummWUhCCPZsVRR9EaeZ7Y4o0kK1E4bv9r48qBvPUych2yjA at mail dot gmail dot com>
Usha Gupta <usha.nitt@gmail.com> writes:
> [...]
> (default-insn-bitsize 8)
> (base-insn-bitsize 16)
> (default-insn-word-bitsize 16 )
> (word-bitsize 16 )
OK (though you might need to raise base-insn-bitsize).
> [...]
> Here are some of the instruction formats :
>
> 1-byte instruction:
> 1) IIIIIrrr - 5 bits opcode , 3 bits for register operand (one of
> the operand is fixed register, implied from the opcode)
> 2) IIIddddd - 3 bits opcode, 5 bit displacement
>
> 2-byte instruction:
> 1) IIIIIsss IIIIIttt - 5-bit opcode, 3-bit register operand
> (source), 5-bit opcode, 3-bit register operand (destination)
>
> How do I define instructions of varying length?
Presumably those IIIII's don't overlap - i.e., the hardware can tell
from the first byte that it's a 2-byte instruction (and more opcode
bits need to be fetched). In cgen, instruction opcodes need not be
single fields nor contiguous; just specify one ifield per unique
opcode piece.
- FChE