blob: 18161cc892a55a91f0708a893c61efbe7edcb34c [file] [log] [blame]
Clement Courbet203fc172017-04-21 09:20:50 +00001; RUN: llc -mtriple=x86_64-linux-gnu -mattr=-ermsb < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOFAST
2; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+ermsb < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=FAST
Clement Courbet2430e252017-04-21 09:20:58 +00003; RUN: llc -mtriple=i686-linux-gnu -mattr=-ermsb < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOFAST32
4; RUN: llc -mtriple=i686-linux-gnu -mattr=+ermsb < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=FAST
5; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=generic < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOFAST
6; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=haswell < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=FAST
7; FIXME: The documentation stes that ivybridge has ermsb, but this is not
8; enabled right now since I coud not confirm by testing.
9; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=ivybridge < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOFAST
Clement Courbet1ce3b822017-04-21 09:20:39 +000010
11%struct.large = type { [4096 x i8] }
12
13declare void @foo(%struct.large* align 8 byval) nounwind
14
15define void @test1(%struct.large* nocapture %x) nounwind {
16 call void @foo(%struct.large* align 8 byval %x)
17 ret void
18
19; ALL-LABEL: test1:
20; NOFAST: rep;movsq
Clement Courbet2430e252017-04-21 09:20:58 +000021; NOFAST32: rep;movsl
Clement Courbet1ce3b822017-04-21 09:20:39 +000022; FAST: rep;movsb
Clement Courbet1ce3b822017-04-21 09:20:39 +000023}
Clement Courbetd5f61822017-04-21 09:20:55 +000024
25define void @test2(%struct.large* nocapture %x) nounwind minsize {
26 call void @foo(%struct.large* align 8 byval %x)
27 ret void
28
29; ALL-LABEL: test2:
30; NOFAST: rep;movsq
Clement Courbet2430e252017-04-21 09:20:58 +000031; NOFAST32: rep;movsl
Clement Courbetd5f61822017-04-21 09:20:55 +000032; FAST: rep;movsb
Clement Courbetd5f61822017-04-21 09:20:55 +000033}
34
35%struct.large_oddsize = type { [4095 x i8] }
36
37declare void @foo_oddsize(%struct.large_oddsize* align 8 byval) nounwind
38
39define void @test3(%struct.large_oddsize* nocapture %x) nounwind minsize {
40 call void @foo_oddsize(%struct.large_oddsize* align 8 byval %x)
41 ret void
42
43; ALL-LABEL: test3:
44; NOFAST: rep;movsb
Clement Courbet2430e252017-04-21 09:20:58 +000045; NOFAST32: rep;movsb
Clement Courbetd5f61822017-04-21 09:20:55 +000046; FAST: rep;movsb
Clement Courbetd5f61822017-04-21 09:20:55 +000047}