bit test instruction

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

 



My target has a bit test (btst) instruction, so the C code:

  if (x & 256)

can be efficiently coded as (for example):

  btst    $r0,256
  jmp    nz,.L1

However, with my current patterns, it generates an explicit "and" and
"compare" using a scratch:

  and    $r1,$r0,256
  cmp   $r1,0
  jmp    nz,.L1

Looking through targets with a similar instruction - arc, rx, s390,
i386 - I see several different approaches. They all seem quite
complicated.

What is the best way of implementing this? Thanks.

-- 
James Bowman
http://www.excamera.com/




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux