Branch: refs/heads/smoke-me/khw-grok
  Home:   https://github.com/Perl/perl5
  Commit: f0cd0abd266d767ef8479bc8ed2d99cd783d4811
      
https://github.com/Perl/perl5/commit/f0cd0abd266d767ef8479bc8ed2d99cd783d4811
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M embed.fnc

  Log Message:
  -----------
  embed.fnc: Fix typo in comment


  Commit: 16628d42004d97d495d725849ad31f63460bd05a
      
https://github.com/Perl/perl5/commit/16628d42004d97d495d725849ad31f63460bd05a
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M numeric.c

  Log Message:
  -----------
  perlapi: Perl_isinfnan: fix typo


  Commit: babb0a8b3da68a163af4a7acc2ed23ce5cc33955
      
https://github.com/Perl/perl5/commit/babb0a8b3da68a163af4a7acc2ed23ce5cc33955
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M numeric.c

  Log Message:
  -----------
  numeric.c: Fix typo in comment


  Commit: d70f62946d8cb5ca82047b600114f3fdac7e974d
      
https://github.com/Perl/perl5/commit/d70f62946d8cb5ca82047b600114f3fdac7e974d
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M handy.h

  Log Message:
  -----------
  handy.h: Convert XDIGIT_VALUE to branchless

This removes a branch and an array lookup in the XDIGIT_VALUE() macro.
It adds some shifts, masks, and additions instead, though replacing a
mask and addition in the old way.

A somewhat more complicated version could be made for EBCDIC, but I'm
not bothering to do that, using an array lookup to convert the salient
value to ASCII, so on EBCDIC there isn't an array lookup removal.


  Commit: 3dc73b60b6f17838dfa26eda15ac3a4d4088ee6a
      
https://github.com/Perl/perl5/commit/3dc73b60b6f17838dfa26eda15ac3a4d4088ee6a
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M charclass_invlists.h
    M handy.h
    M l1_char_class_tab.h
    M lib/unicore/uni_keywords.pl
    M regen/mk_PL_charclass.pl
    M uni_keywords.h

  Log Message:
  -----------
  l1_char_class_tab.h: Add bits for binary, octal digits

The motivation behind these extra bits is to allow three functions that
deal with, respectively, binary, octal, and hex data to use the same
paradigm, and hence be collapsible into a single function.


  Commit: 21656c9f9135b74cfc34f5c5e4c24a3ce8743f21
      
https://github.com/Perl/perl5/commit/21656c9f9135b74cfc34f5c5e4c24a3ce8743f21
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M embed.fnc
    M embed.h
    M numeric.c
    M perl.h
    M pod/perldiag.pod
    M proto.h

  Log Message:
  -----------
  Collapse grok_bin, _oct, _hex into one function

These functions are identical in logic in the main loop, the difference
being which digits they accept.  The rest of the code had slight
variations.  This commit unifies the functions.

I presume the reason they were kept separate was because of speed.  I
believe I have solved that sufficiently to warrant unifying them, and
thus lowering the maintenance costs.

There are extra conditionals in unlikely error branches and in set-up
code.  The key to making this feasible in my opinion, was being able to
extract the value of a hex digit without branching, done in a previous
commit.  That speeds up the grok_hex routine.  The others are slowed
down by a couple of shifts, masks, and additions, but with no branching
added.  There is also an extra array indirection per loop iteration for
grok_bin and grok_oct.  (Though a branch has been removed in
compensation from grok_bin (although a compiler might have been smart
enough to remove it anyway)).  I think that small extra bit of work is
justified by the increased maintainability.

The only other thing I can think of that could affect the speed is that
in places a variable is used instead of the constant it replaces.
Again, I don't think the effect of this would be noticeable.


  Commit: 0fa118671e152adc72ed5fba0dd9d299b3fc743f
      
https://github.com/Perl/perl5/commit/0fa118671e152adc72ed5fba0dd9d299b3fc743f
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M numeric.c

  Log Message:
  -----------
  grok_bin_oct_hex(): Add branch prediction


  Commit: 716ef6445cd3ba88da8a075f371f1806738ba23c
      
https://github.com/Perl/perl5/commit/716ef6445cd3ba88da8a075f371f1806738ba23c
  Author: Karl Williamson <[email protected]>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M numeric.c

  Log Message:
  -----------
  numeric.c: Fix typo in comment


Compare: https://github.com/Perl/perl5/compare/f0cd0abd266d%5E...716ef6445cd3

Reply via email to