TIL that the ppc64 (PowerPC 64-bit) architecture overloads 'or r1,r1,r1' (and the same using all r6 or r2) to change the (hardware) priority of your thread. This came up in a Go code generation issue, and Raymond Chen mentioned it in passing in 2018.

https://github.com/golang/go/issues/57741
https://devblogs.microsoft.com/oldnewthing/20180809-00/?p=99455
Also see the discussion in this PDF: https://student.ing-steen.se/unix/aix/redbooks/sg245768.pdf

runtime: performance regression due to bad instruction used in morestack_noctxt for ppc64 in CL 425396 · Issue #57741 · golang/go

What version of Go are you using (go version)? $ go version latest Does this issue reproduce with the latest release? yes What operating system and processor architecture are you using (go env)? go...

GitHub

@cks sure does, and there's more than that: https://elixir.bootlin.com/linux/latest/source/arch/powerpc/include/asm/ppc_asm.h#L147

special casing nops like this is very useful because you can compile them in without consequences if the program runs on older hardware.

ppc_asm.h - arch/powerpc/include/asm/ppc_asm.h - Linux source code (v6.1.7) - Bootlin

Elixir Cross Referencer - Explore source code in your browser - Particularly useful for the Linux kernel and other low-level projects in C/C++ (bootloaders, C libraries...)