Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434622

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

From Zhaoxiu Zeng <zengzhaoxiu@163.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin
Date 2016-06-30 16:30 +0200
Message-ID <rPL8B-2eN-19@gated-at.bofh.it> (permalink)
References <rPqxb-6tq-5@gated-at.bofh.it> <rPsyZ-7FB-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/6/30 2:31, Michal Nazarewicz wrote:
> On Thu, Jun 30 2016, zengzhaoxiu wrote:
.......
>> So this replaces table lookup in tolower with an explicit table lookup
>> here while also removing some branches.
>>
>> Is that an improvement?  Hard to say.  _ctype table is used by all the
>> other isfoo macros so there’s a chance it’s already in cache the first
>> time hex_to_bin is called.  Having to read the data into cache may
>> overwhelm advantages of lack of branches.

In the 2nd patch, I use the inlined hex_to_bin to replace the local conversion
in _parse_integer which used by all kstrto... functions, so the heat of h2b_lut
may not be less than _ctype table. 

Additionally,in the vast majority of cases,only these bytes (0x00, 0x30~0x39,
 0x41~0x46, 0x61~0x66) will be used.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin zengzhaoxiu@163.com - 2016-06-29 18:30 +0200
  Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-06-29 18:30 +0200
  Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Michal Nazarewicz <mina86@mina86.com> - 2016-06-29 20:40 +0200
    Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-06-29 21:00 +0200
      Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Joe Perches <joe@perches.com> - 2016-06-30 21:30 +0200
        Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-30 21:50 +0200
          Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Joe Perches <joe@perches.com> - 2016-06-30 22:10 +0200
            Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-06-30 22:50 +0200
        Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Michal Nazarewicz <mina86@mina86.com> - 2016-06-30 23:20 +0200
    Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin Zhaoxiu Zeng <zengzhaoxiu@163.com> - 2016-06-30 16:30 +0200

csiph-web