From: Eric Biggers <ebiggers@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
"Herbert Xu" <herbert@gondor.apana.org.au>,
linux-crypto@vger.kernel.org, linux-mips@vger.kernel.org,
"René van Dorst" <opensource@vdorst.com>,
"Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: Re: [linux-next:master 6141/9308] arch/mips/lib/crypto/chacha-core.S:264:118: error: unknown instruction, did you mean: rol, rotr?
Date: Wed, 7 May 2025 15:18:46 -0700 [thread overview]
Message-ID: <20250507221846.GA526360@sol> (raw)
In-Reply-To: <202505080409.EujEBwA0-lkp@intel.com>
[+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
parent reply other threads:[~2025-05-07 22:18 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202505080409.EujEBwA0-lkp@intel.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250507221846.GA526360@sol \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=opensource@vdorst.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).