mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
riscv: lib: Check if output in asm goto supported
The output field of an asm goto statement is not supported by all
compilers. If it is not supported, fallback to the non-optimized code.
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Fixes: a04c192eab
("riscv: Add checksum library")
Link: https://lore.kernel.org/r/20240118-csum_remove_output_operands_asm_goto-v2-1-5d1b73cf93d4@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
66f962d893
commit
4525462dd0
@ -156,6 +156,7 @@ do_csum_with_alignment(const unsigned char *buff, int len)
|
||||
end = (const unsigned long *)(buff + len);
|
||||
csum = do_csum_common(ptr, end, data);
|
||||
|
||||
#ifdef CC_HAS_ASM_GOTO_TIED_OUTPUT
|
||||
/*
|
||||
* Zbb support saves 6 instructions, so not worth checking without
|
||||
* alternatives if supported
|
||||
@ -214,6 +215,7 @@ do_csum_with_alignment(const unsigned char *buff, int len)
|
||||
return csum >> 16;
|
||||
}
|
||||
no_zbb:
|
||||
#endif /* CC_HAS_ASM_GOTO_TIED_OUTPUT */
|
||||
#ifndef CONFIG_32BIT
|
||||
csum += ror64(csum, 32);
|
||||
csum >>= 32;
|
||||
|
Loading…
Reference in New Issue
Block a user