2015-11-24 05:33:58 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2014-09-12 23:10:56 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s
|
2007-12-13 06:21:26 +08:00
|
|
|
|
2011-12-12 19:59:10 +08:00
|
|
|
declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
|
|
|
|
declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>, i1)
|
2007-12-13 06:21:26 +08:00
|
|
|
declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
|
|
|
|
|
2008-05-29 15:09:24 +08:00
|
|
|
define <2 x i64> @footz(<2 x i64> %a) nounwind {
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-LABEL: footz:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-10-13 20:12:06 +08:00
|
|
|
; CHECK-NEXT: pcmpeqd %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: paddq %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: pandn %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlw $1, %xmm1
|
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
|
|
|
; CHECK-NEXT: psubb %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa {{.*#+}} xmm1 = [51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51]
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: psrlw $2, %xmm0
|
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: paddb %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlw $4, %xmm1
|
|
|
|
; CHECK-NEXT: paddb %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
|
|
|
; CHECK-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: psadbw %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: retq
|
2011-12-12 19:59:10 +08:00
|
|
|
%c = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
|
2007-12-13 06:21:26 +08:00
|
|
|
ret <2 x i64> %c
|
2014-09-12 20:50:27 +08:00
|
|
|
|
2007-12-13 06:21:26 +08:00
|
|
|
}
|
2008-05-29 15:09:24 +08:00
|
|
|
define <2 x i64> @foolz(<2 x i64> %a) nounwind {
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-LABEL: foolz:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlq $1, %xmm1
|
|
|
|
; CHECK-NEXT: por %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: psrlq $2, %xmm0
|
|
|
|
; CHECK-NEXT: por %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlq $4, %xmm1
|
|
|
|
; CHECK-NEXT: por %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: psrlq $8, %xmm0
|
|
|
|
; CHECK-NEXT: por %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlq $16, %xmm1
|
|
|
|
; CHECK-NEXT: por %xmm0, %xmm1
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: psrlq $32, %xmm0
|
|
|
|
; CHECK-NEXT: por %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: pcmpeqd %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: pxor %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $1, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm0
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psubb %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa {{.*#+}} xmm0 = [51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51]
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: pand %xmm0, %xmm2
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $2, %xmm1
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: pand %xmm0, %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: paddb %xmm2, %xmm1
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm2
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $4, %xmm2
|
|
|
|
; CHECK-NEXT: paddb %xmm1, %xmm2
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm2
|
|
|
|
; CHECK-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: psadbw %xmm2, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: retq
|
2011-12-12 19:59:10 +08:00
|
|
|
%c = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
|
2007-12-13 06:21:26 +08:00
|
|
|
ret <2 x i64> %c
|
2014-09-12 20:50:27 +08:00
|
|
|
|
2007-12-13 06:21:26 +08:00
|
|
|
}
|
2014-09-12 20:50:27 +08:00
|
|
|
|
2008-05-29 15:09:24 +08:00
|
|
|
define <2 x i64> @foopop(<2 x i64> %a) nounwind {
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-LABEL: foopop:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $1, %xmm1
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psubb %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa {{.*#+}} xmm1 = [51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51]
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm2
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $2, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm0
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: paddb %xmm2, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $4, %xmm1
|
|
|
|
; CHECK-NEXT: paddb %xmm0, %xmm1
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
|
|
|
; CHECK-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: psadbw %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2007-12-13 06:21:26 +08:00
|
|
|
%c = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
|
|
|
|
ret <2 x i64> %c
|
|
|
|
}
|
2014-09-12 20:50:27 +08:00
|
|
|
|
|
|
|
declare <2 x i32> @llvm.cttz.v2i32(<2 x i32>, i1)
|
|
|
|
declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32>, i1)
|
|
|
|
declare <2 x i32> @llvm.ctpop.v2i32(<2 x i32>)
|
|
|
|
|
|
|
|
define <2 x i32> @promtz(<2 x i32> %a) nounwind {
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-LABEL: promtz:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: por {{.*}}(%rip), %xmm0
|
2018-10-13 20:12:06 +08:00
|
|
|
; CHECK-NEXT: pcmpeqd %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: paddq %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: pandn %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlw $1, %xmm1
|
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
|
|
|
; CHECK-NEXT: psubb %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa {{.*#+}} xmm1 = [51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51]
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: psrlw $2, %xmm0
|
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: paddb %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: psrlw $4, %xmm1
|
|
|
|
; CHECK-NEXT: paddb %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
|
|
|
; CHECK-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: psadbw %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-09-12 20:50:27 +08:00
|
|
|
%c = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 false)
|
|
|
|
ret <2 x i32> %c
|
|
|
|
|
|
|
|
}
|
|
|
|
define <2 x i32> @promlz(<2 x i32> %a) nounwind {
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-LABEL: promlz:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm0
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: psrlq $1, %xmm2
|
|
|
|
; CHECK-NEXT: por %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: movdqa %xmm2, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: psrlq $2, %xmm0
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: por %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: psrlq $4, %xmm2
|
|
|
|
; CHECK-NEXT: por %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: movdqa %xmm2, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: psrlq $8, %xmm0
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: por %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: psrlq $16, %xmm2
|
|
|
|
; CHECK-NEXT: por %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: movdqa %xmm2, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: psrlq $32, %xmm0
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: por %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: pcmpeqd %xmm2, %xmm2
|
|
|
|
; CHECK-NEXT: pxor %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: movdqa %xmm2, %xmm0
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $1, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm0
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: psubb %xmm0, %xmm2
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: movdqa {{.*#+}} xmm0 = [51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51]
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm2, %xmm3
|
|
|
|
; CHECK-NEXT: pand %xmm0, %xmm3
|
|
|
|
; CHECK-NEXT: psrlw $2, %xmm2
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: pand %xmm0, %xmm2
|
2018-10-24 01:48:30 +08:00
|
|
|
; CHECK-NEXT: paddb %xmm3, %xmm2
|
|
|
|
; CHECK-NEXT: movdqa %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: psrlw $4, %xmm0
|
|
|
|
; CHECK-NEXT: paddb %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: psadbw %xmm1, %xmm0
|
2016-11-08 22:10:28 +08:00
|
|
|
; CHECK-NEXT: psubq {{.*}}(%rip), %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-09-12 20:50:27 +08:00
|
|
|
%c = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %a, i1 false)
|
|
|
|
ret <2 x i32> %c
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @prompop(<2 x i32> %a) nounwind {
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-LABEL: prompop:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm0
|
2016-02-12 04:21:24 +08:00
|
|
|
; CHECK-NEXT: pxor %xmm2, %xmm2
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $1, %xmm1
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psubb %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movdqa {{.*#+}} xmm1 = [51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51]
|
2016-02-12 04:21:24 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm3
|
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm3
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $2, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand %xmm1, %xmm0
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: paddb %xmm3, %xmm0
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm1
|
2018-10-12 22:18:47 +08:00
|
|
|
; CHECK-NEXT: psrlw $4, %xmm1
|
|
|
|
; CHECK-NEXT: paddb %xmm0, %xmm1
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: pand {{.*}}(%rip), %xmm1
|
2016-02-12 04:21:24 +08:00
|
|
|
; CHECK-NEXT: psadbw %xmm2, %xmm1
|
2015-07-27 01:02:25 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-09-12 20:50:27 +08:00
|
|
|
%c = call <2 x i32> @llvm.ctpop.v2i32(<2 x i32> %a)
|
|
|
|
ret <2 x i32> %c
|
|
|
|
}
|