1; RUN: llc -verify-machineinstrs -mcpu=pwr7 -O2 -fast-isel=false -mattr=-vsx < %s | FileCheck %s 2; RUN: llc -verify-machineinstrs -mcpu=pwr7 -O2 -fast-isel=false -mattr=+vsx < %s | FileCheck -check-prefix=CHECK-VSX %s 3; RUN: llc -verify-machineinstrs -mcpu=pwr9 -O2 -fast-isel=false -mattr=+vsx < %s | FileCheck -check-prefix=CHECK-P9 %s 4 5; Verify internal alignment of long double in a struct. The double 6; argument comes in GPR3; GPR4 is skipped; GPRs 5 and 6 contain 7; the long double. Check that these are stored to proper locations 8; in the parameter save area and loaded from there for return in FPR1/2. 9 10target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64" 11target triple = "powerpc64-unknown-linux-gnu" 12 13%struct.S = type { double, ppc_fp128 } 14 15define ppc_fp128 @test(%struct.S* byval %x) nounwind { 16entry: 17 %b = getelementptr inbounds %struct.S, %struct.S* %x, i32 0, i32 1 18 %0 = load ppc_fp128, ppc_fp128* %b, align 16 19 ret ppc_fp128 %0 20} 21 22; The additional stores are caused because we forward the value in the 23; store->load->bitcast path to make a store and bitcast of the same 24; value. Since the target does bitcast through memory and we no longer 25; remember the address we need to do the store in a fresh local 26; address. 27 28; CHECK-DAG: std 6, 72(1) 29; CHECK-DAG: std 5, 64(1) 30; CHECK-DAG: std 4, 56(1) 31; CHECK-DAG: std 3, 48(1) 32 33; CHECK-DAG: std 5, -16(1) 34; CHECK-DAG: std 6, -8(1) 35; CHECK-DAG: lfd 1, -16(1) 36; CHECK-DAG: lfd 2, -8(1) 37 38; FIXMECHECK: lfd 1, 64(1) 39; FIXMECHECK: lfd 2, 72(1) 40 41; CHECK-VSX-DAG: std 6, 72(1) 42; CHECK-VSX-DAG: std 5, 64(1) 43; CHECK-VSX-DAG: std 4, 56(1) 44; CHECK-VSX-DAG: std 3, 48(1) 45; CHECK-VSX-DAG: std 5, -16(1) 46; CHECK-VSX-DAG: std 6, -8(1) 47; CHECK-VSX-DAG: addi [[REG1:[0-9]+]], 1, -16 48; CHECK-VSX-DAG: addi 3, 1, -8 49; CHECK-VSX: lfdx 1, 0, [[REG1]] 50; CHECK-VSX: lfdx 2, 0, 3 51 52; FIXME-VSX: addi 4, 1, 48 53; FIXME-VSX: lxsdx 1, 4, 3 54; FIXME-VSX: li 3, 24 55; FIXME-VSX: lxsdx 2, 4, 3 56 57; CHECK-P9-DAG: std 6, 72(1) 58; CHECK-P9-DAG: std 5, 64(1) 59; CHECK-P9-DAG: std 4, 56(1) 60; CHECK-P9-DAG: std 3, 48(1) 61; CHECK-P9-DAG: mtvsrd 1, 5 62; CHECK-P9-DAG: mtvsrd 2, 6 63