1; RUN: llc -mtriple=powerpc-unknown-aix-xcoff -verify-machineinstrs -mcpu=pwr7 \ 2; RUN: -mattr=+altivec -stop-after=prologepilog < %s | \ 3; RUN: FileCheck --check-prefix=MIR32 %s 4 5; RUN: llc -mtriple=powerpc-unknown-aix-xcoff -verify-machineinstrs \ 6; RUN: -mcpu=pwr7 -mattr=+altivec < %s | \ 7; RUN: FileCheck --check-prefix=ASM32 %s 8 9; RUN: llc -mtriple=powerpc64-unknown-aix-xcoff -verify-machineinstrs \ 10; RUN: -mcpu=pwr7 -mattr=+altivec -stop-after=prologepilog < %s | \ 11; RUN: FileCheck --check-prefix=MIR64 %s 12 13; RUN: llc -mtriple=powerpc64-unknown-aix-xcoff -verify-machineinstrs \ 14; RUN: -mcpu=pwr7 -mattr=+altivec < %s | \ 15; RUN: FileCheck --check-prefix=ASM64 %s 16 17define dso_local void @vec_regs() { 18 entry: 19 call void asm sideeffect "", "~{v13},~{v20},~{v26},~{v31}"() 20 ret void 21} 22 23; MIR32-LABEL: name: vec_regs 24 25; MIR32: fixedStack: [] 26; MIR32-NOT: STXVD2X killed $v20 27; MIR32-NOT: STXVD2X killed $v26 28; MIR32-NOT: STXVD2X killed $v31 29; MIR32-LABEL: INLINEASM 30; MIR32-NOT: $v20 = LXVD2X 31; MIR32-NOT: $v26 = LXVD2X 32; MIR32-NOT: $v31 = LXVD2X 33; MIR32: BLR implicit $lr, implicit $rm 34 35; MIR64-LABEL: name: vec_regs 36 37; MIR64: fixedStack: [] 38; MIR64-NOT: STXVD2X killed $v20 39; MIR64-NOT: STXVD2X killed $v26 40; MIR64-NOT: STXVD2X killed $v31 41; MIR64-LABEL: INLINEASM 42; MIR64-NOT: $v20 = LXVD2X 43; MIR64-NOT: $v26 = LXVD2X 44; MIR64-NOT: $v31 = LXVD2X 45; MIR64: BLR8 implicit $lr8, implicit $rm 46 47; ASM32-LABEL: .vec_regs: 48 49; ASM32-NOT: 20 50; ASM32-NOT: 26 51; ASM32-NOT: 31 52; ASM32-DAG: #APP 53; ASM32-DAG: #NO_APP 54; ASM32: blr 55 56; ASM64-LABEL: .vec_regs: 57 58; ASM64-NOT: 20 59; ASM64-NOT: 26 60; ASM64-NOT: 31 61; ASM64-DAG: #APP 62; ASM64-DAG: #NO_APP 63; ASM64: blr 64 65define dso_local void @fprs_gprs_vecregs() { 66 call void asm sideeffect "", "~{r25},~{r28},~{r31},~{f21},~{f25},~{f31},~{v20},~{v26},~{v31}"() 67 ret void 68} 69 70; MIR32-LABEL: name: fprs_gprs_vecregs 71 72; MIR32: liveins: $r25, $r26, $r27, $r28, $r29, $r30, $r31, $f21, $f22, $f23, $f24, $f25, $f26, $f27, $f28, $f29, $f30, $f31 73 74; MIR32-NOT: STXVD2X killed $v20 75; MIR32-NOT: STXVD2X killed $v26 76; MIR32-NOT: STXVD2X killed $v31 77; MIR32-DAG: STW killed $r25, -116, $r1 :: (store (s32) into %fixed-stack.17) 78; MIR32-DAG: STW killed $r26, -112, $r1 :: (store (s32) into %fixed-stack.16, align 8) 79; MIR32-DAG: STW killed $r27, -108, $r1 :: (store (s32) into %fixed-stack.15) 80; MIR32-DAG: STW killed $r28, -104, $r1 :: (store (s32) into %fixed-stack.14, align 16) 81; MIR32-DAG: STW killed $r29, -100, $r1 :: (store (s32) into %fixed-stack.13) 82; MIR32-DAG: STW killed $r30, -96, $r1 :: (store (s32) into %fixed-stack.12, align 8) 83; MIR32-DAG: STW killed $r31, -92, $r1 :: (store (s32) into %fixed-stack.11) 84; MIR32-DAG: STFD killed $f21, -88, $r1 :: (store (s64) into %fixed-stack.10) 85; MIR32-DAG: STFD killed $f22, -80, $r1 :: (store (s64) into %fixed-stack.9, align 16) 86; MIR32-DAG: STFD killed $f23, -72, $r1 :: (store (s64) into %fixed-stack.8) 87; MIR32-DAG: STFD killed $f24, -64, $r1 :: (store (s64) into %fixed-stack.7, align 16) 88; MIR32-DAG: STFD killed $f25, -56, $r1 :: (store (s64) into %fixed-stack.6) 89; MIR32-DAG: STFD killed $f26, -48, $r1 :: (store (s64) into %fixed-stack.5, align 16) 90; MIR32-DAG: STFD killed $f27, -40, $r1 :: (store (s64) into %fixed-stack.4) 91; MIR32-DAG: STFD killed $f28, -32, $r1 :: (store (s64) into %fixed-stack.3, align 16) 92; MIR32-DAG: STFD killed $f29, -24, $r1 :: (store (s64) into %fixed-stack.2) 93; MIR32-DAG: STFD killed $f30, -16, $r1 :: (store (s64) into %fixed-stack.1, align 16) 94; MIR32-DAG: STFD killed $f31, -8, $r1 :: (store (s64) into %fixed-stack.0) 95 96; MIR32-LABEL: INLINEASM 97 98; MIR32-NOT: $v20 = LXVD2X 99; MIR32-NOT: $v26 = LXVD2X 100; MIR32-NOT: $v31 = LXVD2X 101; MIR32-DAG: $f31 = LFD -8, $r1 :: (load (s64) from %fixed-stack.0) 102; MIR32-DAG: $f30 = LFD -16, $r1 :: (load (s64) from %fixed-stack.1, align 16) 103; MIR32-DAG: $f29 = LFD -24, $r1 :: (load (s64) from %fixed-stack.2) 104; MIR32-DAG: $f28 = LFD -32, $r1 :: (load (s64) from %fixed-stack.3, align 16) 105; MIR32-DAG: $f27 = LFD -40, $r1 :: (load (s64) from %fixed-stack.4) 106; MIR32-DAG: $f26 = LFD -48, $r1 :: (load (s64) from %fixed-stack.5, align 16) 107; MIR32-DAG: $f25 = LFD -56, $r1 :: (load (s64) from %fixed-stack.6) 108; MIR32-DAG: $f24 = LFD -64, $r1 :: (load (s64) from %fixed-stack.7, align 16) 109; MIR32-DAG: $f23 = LFD -72, $r1 :: (load (s64) from %fixed-stack.8) 110; MIR32-DAG: $f22 = LFD -80, $r1 :: (load (s64) from %fixed-stack.9, align 16) 111; MIR32-DAG: $f21 = LFD -88, $r1 :: (load (s64) from %fixed-stack.10) 112; MIR32-DAG: $r31 = LWZ -92, $r1 :: (load (s32) from %fixed-stack.11) 113; MIR32-DAG: $r30 = LWZ -96, $r1 :: (load (s32) from %fixed-stack.12, align 8) 114; MIR32-DAG: $r29 = LWZ -100, $r1 :: (load (s32) from %fixed-stack.13) 115; MIR32-DAG: $r28 = LWZ -104, $r1 :: (load (s32) from %fixed-stack.14, align 16) 116; MIR32-DAG: $r27 = LWZ -108, $r1 :: (load (s32) from %fixed-stack.15) 117; MIR32-DAG: $r26 = LWZ -112, $r1 :: (load (s32) from %fixed-stack.16, align 8) 118; MIR32-DAG: $r25 = LWZ -116, $r1 :: (load (s32) from %fixed-stack.17) 119; MIR32: BLR implicit $lr, implicit $rm 120 121; MIR64-LABEL: name: fprs_gprs_vecregs 122 123; MIR64: liveins: $x25, $x26, $x27, $x28, $x29, $x30, $x31, $f21, $f22, $f23, $f24, $f25, $f26, $f27, $f28, $f29, $f30, $f31 124 125; MIR64-NOT: STXVD2X killed $v20 126; MIR64-NOT: STXVD2X killed $v26 127; MIR64-NOT: STXVD2X killed $v31 128; MIR64-DAG: STD killed $x25, -144, $x1 :: (store (s64) into %fixed-stack.17) 129; MIR64-DAG: STD killed $x26, -136, $x1 :: (store (s64) into %fixed-stack.16, align 16) 130; MIR64-DAG: STD killed $x27, -128, $x1 :: (store (s64) into %fixed-stack.15) 131; MIR64-DAG: STD killed $x28, -120, $x1 :: (store (s64) into %fixed-stack.14, align 16) 132; MIR64-DAG: STD killed $x29, -112, $x1 :: (store (s64) into %fixed-stack.13) 133; MIR64-DAG: STD killed $x30, -104, $x1 :: (store (s64) into %fixed-stack.12, align 16) 134; MIR64-DAG: STD killed $x31, -96, $x1 :: (store (s64) into %fixed-stack.11) 135; MIR64-DAG: STFD killed $f21, -88, $x1 :: (store (s64) into %fixed-stack.10) 136; MIR64-DAG: STFD killed $f22, -80, $x1 :: (store (s64) into %fixed-stack.9, align 16) 137; MIR64-DAG: STFD killed $f23, -72, $x1 :: (store (s64) into %fixed-stack.8) 138; MIR64-DAG: STFD killed $f24, -64, $x1 :: (store (s64) into %fixed-stack.7, align 16) 139; MIR64-DAG: STFD killed $f25, -56, $x1 :: (store (s64) into %fixed-stack.6) 140; MIR64-DAG: STFD killed $f26, -48, $x1 :: (store (s64) into %fixed-stack.5, align 16) 141; MIR64-DAG: STFD killed $f27, -40, $x1 :: (store (s64) into %fixed-stack.4) 142; MIR64-DAG: STFD killed $f28, -32, $x1 :: (store (s64) into %fixed-stack.3, align 16) 143; MIR64-DAG: STFD killed $f29, -24, $x1 :: (store (s64) into %fixed-stack.2) 144; MIR64-DAG: STFD killed $f30, -16, $x1 :: (store (s64) into %fixed-stack.1, align 16) 145; MIR64-DAG: STFD killed $f31, -8, $x1 :: (store (s64) into %fixed-stack.0) 146 147; MIR64-LABEL: INLINEASM 148 149; MIR64-NOT: $v20 = LXVD2X 150; MIR64-NOT: $v26 = LXVD2X 151; MIR64-NOT: $v31 = LXVD2X 152; MIR64-DAG: $f31 = LFD -8, $x1 :: (load (s64) from %fixed-stack.0) 153; MIR64-DAG: $f30 = LFD -16, $x1 :: (load (s64) from %fixed-stack.1, align 16) 154; MIR64-DAG: $f29 = LFD -24, $x1 :: (load (s64) from %fixed-stack.2) 155; MIR64-DAG: $f28 = LFD -32, $x1 :: (load (s64) from %fixed-stack.3, align 16) 156; MIR64-DAG: $f27 = LFD -40, $x1 :: (load (s64) from %fixed-stack.4) 157; MIR64-DAG: $f26 = LFD -48, $x1 :: (load (s64) from %fixed-stack.5, align 16) 158; MIR64-DAG: $f25 = LFD -56, $x1 :: (load (s64) from %fixed-stack.6) 159; MIR64-DAG: $f24 = LFD -64, $x1 :: (load (s64) from %fixed-stack.7, align 16) 160; MIR64-DAG: $f23 = LFD -72, $x1 :: (load (s64) from %fixed-stack.8) 161; MIR64-DAG: $f22 = LFD -80, $x1 :: (load (s64) from %fixed-stack.9, align 16) 162; MIR64-DAG: $f21 = LFD -88, $x1 :: (load (s64) from %fixed-stack.10) 163; MIR64-DAG: $x31 = LD -96, $x1 :: (load (s64) from %fixed-stack.11) 164; MIR64-DAG: $x30 = LD -104, $x1 :: (load (s64) from %fixed-stack.12, align 16) 165; MIR64-DAG: $x29 = LD -112, $x1 :: (load (s64) from %fixed-stack.13) 166; MIR64-DAG: $x28 = LD -120, $x1 :: (load (s64) from %fixed-stack.14, align 16) 167; MIR64-DAG: $x27 = LD -128, $x1 :: (load (s64) from %fixed-stack.15) 168; MIR64-DAG: $x26 = LD -136, $x1 :: (load (s64) from %fixed-stack.16, align 16) 169; MIR64-DAG: $x25 = LD -144, $x1 :: (load (s64) from %fixed-stack.17) 170 171; MIR64: BLR8 implicit $lr8, implicit $rm 172 173;; We don't have -ppc-full-reg-names on AIX so can't reliably check-not for 174;; only vector registers numbers in this case. 175 176; ASM32-LABEL: .fprs_gprs_vecregs: 177 178; ASM32-DAG: stw 25, -116(1) # 4-byte Folded Spill 179; ASM32-DAG: stw 26, -112(1) # 4-byte Folded Spill 180; ASM32-DAG: stw 27, -108(1) # 4-byte Folded Spill 181; ASM32-DAG: stw 28, -104(1) # 4-byte Folded Spill 182; ASM32-DAG: stw 29, -100(1) # 4-byte Folded Spill 183; ASM32-DAG: stw 30, -96(1) # 4-byte Folded Spill 184; ASM32-DAG: stw 31, -92(1) # 4-byte Folded Spill 185; ASM32-DAG: stfd 21, -88(1) # 8-byte Folded Spill 186; ASM32-DAG: stfd 22, -80(1) # 8-byte Folded Spill 187; ASM32-DAG: stfd 23, -72(1) # 8-byte Folded Spill 188; ASM32-DAG: stfd 24, -64(1) # 8-byte Folded Spill 189; ASM32-DAG: stfd 25, -56(1) # 8-byte Folded Spill 190; ASM32-DAG: stfd 26, -48(1) # 8-byte Folded Spill 191; ASM32-DAG: stfd 27, -40(1) # 8-byte Folded Spill 192; ASM32-DAG: stfd 28, -32(1) # 8-byte Folded Spill 193; ASM32-DAG: stfd 29, -24(1) # 8-byte Folded Spill 194; ASM32-DAG: stfd 30, -16(1) # 8-byte Folded Spill 195; ASM32-DAG: stfd 31, -8(1) # 8-byte Folded Spill 196; ASM32: #APP 197; ASM32-NEXT: #NO_APP 198; ASM32-DAG: lfd 31, -8(1) # 8-byte Folded Reload 199; ASM32-DAG: lfd 30, -16(1) # 8-byte Folded Reload 200; ASM32-DAG: lfd 29, -24(1) # 8-byte Folded Reload 201; ASM32-DAG: lfd 28, -32(1) # 8-byte Folded Reload 202; ASM32-DAG: lfd 27, -40(1) # 8-byte Folded Reload 203; ASM32-DAG: lfd 26, -48(1) # 8-byte Folded Reload 204; ASM32-DAG: lfd 25, -56(1) # 8-byte Folded Reload 205; ASM32-DAG: lfd 24, -64(1) # 8-byte Folded Reload 206; ASM32-DAG: lfd 23, -72(1) # 8-byte Folded Reload 207; ASM32-DAG: lfd 22, -80(1) # 8-byte Folded Reload 208; ASM32-DAG: lfd 21, -88(1) # 8-byte Folded Reload 209; ASM32-DAG: lwz 31, -92(1) # 4-byte Folded Reload 210; ASM32-DAG: lwz 30, -96(1) # 4-byte Folded Reload 211; ASM32-DAG: lwz 29, -100(1) # 4-byte Folded Reload 212; ASM32-DAG: lwz 28, -104(1) # 4-byte Folded Reload 213; ASM32-DAG: lwz 27, -108(1) # 4-byte Folded Reload 214; ASM32-DAG: lwz 26, -112(1) # 4-byte Folded Reload 215; ASM32-DAG: lwz 25, -116(1) # 4-byte Folded Reload 216; ASM32: blr 217 218; ASM64-LABEL: .fprs_gprs_vecregs: 219 220; ASM64-DAG: std 25, -144(1) # 8-byte Folded Spill 221; ASM64-DAG: std 26, -136(1) # 8-byte Folded Spill 222; ASM64-DAG: std 27, -128(1) # 8-byte Folded Spill 223; ASM64-DAG: std 28, -120(1) # 8-byte Folded Spill 224; ASM64-DAG: std 29, -112(1) # 8-byte Folded Spill 225; ASM64-DAG: std 30, -104(1) # 8-byte Folded Spill 226; ASM64-DAG: std 31, -96(1) # 8-byte Folded Spill 227; ASM64-DAG: stfd 21, -88(1) # 8-byte Folded Spill 228; ASM64-DAG: stfd 22, -80(1) # 8-byte Folded Spill 229; ASM64-DAG: stfd 23, -72(1) # 8-byte Folded Spill 230; ASM64-DAG: stfd 24, -64(1) # 8-byte Folded Spill 231; ASM64-DAG: stfd 25, -56(1) # 8-byte Folded Spill 232; ASM64-DAG: stfd 26, -48(1) # 8-byte Folded Spill 233; ASM64-DAG: stfd 27, -40(1) # 8-byte Folded Spill 234; ASM64-DAG: stfd 28, -32(1) # 8-byte Folded Spill 235; ASM64-DAG: stfd 29, -24(1) # 8-byte Folded Spill 236; ASM64-DAG: stfd 30, -16(1) # 8-byte Folded Spill 237; ASM64-DAG: stfd 31, -8(1) # 8-byte Folded Spill 238; ASM64: #APP 239; ASM64-NEXT: #NO_APP 240; ASM64-DAG: lfd 31, -8(1) # 8-byte Folded Reload 241; ASM64-DAG: lfd 30, -16(1) # 8-byte Folded Reload 242; ASM64-DAG: lfd 29, -24(1) # 8-byte Folded Reload 243; ASM64-DAG: lfd 28, -32(1) # 8-byte Folded Reload 244; ASM64-DAG: lfd 27, -40(1) # 8-byte Folded Reload 245; ASM64-DAG: lfd 26, -48(1) # 8-byte Folded Reload 246; ASM64-DAG: lfd 25, -56(1) # 8-byte Folded Reload 247; ASM64-DAG: lfd 24, -64(1) # 8-byte Folded Reload 248; ASM64-DAG: lfd 23, -72(1) # 8-byte Folded Reload 249; ASM64-DAG: lfd 22, -80(1) # 8-byte Folded Reload 250; ASM64-DAG: lfd 21, -88(1) # 8-byte Folded Reload 251; ASM64-DAG: ld 31, -96(1) # 8-byte Folded Reload 252; ASM64-DAG: ld 30, -104(1) # 8-byte Folded Reload 253; ASM64-DAG: ld 29, -112(1) # 8-byte Folded Reload 254; ASM64-DAG: ld 28, -120(1) # 8-byte Folded Reload 255; ASM64-DAG: ld 27, -128(1) # 8-byte Folded Reload 256; ASM64-DAG: ld 26, -136(1) # 8-byte Folded Reload 257; ASM64-DAG: ld 25, -144(1) # 8-byte Folded Reload 258 259; ASM64: blr 260 261define dso_local void @all_fprs_and_vecregs() { 262 call void asm sideeffect "", "~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f8},~{f9},~{f10},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f18},~{f19},~{f20},~{f21},~{f22},~{f23},~{f24},~{f25},~{f26},~{f27},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6}~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19}"() 263 ret void 264} 265 266;; Check that reserved vectors are not used. 267; MIR32-LABEL: all_fprs_and_vecregs 268 269; MIR32-NOT: $v20 270; MIR32-NOT: $v21 271; MIR32-NOT: $v22 272; MIR32-NOT: $v23 273; MIR32-NOT: $v24 274; MIR32-NOT: $v25 275; MIR32-NOT: $v26 276; MIR32-NOT: $v27 277; MIR32-NOT: $v28 278; MIR32-NOT: $v29 279; MIR32-NOT: $v30 280; MIR32-NOT: $v31 281 282; MIR64-LABEL: all_fprs_and_vecregs 283 284; MIR64-NOT: $v20 285; MIR64-NOT: $v21 286; MIR64-NOT: $v22 287; MIR64-NOT: $v23 288; MIR64-NOT: $v24 289; MIR64-NOT: $v25 290; MIR64-NOT: $v26 291; MIR64-NOT: $v27 292; MIR64-NOT: $v28 293; MIR64-NOT: $v29 294; MIR64-NOT: $v30 295; MIR64-NOT: $v31 296