1 // SPDX-License-Identifier: GPL-2.0
3 * PA-RISC assembly string functions
5 * Copyright (C) 2019 Helge Deller <deller@gmx.de>
8 #include <asm/assembly.h>
9 #include <linux/linkage.h>
18 ENTRY_CFI(strlen, frame=0,no_calls)
19 or,COND(<>) arg0,r0,ret0
20 b,l,n .Lstrlen_null_ptr,r0
22 cmpb,COND(<>) arg0,ret0,.Lstrlen_not_aligned
24 cmpib,tr 0,r0,.Lstrlen_loop
33 b,l,n .Lstrlen_end_loop,r0
35 cmpib,tr 0,r0,.Lstrlen_loop
39 addib,tr,n -3,ret0,.Lstrlen_out
41 addib,tr,n -2,ret0,.Lstrlen_out
52 ENTRY_CFI(strcpy, frame=0,no_calls)
68 ENTRY_CFI(strncpy, frame=0,no_calls)
76 cmpb,COND(=),n r0,arg2,2f
86 ENTRY_CFI(strcat, frame=0,no_calls)
104 ENTRY_CFI(memset, frame=0,no_calls)
106 cmpb,COND(=) r0,arg0,4f
108 cmpb,COND(=) r0,arg2,4f
112 cmpiclr,COND(>=) 0,t1,arg2
119 cmpiclr,COND(<=) 4,arg2,r0
131 addib,COND(>) -4,arg2,3b