1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s --check-prefixes=ALL
define void @lshr_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_4bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr w8, [x1]
; ALL-NEXT: ldr w9, [x0]
; ALL-NEXT: lsr w8, w9, w8
; ALL-NEXT: str w8, [x2]
; ALL-NEXT: ret
%src = load i32, ptr %src.ptr, align 1
%bitOff = load i32, ptr %bitOff.ptr, align 1
%res = lshr i32 %src, %bitOff
store i32 %res, ptr %dst, align 1
ret void
}
define void @shl_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_4bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr w8, [x1]
; ALL-NEXT: ldr w9, [x0]
; ALL-NEXT: lsl w8, w9, w8
; ALL-NEXT: str w8, [x2]
; ALL-NEXT: ret
%src = load i32, ptr %src.ptr, align 1
%bitOff = load i32, ptr %bitOff.ptr, align 1
%res = shl i32 %src, %bitOff
store i32 %res, ptr %dst, align 1
ret void
}
define void @ashr_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_4bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr w8, [x1]
; ALL-NEXT: ldr w9, [x0]
; ALL-NEXT: asr w8, w9, w8
; ALL-NEXT: str w8, [x2]
; ALL-NEXT: ret
%src = load i32, ptr %src.ptr, align 1
%bitOff = load i32, ptr %bitOff.ptr, align 1
%res = ashr i32 %src, %bitOff
store i32 %res, ptr %dst, align 1
ret void
}
define void @lshr_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_8bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr x8, [x1]
; ALL-NEXT: ldr x9, [x0]
; ALL-NEXT: lsr x8, x9, x8
; ALL-NEXT: str x8, [x2]
; ALL-NEXT: ret
%src = load i64, ptr %src.ptr, align 1
%bitOff = load i64, ptr %bitOff.ptr, align 1
%res = lshr i64 %src, %bitOff
store i64 %res, ptr %dst, align 1
ret void
}
define void @shl_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_8bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr x8, [x1]
; ALL-NEXT: ldr x9, [x0]
; ALL-NEXT: lsl x8, x9, x8
; ALL-NEXT: str x8, [x2]
; ALL-NEXT: ret
%src = load i64, ptr %src.ptr, align 1
%bitOff = load i64, ptr %bitOff.ptr, align 1
%res = shl i64 %src, %bitOff
store i64 %res, ptr %dst, align 1
ret void
}
define void @ashr_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_8bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr x8, [x1]
; ALL-NEXT: ldr x9, [x0]
; ALL-NEXT: asr x8, x9, x8
; ALL-NEXT: str x8, [x2]
; ALL-NEXT: ret
%src = load i64, ptr %src.ptr, align 1
%bitOff = load i64, ptr %bitOff.ptr, align 1
%res = ashr i64 %src, %bitOff
store i64 %res, ptr %dst, align 1
ret void
}
define void @lshr_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_16bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr x8, [x1]
; ALL-NEXT: ldp x10, x9, [x0]
; ALL-NEXT: mvn w11, w8
; ALL-NEXT: tst x8, #0x40
; ALL-NEXT: lsr x10, x10, x8
; ALL-NEXT: lsl x12, x9, #1
; ALL-NEXT: lsr x9, x9, x8
; ALL-NEXT: lsl x11, x12, x11
; ALL-NEXT: orr x8, x11, x10
; ALL-NEXT: csel x10, xzr, x9, ne
; ALL-NEXT: csel x8, x9, x8, ne
; ALL-NEXT: stp x8, x10, [x2]
; ALL-NEXT: ret
%src = load i128, ptr %src.ptr, align 1
%bitOff = load i128, ptr %bitOff.ptr, align 1
%res = lshr i128 %src, %bitOff
store i128 %res, ptr %dst, align 1
ret void
}
define void @shl_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_16bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr x8, [x1]
; ALL-NEXT: ldp x9, x10, [x0]
; ALL-NEXT: mvn w11, w8
; ALL-NEXT: tst x8, #0x40
; ALL-NEXT: lsr x12, x9, #1
; ALL-NEXT: lsl x9, x9, x8
; ALL-NEXT: lsl x10, x10, x8
; ALL-NEXT: lsr x11, x12, x11
; ALL-NEXT: orr x8, x10, x11
; ALL-NEXT: csel x10, xzr, x9, ne
; ALL-NEXT: csel x8, x9, x8, ne
; ALL-NEXT: stp x10, x8, [x2]
; ALL-NEXT: ret
%src = load i128, ptr %src.ptr, align 1
%bitOff = load i128, ptr %bitOff.ptr, align 1
%res = shl i128 %src, %bitOff
store i128 %res, ptr %dst, align 1
ret void
}
define void @ashr_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_16bytes:
; ALL: // %bb.0:
; ALL-NEXT: ldr x8, [x1]
; ALL-NEXT: ldp x10, x9, [x0]
; ALL-NEXT: mvn w11, w8
; ALL-NEXT: tst x8, #0x40
; ALL-NEXT: lsr x10, x10, x8
; ALL-NEXT: lsl x12, x9, #1
; ALL-NEXT: lsl x11, x12, x11
; ALL-NEXT: asr x12, x9, x8
; ALL-NEXT: asr x8, x9, #63
; ALL-NEXT: orr x9, x11, x10
; ALL-NEXT: csel x8, x8, x12, ne
; ALL-NEXT: csel x9, x12, x9, ne
; ALL-NEXT: stp x9, x8, [x2]
; ALL-NEXT: ret
%src = load i128, ptr %src.ptr, align 1
%bitOff = load i128, ptr %bitOff.ptr, align 1
%res = ashr i128 %src, %bitOff
store i128 %res, ptr %dst, align 1
ret void
}
define void @lshr_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_32bytes:
; ALL: // %bb.0:
; ALL-NEXT: sub sp, sp, #64
; ALL-NEXT: ldr x9, [x1]
; ALL-NEXT: mov x8, sp
; ALL-NEXT: ldp x10, x11, [x0, #16]
; ALL-NEXT: movi v0.2d, #0000000000000000
; ALL-NEXT: ldr q1, [x0]
; ALL-NEXT: ubfx x12, x9, #3, #5
; ALL-NEXT: add x8, x8, x12
; ALL-NEXT: and x9, x9, #0x7
; ALL-NEXT: stp q0, q0, [sp, #32]
; ALL-NEXT: stp x10, x11, [sp, #16]
; ALL-NEXT: eor x11, x9, #0x3f
; ALL-NEXT: str q1, [sp]
; ALL-NEXT: ldp x10, x13, [x8, #8]
; ALL-NEXT: ldr x12, [x8, #24]
; ALL-NEXT: ldr x8, [x8]
; ALL-NEXT: lsl x14, x10, #1
; ALL-NEXT: lsr x10, x10, x9
; ALL-NEXT: lsl x15, x12, #1
; ALL-NEXT: lsl x14, x14, x11
; ALL-NEXT: lsl x11, x15, x11
; ALL-NEXT: mvn w15, w9
; ALL-NEXT: lsr x8, x8, x9
; ALL-NEXT: lsr x12, x12, x9
; ALL-NEXT: lsr x9, x13, x9
; ALL-NEXT: orr x8, x8, x14
; ALL-NEXT: orr x9, x9, x11
; ALL-NEXT: lsl x11, x13, #1
; ALL-NEXT: lsl x11, x11, x15
; ALL-NEXT: orr x10, x10, x11
; ALL-NEXT: stp x9, x12, [x2, #16]
; ALL-NEXT: stp x8, x10, [x2]
; ALL-NEXT: add sp, sp, #64
; ALL-NEXT: ret
%src = load i256, ptr %src.ptr, align 1
%bitOff = load i256, ptr %bitOff.ptr, align 1
%res = lshr i256 %src, %bitOff
store i256 %res, ptr %dst, align 1
ret void
}
define void @shl_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_32bytes:
; ALL: // %bb.0:
; ALL-NEXT: sub sp, sp, #64
; ALL-NEXT: ldr x9, [x1]
; ALL-NEXT: mov x8, sp
; ALL-NEXT: ldp x10, x11, [x0, #16]
; ALL-NEXT: movi v0.2d, #0000000000000000
; ALL-NEXT: add x8, x8, #32
; ALL-NEXT: ldr q1, [x0]
; ALL-NEXT: ubfx x12, x9, #3, #5
; ALL-NEXT: sub x8, x8, x12
; ALL-NEXT: and x9, x9, #0x7
; ALL-NEXT: mvn w12, w9
; ALL-NEXT: eor x14, x9, #0x3f
; ALL-NEXT: stp q0, q0, [sp]
; ALL-NEXT: stp x10, x11, [sp, #48]
; ALL-NEXT: str q1, [sp, #32]
; ALL-NEXT: ldp x11, x10, [x8, #8]
; ALL-NEXT: ldr x13, [x8]
; ALL-NEXT: ldr x8, [x8, #24]
; ALL-NEXT: lsr x15, x11, #1
; ALL-NEXT: lsl x11, x11, x9
; ALL-NEXT: lsr x16, x10, #1
; ALL-NEXT: lsr x12, x15, x12
; ALL-NEXT: lsr x15, x13, #1
; ALL-NEXT: lsr x16, x16, x14
; ALL-NEXT: lsr x14, x15, x14
; ALL-NEXT: lsl x13, x13, x9
; ALL-NEXT: lsl x8, x8, x9
; ALL-NEXT: lsl x9, x10, x9
; ALL-NEXT: orr x11, x11, x14
; ALL-NEXT: orr x8, x8, x16
; ALL-NEXT: orr x9, x9, x12
; ALL-NEXT: stp x13, x11, [x2]
; ALL-NEXT: stp x9, x8, [x2, #16]
; ALL-NEXT: add sp, sp, #64
; ALL-NEXT: ret
%src = load i256, ptr %src.ptr, align 1
%bitOff = load i256, ptr %bitOff.ptr, align 1
%res = shl i256 %src, %bitOff
store i256 %res, ptr %dst, align 1
ret void
}
define void @ashr_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_32bytes:
; ALL: // %bb.0:
; ALL-NEXT: sub sp, sp, #64
; ALL-NEXT: ldp x11, x10, [x0, #16]
; ALL-NEXT: mov x8, sp
; ALL-NEXT: ldr x9, [x1]
; ALL-NEXT: ldr q0, [x0]
; ALL-NEXT: asr x12, x10, #63
; ALL-NEXT: stp x11, x10, [sp, #16]
; ALL-NEXT: ubfx x10, x9, #3, #5
; ALL-NEXT: str q0, [sp]
; ALL-NEXT: add x8, x8, x10
; ALL-NEXT: and x9, x9, #0x7
; ALL-NEXT: stp x12, x12, [sp, #48]
; ALL-NEXT: eor x14, x9, #0x3f
; ALL-NEXT: stp x12, x12, [sp, #32]
; ALL-NEXT: mvn w12, w9
; ALL-NEXT: ldp x10, x11, [x8, #8]
; ALL-NEXT: ldr x13, [x8, #24]
; ALL-NEXT: ldr x8, [x8]
; ALL-NEXT: lsl x16, x10, #1
; ALL-NEXT: lsl x15, x11, #1
; ALL-NEXT: lsl x16, x16, x14
; ALL-NEXT: lsl x12, x15, x12
; ALL-NEXT: lsl x15, x13, #1
; ALL-NEXT: lsl x14, x15, x14
; ALL-NEXT: lsr x11, x11, x9
; ALL-NEXT: asr x13, x13, x9
; ALL-NEXT: lsr x8, x8, x9
; ALL-NEXT: lsr x9, x10, x9
; ALL-NEXT: orr x11, x11, x14
; ALL-NEXT: orr x8, x8, x16
; ALL-NEXT: orr x9, x9, x12
; ALL-NEXT: stp x11, x13, [x2, #16]
; ALL-NEXT: stp x8, x9, [x2]
; ALL-NEXT: add sp, sp, #64
; ALL-NEXT: ret
%src = load i256, ptr %src.ptr, align 1
%bitOff = load i256, ptr %bitOff.ptr, align 1
%res = ashr i256 %src, %bitOff
store i256 %res, ptr %dst, align 1
ret void
}
|