blob: 4f6998ee68dfe9d73b8cf09efd8c38d0de25a8be [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
David Blaikiea79ac142015-02-27 21:17:42 +00009 %1 = load i16, i16* @foo
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000010 %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
David Blaikiea79ac142015-02-27 21:17:42 +000017 %1 = load i16, i16* @foo
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000018 %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
David Blaikiea79ac142015-02-27 21:17:42 +000025 %1 = load i16, i16* @foo
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000026 %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
David Blaikiea79ac142015-02-27 21:17:42 +000033 %1 = load i16, i16* @foo
Anton Korobeynikov700c4ab2009-11-08 15:33:12 +000034 %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
David Blaikiea79ac142015-02-27 21:17:42 +000042 %1 = load i16, i16* @foo
Anton Korobeynikovda0508f2009-10-11 23:02:38 +000043 %2 = xor i16 %a, %1
44 ret i16 %2
45}
46