1 /* SPDX-License-Identifier: Apache-2.0 */ 2 /* 3 * Copyright (C) 2021 Synopsys, Inc. (www.synopsys.com) 4 * 5 * Author: Vineet Gupta <vgupta@synopsys.com> 6 * 7 * ALU/Memory instructions pseudo-mnemonics for ARCv2 and ARC32 ISA 8 */ 9 10 .irp cc,,.hi,.nz 11 .macro MOVR\cc d, s 12 mov\cc \d, \s 13 .endm 14 .endr 15 16 .irp aa,,.ab,.as,.aw 17 .macro LDR\aa d, s, off=0 18 ld\aa \d, [\s, \off] 19 .endm 20 .endr 21 22 .irp aa,,.ab,.as,.aw 23 .macro STR\aa d, s, off=0 24 ; workaround assembler barfing for ST r, [@symb, 0] 25 .if \off == 0 26 st\aa \d, [\s] 27 .else 28 st\aa \d, [\s, \off] 29 .endif 30 .endm 31 .endr 32 33 .macro PUSHR r 34 push \r 35 .endm 36 37 .macro POPR r 38 pop \r 39 .endm 40 41 .macro LRR d, aux 42 lr \d, \aux 43 .endm 44 45 .macro SRR d, aux 46 sr \d, \aux 47 .endm 48 49 .irp cc,,.nz 50 .macro ADDR\cc d, s, v 51 add\cc \d, \s, \v 52 .endm 53 .endr 54 55 .irp cc,,.nz 56 .macro ADD2R\cc d, s, v 57 add2\cc \d, \s, \v 58 .endm 59 .endr 60 61 .macro ADD3R d, s, v 62 add3 \d, \s, \v 63 .endm 64 65 .macro SUBR d, s, v 66 sub \d, \s, \v 67 .endm 68 69 .macro BMSKNR d, s, v 70 bmskn \d, \s, \v 71 .endm 72 73 .macro LSRR d, s, v 74 lsr \d, \s, \v 75 .endm 76 77 .macro ASLR d, s, v 78 asl \d, \s, \v 79 .endm 80 81 .macro ANDR d, s, v 82 and \d, \s, \v 83 .endm 84 85 .macro ORR, d, s, v 86 or \d, \s, \v 87 .endm 88 89 .irp cc,ne,eq 90 .macro BRR\cc d, s, lbl 91 br\cc \d, \s, \lbl 92 .endm 93 .endr 94 95 .macro BREQR d, s, lbl 96 breq \d, \s, \lbl 97 .endm 98 99 .macro CMPR op1, op2 100 cmp \op1, \op2 101 .endm 102