266 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd -verify-machineinstrs | FileCheck %s3 4define i16 @shld16rrcl(i16 noundef %a, i16 noundef %b, i8 %cl) {5; CHECK-LABEL: shld16rrcl:6; CHECK: # %bb.0: # %entry7; CHECK-NEXT: andb $15, %dl, %cl8; CHECK-NEXT: shldw %cl, %si, %di, %ax9; CHECK-NEXT: retq10entry:11 %clin = sext i8 %cl to i1612 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %clin)13 ret i16 %shld14}15 16define i16 @shld16rrcl_mask(i16 noundef %a, i16 noundef %b, i8 %cl) {17; CHECK-LABEL: shld16rrcl_mask:18; CHECK: # %bb.0: # %entry19; CHECK-NEXT: andb $15, %dl, %cl20; CHECK-NEXT: shldw %cl, %si, %di, %ax21; CHECK-NEXT: retq22entry:23 %clin = sext i8 %cl to i1624 %shamt = and i16 %clin, 3125 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %shamt)26 ret i16 %shld27}28 29define i32 @shld32rrcl(i32 noundef %a, i32 noundef %b, i8 %cl) {30; CHECK-LABEL: shld32rrcl:31; CHECK: # %bb.0: # %entry32; CHECK-NEXT: movl %edx, %ecx33; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx34; CHECK-NEXT: shldl %cl, %esi, %edi, %eax35; CHECK-NEXT: retq36entry:37 %clin = sext i8 %cl to i3238 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %clin)39 ret i32 %shld40}41 42define i32 @shld32rrcl_mask(i32 noundef %a, i32 noundef %b, i8 %cl) {43; CHECK-LABEL: shld32rrcl_mask:44; CHECK: # %bb.0: # %entry45; CHECK-NEXT: movl %edx, %ecx46; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx47; CHECK-NEXT: shldl %cl, %esi, %edi, %eax48; CHECK-NEXT: retq49entry:50 %clin = sext i8 %cl to i3251 %shamt = and i32 %clin, 3152 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %shamt)53 ret i32 %shld54}55 56define i64 @shld64rrcl(i64 noundef %a, i64 noundef %b, i8 %cl) {57; CHECK-LABEL: shld64rrcl:58; CHECK: # %bb.0: # %entry59; CHECK-NEXT: movl %edx, %ecx60; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx61; CHECK-NEXT: shldq %cl, %rsi, %rdi, %rax62; CHECK-NEXT: retq63entry:64 %clin = sext i8 %cl to i6465 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)66 ret i64 %shld67}68 69define i64 @shld64rrcl_mask(i64 noundef %a, i64 noundef %b, i8 %cl) {70; CHECK-LABEL: shld64rrcl_mask:71; CHECK: # %bb.0: # %entry72; CHECK-NEXT: movl %edx, %ecx73; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx74; CHECK-NEXT: shldq %cl, %rsi, %rdi, %rax75; CHECK-NEXT: retq76entry:77 %clin = sext i8 %cl to i6478 %shamt = and i64 %clin, 6379 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)80 ret i64 %shld81}82 83define i16 @shld16rri8(i16 noundef %a, i16 noundef %b) {84; CHECK-LABEL: shld16rri8:85; CHECK: # %bb.0: # %entry86; CHECK-NEXT: shldw $12, %si, %di, %ax87; CHECK-NEXT: retq88entry:89 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 12)90 ret i16 %shld91}92 93define i32 @shld32rri8(i32 noundef %a, i32 noundef %b) {94; CHECK-LABEL: shld32rri8:95; CHECK: # %bb.0: # %entry96; CHECK-NEXT: shldl $12, %esi, %edi, %eax97; CHECK-NEXT: retq98entry:99 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 12)100 ret i32 %shld101}102 103define i64 @shld64rri8(i64 noundef %a, i64 noundef %b) {104; CHECK-LABEL: shld64rri8:105; CHECK: # %bb.0: # %entry106; CHECK-NEXT: shldq $12, %rsi, %rdi, %rax107; CHECK-NEXT: retq108entry:109 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 12)110 ret i64 %shld111}112 113define i16 @shld16mrcl(ptr %ptr, i16 noundef %b, i8 %cl) {114; CHECK-LABEL: shld16mrcl:115; CHECK: # %bb.0: # %entry116; CHECK-NEXT: andb $15, %dl, %cl117; CHECK-NEXT: shldw %cl, %si, (%rdi), %ax118; CHECK-NEXT: retq119entry:120 %a = load i16, ptr %ptr121 %clin = sext i8 %cl to i16122 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %clin)123 ret i16 %shld124}125 126define i32 @shld32mrcl(ptr %ptr, i32 noundef %b, i8 %cl) {127; CHECK-LABEL: shld32mrcl:128; CHECK: # %bb.0: # %entry129; CHECK-NEXT: movl %edx, %ecx130; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx131; CHECK-NEXT: shldl %cl, %esi, (%rdi), %eax132; CHECK-NEXT: retq133entry:134 %a = load i32, ptr %ptr135 %clin = sext i8 %cl to i32136 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %clin)137 ret i32 %shld138}139 140define i64 @shld64mrcl(ptr %ptr, i64 noundef %b, i8 %cl) {141; CHECK-LABEL: shld64mrcl:142; CHECK: # %bb.0: # %entry143; CHECK-NEXT: movl %edx, %ecx144; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx145; CHECK-NEXT: shldq %cl, %rsi, (%rdi), %rax146; CHECK-NEXT: retq147entry:148 %a = load i64, ptr %ptr149 %clin = sext i8 %cl to i64150 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)151 ret i64 %shld152}153 154define i16 @shld16mri8(ptr %ptr, i16 noundef %b) {155; CHECK-LABEL: shld16mri8:156; CHECK: # %bb.0: # %entry157; CHECK-NEXT: shldw $12, %si, (%rdi), %ax158; CHECK-NEXT: retq159entry:160 %a = load i16, ptr %ptr161 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 12)162 ret i16 %shld163}164 165define i32 @shld32mri8(ptr %ptr, i32 noundef %b) {166; CHECK-LABEL: shld32mri8:167; CHECK: # %bb.0: # %entry168; CHECK-NEXT: shldl $12, %esi, (%rdi), %eax169; CHECK-NEXT: retq170entry:171 %a = load i32, ptr %ptr172 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 12)173 ret i32 %shld174}175 176define i64 @shld64mri8(ptr %ptr, i64 noundef %b) {177; CHECK-LABEL: shld64mri8:178; CHECK: # %bb.0: # %entry179; CHECK-NEXT: shldq $12, %rsi, (%rdi), %rax180; CHECK-NEXT: retq181entry:182 %a = load i64, ptr %ptr183 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 12)184 ret i64 %shld185}186 187define void @shld16mrcl_legacy(ptr %ptr, i16 noundef %b, i8 %cl) {188; CHECK-LABEL: shld16mrcl_legacy:189; CHECK: # %bb.0: # %entry190; CHECK-NEXT: andb $15, %dl, %cl191; CHECK-NEXT: shldw %cl, %si, (%rdi)192; CHECK-NEXT: retq193entry:194 %a = load i16, ptr %ptr195 %clin = sext i8 %cl to i16196 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %clin)197 store i16 %shld, ptr %ptr198 ret void199}200 201define void @shld32mrcl_legacy(ptr %ptr, i32 noundef %b, i8 %cl) {202; CHECK-LABEL: shld32mrcl_legacy:203; CHECK: # %bb.0: # %entry204; CHECK-NEXT: movl %edx, %ecx205; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx206; CHECK-NEXT: shldl %cl, %esi, (%rdi)207; CHECK-NEXT: retq208entry:209 %a = load i32, ptr %ptr210 %clin = sext i8 %cl to i32211 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %clin)212 store i32 %shld, ptr %ptr213 ret void214}215 216define void @shld64mrcl_legacy(ptr %ptr, i64 noundef %b, i8 %cl) {217; CHECK-LABEL: shld64mrcl_legacy:218; CHECK: # %bb.0: # %entry219; CHECK-NEXT: movl %edx, %ecx220; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx221; CHECK-NEXT: shldq %cl, %rsi, (%rdi)222; CHECK-NEXT: retq223entry:224 %a = load i64, ptr %ptr225 %clin = sext i8 %cl to i64226 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)227 store i64 %shld, ptr %ptr228 ret void229}230 231define void @shld16mri8_legacy(ptr %ptr, i16 noundef %b) {232; CHECK-LABEL: shld16mri8_legacy:233; CHECK: # %bb.0: # %entry234; CHECK-NEXT: shldw $12, %si, (%rdi)235; CHECK-NEXT: retq236entry:237 %a = load i16, ptr %ptr238 %shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 12)239 store i16 %shld, ptr %ptr240 ret void241}242 243define void @shld32mri8_legacy(ptr %ptr, i32 noundef %b) {244; CHECK-LABEL: shld32mri8_legacy:245; CHECK: # %bb.0: # %entry246; CHECK-NEXT: shldl $12, %esi, (%rdi)247; CHECK-NEXT: retq248entry:249 %a = load i32, ptr %ptr250 %shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 12)251 store i32 %shld, ptr %ptr252 ret void253}254 255define void @shld64mri8_legacy(ptr %ptr, i64 noundef %b) {256; CHECK-LABEL: shld64mri8_legacy:257; CHECK: # %bb.0: # %entry258; CHECK-NEXT: shldq $12, %rsi, (%rdi)259; CHECK-NEXT: retq260entry:261 %a = load i64, ptr %ptr262 %shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 12)263 store i64 %shld, ptr %ptr264 ret void265}266