How to issue POWERPC instructions or byte codes?

Alan Modra amodra@gmail.com
Tue Mar 29 23:51:30 GMT 2022


On Tue, Mar 29, 2022 at 07:22:04PM -0400, Jeffrey Walton via Binutils wrote:
> I need to switch to inline assembler and byte codes so I can drop
> -mcpu=power8. ARM has .inst to issue instructions and byte codes. For
> example, here is a ARMv7 probe:
> 
>        asm volatile (
>     #if defined(__thumb__)
>            ".inst.n 0xf241, 0x2034  \n\t"   // movw r0, 0x1234
>            ".inst.n 0xf2c1, 0x2034  \n\t"   // movt r0, 0x1234
>            "mov %0, r0              \n\t"   // mov [a], r0
>     #else
>            ".inst 0xe3010234  \n\t"   // movw r0, 0x1234
>            ".inst 0xe3410234  \n\t"   // movt r0, 0x1234
>            "mov %0, r0        \n\t"   // mov [a], r0
>     #endif
>            : "=r" (a) : : "r0");
> 
> My question is, what does POWERPC offer to issue instructions or byte code?

 .machine push
 .machine power8
 power8 instructions here
 .machine pop

or if you want to emit raw machine code, just ".long <number>".

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list