* [Qemu-devel] [PATCH] disas/microblaze: Remove unused code
@ 2015-08-29 7:44 Stefan Weil
2015-08-30 19:36 ` Edgar E. Iglesias
2015-09-06 11:08 ` Michael Tokarev
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Weil @ 2015-08-29 7:44 UTC (permalink / raw)
To: Edgar E. Iglesias; +Cc: QEMU Trivial, Stefan Weil, QEMU Developer
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
disas/microblaze.c | 150 -----------------------------------------------------
1 file changed, 150 deletions(-)
diff --git a/disas/microblaze.c b/disas/microblaze.c
index c14ab89..3588235 100644
--- a/disas/microblaze.c
+++ b/disas/microblaze.c
@@ -604,25 +604,6 @@ char * get_field_special (long instr, struct op_code_struct * op);
unsigned long read_insn_microblaze (bfd_vma memaddr,
struct disassemble_info *info,
struct op_code_struct **opr);
-enum microblaze_instr get_insn_microblaze (long inst,
- bfd_boolean *isunsignedimm,
- enum microblaze_instr_type *insn_type,
- short *delay_slots);
-short get_delay_slots_microblaze (long inst);
-enum microblaze_instr microblaze_decode_insn (long insn,
- int *rd,
- int *ra,
- int *rb,
- int *imm);
-unsigned long
-microblaze_get_target_address (long inst,
- bfd_boolean immfound,
- int immval,
- long pcval,
- long r1val,
- long r2val,
- bfd_boolean *targetvalid,
- bfd_boolean *unconditionalbranch);
static char *
get_field (long instr, long mask, unsigned short low)
@@ -968,134 +949,3 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
/* Say how many bytes we consumed? */
return 4;
}
-
-enum microblaze_instr
-get_insn_microblaze (long inst,
- bfd_boolean *isunsignedimm,
- enum microblaze_instr_type *insn_type,
- short *delay_slots)
-{
- struct op_code_struct * op;
- *isunsignedimm = FALSE;
-
- /* Just a linear search of the table. */
- for (op = opcodes; op->name != 0; op ++)
- if (op->bit_sequence == (inst & op->opcode_mask))
- break;
-
- if (op->name == 0)
- return invalid_inst;
- else {
- *isunsignedimm = (op->inst_type == INST_TYPE_RD_R1_UNSIGNED_IMM);
- *insn_type = op->instr_type;
- *delay_slots = op->delay_slots;
- return op->instr;
- }
-}
-
-short
-get_delay_slots_microblaze (long inst)
-{
- bfd_boolean isunsignedimm;
- enum microblaze_instr_type insn_type;
- enum microblaze_instr op;
- short delay_slots;
-
- op = get_insn_microblaze( inst, &isunsignedimm, &insn_type, &delay_slots);
- if (op == invalid_inst)
- return 0;
- else
- return delay_slots;
-}
-
-enum microblaze_instr
-microblaze_decode_insn (long insn,
- int *rd,
- int *ra,
- int *rb,
- int *imm)
-{
- enum microblaze_instr op;
- bfd_boolean t1;
- enum microblaze_instr_type t2;
- short t3;
-
- op = get_insn_microblaze(insn, &t1, &t2, &t3);
- *rd = (insn & RD_MASK) >> RD_LOW;
- *ra = (insn & RA_MASK) >> RA_LOW;
- *rb = (insn & RB_MASK) >> RB_LOW;
- t3 = (insn & IMM_MASK) >> IMM_LOW;
- *imm = (int) t3;
- return (op);
-}
-
-unsigned long
-microblaze_get_target_address (long inst,
- bfd_boolean immfound,
- int immval,
- long pcval,
- long r1val,
- long r2val,
- bfd_boolean *targetvalid,
- bfd_boolean *unconditionalbranch)
-{
- struct op_code_struct * op;
- long targetaddr = 0;
-
- *unconditionalbranch = FALSE;
- /* Just a linear search of the table. */
- for (op = opcodes; op->name != 0; op ++)
- if (op->bit_sequence == (inst & op->opcode_mask))
- break;
-
- if (op->name == 0) {
- *targetvalid = FALSE;
- } else if (op->instr_type == branch_inst) {
- switch (op->inst_type) {
- case INST_TYPE_R2:
- *unconditionalbranch = TRUE;
- /* fallthru */
- case INST_TYPE_RD_R2:
- case INST_TYPE_R1_R2:
- targetaddr = r2val;
- *targetvalid = TRUE;
- if (op->inst_offset_type == INST_PC_OFFSET)
- targetaddr += pcval;
- break;
- case INST_TYPE_IMM:
- *unconditionalbranch = TRUE;
- /* fallthru */
- case INST_TYPE_RD_IMM:
- case INST_TYPE_R1_IMM:
- if (immfound) {
- targetaddr = (immval << 16) & 0xffff0000;
- targetaddr |= (get_int_field_imm(inst) & 0x0000ffff);
- } else {
- targetaddr = get_int_field_imm(inst);
- if (targetaddr & 0x8000)
- targetaddr |= 0xFFFF0000;
- }
- if (op->inst_offset_type == INST_PC_OFFSET)
- targetaddr += pcval;
- *targetvalid = TRUE;
- break;
- default:
- *targetvalid = FALSE;
- break;
- }
- } else if (op->instr_type == return_inst) {
- if (immfound) {
- targetaddr = (immval << 16) & 0xffff0000;
- targetaddr |= (get_int_field_imm(inst) & 0x0000ffff);
- } else {
- targetaddr = get_int_field_imm(inst);
- if (targetaddr & 0x8000)
- targetaddr |= 0xFFFF0000;
- }
- targetaddr += r1val;
- *targetvalid = TRUE;
- } else {
- *targetvalid = FALSE;
- }
- return targetaddr;
-}
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] disas/microblaze: Remove unused code
2015-08-29 7:44 [Qemu-devel] [PATCH] disas/microblaze: Remove unused code Stefan Weil
@ 2015-08-30 19:36 ` Edgar E. Iglesias
2015-09-06 11:08 ` Michael Tokarev
1 sibling, 0 replies; 3+ messages in thread
From: Edgar E. Iglesias @ 2015-08-30 19:36 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Trivial, QEMU Developer
On Sat, Aug 29, 2015 at 09:44:33AM +0200, Stefan Weil wrote:
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> ---
> disas/microblaze.c | 150 -----------------------------------------------------
> 1 file changed, 150 deletions(-)
>
> diff --git a/disas/microblaze.c b/disas/microblaze.c
> index c14ab89..3588235 100644
> --- a/disas/microblaze.c
> +++ b/disas/microblaze.c
> @@ -604,25 +604,6 @@ char * get_field_special (long instr, struct op_code_struct * op);
> unsigned long read_insn_microblaze (bfd_vma memaddr,
> struct disassemble_info *info,
> struct op_code_struct **opr);
> -enum microblaze_instr get_insn_microblaze (long inst,
> - bfd_boolean *isunsignedimm,
> - enum microblaze_instr_type *insn_type,
> - short *delay_slots);
> -short get_delay_slots_microblaze (long inst);
> -enum microblaze_instr microblaze_decode_insn (long insn,
> - int *rd,
> - int *ra,
> - int *rb,
> - int *imm);
> -unsigned long
> -microblaze_get_target_address (long inst,
> - bfd_boolean immfound,
> - int immval,
> - long pcval,
> - long r1val,
> - long r2val,
> - bfd_boolean *targetvalid,
> - bfd_boolean *unconditionalbranch);
>
> static char *
> get_field (long instr, long mask, unsigned short low)
> @@ -968,134 +949,3 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
> /* Say how many bytes we consumed? */
> return 4;
> }
> -
> -enum microblaze_instr
> -get_insn_microblaze (long inst,
> - bfd_boolean *isunsignedimm,
> - enum microblaze_instr_type *insn_type,
> - short *delay_slots)
> -{
> - struct op_code_struct * op;
> - *isunsignedimm = FALSE;
> -
> - /* Just a linear search of the table. */
> - for (op = opcodes; op->name != 0; op ++)
> - if (op->bit_sequence == (inst & op->opcode_mask))
> - break;
> -
> - if (op->name == 0)
> - return invalid_inst;
> - else {
> - *isunsignedimm = (op->inst_type == INST_TYPE_RD_R1_UNSIGNED_IMM);
> - *insn_type = op->instr_type;
> - *delay_slots = op->delay_slots;
> - return op->instr;
> - }
> -}
> -
> -short
> -get_delay_slots_microblaze (long inst)
> -{
> - bfd_boolean isunsignedimm;
> - enum microblaze_instr_type insn_type;
> - enum microblaze_instr op;
> - short delay_slots;
> -
> - op = get_insn_microblaze( inst, &isunsignedimm, &insn_type, &delay_slots);
> - if (op == invalid_inst)
> - return 0;
> - else
> - return delay_slots;
> -}
> -
> -enum microblaze_instr
> -microblaze_decode_insn (long insn,
> - int *rd,
> - int *ra,
> - int *rb,
> - int *imm)
> -{
> - enum microblaze_instr op;
> - bfd_boolean t1;
> - enum microblaze_instr_type t2;
> - short t3;
> -
> - op = get_insn_microblaze(insn, &t1, &t2, &t3);
> - *rd = (insn & RD_MASK) >> RD_LOW;
> - *ra = (insn & RA_MASK) >> RA_LOW;
> - *rb = (insn & RB_MASK) >> RB_LOW;
> - t3 = (insn & IMM_MASK) >> IMM_LOW;
> - *imm = (int) t3;
> - return (op);
> -}
> -
> -unsigned long
> -microblaze_get_target_address (long inst,
> - bfd_boolean immfound,
> - int immval,
> - long pcval,
> - long r1val,
> - long r2val,
> - bfd_boolean *targetvalid,
> - bfd_boolean *unconditionalbranch)
> -{
> - struct op_code_struct * op;
> - long targetaddr = 0;
> -
> - *unconditionalbranch = FALSE;
> - /* Just a linear search of the table. */
> - for (op = opcodes; op->name != 0; op ++)
> - if (op->bit_sequence == (inst & op->opcode_mask))
> - break;
> -
> - if (op->name == 0) {
> - *targetvalid = FALSE;
> - } else if (op->instr_type == branch_inst) {
> - switch (op->inst_type) {
> - case INST_TYPE_R2:
> - *unconditionalbranch = TRUE;
> - /* fallthru */
> - case INST_TYPE_RD_R2:
> - case INST_TYPE_R1_R2:
> - targetaddr = r2val;
> - *targetvalid = TRUE;
> - if (op->inst_offset_type == INST_PC_OFFSET)
> - targetaddr += pcval;
> - break;
> - case INST_TYPE_IMM:
> - *unconditionalbranch = TRUE;
> - /* fallthru */
> - case INST_TYPE_RD_IMM:
> - case INST_TYPE_R1_IMM:
> - if (immfound) {
> - targetaddr = (immval << 16) & 0xffff0000;
> - targetaddr |= (get_int_field_imm(inst) & 0x0000ffff);
> - } else {
> - targetaddr = get_int_field_imm(inst);
> - if (targetaddr & 0x8000)
> - targetaddr |= 0xFFFF0000;
> - }
> - if (op->inst_offset_type == INST_PC_OFFSET)
> - targetaddr += pcval;
> - *targetvalid = TRUE;
> - break;
> - default:
> - *targetvalid = FALSE;
> - break;
> - }
> - } else if (op->instr_type == return_inst) {
> - if (immfound) {
> - targetaddr = (immval << 16) & 0xffff0000;
> - targetaddr |= (get_int_field_imm(inst) & 0x0000ffff);
> - } else {
> - targetaddr = get_int_field_imm(inst);
> - if (targetaddr & 0x8000)
> - targetaddr |= 0xFFFF0000;
> - }
> - targetaddr += r1val;
> - *targetvalid = TRUE;
> - } else {
> - *targetvalid = FALSE;
> - }
> - return targetaddr;
> -}
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] disas/microblaze: Remove unused code
2015-08-29 7:44 [Qemu-devel] [PATCH] disas/microblaze: Remove unused code Stefan Weil
2015-08-30 19:36 ` Edgar E. Iglesias
@ 2015-09-06 11:08 ` Michael Tokarev
1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2015-09-06 11:08 UTC (permalink / raw)
To: Stefan Weil, Edgar E. Iglesias; +Cc: QEMU Trivial, QEMU Developer
Applied to -trivial, thanks!
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-06 11:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-29 7:44 [Qemu-devel] [PATCH] disas/microblaze: Remove unused code Stefan Weil
2015-08-30 19:36 ` Edgar E. Iglesias
2015-09-06 11:08 ` Michael Tokarev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).