include/linux/ctype.h: make isdigit() table lookupless
authorAlexey Dobriyan <adobriyan@gmail.com>
Sat, 10 Sep 2016 10:34:20 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:20 +0000 (20:34 +1000)
commit5a7dd63912fb21fa710eecd23c01bfda44ca68ef
treee563c561b165f8639bdd43dbe5f11f50529cd59c
parent4e51eaf71e0a47d92fca3fef1158ee8585897f9b
include/linux/ctype.h: make isdigit() table lookupless

Make isdigit into a simple range checking inline function:

return '0' <= c && c <= '9';

This code is 1 branch, not 2 because any reasonable compiler can
optimize this code into SUB+CMP, so the code

while (isdigit((c = *s++)))
...

remains 1 branch per iteration HOWEVER it suddenly doesn't do table
lookup priming cacheline nobody cares about.

Link: http://lkml.kernel.org/r/20160826190047.GA12536@p183.telecom.by
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/ctype.h
This page took 0.025177 seconds and 5 git commands to generate.