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
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd -verify-machineinstrs | FileCheck %s
define i16 @shld16rrcl(i16 noundef %a, i16 noundef %b, i8 %cl) {
; CHECK-LABEL: shld16rrcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: andb $15, %dl, %cl
; CHECK-NEXT: shldw %cl, %si, %di, %ax
; CHECK-NEXT: retq
entry:
%clin = sext i8 %cl to i16
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %clin)
ret i16 %shld
}
define i16 @shld16rrcl_mask(i16 noundef %a, i16 noundef %b, i8 %cl) {
; CHECK-LABEL: shld16rrcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: andb $15, %dl, %cl
; CHECK-NEXT: shldw %cl, %si, %di, %ax
; CHECK-NEXT: retq
entry:
%clin = sext i8 %cl to i16
%shamt = and i16 %clin, 31
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %shamt)
ret i16 %shld
}
define i32 @shld32rrcl(i32 noundef %a, i32 noundef %b, i8 %cl) {
; CHECK-LABEL: shld32rrcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldl %cl, %esi, %edi, %eax
; CHECK-NEXT: retq
entry:
%clin = sext i8 %cl to i32
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %clin)
ret i32 %shld
}
define i32 @shld32rrcl_mask(i32 noundef %a, i32 noundef %b, i8 %cl) {
; CHECK-LABEL: shld32rrcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldl %cl, %esi, %edi, %eax
; CHECK-NEXT: retq
entry:
%clin = sext i8 %cl to i32
%shamt = and i32 %clin, 31
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %shamt)
ret i32 %shld
}
define i64 @shld64rrcl(i64 noundef %a, i64 noundef %b, i8 %cl) {
; CHECK-LABEL: shld64rrcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldq %cl, %rsi, %rdi, %rax
; CHECK-NEXT: retq
entry:
%clin = sext i8 %cl to i64
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)
ret i64 %shld
}
define i64 @shld64rrcl_mask(i64 noundef %a, i64 noundef %b, i8 %cl) {
; CHECK-LABEL: shld64rrcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldq %cl, %rsi, %rdi, %rax
; CHECK-NEXT: retq
entry:
%clin = sext i8 %cl to i64
%shamt = and i64 %clin, 63
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)
ret i64 %shld
}
define i16 @shld16rri8(i16 noundef %a, i16 noundef %b) {
; CHECK-LABEL: shld16rri8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldw $12, %si, %di, %ax
; CHECK-NEXT: retq
entry:
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 12)
ret i16 %shld
}
define i32 @shld32rri8(i32 noundef %a, i32 noundef %b) {
; CHECK-LABEL: shld32rri8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldl $12, %esi, %edi, %eax
; CHECK-NEXT: retq
entry:
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 12)
ret i32 %shld
}
define i64 @shld64rri8(i64 noundef %a, i64 noundef %b) {
; CHECK-LABEL: shld64rri8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldq $12, %rsi, %rdi, %rax
; CHECK-NEXT: retq
entry:
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 12)
ret i64 %shld
}
define i16 @shld16mrcl(ptr %ptr, i16 noundef %b, i8 %cl) {
; CHECK-LABEL: shld16mrcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: andb $15, %dl, %cl
; CHECK-NEXT: shldw %cl, %si, (%rdi), %ax
; CHECK-NEXT: retq
entry:
%a = load i16, ptr %ptr
%clin = sext i8 %cl to i16
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %clin)
ret i16 %shld
}
define i32 @shld32mrcl(ptr %ptr, i32 noundef %b, i8 %cl) {
; CHECK-LABEL: shld32mrcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldl %cl, %esi, (%rdi), %eax
; CHECK-NEXT: retq
entry:
%a = load i32, ptr %ptr
%clin = sext i8 %cl to i32
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %clin)
ret i32 %shld
}
define i64 @shld64mrcl(ptr %ptr, i64 noundef %b, i8 %cl) {
; CHECK-LABEL: shld64mrcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldq %cl, %rsi, (%rdi), %rax
; CHECK-NEXT: retq
entry:
%a = load i64, ptr %ptr
%clin = sext i8 %cl to i64
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)
ret i64 %shld
}
define i16 @shld16mri8(ptr %ptr, i16 noundef %b) {
; CHECK-LABEL: shld16mri8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldw $12, %si, (%rdi), %ax
; CHECK-NEXT: retq
entry:
%a = load i16, ptr %ptr
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 12)
ret i16 %shld
}
define i32 @shld32mri8(ptr %ptr, i32 noundef %b) {
; CHECK-LABEL: shld32mri8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldl $12, %esi, (%rdi), %eax
; CHECK-NEXT: retq
entry:
%a = load i32, ptr %ptr
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 12)
ret i32 %shld
}
define i64 @shld64mri8(ptr %ptr, i64 noundef %b) {
; CHECK-LABEL: shld64mri8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldq $12, %rsi, (%rdi), %rax
; CHECK-NEXT: retq
entry:
%a = load i64, ptr %ptr
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 12)
ret i64 %shld
}
define void @shld16mrcl_legacy(ptr %ptr, i16 noundef %b, i8 %cl) {
; CHECK-LABEL: shld16mrcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: andb $15, %dl, %cl
; CHECK-NEXT: shldw %cl, %si, (%rdi)
; CHECK-NEXT: retq
entry:
%a = load i16, ptr %ptr
%clin = sext i8 %cl to i16
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 %clin)
store i16 %shld, ptr %ptr
ret void
}
define void @shld32mrcl_legacy(ptr %ptr, i32 noundef %b, i8 %cl) {
; CHECK-LABEL: shld32mrcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldl %cl, %esi, (%rdi)
; CHECK-NEXT: retq
entry:
%a = load i32, ptr %ptr
%clin = sext i8 %cl to i32
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %clin)
store i32 %shld, ptr %ptr
ret void
}
define void @shld64mrcl_legacy(ptr %ptr, i64 noundef %b, i8 %cl) {
; CHECK-LABEL: shld64mrcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %ecx
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shldq %cl, %rsi, (%rdi)
; CHECK-NEXT: retq
entry:
%a = load i64, ptr %ptr
%clin = sext i8 %cl to i64
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 %clin)
store i64 %shld, ptr %ptr
ret void
}
define void @shld16mri8_legacy(ptr %ptr, i16 noundef %b) {
; CHECK-LABEL: shld16mri8_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldw $12, %si, (%rdi)
; CHECK-NEXT: retq
entry:
%a = load i16, ptr %ptr
%shld = call i16 @llvm.fshl.i16(i16 %a, i16 %b, i16 12)
store i16 %shld, ptr %ptr
ret void
}
define void @shld32mri8_legacy(ptr %ptr, i32 noundef %b) {
; CHECK-LABEL: shld32mri8_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldl $12, %esi, (%rdi)
; CHECK-NEXT: retq
entry:
%a = load i32, ptr %ptr
%shld = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 12)
store i32 %shld, ptr %ptr
ret void
}
define void @shld64mri8_legacy(ptr %ptr, i64 noundef %b) {
; CHECK-LABEL: shld64mri8_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shldq $12, %rsi, (%rdi)
; CHECK-NEXT: retq
entry:
%a = load i64, ptr %ptr
%shld = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 12)
store i64 %shld, ptr %ptr
ret void
}
|