blob: 8a873daa6c7a229e8924c1cd58345b72ed3786c1 [file] [log] [blame]
Samuel Antaof6815602015-03-17 15:00:57 +00001; RUN: llc < %s -O0 -fast-isel -mattr=+vsx -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64VSX
2
3;; The semantics of VSX stores for when R0 is used is different depending on
4;; whether it is used as base or offset. If used as base, the effective
Eric Christopherd9bbc4d2015-04-04 02:26:47 +00005;; address computation will use zero regardless of the content of R0. If used as
6;; an offset the content will be used in the effective address. We observed that
Samuel Antaof6815602015-03-17 15:00:57 +00007;; for some constructors, the initialization values were being stored without
Eric Christopherd9bbc4d2015-04-04 02:26:47 +00008;; an offset register being specified which was causing R0 to be used as offset
9;; in regions where it contained the value in the link register. This test
Samuel Antaof6815602015-03-17 15:00:57 +000010;; verifies that R0 is used as base in these situations.
11
12%SomeStruct = type { double }
13
14; ELF64VSX-LABEL: SomeStructCtor
15define linkonce_odr void @SomeStructCtor(%SomeStruct* %this, double %V) unnamed_addr align 2 {
16entry:
17 %this.addr = alloca %SomeStruct*, align 8
18 %V.addr = alloca double, align 8
19 store %SomeStruct* %this, %SomeStruct** %this.addr, align 8
20; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}}
21 store double %V, double* %V.addr, align 8
22 %this1 = load %SomeStruct*, %SomeStruct** %this.addr
23 %Val = getelementptr inbounds %SomeStruct, %SomeStruct* %this1, i32 0, i32 0
24; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}}
25 %0 = load double, double* %V.addr, align 8
26 store double %0, double* %Val, align 8
27 ret void
Eric Christopherd9bbc4d2015-04-04 02:26:47 +000028 }