285 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s --check-prefixes=ALL3define void @lshr_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {4; ALL-LABEL: lshr_4bytes:5; ALL: // %bb.0:6; ALL-NEXT: ldr w8, [x0]7; ALL-NEXT: ldr w9, [x1]8; ALL-NEXT: lsr w8, w8, w99; ALL-NEXT: str w8, [x2]10; ALL-NEXT: ret11 %src = load i32, ptr %src.ptr, align 112 %bitOff = load i32, ptr %bitOff.ptr, align 113 %res = lshr i32 %src, %bitOff14 store i32 %res, ptr %dst, align 115 ret void16}17define void @shl_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {18; ALL-LABEL: shl_4bytes:19; ALL: // %bb.0:20; ALL-NEXT: ldr w8, [x0]21; ALL-NEXT: ldr w9, [x1]22; ALL-NEXT: lsl w8, w8, w923; ALL-NEXT: str w8, [x2]24; ALL-NEXT: ret25 %src = load i32, ptr %src.ptr, align 126 %bitOff = load i32, ptr %bitOff.ptr, align 127 %res = shl i32 %src, %bitOff28 store i32 %res, ptr %dst, align 129 ret void30}31define void @ashr_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {32; ALL-LABEL: ashr_4bytes:33; ALL: // %bb.0:34; ALL-NEXT: ldr w8, [x0]35; ALL-NEXT: ldr w9, [x1]36; ALL-NEXT: asr w8, w8, w937; ALL-NEXT: str w8, [x2]38; ALL-NEXT: ret39 %src = load i32, ptr %src.ptr, align 140 %bitOff = load i32, ptr %bitOff.ptr, align 141 %res = ashr i32 %src, %bitOff42 store i32 %res, ptr %dst, align 143 ret void44}45define void @lshr_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {46; ALL-LABEL: lshr_8bytes:47; ALL: // %bb.0:48; ALL-NEXT: ldr x8, [x0]49; ALL-NEXT: ldr x9, [x1]50; ALL-NEXT: lsr x8, x8, x951; ALL-NEXT: str x8, [x2]52; ALL-NEXT: ret53 %src = load i64, ptr %src.ptr, align 154 %bitOff = load i64, ptr %bitOff.ptr, align 155 %res = lshr i64 %src, %bitOff56 store i64 %res, ptr %dst, align 157 ret void58}59define void @shl_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {60; ALL-LABEL: shl_8bytes:61; ALL: // %bb.0:62; ALL-NEXT: ldr x8, [x0]63; ALL-NEXT: ldr x9, [x1]64; ALL-NEXT: lsl x8, x8, x965; ALL-NEXT: str x8, [x2]66; ALL-NEXT: ret67 %src = load i64, ptr %src.ptr, align 168 %bitOff = load i64, ptr %bitOff.ptr, align 169 %res = shl i64 %src, %bitOff70 store i64 %res, ptr %dst, align 171 ret void72}73define void @ashr_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {74; ALL-LABEL: ashr_8bytes:75; ALL: // %bb.0:76; ALL-NEXT: ldr x8, [x0]77; ALL-NEXT: ldr x9, [x1]78; ALL-NEXT: asr x8, x8, x979; ALL-NEXT: str x8, [x2]80; ALL-NEXT: ret81 %src = load i64, ptr %src.ptr, align 182 %bitOff = load i64, ptr %bitOff.ptr, align 183 %res = ashr i64 %src, %bitOff84 store i64 %res, ptr %dst, align 185 ret void86}87define void @lshr_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {88; ALL-LABEL: lshr_16bytes:89; ALL: // %bb.0:90; ALL-NEXT: ldp x10, x8, [x0]91; ALL-NEXT: ldr x9, [x1]92; ALL-NEXT: mvn w12, w993; ALL-NEXT: tst x9, #0x4094; ALL-NEXT: lsl x11, x8, #195; ALL-NEXT: lsr x10, x10, x996; ALL-NEXT: lsr x8, x8, x997; ALL-NEXT: lsl x11, x11, x1298; ALL-NEXT: orr x9, x11, x1099; ALL-NEXT: csel x10, xzr, x8, ne100; ALL-NEXT: csel x8, x8, x9, ne101; ALL-NEXT: stp x8, x10, [x2]102; ALL-NEXT: ret103 %src = load i128, ptr %src.ptr, align 1104 %bitOff = load i128, ptr %bitOff.ptr, align 1105 %res = lshr i128 %src, %bitOff106 store i128 %res, ptr %dst, align 1107 ret void108}109define void @shl_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {110; ALL-LABEL: shl_16bytes:111; ALL: // %bb.0:112; ALL-NEXT: ldp x8, x10, [x0]113; ALL-NEXT: ldr x9, [x1]114; ALL-NEXT: mvn w12, w9115; ALL-NEXT: tst x9, #0x40116; ALL-NEXT: lsr x11, x8, #1117; ALL-NEXT: lsl x10, x10, x9118; ALL-NEXT: lsl x8, x8, x9119; ALL-NEXT: lsr x11, x11, x12120; ALL-NEXT: orr x9, x10, x11121; ALL-NEXT: csel x10, xzr, x8, ne122; ALL-NEXT: csel x8, x8, x9, ne123; ALL-NEXT: stp x10, x8, [x2]124; ALL-NEXT: ret125 %src = load i128, ptr %src.ptr, align 1126 %bitOff = load i128, ptr %bitOff.ptr, align 1127 %res = shl i128 %src, %bitOff128 store i128 %res, ptr %dst, align 1129 ret void130}131define void @ashr_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {132; ALL-LABEL: ashr_16bytes:133; ALL: // %bb.0:134; ALL-NEXT: ldp x9, x8, [x0]135; ALL-NEXT: ldr x10, [x1]136; ALL-NEXT: mvn w12, w10137; ALL-NEXT: tst x10, #0x40138; ALL-NEXT: lsl x11, x8, #1139; ALL-NEXT: lsr x9, x9, x10140; ALL-NEXT: lsl x11, x11, x12141; ALL-NEXT: asr x12, x8, x10142; ALL-NEXT: asr x8, x8, #63143; ALL-NEXT: orr x9, x11, x9144; ALL-NEXT: csel x8, x8, x12, ne145; ALL-NEXT: csel x9, x12, x9, ne146; ALL-NEXT: stp x9, x8, [x2]147; ALL-NEXT: ret148 %src = load i128, ptr %src.ptr, align 1149 %bitOff = load i128, ptr %bitOff.ptr, align 1150 %res = ashr i128 %src, %bitOff151 store i128 %res, ptr %dst, align 1152 ret void153}154define void @lshr_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {155; ALL-LABEL: lshr_32bytes:156; ALL: // %bb.0:157; ALL-NEXT: sub sp, sp, #64158; ALL-NEXT: ldp x9, x8, [x0, #16]159; ALL-NEXT: movi v0.2d, #0000000000000000160; ALL-NEXT: ldr x10, [x1]161; ALL-NEXT: ldr q1, [x0]162; ALL-NEXT: stp x9, x8, [sp, #16]163; ALL-NEXT: lsr x8, x10, #3164; ALL-NEXT: mov x9, sp165; ALL-NEXT: str q1, [sp]166; ALL-NEXT: and x12, x10, #0x3f167; ALL-NEXT: and x8, x8, #0x18168; ALL-NEXT: stp q0, q0, [sp, #32]169; ALL-NEXT: eor x12, x12, #0x3f170; ALL-NEXT: add x8, x9, x8171; ALL-NEXT: ldp x13, x9, [x8]172; ALL-NEXT: ldp x8, x11, [x8, #16]173; ALL-NEXT: lsl x15, x9, #1174; ALL-NEXT: lsr x9, x9, x10175; ALL-NEXT: lsr x13, x13, x10176; ALL-NEXT: lsl x14, x11, #1177; ALL-NEXT: lsr x11, x11, x10178; ALL-NEXT: lsl x14, x14, x12179; ALL-NEXT: lsl x12, x15, x12180; ALL-NEXT: lsl x15, x8, #1181; ALL-NEXT: lsr x8, x8, x10182; ALL-NEXT: mvn w10, w10183; ALL-NEXT: lsl x10, x15, x10184; ALL-NEXT: orr x8, x14, x8185; ALL-NEXT: stp x8, x11, [x2, #16]186; ALL-NEXT: orr x11, x12, x13187; ALL-NEXT: orr x8, x9, x10188; ALL-NEXT: stp x11, x8, [x2]189; ALL-NEXT: add sp, sp, #64190; ALL-NEXT: ret191 %src = load i256, ptr %src.ptr, align 1192 %bitOff = load i256, ptr %bitOff.ptr, align 1193 %res = lshr i256 %src, %bitOff194 store i256 %res, ptr %dst, align 1195 ret void196}197define void @shl_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {198; ALL-LABEL: shl_32bytes:199; ALL: // %bb.0:200; ALL-NEXT: sub sp, sp, #64201; ALL-NEXT: ldp x9, x8, [x0, #16]202; ALL-NEXT: movi v0.2d, #0000000000000000203; ALL-NEXT: ldr x10, [x1]204; ALL-NEXT: ldr q1, [x0]205; ALL-NEXT: stp x9, x8, [sp, #48]206; ALL-NEXT: lsr x8, x10, #3207; ALL-NEXT: mov x9, sp208; ALL-NEXT: add x9, x9, #32209; ALL-NEXT: stp q0, q1, [sp, #16]210; ALL-NEXT: and x12, x10, #0x3f211; ALL-NEXT: and x8, x8, #0x18212; ALL-NEXT: str q0, [sp]213; ALL-NEXT: eor x12, x12, #0x3f214; ALL-NEXT: sub x8, x9, x8215; ALL-NEXT: ldp x9, x13, [x8, #16]216; ALL-NEXT: ldp x11, x8, [x8]217; ALL-NEXT: lsr x14, x9, #1218; ALL-NEXT: lsl x9, x9, x10219; ALL-NEXT: lsl x13, x13, x10220; ALL-NEXT: lsr x15, x11, #1221; ALL-NEXT: lsl x11, x11, x10222; ALL-NEXT: lsr x14, x14, x12223; ALL-NEXT: lsr x12, x15, x12224; ALL-NEXT: lsr x15, x8, #1225; ALL-NEXT: lsl x8, x8, x10226; ALL-NEXT: mvn w10, w10227; ALL-NEXT: lsr x10, x15, x10228; ALL-NEXT: orr x8, x8, x12229; ALL-NEXT: stp x11, x8, [x2]230; ALL-NEXT: orr x11, x13, x14231; ALL-NEXT: orr x8, x9, x10232; ALL-NEXT: stp x8, x11, [x2, #16]233; ALL-NEXT: add sp, sp, #64234; ALL-NEXT: ret235 %src = load i256, ptr %src.ptr, align 1236 %bitOff = load i256, ptr %bitOff.ptr, align 1237 %res = shl i256 %src, %bitOff238 store i256 %res, ptr %dst, align 1239 ret void240}241define void @ashr_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {242; ALL-LABEL: ashr_32bytes:243; ALL: // %bb.0:244; ALL-NEXT: sub sp, sp, #64245; ALL-NEXT: ldp x9, x8, [x0, #16]246; ALL-NEXT: mov x11, sp247; ALL-NEXT: ldr x10, [x1]248; ALL-NEXT: ldr q0, [x0]249; ALL-NEXT: stp x9, x8, [sp, #16]250; ALL-NEXT: lsr x9, x10, #3251; ALL-NEXT: asr x8, x8, #63252; ALL-NEXT: str q0, [sp]253; ALL-NEXT: and x12, x10, #0x3f254; ALL-NEXT: and x9, x9, #0x18255; ALL-NEXT: stp x8, x8, [sp, #48]256; ALL-NEXT: eor x12, x12, #0x3f257; ALL-NEXT: stp x8, x8, [sp, #32]258; ALL-NEXT: add x8, x11, x9259; ALL-NEXT: ldp x13, x9, [x8]260; ALL-NEXT: ldp x8, x11, [x8, #16]261; ALL-NEXT: lsl x15, x9, #1262; ALL-NEXT: lsr x9, x9, x10263; ALL-NEXT: lsr x13, x13, x10264; ALL-NEXT: lsl x14, x11, #1265; ALL-NEXT: asr x11, x11, x10266; ALL-NEXT: lsl x14, x14, x12267; ALL-NEXT: lsl x12, x15, x12268; ALL-NEXT: lsl x15, x8, #1269; ALL-NEXT: lsr x8, x8, x10270; ALL-NEXT: mvn w10, w10271; ALL-NEXT: lsl x10, x15, x10272; ALL-NEXT: orr x8, x14, x8273; ALL-NEXT: stp x8, x11, [x2, #16]274; ALL-NEXT: orr x11, x12, x13275; ALL-NEXT: orr x8, x9, x10276; ALL-NEXT: stp x11, x8, [x2]277; ALL-NEXT: add sp, sp, #64278; ALL-NEXT: ret279 %src = load i256, ptr %src.ptr, align 1280 %bitOff = load i256, ptr %bitOff.ptr, align 1281 %res = ashr i256 %src, %bitOff282 store i256 %res, ptr %dst, align 1283 ret void284}285