1; RUN: llc < %s -march=avr | FileCheck %s 2 3define i8 @read8() { 4; CHECK-LABEL: read8 5; CHECK: in r24, 8 6 %1 = load i8, i8* inttoptr (i16 40 to i8*) 7 ret i8 %1 8} 9 10define i16 @read16() { 11; CHECK-LABEL: read16 12; CHECK: in r24, 8 13; CHECK: in r25, 9 14 %1 = load i16, i16* inttoptr (i16 40 to i16*) 15 ret i16 %1 16} 17 18define i32 @read32() { 19; CHECK-LABEL: read32 20; CHECK: in r22, 8 21; CHECK: in r23, 9 22; CHECK: in r24, 10 23; CHECK: in r25, 11 24 %1 = load i32, i32* inttoptr (i16 40 to i32*) 25 ret i32 %1 26} 27 28define i64 @read64() { 29; CHECK-LABEL: read64 30; CHECK: in r18, 8 31; CHECK: in r19, 9 32; CHECK: in r20, 10 33; CHECK: in r21, 11 34; CHECK: in r22, 12 35; CHECK: in r23, 13 36; CHECK: in r24, 14 37; CHECK: in r25, 15 38 %1 = load i64, i64* inttoptr (i16 40 to i64*) 39 ret i64 %1 40} 41 42define void @write8() { 43; CHECK-LABEL: write8 44; CHECK: out 8 45 store i8 22, i8* inttoptr (i16 40 to i8*) 46 ret void 47} 48 49define void @write16() { 50; CHECK-LABEL: write16 51; CHECK: out 9 52; CHECK: out 8 53 store i16 1234, i16* inttoptr (i16 40 to i16*) 54 ret void 55} 56 57define void @write32() { 58; CHECK-LABEL: write32 59; CHECK: out 11 60; CHECK: out 10 61; CHECK: out 9 62; CHECK: out 8 63 store i32 12345678, i32* inttoptr (i16 40 to i32*) 64 ret void 65} 66 67define void @write64() { 68; CHECK-LABEL: write64 69; CHECK: out 15 70; CHECK: out 14 71; CHECK: out 13 72; CHECK: out 12 73; CHECK: out 11 74; CHECK: out 10 75; CHECK: out 9 76; CHECK: out 8 77 store i64 1234567891234567, i64* inttoptr (i16 40 to i64*) 78 ret void 79} 80 81define void @sbi8() { 82; CHECK-LABEL: sbi8 83; CHECK: sbi 8, 5 84 %1 = load i8, i8* inttoptr (i16 40 to i8*) 85 %or = or i8 %1, 32 86 store i8 %or, i8* inttoptr (i16 40 to i8*) 87 ret void 88} 89 90define void @cbi8() { 91; CHECK-LABEL: cbi8 92; CHECK: cbi 8, 5 93 %1 = load volatile i8, i8* inttoptr (i16 40 to i8*) 94 %and = and i8 %1, -33 95 store volatile i8 %and, i8* inttoptr (i16 40 to i8*) 96 ret void 97} 98