1; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu                          | FileCheck %s --check-prefixes=CHECK,CHECK-STRQRO
2; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=slow-strqro-store | FileCheck %s --check-prefixes=CHECK,CHECK-NOSTRQRO
3; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mcpu=falkor             | FileCheck %s --check-prefixes=CHECK,CHECK-NOSTRQRO
4
5; CHECK-LABEL: strqrox:
6; CHECK-STRQRO: str q{{[0-9]+}}, [x{{[0-9]+}}, x
7; CHECK-NOSTRQRO-NOT: str q{{[0-9]+}}, [x{{[0-9]+}}, x
8define void @strqrox(fp128 %val64, i64 %base, i64 %offset) {
9  %addrint = add i64 %base, %offset
10  %addr = inttoptr i64 %addrint to fp128*
11  store volatile fp128 %val64, fp128* %addr
12  ret void
13}
14
15; Check that STRQro is generated for both cases if we're optimizing for code size.
16; CHECK-LABEL: strqrox_optsize:
17; CHECK-STRQRO: str q{{[0-9]+}}, [x{{[0-9]+}}, x
18; CHECK-NOSTRQRO: str q{{[0-9]+}}, [x{{[0-9]+}}, x
19define void @strqrox_optsize(fp128 %val64, i64 %base, i64 %offset) minsize {
20  %addrint = add i64 %base, %offset
21  %addr = inttoptr i64 %addrint to fp128*
22  store volatile fp128 %val64, fp128* %addr
23  ret void
24}
25
26; CHECK-LABEL: strqrow:
27; CHECK-STRQRO: str q{{[0-9]+}}, [x{{[0-9]+}}, w
28; CHECK-NOSTRQRO-NOT: str q{{[0-9]+}}, [x{{[0-9]+}}, w
29define void @strqrow(fp128 %val64, i64 %base, i32 %offset) {
30  %offset64 = zext i32 %offset to i64
31  %addrint = add i64 %base, %offset64
32  %addr = inttoptr i64 %addrint to fp128*
33  store volatile fp128 %val64, fp128* %addr
34  ret void
35}
36
37; Check that STRQro is generated for both cases if we're optimizing for code size.
38; CHECK-LABEL: strqrow_optsize:
39; CHECK-STRQRO: str q{{[0-9]+}}, [x{{[0-9]+}}, w
40; CHECK-NOSTRQRO: str q{{[0-9]+}}, [x{{[0-9]+}}, w
41define void @strqrow_optsize(fp128 %val64, i64 %base, i32 %offset) minsize {
42  %offset64 = zext i32 %offset to i64
43  %addrint = add i64 %base, %offset64
44  %addr = inttoptr i64 %addrint to fp128*
45  store volatile fp128 %val64, fp128* %addr
46  ret void
47}
48
49