qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 08/14] tcg-arm: Make use of conditional avail


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 08/14] tcg-arm: Make use of conditional availability of opcodes for divide
Date: Thu, 4 Jul 2013 18:39:06 +0100

On 4 July 2013 18:33, Richard Henderson <address@hidden> wrote:
> On 07/04/2013 04:02 AM, Peter Maydell wrote:
>>> +        unsigned long hwcap = getauxval(AT_HWCAP);
>>> +        use_idiv_instructions = hwcap & (HWCAP_ARM_IDIVA | 
>>> HWCAP_ARM_IDIVT);
>>
>> Doesn't this mean we'll try to use the ARM division
>> insns even if the CPU only supports the Thumb encodings?
>> I think you should only be testing for whether HWCAP_ARM_IDIVA
>> is set.
>
> I suppose.  Though later kernels have actually merged these bits:
>
> uapi/asm/hwcap.h:27:#define HWCAP_IDIV  (HWCAP_IDIVA | HWCAP_IDIVT)

Yes, but the two bits are still separate values:

 #define HWCAP_IDIVA     (1 << 17)
 #define HWCAP_IDIVT     (1 << 18)

Presumably the HWCAP_IDIV is if you want to check that you
have full division support via
  (hwcap & HWCAP_IDIV) == HWCAP_IDIV

We could do that if you prefer; it would be effectively
the same as just testing the IDIVA bit though.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]