Re: [Dwarf-Discuss] dwarf stack operator for byte swap.

2019-12-16 Thread Chirag Patel via Dwarf-Discuss
ly to be years away. In the meantime let me > suggest a > shorter expression for doing the byte-swap operation. > The book > “Hacker’s Delight” shows a straightforward 32-bit byte > swap with masks > no wider than 16 bits, as follows: > > > > x = (x

Re: [Dwarf-Discuss] dwarf stack operator for byte swap.

2019-11-10 Thread Chirag Patel via Dwarf-Discuss
ion.  > The book > "Hacker's Delight" shows a straightforward 32-bit byte > swap with masks > no wider than 16 bits, as follows: > > > >         x = (x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & > > 0xff00) | (x &g

Re: [Dwarf-Discuss] dwarf stack operator for byte swap.

2019-11-08 Thread Chirag Patel via Dwarf-Discuss
Cc: Michael Eager ; Robinson, Paul ; Ron Brender ; dwarf-discuss@lists.dwarfstd.org Subject: Re: [Dwarf-Discuss] dwarf stack operator for byte swap. On Fri, Nov 08, 2019 at 06:51:52AM +, Chirag Patel via Dwarf-Discuss wrote: > Proposed changes to DW

Re: [Dwarf-Discuss] dwarf stack operator for byte swap.

2019-11-07 Thread Chirag Patel via Dwarf-Discuss
ff) << 24) | ((x & 0xff00) << 8) | ((x >> 8) > & 0xff00) | (x >> 24); > > Translating this into a DWARF expression, I get the following: > > DW_OP_dup, DW_OP_const1u 0xff, DW_OP_and, DW_OP_lit24, > DW_OP_shl, DW_OP_swap, DW_OP_dup, DW_OP

Re: [Dwarf-Discuss] dwarf stack operator for byte swap.

2019-10-29 Thread Chirag Patel via Dwarf-Discuss
et the following: > > DW_OP_dup, DW_OP_const1u 0xff, DW_OP_and, DW_OP_lit24, > DW_OP_shl, DW_OP_swap, DW_OP_dup, DW_OP_const2u 0xff00, DW_OP_and, > DW_OP_lit8, DW_OP_shl, DW_OP_swap, DW_OP_dup, DW_OP_lit8, DW_OP_shr, > DW_OP_const2u 0xff00, DW_OP_and, DW_OP_swap, DW_OP

[Dwarf-Discuss] dwarf stack operator for byte swap.

2019-10-28 Thread Chirag Patel via Dwarf-Discuss
Hello Dwarf experts. I am currently working trying to encode dwarf of binaries with having bi-endian variables marked with DW_AT_endianity attribute. The location calculation for some variable depends on other variable with different endianity, also the value of this other variable is known at