xref: /kernel/linux/linux-6.6/arch/sh/lib/memchr.S
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/arch/sh/lib/
162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/* $Id: memchr.S,v 1.1 2000/04/14 16:49:01 mjd Exp $
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * "memchr" implementation of SuperH
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright (C) 1999  Niibe Yutaka
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci/*
1162306a36Sopenharmony_ci * void *memchr(const void *s, int c, size_t n);
1262306a36Sopenharmony_ci */
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#include <linux/linkage.h>
1562306a36Sopenharmony_ciENTRY(memchr)
1662306a36Sopenharmony_ci	tst	r6,r6
1762306a36Sopenharmony_ci	bt/s	2f
1862306a36Sopenharmony_ci	 exts.b	r5,r5
1962306a36Sopenharmony_ci1:	mov.b	@r4,r1
2062306a36Sopenharmony_ci	cmp/eq	r1,r5
2162306a36Sopenharmony_ci	bt/s	3f
2262306a36Sopenharmony_ci	 dt	r6
2362306a36Sopenharmony_ci	bf/s	1b
2462306a36Sopenharmony_ci	 add	#1,r4
2562306a36Sopenharmony_ci2:	mov	#0,r4
2662306a36Sopenharmony_ci3:	rts
2762306a36Sopenharmony_ci	 mov	r4,r0
28

Indexes created Thu Nov 07 10:32:03 CST 2024