2017-03-10 23:41:05 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-unknown -mattr=+mmx,+sse2 | FileCheck %s --check-prefix=X86
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+mmx,+sse2 | FileCheck %s --check-prefix=X64
|
2015-02-23 23:23:06 +08:00
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t0(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psllq %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psllq %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.pslli.q(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.pslli.q(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t1(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psrlq %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psrlq %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.psrli.q(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrli.q(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t2(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psllw %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psllw %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.pslli.w(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.pslli.w(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t3(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psrlw %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psrlw %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.psrli.w(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrli.w(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t4(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: pslld %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: pslld %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.pslli.d(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.pslli.d(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t5(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psrld %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psrld %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.psrli.d(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrli.d(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t6(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psraw %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psraw %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.psrai.w(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrai.w(x86_mmx, i32)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @t7(<1 x i64>* %a, i32* %b) nounwind {
|
|
|
|
; X86-LABEL: t7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 12(%ebp), %eax
|
|
|
|
; X86-NEXT: movl 8(%ebp), %ecx
|
|
|
|
; X86-NEXT: movq (%ecx), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: movd (%eax), %mm1
|
|
|
|
; X86-NEXT: psrad %mm1, %mm0
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: t7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: movq (%rdi), %mm0
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd (%rsi), %mm1
|
|
|
|
; X64-NEXT: psrad %mm1, %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: retq
|
2015-02-23 23:23:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64>* %a to x86_mmx*
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load x86_mmx, x86_mmx* %0, align 8
|
|
|
|
%2 = load i32, i32* %b, align 4
|
2015-02-23 23:23:06 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.psrai.d(x86_mmx %1, i32 %2)
|
|
|
|
%4 = bitcast x86_mmx %3 to i64
|
|
|
|
ret i64 %4
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrai.d(x86_mmx, i32)
|
2015-02-25 23:14:02 +08:00
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt0(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: paddb (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: paddb (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.padd.b(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.b(x86_mmx, x86_mmx)
|
|
|
|
declare void @llvm.x86.mmx.emms()
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt1(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: paddw (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: paddw (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.padd.w(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.w(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt2(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: paddd (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: paddd (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.padd.d(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.d(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt3(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: paddq (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: paddq (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.padd.q(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.q(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt4(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: paddusb (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: paddusb (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.paddus.b(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.paddus.b(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt5(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: paddusw (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: paddusw (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.paddus.w(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.paddus.w(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt6(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: psrlw (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: psrlw (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.psrl.w(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrl.w(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt7(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: psrld (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: psrld (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.psrl.d(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrl.d(x86_mmx, x86_mmx)
|
|
|
|
|
2017-03-10 23:41:05 +08:00
|
|
|
define i64 @tt8(x86_mmx %t, x86_mmx* %q) nounwind {
|
|
|
|
; X86-LABEL: tt8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X86-NEXT: pushl %ebp
|
|
|
|
; X86-NEXT: movl %esp, %ebp
|
|
|
|
; X86-NEXT: andl $-8, %esp
|
|
|
|
; X86-NEXT: subl $8, %esp
|
|
|
|
; X86-NEXT: movl 8(%ebp), %eax
|
|
|
|
; X86-NEXT: psrlq (%eax), %mm0
|
|
|
|
; X86-NEXT: movq %mm0, (%esp)
|
|
|
|
; X86-NEXT: movl (%esp), %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X86-NEXT: emms
|
|
|
|
; X86-NEXT: movl %ebp, %esp
|
|
|
|
; X86-NEXT: popl %ebp
|
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: tt8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: psrlq (%rdi), %mm0
|
2018-01-06 04:55:12 +08:00
|
|
|
; X64-NEXT: movq %mm0, %rax
|
2017-03-10 23:41:05 +08:00
|
|
|
; X64-NEXT: emms
|
|
|
|
; X64-NEXT: retq
|
2015-02-25 23:14:02 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%v = load x86_mmx, x86_mmx* %q
|
2015-02-25 23:14:02 +08:00
|
|
|
%u = tail call x86_mmx @llvm.x86.mmx.psrl.q(x86_mmx %t, x86_mmx %v)
|
|
|
|
%s = bitcast x86_mmx %u to i64
|
|
|
|
call void @llvm.x86.mmx.emms()
|
|
|
|
ret i64 %s
|
|
|
|
}
|
|
|
|
declare x86_mmx @llvm.x86.mmx.psrl.q(x86_mmx, x86_mmx)
|
2017-03-10 23:53:41 +08:00
|
|
|
|
2017-03-11 00:18:50 +08:00
|
|
|
define void @test_psrlq_by_volatile_shift_amount(x86_mmx* %t) nounwind {
|
2017-03-10 23:53:41 +08:00
|
|
|
; X86-LABEL: test_psrlq_by_volatile_shift_amount:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86: # %bb.0: # %entry
|
2018-01-16 22:21:28 +08:00
|
|
|
; X86-NEXT: pushl %eax
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X86-NEXT: movl $1, (%esp)
|
|
|
|
; X86-NEXT: movd (%esp), %mm0
|
|
|
|
; X86-NEXT: movl $255, %ecx
|
|
|
|
; X86-NEXT: movd %ecx, %mm1
|
2017-03-14 05:23:29 +08:00
|
|
|
; X86-NEXT: psrlq %mm0, %mm1
|
|
|
|
; X86-NEXT: movq %mm1, (%eax)
|
2018-01-16 22:21:28 +08:00
|
|
|
; X86-NEXT: popl %eax
|
2017-03-10 23:53:41 +08:00
|
|
|
; X86-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_psrlq_by_volatile_shift_amount:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64: # %bb.0: # %entry
|
2017-03-10 23:53:41 +08:00
|
|
|
; X64-NEXT: movl $1, -{{[0-9]+}}(%rsp)
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: movd -{{[0-9]+}}(%rsp), %mm0
|
2017-03-11 00:18:50 +08:00
|
|
|
; X64-NEXT: movl $255, %eax
|
2018-01-16 22:21:28 +08:00
|
|
|
; X64-NEXT: movd %eax, %mm1
|
2017-03-14 05:23:29 +08:00
|
|
|
; X64-NEXT: psrlq %mm0, %mm1
|
|
|
|
; X64-NEXT: movq %mm1, (%rdi)
|
2017-03-10 23:53:41 +08:00
|
|
|
; X64-NEXT: retq
|
|
|
|
entry:
|
|
|
|
%0 = alloca i32, align 4
|
|
|
|
%1 = bitcast i32* %0 to i8*
|
|
|
|
call void @llvm.lifetime.start(i64 4, i8* nonnull %1)
|
|
|
|
store volatile i32 1, i32* %0, align 4
|
|
|
|
%2 = load volatile i32, i32* %0, align 4
|
2017-03-11 00:18:50 +08:00
|
|
|
%3 = tail call x86_mmx @llvm.x86.mmx.psrli.q(x86_mmx bitcast (<1 x i64> <i64 255> to x86_mmx), i32 %2)
|
|
|
|
store x86_mmx %3, x86_mmx* %t, align 8
|
2017-03-10 23:53:41 +08:00
|
|
|
call void @llvm.lifetime.end(i64 4, i8* nonnull %1)
|
2017-03-11 00:18:50 +08:00
|
|
|
ret void
|
2017-03-10 23:53:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.lifetime.start(i64, i8* nocapture)
|
|
|
|
declare void @llvm.lifetime.end(i64, i8* nocapture)
|