memset.S (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) memset.S (8ad8b72721d0f07fa02dbe71f901743f9c71c8e6)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2013 Regents of the University of California
4 */
5
6
7#include <linux/linkage.h>
8#include <asm/asm.h>
9
10/* void *memset(void *, int, size_t) */
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2013 Regents of the University of California
4 */
5
6
7#include <linux/linkage.h>
8#include <asm/asm.h>
9
10/* void *memset(void *, int, size_t) */
11ENTRY(memset)
11ENTRY(__memset)
12WEAK(memset)
12 move t0, a0 /* Preserve return value */
13
14 /* Defer to byte-oriented fill for small sizes */
15 sltiu a3, a2, 16
16 bnez a3, 4f
17
18 /*
19 * Round to nearest XLEN-aligned address

--- 84 unchanged lines hidden (view full) ---

104 beqz a2, 6f
105 add a3, t0, a2
1065:
107 sb a1, 0(t0)
108 addi t0, t0, 1
109 bltu t0, a3, 5b
1106:
111 ret
13 move t0, a0 /* Preserve return value */
14
15 /* Defer to byte-oriented fill for small sizes */
16 sltiu a3, a2, 16
17 bnez a3, 4f
18
19 /*
20 * Round to nearest XLEN-aligned address

--- 84 unchanged lines hidden (view full) ---

105 beqz a2, 6f
106 add a3, t0, a2
1075:
108 sb a1, 0(t0)
109 addi t0, t0, 1
110 bltu t0, a3, 5b
1116:
112 ret
112END(memset)
113END(__memset)