#269 Use cpir for (builtin) strnlen() and memchr()

open
nobody
z80 port (30)
4
2008-12-27
2008-12-27
No

The Z80 has the cpir instruction, which essentially implements memchr().
The Z80 port should use cpir to get a small, fast memchr() and strnlen(), maybe even as builtin functions. The code generated for the builtin function would probably be even less than the call overhead in many cases.

Philipp

Discussion

  • Implemented for strlen() in revision #5330. Still not implemented for strnlen() and memchr().

     
  • The strnlen() part is rejected, since it is not a standard C function (it is from POSIX.1-2008).

    Philipp