2011-02-22 07:21:33 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefix=CHECK-64
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s --check-prefix=CHECK-64
|
2009-09-08 23:54:48 +00:00
|
|
|
; RUN: llc < %s -march=x86 | FileCheck %s --check-prefix=CHECK-32
|
2009-08-19 18:16:17 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g64xh:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testb $8, {{%ah|%ch}}
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g64xh:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testb $8, %ah
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g64xh(i64 inreg %x) nounwind {
|
|
|
|
%t = and i64 %x, 2048
|
|
|
|
%s = icmp eq i64 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g64xl:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testb $8, [[A0L:%dil|%cl]]
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g64xl:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testb $8, %al
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g64xl(i64 inreg %x) nounwind {
|
|
|
|
%t = and i64 %x, 8
|
|
|
|
%s = icmp eq i64 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g32xh:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testb $8, {{%ah|%ch}}
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g32xh:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testb $8, %ah
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g32xh(i32 inreg %x) nounwind {
|
|
|
|
%t = and i32 %x, 2048
|
|
|
|
%s = icmp eq i32 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g32xl:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testb $8, [[A0L]]
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g32xl:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testb $8, %al
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g32xl(i32 inreg %x) nounwind {
|
|
|
|
%t = and i32 %x, 8
|
|
|
|
%s = icmp eq i32 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g16xh:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testb $8, {{%ah|%ch}}
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g16xh:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testb $8, %ah
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g16xh(i16 inreg %x) nounwind {
|
|
|
|
%t = and i16 %x, 2048
|
|
|
|
%s = icmp eq i16 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g16xl:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testb $8, [[A0L]]
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g16xl:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testb $8, %al
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g16xl(i16 inreg %x) nounwind {
|
|
|
|
%t = and i16 %x, 8
|
|
|
|
%s = icmp eq i16 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g64x16:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testw $-32640, %[[A0W:di|cx]]
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g64x16:
|
2009-09-08 23:05:44 +00:00
|
|
|
; CHECK-32: testw $-32640, %ax
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g64x16(i64 inreg %x) nounwind {
|
|
|
|
%t = and i64 %x, 32896
|
|
|
|
%s = icmp eq i64 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g32x16:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testw $-32640, %[[A0W]]
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g32x16:
|
2009-09-08 23:05:44 +00:00
|
|
|
; CHECK-32: testw $-32640, %ax
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g32x16(i32 inreg %x) nounwind {
|
|
|
|
%t = and i32 %x, 32896
|
|
|
|
%s = icmp eq i32 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-64-LABEL: g64x32:
|
2011-02-22 07:21:33 +00:00
|
|
|
; CHECK-64: testl $268468352, %e[[A0W]]
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-64: ret
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-32-LABEL: g64x32:
|
2009-08-19 18:16:17 +00:00
|
|
|
; CHECK-32: testl $268468352, %eax
|
|
|
|
; CHECK-32: ret
|
|
|
|
define void @g64x32(i64 inreg %x) nounwind {
|
|
|
|
%t = and i64 %x, 268468352
|
|
|
|
%s = icmp eq i64 %t, 0
|
|
|
|
br i1 %s, label %yes, label %no
|
|
|
|
|
|
|
|
yes:
|
|
|
|
call void @bar()
|
|
|
|
ret void
|
|
|
|
no:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @bar()
|