Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-26 Thread Aldy Hernandez
On 10/24/2017 12:24 PM, Richard Sandiford wrote: Andrew MacLeod writes: On 10/19/2017 04:22 PM, Richard Sandiford wrote: Richard Sandiford writes: Aldy Hernandez writes: gcc/ * wide-int-print.cc (print_hex): Loop based on extract_uhwi. Don't print any bits outside the p

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-24 Thread Jeff Law
On 10/24/2017 10:24 AM, Richard Sandiford wrote: > Andrew MacLeod writes: >> On 10/19/2017 04:22 PM, Richard Sandiford wrote: >>> Richard Sandiford writes: Aldy Hernandez writes: > On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford > wrote: >> Andrew MacLeod writes: >>> On

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-24 Thread Richard Sandiford
Andrew MacLeod writes: > On 10/19/2017 04:22 PM, Richard Sandiford wrote: >> Richard Sandiford writes: >>> Aldy Hernandez writes: On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford wrote: > Andrew MacLeod writes: >> On 10/17/2017 08:18 AM, Richard Sandiford wrote: >>> Ald

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-24 Thread Andrew MacLeod
On 10/19/2017 04:22 PM, Richard Sandiford wrote: Richard Sandiford writes: Aldy Hernandez writes: On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford wrote: Andrew MacLeod writes: On 10/17/2017 08:18 AM, Richard Sandiford wrote: Aldy Hernandez writes: Hi folks! Calling print_hex() on a

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-19 Thread Richard Sandiford
Richard Sandiford writes: > Aldy Hernandez writes: >> On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford >> wrote: >>> Andrew MacLeod writes: On 10/17/2017 08:18 AM, Richard Sandiford wrote: > Aldy Hernandez writes: >> Hi folks! >> >> Calling print_hex() on a widest_int wi

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-19 Thread Aldy Hernandez
On 10/18/2017 06:39 PM, Richard Sandiford wrote: Aldy Hernandez writes: On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford Ah! OK. Yeah, I agree it doesn't make sense to print sign-extension bits above the precision. I think it'd work if print_hex used extract_uhwi insteead of elt, whic

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-18 Thread Richard Sandiford
Aldy Hernandez writes: > On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford > wrote: >> Andrew MacLeod writes: >>> On 10/17/2017 08:18 AM, Richard Sandiford wrote: Aldy Hernandez writes: > Hi folks! > > Calling print_hex() on a widest_int with the most significant bit turned >>

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-18 Thread Aldy Hernandez
On Tue, Oct 17, 2017 at 6:05 PM, Richard Sandiford wrote: > Andrew MacLeod writes: >> On 10/17/2017 08:18 AM, Richard Sandiford wrote: >>> Aldy Hernandez writes: Hi folks! Calling print_hex() on a widest_int with the most significant bit turned on can lead to a leading zero b

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-17 Thread Richard Sandiford
Andrew MacLeod writes: > On 10/17/2017 08:18 AM, Richard Sandiford wrote: >> Aldy Hernandez writes: >>> Hi folks! >>> >>> Calling print_hex() on a widest_int with the most significant bit turned >>> on can lead to a leading zero being printed (0x0). This produces >>> confusing dumps to sa

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-17 Thread Andrew MacLeod
On 10/17/2017 08:18 AM, Richard Sandiford wrote: Aldy Hernandez writes: Hi folks! Calling print_hex() on a widest_int with the most significant bit turned on can lead to a leading zero being printed (0x0). This produces confusing dumps to say the least, especially when you incorrectly

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-17 Thread Mike Stump
On Oct 17, 2017, at 5:18 AM, Richard Sandiford wrote: > > Aldy Hernandez writes: >> This produces confusing dumps to say the least > That's the intended behaviour though. > 0x0 -> (1 << 32) - 1 to infinite precision > (i.e. a positive value) > 0x -> -1

Re: [patch] avoid printing leading 0 in widest_int hex dumps

2017-10-17 Thread Richard Sandiford
Aldy Hernandez writes: > Hi folks! > > Calling print_hex() on a widest_int with the most significant bit turned > on can lead to a leading zero being printed (0x0). This produces > confusing dumps to say the least, especially when you incorrectly assume > an integer is NOT signed :). T