1*869ffda3Schristos@c Copyright (C) 2015-2020 Free Software Foundation, Inc. 2b643afa1Schristos@c This is part of the GAS manual. 3b643afa1Schristos@c For copying conditions, see the file as.texinfo. 4b643afa1Schristos@c man end 5b643afa1Schristos@ifset GENERIC 6b643afa1Schristos@page 7b643afa1Schristos@node PRU-Dependent 8b643afa1Schristos@chapter PRU Dependent Features 9b643afa1Schristos@end ifset 10b643afa1Schristos 11b643afa1Schristos@cindex PRU support 12b643afa1Schristos@menu 13b643afa1Schristos* PRU Options:: Options 14b643afa1Schristos* PRU Syntax:: Syntax 15b643afa1Schristos* PRU Relocations:: Relocations 16b643afa1Schristos* PRU Directives:: PRU Machine Directives 17b643afa1Schristos* PRU Opcodes:: Opcodes 18b643afa1Schristos@end menu 19b643afa1Schristos 20b643afa1Schristos@node PRU Options 21b643afa1Schristos@section Options 22b643afa1Schristos@cindex PRU options 23b643afa1Schristos@cindex options for PRU 24b643afa1Schristos 25b643afa1Schristos@c man begin OPTIONS 26b643afa1Schristos@table @gcctabopt 27b643afa1Schristos 28*869ffda3Schristos@cindex @code{mlink-relax} command-line option, PRU 29b643afa1Schristos@item -mlink-relax 30b643afa1SchristosAssume that LD would optimize LDI32 instructions by checking the upper 31b643afa1Schristos16 bits of the @var{expression}. If they are all zeros, then LD would 32b643afa1Schristosshorten the LDI32 instruction to a single LDI. In such case @code{@value{AS}} 33b643afa1Schristoswill output DIFF relocations for diff expressions. 34b643afa1Schristos 35*869ffda3Schristos@cindex @code{mno-link-relax} command-line option, PRU 36b643afa1Schristos@item -mno-link-relax 37b643afa1SchristosAssume that LD would not optimize LDI32 instructions. As a consequence, 38b643afa1SchristosDIFF relocations will not be emitted. 39b643afa1Schristos 40*869ffda3Schristos@cindex @code{mno-warn-regname-label} command-line option, PRU 41b643afa1Schristos@item -mno-warn-regname-label 42b643afa1SchristosDo not warn if a label name matches a register name. Usually assembler 43b643afa1Schristosprogrammers will want this warning to be emitted. C compilers may want 44b643afa1Schristosto turn this off. 45b643afa1Schristos 46b643afa1Schristos@end table 47b643afa1Schristos@c man end 48b643afa1Schristos 49b643afa1Schristos@node PRU Syntax 50b643afa1Schristos@section Syntax 51b643afa1Schristos@menu 52b643afa1Schristos* PRU Chars:: Special Characters 53b643afa1Schristos@end menu 54b643afa1Schristos 55b643afa1Schristos 56b643afa1Schristos@node PRU Chars 57b643afa1Schristos@subsection Special Characters 58b643afa1Schristos 59b643afa1Schristos@cindex line comment character, PRU 60b643afa1Schristos@cindex PRU line comment character 61b643afa1Schristos@samp{#} and @samp{;} are the line comment characters. 62b643afa1Schristos 63b643afa1Schristos 64b643afa1Schristos@node PRU Relocations 65b643afa1Schristos@section PRU Machine Relocations 66b643afa1Schristos 67b643afa1Schristos@cindex machine relocations, PRU 68b643afa1Schristos@cindex PRU machine relocations 69b643afa1Schristos 70b643afa1Schristos@table @code 71b643afa1Schristos 72b643afa1Schristos@cindex @code{pmem} directive, PRU 73b643afa1Schristos@item %pmem(@var{expression}) 74b643afa1SchristosConvert @var{expression} from byte-address to a 75b643afa1Schristosword-address. In other words, shift right by two. 76b643afa1Schristos 77b643afa1Schristos@item %label(@var{expression}) 78b643afa1SchristosMark the given operand as a label. This is useful if you need to jump to 79b643afa1Schristosa label that matches a register name. 80b643afa1Schristos 81b643afa1Schristos@smallexample 82b643afa1Schristos@group 83b643afa1Schristosr1: 84b643afa1Schristos jmp r1 ; Will jump to register R1 85b643afa1Schristos jmp %label(r1) ; Will jump to label r1 86b643afa1Schristos@end group 87b643afa1Schristos@end smallexample 88b643afa1Schristos 89b643afa1Schristos@end table 90b643afa1Schristos 91b643afa1Schristos 92b643afa1Schristos@node PRU Directives 93b643afa1Schristos@section PRU Machine Directives 94b643afa1Schristos 95b643afa1Schristos@cindex machine directives, PRU 96b643afa1Schristos@cindex PRU machine directives 97b643afa1Schristos 98b643afa1Schristos@table @code 99b643afa1Schristos 100b643afa1Schristos@cindex @code{align} directive, PRU 101b643afa1Schristos@item .align @var{expression} [, @var{expression}] 102b643afa1SchristosThis is the generic @code{.align} directive, however 103b643afa1Schristosthis aligns to a power of two. 104b643afa1Schristos 105b643afa1Schristos@cindex @code{word} directive, PRU 106b643afa1Schristos@item .word @var{expression} 107b643afa1SchristosCreate an aligned constant 4 bytes in size. 108b643afa1Schristos 109b643afa1Schristos@cindex @code{dword} directive, PRU 110b643afa1Schristos@item .dword @var{expression} 111b643afa1SchristosCreate an aligned constant 8 bytes in size. 112b643afa1Schristos 113b643afa1Schristos@cindex @code{2byte} directive, PRU 114b643afa1Schristos@item .2byte @var{expression} 115b643afa1SchristosCreate an unaligned constant 2 bytes in size. 116b643afa1Schristos 117b643afa1Schristos@cindex @code{4byte} directive, PRU 118b643afa1Schristos@item .4byte @var{expression} 119b643afa1SchristosCreate an unaligned constant 4 bytes in size. 120b643afa1Schristos 121b643afa1Schristos@cindex @code{8byte} directive, PRU 122b643afa1Schristos@item .8byte @var{expression} 123b643afa1SchristosCreate an unaligned constant 8 bytes in size. 124b643afa1Schristos 125b643afa1Schristos@cindex @code{16byte} directive, PRU 126b643afa1Schristos@item .16byte @var{expression} 127b643afa1SchristosCreate an unaligned constant 16 bytes in size. 128b643afa1Schristos 129b643afa1Schristos@cindex @code{set no_warn_regname_label} directive, PRU 130b643afa1Schristos@item .set no_warn_regname_label 131b643afa1SchristosDo not output warnings when a label name matches a register name. Equivalent 132*869ffda3Schristosto passing the @code{-mno-warn-regname-label} command-line option. 133b643afa1Schristos 134b643afa1Schristos@end table 135b643afa1Schristos 136b643afa1Schristos@node PRU Opcodes 137b643afa1Schristos@section Opcodes 138b643afa1Schristos 139b643afa1Schristos@cindex PRU opcodes 140b643afa1Schristos@cindex opcodes for PRU 141b643afa1Schristos@code{@value{AS}} implements all the standard PRU core V3 opcodes in the 142b643afa1Schristosoriginal pasm assembler. Older cores are not supported by @code{@value{AS}}. 143b643afa1Schristos 144b643afa1SchristosGAS also implements the LDI32 pseudo instruction for loading a 32-bit 145b643afa1Schristosimmediate value into a register. 146b643afa1Schristos 147b643afa1Schristos@smallexample 148b643afa1Schristos ldi32 sp, __stack_top 149b643afa1Schristos ldi32 r14, 0x12345678 150b643afa1Schristos@end smallexample 151