CGEN:PATCH:RFA: Extracting from the entire insn int
Dave Brolley
brolley@redhat.com
Thu Oct 5 14:51:00 GMT 2000
Hi,
The attached patch extends the capability of
-gen-ifld-extract-base so that it can extract all of the fields
of an instruction when adata-integral-insn? is true. This changes
generated code in decode.c like:
/* Contents of trailing part of insn. */
UINT word_1;
word_1 = GETIMEMUHI (current_cpu, pc + 2);
f_imm16 = (0|(EXTRACT_MSB0_UINT (word_1, 16, 0, 16) << 0));
f_Rn1 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
into:
f_imm16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16);
f_Rn1 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
which is a-good-thing(tm) because:
o It takes advantage of the fact that the entire insn is already
in 'insn'
o I avoids a redundant core access
OK to commit?
Dave
2000-10-05 Dave Brolley <brolley@redhat.com>
* utils-gen.scm (-gen-ifld-extract-base): Compute start position as
ifld-start + ifld-word-offset.
(gen-ifld-extract): Check adata-integral-insn? before checking whether
the field is beyond the base number of bits.
(gen-define-ifields): Use a base-length of 32 if adata-integral-insn?.
(gen-extract-ifields): Ditto.
More information about the Cgen
mailing list