blob: ab439cdbd8535879875f75ad0480d9d733fb01b6 [file] [log] [blame]
Samuel Antaof6815602015-03-17 15:00:57 +00001;; There are some known limitations in the VSX support during FastIsel
2;; (see fast-isel-load-store.ll header). Nevertheless, we are adding some
3;; regressions here for bugs we fix in the meantime
4; RUN: llc < %s -O0 -fast-isel -mattr=+vsx -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64VSX
5
6;; The semantics of VSX stores for when R0 is used is different depending on
7;; whether it is used as base or offset. If used as base, the effective
8;; address computation will use zero regardless the content of R0. If used as
9;; offset, the content will be used in the effective address. We observed that
10;; for some constructors, the initialization values were being stored without
11;; any offset register being specified which was causing R0 to be used as offset
12;; in regions where it contained the value in the link register. This regression
13;; verifies that R0 is used as base in these situations.
14
15%SomeStruct = type { double }
16
17; ELF64VSX-LABEL: SomeStructCtor
18define linkonce_odr void @SomeStructCtor(%SomeStruct* %this, double %V) unnamed_addr align 2 {
19entry:
20 %this.addr = alloca %SomeStruct*, align 8
21 %V.addr = alloca double, align 8
22 store %SomeStruct* %this, %SomeStruct** %this.addr, align 8
23; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}}
24 store double %V, double* %V.addr, align 8
25 %this1 = load %SomeStruct*, %SomeStruct** %this.addr
26 %Val = getelementptr inbounds %SomeStruct, %SomeStruct* %this1, i32 0, i32 0
27; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}}
28 %0 = load double, double* %V.addr, align 8
29 store double %0, double* %Val, align 8
30 ret void
31 }
32
33