1 # RUN: llvm-mc -triple hexagon -disassemble < %s | FileCheck %s 2 # Hexagon Programmer's Reference Manual 11.1.3 ALU32/PRED 3 4 # Conditional add 5 0xf1 0xc3 0x75 0x74 6 # CHECK: if (p3) r17 = add(r21, #31) 7 0x03 0x40 0x45 0x85 0xf1 0xe3 0x75 0x74 8 # CHECK: p3 = r5 9 # CHECK-NEXT: if (p3.new) r17 = add(r21, #31) 10 0xf1 0xc3 0xf5 0x74 11 # CHECK: if (!p3) r17 = add(r21, #31) 12 0x03 0x40 0x45 0x85 0xf1 0xe3 0xf5 0x74 13 # CHECK: p3 = r5 14 # CHECK-NEXT: if (!p3.new) r17 = add(r21, #31) 15 0x71 0xdf 0x15 0xfb 16 # CHECK: if (p3) r17 = add(r21, r31) 17 0x03 0x40 0x45 0x85 0x71 0xff 0x15 0xfb 18 # CHECK: p3 = r5 19 # CHECK-NEXT: if (p3.new) r17 = add(r21, r31) 20 0xf1 0xdf 0x15 0xfb 21 # CHECK: if (!p3) r17 = add(r21, r31) 22 0x03 0x40 0x45 0x85 0xf1 0xff 0x15 0xfb 23 # CHECK: p3 = r5 24 # CHECK-NEXT: if (!p3.new) r17 = add(r21, r31) 25 26 # Conditional shift halfword 27 0x11 0xe3 0x15 0x70 28 # CHECK: if (p3) r17 = aslh(r21) 29 0x03 0x40 0x45 0x85 0x11 0xe7 0x15 0x70 30 # CHECK: p3 = r5 31 # CHECK-NEXT: if (p3.new) r17 = aslh(r21) 32 0x11 0xeb 0x15 0x70 33 # CHECK: if (!p3) r17 = aslh(r21) 34 0x03 0x40 0x45 0x85 0x11 0xef 0x15 0x70 35 # CHECK: p3 = r5 36 # CHECK-NEXT: if (!p3.new) r17 = aslh(r21) 37 0x11 0xe3 0x35 0x70 38 # CHECK: if (p3) r17 = asrh(r21) 39 0x03 0x40 0x45 0x85 0x11 0xe7 0x35 0x70 40 # CHECK: p3 = r5 41 # CHECK-NEXT: if (p3.new) r17 = asrh(r21) 42 0x11 0xeb 0x35 0x70 43 # CHECK: if (!p3) r17 = asrh(r21) 44 0x03 0x40 0x45 0x85 0x11 0xef 0x35 0x70 45 # CHECK: p3 = r5 46 # CHECK-NEXT: if (!p3.new) r17 = asrh(r21) 47 48 # Conditional combine 49 0x70 0xdf 0x15 0xfd 50 # CHECK: if (p3) r17:16 = combine(r21, r31) 51 0xf0 0xdf 0x15 0xfd 52 # CHECK: if (!p3) r17:16 = combine(r21, r31) 53 0x03 0x40 0x45 0x85 0x70 0xff 0x15 0xfd 54 # CHECK: p3 = r5 55 # CHECK-NEXT: if (p3.new) r17:16 = combine(r21, r31) 56 0x03 0x40 0x45 0x85 0xf0 0xff 0x15 0xfd 57 # CHECK: p3 = r5 58 # CHECK-NEXT: if (!p3.new) r17:16 = combine(r21, r31) 59 60 # Conditional logical operations 61 0x71 0xdf 0x15 0xf9 62 # CHECK: if (p3) r17 = and(r21, r31) 63 0xf1 0xdf 0x15 0xf9 64 # CHECK: if (!p3) r17 = and(r21, r31) 65 0x03 0x40 0x45 0x85 0x71 0xff 0x15 0xf9 66 # CHECK: p3 = r5 67 # CHECK-NEXT: if (p3.new) r17 = and(r21, r31) 68 0x03 0x40 0x45 0x85 0xf1 0xff 0x15 0xf9 69 # CHECK: p3 = r5 70 # CHECK-NEXT: if (!p3.new) r17 = and(r21, r31) 71 0x71 0xdf 0x35 0xf9 72 # CHECK: if (p3) r17 = or(r21, r31) 73 0xf1 0xdf 0x35 0xf9 74 # CHECK: if (!p3) r17 = or(r21, r31) 75 0x03 0x40 0x45 0x85 0x71 0xff 0x35 0xf9 76 # CHECK: p3 = r5 77 # CHECK-NEXT: if (p3.new) r17 = or(r21, r31) 78 0x03 0x40 0x45 0x85 0xf1 0xff 0x35 0xf9 79 # CHECK: p3 = r5 80 # CHECK-NEXT: if (!p3.new) r17 = or(r21, r31) 81 0x71 0xdf 0x75 0xf9 82 # CHECK: if (p3) r17 = xor(r21, r31) 83 0xf1 0xdf 0x75 0xf9 84 # CHECK: if (!p3) r17 = xor(r21, r31) 85 0x03 0x40 0x45 0x85 0x71 0xff 0x75 0xf9 86 # CHECK: p3 = r5 87 # CHECK-NEXT: if (p3.new) r17 = xor(r21, r31) 88 0x03 0x40 0x45 0x85 0xf1 0xff 0x75 0xf9 89 # CHECK: p3 = r5 90 # CHECK-NEXT: if (!p3.new) r17 = xor(r21, r31) 91 92 # Conditional subtract 93 0x71 0xdf 0x35 0xfb 94 # CHECK: if (p3) r17 = sub(r31, r21) 95 0xf1 0xdf 0x35 0xfb 96 # CHECK: if (!p3) r17 = sub(r31, r21) 97 0x03 0x40 0x45 0x85 0x71 0xff 0x35 0xfb 98 # CHECK: p3 = r5 99 # CHECK-NEXT: if (p3.new) r17 = sub(r31, r21) 100 0x03 0x40 0x45 0x85 0xf1 0xff 0x35 0xfb 101 # CHECK: p3 = r5 102 # CHECK-NEXT: if (!p3.new) r17 = sub(r31, r21) 103 104 # Conditional sign extend 105 0x11 0xe3 0xb5 0x70 106 # CHECK: if (p3) r17 = sxtb(r21) 107 0x11 0xeb 0xb5 0x70 108 # CHECK: if (!p3) r17 = sxtb(r21) 109 0x03 0x40 0x45 0x85 0x11 0xe7 0xb5 0x70 110 # CHECK: p3 = r5 111 # CHECK-NEXT: if (p3.new) r17 = sxtb(r21) 112 0x03 0x40 0x45 0x85 0x11 0xef 0xb5 0x70 113 # CHECK: p3 = r5 114 # CHECK-NEXT: if (!p3.new) r17 = sxtb(r21) 115 0x11 0xe3 0xf5 0x70 116 # CHECK: if (p3) r17 = sxth(r21) 117 0x11 0xeb 0xf5 0x70 118 # CHECK: if (!p3) r17 = sxth(r21) 119 0x03 0x40 0x45 0x85 0x11 0xe7 0xf5 0x70 120 # CHECK: p3 = r5 121 # CHECK-NEXT: if (p3.new) r17 = sxth(r21) 122 0x03 0x40 0x45 0x85 0x11 0xef 0xf5 0x70 123 # CHECK: p3 = r5 124 # CHECK-NEXT: if (!p3.new) r17 = sxth(r21) 125 126 # Conditional transfer 127 0xb1 0xc2 0x60 0x7e 128 # CHECK: if (p3) r17 = #21 129 0xb1 0xc2 0xe0 0x7e 130 # CHECK: if (!p3) r17 = #21 131 0x03 0x40 0x45 0x85 0xb1 0xe2 0x60 0x7e 132 # CHECK: p3 = r5 133 # CHECK-NEXT: if (p3.new) r17 = #21 134 0x03 0x40 0x45 0x85 0xb1 0xe2 0xe0 0x7e 135 # CHECK: p3 = r5 136 # CHECK-NEXT: if (!p3.new) r17 = #21 137 138 # Conditional zero extend 139 0x11 0xe3 0x95 0x70 140 # CHECK: if (p3) r17 = zxtb(r21) 141 0x11 0xeb 0x95 0x70 142 # CHECK: if (!p3) r17 = zxtb(r21) 143 0x03 0x40 0x45 0x85 0x11 0xe7 0x95 0x70 144 # CHECK: p3 = r5 145 # CHECK-NEXT: if (p3.new) r17 = zxtb(r21) 146 0x03 0x40 0x45 0x85 0x11 0xef 0x95 0x70 147 # CHECK: p3 = r5 148 # CHECK-NEXT: if (!p3.new) r17 = zxtb(r21) 149 0x11 0xe3 0xd5 0x70 150 # CHECK: if (p3) r17 = zxth(r21) 151 0x11 0xeb 0xd5 0x70 152 # CHECK: if (!p3) r17 = zxth(r21) 153 0x03 0x40 0x45 0x85 0x11 0xe7 0xd5 0x70 154 # CHECK: p3 = r5 155 # CHECK-NEXT: if (p3.new) r17 = zxth(r21) 156 0x03 0x40 0x45 0x85 0x11 0xef 0xd5 0x70 157 # CHECK: p3 = r5 158 # CHECK-NEXT: if (!p3.new) r17 = zxth(r21) 159 160 # Compare 161 0xe3 0xc3 0x15 0x75 162 # CHECK: p3 = cmp.eq(r21, #31) 163 0xf3 0xc3 0x15 0x75 164 # CHECK: p3 = !cmp.eq(r21, #31) 165 0xe3 0xc3 0x55 0x75 166 # CHECK: p3 = cmp.gt(r21, #31) 167 0xf3 0xc3 0x55 0x75 168 # CHECK: p3 = !cmp.gt(r21, #31) 169 0xe3 0xc3 0x95 0x75 170 # CHECK: p3 = cmp.gtu(r21, #31) 171 0xf3 0xc3 0x95 0x75 172 # CHECK: p3 = !cmp.gtu(r21, #31) 173 0x03 0xdf 0x15 0xf2 174 # CHECK: p3 = cmp.eq(r21, r31) 175 0x13 0xdf 0x15 0xf2 176 # CHECK: p3 = !cmp.eq(r21, r31) 177 0x03 0xdf 0x55 0xf2 178 # CHECK: p3 = cmp.gt(r21, r31) 179 0x13 0xdf 0x55 0xf2 180 # CHECK: p3 = !cmp.gt(r21, r31) 181 0x03 0xdf 0x75 0xf2 182 # CHECK: p3 = cmp.gtu(r21, r31) 183 0x13 0xdf 0x75 0xf2 184 # CHECK: p3 = !cmp.gtu(r21, r31) 185 186 # Compare to general register 187 0xf1 0xe3 0x55 0x73 188 # CHECK: r17 = cmp.eq(r21, #31) 189 0xf1 0xe3 0x75 0x73 190 # CHECK: r17 = !cmp.eq(r21, #31) 191 0x11 0xdf 0x55 0xf3 192 # CHECK: r17 = cmp.eq(r21, r31) 193 0x11 0xdf 0x75 0xf3 194 # CHECK: r17 = !cmp.eq(r21, r31) 195