blob: 87b45beeab7e08c74ec7cdbdc6aa5c3fecbb4f64 [file] [log] [blame]
Tony Jiangd5acad02017-07-11 16:42:20 +00001; Note the formula for negative number alignment calculation should be y = x & ~(n-1) rather than y = (x + (n-1)) & ~(n-1).
2; after patch https://reviews.llvm.org/D34337, we could save 16 bytes in the best case.
3; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-BE
4; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-LE
5
6define signext i32 @bar(i32 signext %ii) {
7entry:
8 %0 = tail call i32 asm sideeffect "add $0, $1, $2\0A", "=r,r,r,~{f14},~{r15},~{v20}"(i32 %ii, i32 10)
9 ret i32 %0
10; Before the fix by patch D34337:
11; stdu 1, -544(1)
12; std 15, 264(1)
13; stfd 14, 400(1)
14; stdu 1, -560(1)
15; std 15, 280(1)
16; stfd 14, 416(1)
17
18; After the fix by patch D34337:
19; CHECK-LE: stdu 1, -528(1)
Stefan Pintilie70bfe662018-01-12 13:12:49 +000020; CHECK-LE:std 15, 248(1)
21; CHECK-LE:stfd 14, 384(1)
Tony Jiangd5acad02017-07-11 16:42:20 +000022; CHECK-BE: stdu 1, -544(1)
Stefan Pintilie70bfe662018-01-12 13:12:49 +000023; CHECK-BE:std 15, 264(1)
24; CHECK-BE:stfd 14, 400(1)
Tony Jiangd5acad02017-07-11 16:42:20 +000025}
26
27define signext i32 @foo() {
28entry:
29 %call = tail call signext i32 @bar(i32 signext 5)
30 ret i32 %call
31}
32