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 * pseudo-mnemonics for ALU/Memory instructions for ARC64 ISA 8 */ 9 10 .irp cc,,.hi,.nz 11 .macro MOVR\cc d, s 12 movl\cc \d, \s 13 .endm 14 .endr 15 16 .irp aa,,.ab,.as,.aw 17 .macro LDR\aa d, s, off=0 18 ldl\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 stl\aa \d, [\s] 27 .else 28 stl\aa \d, [\s, \off] 29 .endif 30 .endm 31 .endr 32 33 .macro STR d, s, off=0 34 .if \off == 0 35 stl \d, [\s] 36 .else 37 .if \off > 255 38 STR.as \d, \s, \off / 8 39 .else 40 stl \d, [\s, \off] 41 .endif 42 .endif 43 .endm 44 45 .macro PUSHR r 46 pushl \r 47 .endm 48 49 .macro POPR r 50 popl \r 51 .endm 52 53 .macro LRR d, aux 54 lrl \d, \aux 55 .endm 56 57 .macro SRR d, aux 58 srl \d, \aux 59 .endm 60 61 .irp cc,,.nz 62 .macro ADDR\cc d, s, v 63 addl\cc \d, \s, \v 64 .endm 65 .endr 66 67 .irp cc,,.nz 68 .macro ADD2R\cc d, s, v 69 add2l\cc \d, \s, \v 70 .endm 71 .endr 72 73 .macro ADD3R d, s, v 74 add3l \d, \s, \v 75 .endm 76 77 .macro SUBR d, s, v 78 subl \d, \s, \v 79 .endm 80 81 .macro BMSKNR d, s, v 82 bmsknl \d, \s, \v 83 .endm 84 85 .macro LSRR d, s, v 86 lsrl \d, \s, \v 87 .endm 88 89 .macro ASLR d, s, v 90 asll \d, \s, \v 91 .endm 92 93 .macro ANDR d, s, v 94 andl \d, \s, \v 95 .endm 96 97 .macro ORR, d, s, v 98 orl \d, \s, \v 99 .endm 100 101 .irp cc,ne,eq 102 .macro BRR\cc d, s, lbl 103 br\cc\()l \d, \s, \lbl 104 .endm 105 .endr 106 107 .macro BREQR d, s, lbl 108 breql \d, \s, \lbl 109 .endm 110 111 .macro CMPR op1, op2 112 cmpl \op1, \op2 113 .endm 114