ret i7 %f
}
+; demanded bits tests
+
+define i32 @fshl_i32_demandedbits(i32 %a0, i32 %a1) nounwind {
+; X32-SSE2-LABEL: fshl_i32_demandedbits:
+; X32-SSE2: # %bb.0:
+; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-SSE2-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
+; X32-SSE2-NEXT: orl {{[0-9]+}}(%esp), %ecx
+; X32-SSE2-NEXT: orl $1, %eax
+; X32-SSE2-NEXT: shrdl $23, %ecx, %eax
+; X32-SSE2-NEXT: retl
+;
+; X64-AVX2-LABEL: fshl_i32_demandedbits:
+; X64-AVX2: # %bb.0:
+; X64-AVX2-NEXT: movl %esi, %eax
+; X64-AVX2-NEXT: orl $-2147483648, %edi # imm = 0x80000000
+; X64-AVX2-NEXT: orl $1, %eax
+; X64-AVX2-NEXT: shrdl $23, %edi, %eax
+; X64-AVX2-NEXT: retq
+ %x = or i32 %a0, 2147483648
+ %y = or i32 %a1, 1
+ %res = call i32 @llvm.fshl.i32(i32 %x, i32 %y, i32 9)
+ ret i32 %res
+}
+
+define i32 @fshr_i32_demandedbits(i32 %a0, i32 %a1) nounwind {
+; X32-SSE2-LABEL: fshr_i32_demandedbits:
+; X32-SSE2: # %bb.0:
+; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-SSE2-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
+; X32-SSE2-NEXT: orl {{[0-9]+}}(%esp), %ecx
+; X32-SSE2-NEXT: orl $1, %eax
+; X32-SSE2-NEXT: shrdl $9, %ecx, %eax
+; X32-SSE2-NEXT: retl
+;
+; X64-AVX2-LABEL: fshr_i32_demandedbits:
+; X64-AVX2: # %bb.0:
+; X64-AVX2-NEXT: movl %esi, %eax
+; X64-AVX2-NEXT: orl $-2147483648, %edi # imm = 0x80000000
+; X64-AVX2-NEXT: orl $1, %eax
+; X64-AVX2-NEXT: shrdl $9, %edi, %eax
+; X64-AVX2-NEXT: retq
+ %x = or i32 %a0, 2147483648
+ %y = or i32 %a1, 1
+ %res = call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 9)
+ ret i32 %res
+}
+
; With constant shift amount, this is 'shrd' or 'shld'.
define i32 @fshr_i32_const_shift(i32 %x, i32 %y) nounwind {