need some ASM help with "bitrev"

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

need some ASM help with "bitrev"

Post by Heimdall »

I've been studying the mips_opcode struct from binutils:

Code: Select all

struct mips_opcode
{
  /* The name of the instruction.  */
  const char *name;
  /* A string describing the arguments for this instruction.  */
  const char *args;
  /* The basic opcode for the instruction.  When assembling, this
     opcode is modified by the arguments to produce the actual opcode
     that is used.  If pinfo is INSN_MACRO, then this is 0.  */
  unsigned long match;
  /* If pinfo is not INSN_MACRO, then this is a bit mask for the
     relevant portions of the opcode when disassembling.  If the
     actual opcode anded with the match field equals the opcode field,
     then we have found the correct instruction.  If pinfo is
     INSN_MACRO, then this field is the macro identifier.  */
  unsigned long mask;
  /* For a macro, this is INSN_MACRO.  Otherwise, it is a collection
     of bits describing the instruction, notably any relevant hazard
     information.  */
  unsigned long pinfo;
  /* A collection of additional bits describing the instruction. */
  unsigned long pinfo2;
  /* A collection of bits describing the instruction sets of which this
     instruction or macro is a member. */
  unsigned long membership;
};
and saw that the binutils patch defines the asm instruction bit rev as:

{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0,...},

however the latest binutils already contains this instruction and is defined as:

{"bitrev", "d,t", 0x7c0006d2, 0xffe007ff, WR_d|RD_t, 0,...},

so the match is different and now i'm confused, do the new mips processors supported by binutils have a different match for the bitrev instruction, or does the psp patch is using a wrong match?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

have you just tried it and tested if the current definition works? :) I am sure I have seen bitrev used in some code and it matches the definition binutils use but I could be wrong.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

bitrev is required for libstdc++ using the binutils 2.19.1 definition is can compile a working g++ but i haven't tested it.
Post Reply