microblaze: Adding likely macros
On the base on GCOV analytics is helpful to add likely/unlikely macros. Signed-off-by: Michal Simek <monstr@monstr.eu>
This commit is contained in:
@@ -53,7 +53,7 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
|
||||
const uint32_t *i_src;
|
||||
uint32_t *i_dst;
|
||||
|
||||
if (c >= 4) {
|
||||
if (likely(c >= 4)) {
|
||||
unsigned value, buf_hold;
|
||||
|
||||
/* Align the dstination to a word boundry. */
|
||||
|
@@ -33,22 +33,23 @@
|
||||
#ifdef __HAVE_ARCH_MEMSET
|
||||
void *memset(void *v_src, int c, __kernel_size_t n)
|
||||
{
|
||||
|
||||
char *src = v_src;
|
||||
#ifdef CONFIG_OPT_LIB_FUNCTION
|
||||
uint32_t *i_src;
|
||||
uint32_t w32;
|
||||
uint32_t w32 = 0;
|
||||
#endif
|
||||
/* Truncate c to 8 bits */
|
||||
c = (c & 0xFF);
|
||||
|
||||
#ifdef CONFIG_OPT_LIB_FUNCTION
|
||||
/* Make a repeating word out of it */
|
||||
w32 = c;
|
||||
w32 |= w32 << 8;
|
||||
w32 |= w32 << 16;
|
||||
if (unlikely(c)) {
|
||||
/* Make a repeating word out of it */
|
||||
w32 = c;
|
||||
w32 |= w32 << 8;
|
||||
w32 |= w32 << 16;
|
||||
}
|
||||
|
||||
if (n >= 4) {
|
||||
if (likely(n >= 4)) {
|
||||
/* Align the destination to a word boundary */
|
||||
/* This is done in an endian independant manner */
|
||||
switch ((unsigned) src & 3) {
|
||||
|
Reference in New Issue
Block a user