* Re: [linux-next:master 6141/9308] arch/mips/lib/crypto/chacha-core.S:264:118: error: unknown instruction, did you mean: rol, rotr?
[not found] <202505080409.EujEBwA0-lkp@intel.com>
@ 2025-05-07 22:18 ` Eric Biggers
0 siblings, 0 replies; only message in thread
From: Eric Biggers @ 2025-05-07 22:18 UTC (permalink / raw)
To: kernel test robot
Cc: oe-kbuild-all, Herbert Xu, linux-crypto, linux-mips,
René van Dorst, Jason A. Donenfeld
[+Cc linux-crypto, linux-mips, and the authors of the mips chacha-core.S]
On Thu, May 08, 2025 at 04:36:30AM +0800, kernel test robot wrote:
> Hi Eric,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 08710e696081d58163c8078e0e096be6d35c5fad
> commit: 939a54ac073808db15ed411d563dfadb3ef12798 [6141/9308] crypto: mips - move library functions to arch/mips/lib/crypto/
> config: mips-randconfig-r111-20250501 (https://download.01.org/0day-ci/archive/20250508/202505080409.EujEBwA0-lkp@intel.com/config)
> compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
> reproduce: (https://download.01.org/0day-ci/archive/20250508/202505080409.EujEBwA0-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202505080409.EujEBwA0-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> >> arch/mips/lib/crypto/chacha-core.S:264:118: error: unknown instruction, did you mean: rol, rotr?
> addu $t0, $t4; addu $t1, $t5; addu $t2, $t6; addu $t3, $t7; xor $s5, $t0; xor $s4, $t1; xor $s3, $t2; xor $s2, $t3; rotl $s5, 16; rotl $s4, 16; rotl $s3, 16; rotl $s2, 16;;
This build error actually occurs before my commit too, and even on current
mainline. I don't know why it's just getting reported now. It occurs only with
clang, which is why I didn't notice it before (I did the mips build with gcc).
Anyway, I don't really speak MIPS, but it looks like what's going on is the CPU
only has a right rotate instruction, and binutils translates left rotates into
right rotates, but clang doesn't.
'mips-linux-gnu-gcc -c -march=mips32r2' successfully compiles the following:
rotl $a0, 5
... and with 'mips-linux-gnu-objdump' it comes back as:
ror a0,a0,0x1b
But 'clang -c -target mips-linux-gnu -march=mips32r2' errors out:
test.S:1:1: error: unknown instruction, did you mean: rol, rotr?
rotl $a0, 5
I don't know if 'rotl' is "supposed" to work or not. But either way, we could
make the assembly code use right rotates only.
- Eric
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-07 22:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <202505080409.EujEBwA0-lkp@intel.com>
2025-05-07 22:18 ` [linux-next:master 6141/9308] arch/mips/lib/crypto/chacha-core.S:264:118: error: unknown instruction, did you mean: rol, rotr? Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).