2012-08-02 02:56:42 +02:00
|
|
|
; RUN: llc < %s -march=x86 -mcpu=yonah -mtriple=i386-apple-darwin | FileCheck %s
|
2009-07-08 00:51:09 +02:00
|
|
|
|
2009-07-08 01:03:54 +02:00
|
|
|
|
2009-07-08 20:51:25 +02:00
|
|
|
define <4 x i32> @test1(<4 x i32> %A, <4 x i32> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test1:
|
2009-07-08 20:51:25 +02:00
|
|
|
; CHECK: pcmpgtd
|
|
|
|
; CHECK: ret
|
|
|
|
|
2009-07-08 01:03:54 +02:00
|
|
|
%C = icmp sgt <4 x i32> %A, %B
|
|
|
|
%D = sext <4 x i1> %C to <4 x i32>
|
|
|
|
ret <4 x i32> %D
|
|
|
|
}
|
|
|
|
|
2009-07-08 20:51:25 +02:00
|
|
|
define <4 x i32> @test2(<4 x i32> %A, <4 x i32> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test2:
|
2009-07-08 20:51:25 +02:00
|
|
|
; CHECK: pcmp
|
2012-08-02 21:37:32 +02:00
|
|
|
; CHECK: pcmp
|
|
|
|
; CHECK: pxor
|
2009-07-08 20:51:25 +02:00
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp sge <4 x i32> %A, %B
|
|
|
|
%D = sext <4 x i1> %C to <4 x i32>
|
|
|
|
ret <4 x i32> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @test3(<4 x i32> %A, <4 x i32> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test3:
|
2009-07-08 20:51:25 +02:00
|
|
|
; CHECK: pcmpgtd
|
2010-03-31 00:47:00 +02:00
|
|
|
; CHECK: movdqa
|
2009-07-08 20:51:25 +02:00
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp slt <4 x i32> %A, %B
|
|
|
|
%D = sext <4 x i1> %C to <4 x i32>
|
|
|
|
ret <4 x i32> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @test4(<4 x i32> %A, <4 x i32> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test4:
|
2010-03-31 00:47:00 +02:00
|
|
|
; CHECK: movdqa
|
2009-07-08 20:51:25 +02:00
|
|
|
; CHECK: pcmpgtd
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp ugt <4 x i32> %A, %B
|
|
|
|
%D = sext <4 x i1> %C to <4 x i32>
|
|
|
|
ret <4 x i32> %D
|
|
|
|
}
|
2012-12-25 13:54:19 +01:00
|
|
|
|
|
|
|
define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test5:
|
2012-12-25 13:54:19 +01:00
|
|
|
; CHECK: pcmpeqd
|
2012-12-25 14:09:08 +01:00
|
|
|
; CHECK: pshufd $-79
|
2012-12-25 13:54:19 +01:00
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp eq <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test6(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test6:
|
2012-12-25 13:54:19 +01:00
|
|
|
; CHECK: pcmpeqd
|
2012-12-25 14:09:08 +01:00
|
|
|
; CHECK: pshufd $-79
|
2012-12-25 13:54:19 +01:00
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp ne <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
2013-04-18 23:37:45 +02:00
|
|
|
|
|
|
|
define <2 x i64> @test7(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-05-22 19:01:12 +02:00
|
|
|
; CHECK: [[CONSTSEG:[A-Z0-9_]*]]:
|
|
|
|
; CHECK: .long 2147483648
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .long 2147483648
|
|
|
|
; CHECK-NEXT: .long 0
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test7:
|
2013-05-22 19:01:12 +02:00
|
|
|
; CHECK: movdqa [[CONSTSEG]], [[CONSTREG:%xmm[0-9]*]]
|
|
|
|
; CHECK: pxor [[CONSTREG]]
|
|
|
|
; CHECK: pxor [[CONSTREG]]
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pcmpgtd %xmm1
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp sgt <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test8(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test8:
|
2013-05-22 19:01:12 +02:00
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pxor
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pcmpgtd %xmm0
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp slt <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test9(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test9:
|
2013-05-22 19:01:12 +02:00
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pxor
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pcmpgtd %xmm0
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp sge <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test10(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test10:
|
2013-05-22 19:01:12 +02:00
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pxor
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pcmpgtd %xmm1
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp sle <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test11(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-05-21 11:58:54 +02:00
|
|
|
; CHECK: [[CONSTSEG:[A-Z0-9_]*]]:
|
|
|
|
; CHECK: .long 2147483648
|
|
|
|
; CHECK-NEXT: .long 2147483648
|
|
|
|
; CHECK-NEXT: .long 2147483648
|
|
|
|
; CHECK-NEXT: .long 2147483648
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test11:
|
2013-05-21 11:58:54 +02:00
|
|
|
; CHECK: movdqa [[CONSTSEG]], [[CONSTREG:%xmm[0-9]*]]
|
|
|
|
; CHECK: pxor [[CONSTREG]]
|
|
|
|
; CHECK: pxor [[CONSTREG]]
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pcmpgtd %xmm1
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp ugt <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test12(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test12:
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pcmpgtd %xmm0
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp ult <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test13(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test13:
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pcmpgtd %xmm0
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp uge <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @test14(<2 x i64> %A, <2 x i64> %B) nounwind {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test14:
|
2013-04-18 23:37:45 +02:00
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: pcmpgtd %xmm1
|
|
|
|
; CHECK: pshufd $-96
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: pand
|
|
|
|
; CHECK: pshufd $-11
|
|
|
|
; CHECK: por
|
|
|
|
; CHECK: pcmpeqd
|
|
|
|
; CHECK: pxor
|
|
|
|
; CHECK: ret
|
|
|
|
%C = icmp ule <2 x i64> %A, %B
|
|
|
|
%D = sext <2 x i1> %C to <2 x i64>
|
|
|
|
ret <2 x i64> %D
|
|
|
|
}
|