blob: e6c52616c8f61d4bee2a6b8eaa1215d64f1e5205 [file] [log] [blame]
Benjamin Kramer258c7fa2009-10-12 09:31:55 +00001; RUN: llc -march=msp430 < %s | FileCheck %s
Anton Korobeynikovda0508f2009-10-11 23:02:38 +00002target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
3target triple = "msp430-generic-generic"
4@foo = common global i16 0, align 2
5
6define i16 @add(i16 %a) nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +00007; CHECK-LABEL: add:
Anton Korobeynikovda0508f2009-10-11 23:02:38 +00008; CHECK: add.w &foo, r15
9 %1 = load i16* @foo
10 %2 = add i16 %a, %1
11 ret i16 %2
12}
13
14define i16 @and(i16 %a) nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000015; CHECK-LABEL: and:
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000016; CHECK: and.w &foo, r15
17 %1 = load i16* @foo
18 %2 = and i16 %a, %1
19 ret i16 %2
20}
21
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000022define i16 @bis(i16 %a) nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000023; CHECK-LABEL: bis:
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000024; CHECK: bis.w &foo, r15
25 %1 = load i16* @foo
26 %2 = or i16 %a, %1
27 ret i16 %2
28}
29
Anton Korobeynikov700c4ab2009-11-08 15:33:12 +000030define i16 @bic(i16 %a) nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000031; CHECK-LABEL: bic:
Anton Korobeynikov700c4ab2009-11-08 15:33:12 +000032; CHECK: bic.w &foo, r15
33 %1 = load i16* @foo
34 %2 = xor i16 %1, -1
35 %3 = and i16 %a, %2
36 ret i16 %3
37}
38
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000039define i16 @xor(i16 %a) nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000040; CHECK-LABEL: xor:
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000041; CHECK: xor.w &foo, r15
42 %1 = load i16* @foo
43 %2 = xor i16 %a, %1
44 ret i16 %2
45}
46