This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]Extend GAS arm_feature_set struct to provide more available bits


>>
>> Hi Alan and Nick, I noticed that GDB now can be built with g++
>> https://sourceware.org/ml/gdb-patches/2015-03/msg00194.html. Is there
>> any plan to build whole binutils with g++? If so, I am thinking that
>> maybe I can use c++ bitset to handle those arm feature stuff which
>> should be more flexible and clean.
>
> Also c++ bitset is very inefficient for a few bits. If anything sbitmap or bitmap that is part of gcc is much better are more efficient. One of them (can't remember which one off hand) is a fixed size bitmask.
>
> Thanks,
> Andrew

It should be sbitmap, the simple bitmap. I noticed this one and once
thought to put it into libiberty to share between gcc and binutils. Is
it worth doing so?

There is another big change to existing code if we use sbitmap. In
current code, we define a lot of file-scope variables like below:

static const arm_feature_set fpu_default = FPU_DEFAULT;
static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1;
static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2;
static const arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3;

And more complicated case like below:
struct opcode32
{
  arm_feature_set arch;         /* Architecture defining this insn.  */
  unsigned long value;          /* If arch is 0 then value is a sentinel.  */
  unsigned long mask;           /* Recognise insn if (op & mask) == value.  */
  const char *  assembler;      /* How to disassemble this insn.  */
};

static const struct opcode32 coprocessor_opcodes[] =
{
  /* XScale instructions.  */
  {ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
    0x0e200010, 0x0fff0ff0,
    "mia%c\tacc0, %0-3r, %12-15r"},
  {ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
    0x0e280010, 0x0fff0ff0,
    "miaph%c\tacc0, %0-3r, %12-15r"},
.....
};

If use sbitmap, we can't initialize them like this, we need to put
them into a function.

BR,
Terry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]