brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 48fc056 Raw
82 lines · plain
1; RUN: llc < %s -mtriple=msp430 | FileCheck %s2target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:16"3target triple = "msp430-generic-generic"4 5define void @am1(ptr %a, i16 %x) nounwind {6	%1 = load i16, ptr %a7	%2 = or i16 %x, %18	store i16 %2, ptr %a9	ret void10}11; CHECK-LABEL: am1:12; CHECK:		bis	r13, 0(r12)13 14@foo = external global i1615 16define void @am2(i16 %x) nounwind {17	%1 = load i16, ptr @foo18	%2 = or i16 %x, %119	store i16 %2, ptr @foo20	ret void21}22; CHECK-LABEL: am2:23; CHECK:		bis	r12, &foo24 25@bar = external global [2 x i8]26 27define void @am3(i16 %i, i8 %x) nounwind {28	%1 = getelementptr [2 x i8], ptr @bar, i16 0, i16 %i29	%2 = load i8, ptr %130	%3 = or i8 %x, %231	store i8 %3, ptr %132	ret void33}34; CHECK-LABEL: am3:35; CHECK:		bis.b	r13, bar(r12)36 37define void @am4(i16 %x) nounwind {38	%1 = load volatile i16, ptr inttoptr(i16 32 to ptr)39	%2 = or i16 %x, %140	store volatile i16 %2, ptr inttoptr(i16 32 to ptr)41	ret void42}43; CHECK-LABEL: am4:44; CHECK:		bis	r12, &3245 46define void @am5(ptr %a, i16 %x) readonly {47	%1 = getelementptr inbounds i16, ptr %a, i16 248	%2 = load i16, ptr %149	%3 = or i16 %x, %250	store i16 %3, ptr %151	ret void52}53; CHECK-LABEL: am5:54; CHECK:		bis	r13, 4(r12)55 56%S = type { i16, i16 }57@baz = common global %S zeroinitializer58 59define void @am6(i16 %x) nounwind {60	%1 = load i16, ptr getelementptr (%S, ptr @baz, i32 0, i32 1)61	%2 = or i16 %x, %162	store i16 %2, ptr getelementptr (%S, ptr @baz, i32 0, i32 1)63	ret void64}65; CHECK-LABEL: am6:66; CHECK:		bis	r12, &baz+267 68%T = type { i16, [2 x i8] }69@duh = external global %T70 71define void @am7(i16 %n, i8 %x) nounwind {72	%1 = getelementptr %T, ptr @duh, i32 0, i32 173	%2 = getelementptr [2 x i8], ptr %1, i16 0, i16 %n74	%3 = load i8, ptr %275	%4 = or i8 %x, %376	store i8 %4, ptr %277	ret void78}79; CHECK-LABEL: am7:80; CHECK:		bis.b	r13, duh+2(r12)81 82