2010-02-22 23:34:12 +00:00
|
|
|
; RUN: llc < %s -march=msp430 | FileCheck %s
|
2009-12-08 01:03:04 +00:00
|
|
|
target datalayout = "e-p:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:16:32"
|
|
|
|
target triple = "msp430-generic-generic"
|
|
|
|
|
2010-01-05 17:55:26 +00:00
|
|
|
@foo8 = external global i8
|
|
|
|
@bar8 = external global i8
|
2009-12-08 01:03:04 +00:00
|
|
|
|
|
|
|
define i8 @bitbrr(i8 %a, i8 %b) nounwind {
|
|
|
|
%t1 = and i8 %a, %b
|
|
|
|
%t2 = icmp ne i8 %t1, 0
|
|
|
|
%t3 = zext i1 %t2 to i8
|
|
|
|
ret i8 %t3
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbrr:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b r14, r15
|
|
|
|
|
|
|
|
define i8 @bitbri(i8 %a) nounwind {
|
|
|
|
%t1 = and i8 %a, 15
|
|
|
|
%t2 = icmp ne i8 %t1, 0
|
|
|
|
%t3 = zext i1 %t2 to i8
|
|
|
|
ret i8 %t3
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbri:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b #15, r15
|
|
|
|
|
|
|
|
define i8 @bitbir(i8 %a) nounwind {
|
|
|
|
%t1 = and i8 15, %a
|
|
|
|
%t2 = icmp ne i8 %t1, 0
|
|
|
|
%t3 = zext i1 %t2 to i8
|
|
|
|
ret i8 %t3
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbir:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b #15, r15
|
|
|
|
|
|
|
|
define i8 @bitbmi() nounwind {
|
|
|
|
%t1 = load i8* @foo8
|
|
|
|
%t2 = and i8 %t1, 15
|
|
|
|
%t3 = icmp ne i8 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i8
|
|
|
|
ret i8 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbmi:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b #15, &foo8
|
|
|
|
|
|
|
|
define i8 @bitbim() nounwind {
|
|
|
|
%t1 = load i8* @foo8
|
|
|
|
%t2 = and i8 15, %t1
|
|
|
|
%t3 = icmp ne i8 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i8
|
|
|
|
ret i8 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbim:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b #15, &foo8
|
|
|
|
|
|
|
|
define i8 @bitbrm(i8 %a) nounwind {
|
|
|
|
%t1 = load i8* @foo8
|
|
|
|
%t2 = and i8 %a, %t1
|
|
|
|
%t3 = icmp ne i8 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i8
|
|
|
|
ret i8 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbrm:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b &foo8, r15
|
|
|
|
|
|
|
|
define i8 @bitbmr(i8 %a) nounwind {
|
|
|
|
%t1 = load i8* @foo8
|
|
|
|
%t2 = and i8 %t1, %a
|
|
|
|
%t3 = icmp ne i8 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i8
|
|
|
|
ret i8 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbmr:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b r15, &foo8
|
|
|
|
|
|
|
|
define i8 @bitbmm() nounwind {
|
|
|
|
%t1 = load i8* @foo8
|
|
|
|
%t2 = load i8* @bar8
|
|
|
|
%t3 = and i8 %t1, %t2
|
|
|
|
%t4 = icmp ne i8 %t3, 0
|
|
|
|
%t5 = zext i1 %t4 to i8
|
|
|
|
ret i8 %t5
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitbmm:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.b &bar8, &foo8
|
|
|
|
|
2010-01-05 17:55:26 +00:00
|
|
|
@foo16 = external global i16
|
|
|
|
@bar16 = external global i16
|
2009-12-08 01:03:04 +00:00
|
|
|
|
|
|
|
define i16 @bitwrr(i16 %a, i16 %b) nounwind {
|
|
|
|
%t1 = and i16 %a, %b
|
|
|
|
%t2 = icmp ne i16 %t1, 0
|
|
|
|
%t3 = zext i1 %t2 to i16
|
|
|
|
ret i16 %t3
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwrr:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w r14, r15
|
|
|
|
|
|
|
|
define i16 @bitwri(i16 %a) nounwind {
|
|
|
|
%t1 = and i16 %a, 4080
|
|
|
|
%t2 = icmp ne i16 %t1, 0
|
|
|
|
%t3 = zext i1 %t2 to i16
|
|
|
|
ret i16 %t3
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwri:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w #4080, r15
|
|
|
|
|
|
|
|
define i16 @bitwir(i16 %a) nounwind {
|
|
|
|
%t1 = and i16 4080, %a
|
|
|
|
%t2 = icmp ne i16 %t1, 0
|
|
|
|
%t3 = zext i1 %t2 to i16
|
|
|
|
ret i16 %t3
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwir:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w #4080, r15
|
|
|
|
|
|
|
|
define i16 @bitwmi() nounwind {
|
|
|
|
%t1 = load i16* @foo16
|
|
|
|
%t2 = and i16 %t1, 4080
|
|
|
|
%t3 = icmp ne i16 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i16
|
|
|
|
ret i16 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwmi:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w #4080, &foo16
|
|
|
|
|
|
|
|
define i16 @bitwim() nounwind {
|
|
|
|
%t1 = load i16* @foo16
|
|
|
|
%t2 = and i16 4080, %t1
|
|
|
|
%t3 = icmp ne i16 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i16
|
|
|
|
ret i16 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwim:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w #4080, &foo16
|
|
|
|
|
|
|
|
define i16 @bitwrm(i16 %a) nounwind {
|
|
|
|
%t1 = load i16* @foo16
|
|
|
|
%t2 = and i16 %a, %t1
|
|
|
|
%t3 = icmp ne i16 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i16
|
|
|
|
ret i16 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwrm:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w &foo16, r15
|
|
|
|
|
|
|
|
define i16 @bitwmr(i16 %a) nounwind {
|
|
|
|
%t1 = load i16* @foo16
|
|
|
|
%t2 = and i16 %t1, %a
|
|
|
|
%t3 = icmp ne i16 %t2, 0
|
|
|
|
%t4 = zext i1 %t3 to i16
|
|
|
|
ret i16 %t4
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwmr:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w r15, &foo16
|
|
|
|
|
|
|
|
define i16 @bitwmm() nounwind {
|
|
|
|
%t1 = load i16* @foo16
|
|
|
|
%t2 = load i16* @bar16
|
|
|
|
%t3 = and i16 %t1, %t2
|
|
|
|
%t4 = icmp ne i16 %t3, 0
|
|
|
|
%t5 = zext i1 %t4 to i16
|
|
|
|
ret i16 %t5
|
|
|
|
}
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: bitwmm:
|
2009-12-08 01:03:04 +00:00
|
|
|
; CHECK: bit.w &bar16, &foo16
|
|
|
|
|