llvm.org GIT mirror llvm / 502de5f
[X86] Added nontemporal scalar store tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271656 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 4 years ago
1 changed file(s) with 172 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
88 ; Make sure that we generate non-temporal stores for the test cases below.
99 ; We use xorps for zeroing, so domain information isn't available anymore.
1010
11 ; Scalar versions (zeroing means we can this even for fp types).
12
13 define void @test_zero_f32(float* %dst) {
14 ; SSE-LABEL: test_zero_f32:
15 ; SSE: # BB#0:
16 ; SSE-NEXT: xorl %eax, %eax
17 ; SSE-NEXT: movntil %eax, (%rdi)
18 ; SSE-NEXT: retq
19 ;
20 ; AVX-LABEL: test_zero_f32:
21 ; AVX: # BB#0:
22 ; AVX-NEXT: xorl %eax, %eax
23 ; AVX-NEXT: movntil %eax, (%rdi)
24 ; AVX-NEXT: retq
25 ;
26 ; VLX-LABEL: test_zero_f32:
27 ; VLX: # BB#0:
28 ; VLX-NEXT: xorl %eax, %eax
29 ; VLX-NEXT: movntil %eax, (%rdi)
30 ; VLX-NEXT: retq
31 store float zeroinitializer, float* %dst, align 1, !nontemporal !1
32 ret void
33 }
34
35 define void @test_zero_i32(i32* %dst) {
36 ; SSE-LABEL: test_zero_i32:
37 ; SSE: # BB#0:
38 ; SSE-NEXT: xorl %eax, %eax
39 ; SSE-NEXT: movntil %eax, (%rdi)
40 ; SSE-NEXT: retq
41 ;
42 ; AVX-LABEL: test_zero_i32:
43 ; AVX: # BB#0:
44 ; AVX-NEXT: xorl %eax, %eax
45 ; AVX-NEXT: movntil %eax, (%rdi)
46 ; AVX-NEXT: retq
47 ;
48 ; VLX-LABEL: test_zero_i32:
49 ; VLX: # BB#0:
50 ; VLX-NEXT: xorl %eax, %eax
51 ; VLX-NEXT: movntil %eax, (%rdi)
52 ; VLX-NEXT: retq
53 store i32 zeroinitializer, i32* %dst, align 1, !nontemporal !1
54 ret void
55 }
56
57 define void @test_zero_f64(double* %dst) {
58 ; SSE-LABEL: test_zero_f64:
59 ; SSE: # BB#0:
60 ; SSE-NEXT: xorl %eax, %eax
61 ; SSE-NEXT: movntiq %rax, (%rdi)
62 ; SSE-NEXT: retq
63 ;
64 ; AVX-LABEL: test_zero_f64:
65 ; AVX: # BB#0:
66 ; AVX-NEXT: xorl %eax, %eax
67 ; AVX-NEXT: movntiq %rax, (%rdi)
68 ; AVX-NEXT: retq
69 ;
70 ; VLX-LABEL: test_zero_f64:
71 ; VLX: # BB#0:
72 ; VLX-NEXT: xorl %eax, %eax
73 ; VLX-NEXT: movntiq %rax, (%rdi)
74 ; VLX-NEXT: retq
75 store double zeroinitializer, double* %dst, align 1, !nontemporal !1
76 ret void
77 }
78
79 define void @test_zero_i64(i64* %dst) {
80 ; SSE-LABEL: test_zero_i64:
81 ; SSE: # BB#0:
82 ; SSE-NEXT: xorl %eax, %eax
83 ; SSE-NEXT: movntiq %rax, (%rdi)
84 ; SSE-NEXT: retq
85 ;
86 ; AVX-LABEL: test_zero_i64:
87 ; AVX: # BB#0:
88 ; AVX-NEXT: xorl %eax, %eax
89 ; AVX-NEXT: movntiq %rax, (%rdi)
90 ; AVX-NEXT: retq
91 ;
92 ; VLX-LABEL: test_zero_i64:
93 ; VLX: # BB#0:
94 ; VLX-NEXT: xorl %eax, %eax
95 ; VLX-NEXT: movntiq %rax, (%rdi)
96 ; VLX-NEXT: retq
97 store i64 zeroinitializer, i64* %dst, align 1, !nontemporal !1
98 ret void
99 }
100
101 ; And now XMM versions.
102
11103 define void @test_zero_v4f32(<4 x float>* %dst) {
12104 ; SSE-LABEL: test_zero_v4f32:
13105 ; SSE: # BB#0:
289381
290382
291383 ; Check that we also handle arguments. Here the type survives longer.
384
385 ; Scalar versions.
386
387 define void @test_arg_f32(float %arg, float* %dst) {
388 ; SSE-LABEL: test_arg_f32:
389 ; SSE: # BB#0:
390 ; SSE-NEXT: movss %xmm0, (%rdi)
391 ; SSE-NEXT: retq
392 ;
393 ; AVX-LABEL: test_arg_f32:
394 ; AVX: # BB#0:
395 ; AVX-NEXT: vmovss %xmm0, (%rdi)
396 ; AVX-NEXT: retq
397 ;
398 ; VLX-LABEL: test_arg_f32:
399 ; VLX: # BB#0:
400 ; VLX-NEXT: vmovss %xmm0, (%rdi)
401 ; VLX-NEXT: retq
402 store float %arg, float* %dst, align 1, !nontemporal !1
403 ret void
404 }
405
406 define void @test_arg_i32(i32 %arg, i32* %dst) {
407 ; SSE-LABEL: test_arg_i32:
408 ; SSE: # BB#0:
409 ; SSE-NEXT: movntil %edi, (%rsi)
410 ; SSE-NEXT: retq
411 ;
412 ; AVX-LABEL: test_arg_i32:
413 ; AVX: # BB#0:
414 ; AVX-NEXT: movntil %edi, (%rsi)
415 ; AVX-NEXT: retq
416 ;
417 ; VLX-LABEL: test_arg_i32:
418 ; VLX: # BB#0:
419 ; VLX-NEXT: movntil %edi, (%rsi)
420 ; VLX-NEXT: retq
421 store i32 %arg, i32* %dst, align 1, !nontemporal !1
422 ret void
423 }
424
425 define void @test_arg_f64(double %arg, double* %dst) {
426 ; SSE-LABEL: test_arg_f64:
427 ; SSE: # BB#0:
428 ; SSE-NEXT: movsd %xmm0, (%rdi)
429 ; SSE-NEXT: retq
430 ;
431 ; AVX-LABEL: test_arg_f64:
432 ; AVX: # BB#0:
433 ; AVX-NEXT: vmovsd %xmm0, (%rdi)
434 ; AVX-NEXT: retq
435 ;
436 ; VLX-LABEL: test_arg_f64:
437 ; VLX: # BB#0:
438 ; VLX-NEXT: vmovsd %xmm0, (%rdi)
439 ; VLX-NEXT: retq
440 store double %arg, double* %dst, align 1, !nontemporal !1
441 ret void
442 }
443
444 define void @test_arg_i64(i64 %arg, i64* %dst) {
445 ; SSE-LABEL: test_arg_i64:
446 ; SSE: # BB#0:
447 ; SSE-NEXT: movntiq %rdi, (%rsi)
448 ; SSE-NEXT: retq
449 ;
450 ; AVX-LABEL: test_arg_i64:
451 ; AVX: # BB#0:
452 ; AVX-NEXT: movntiq %rdi, (%rsi)
453 ; AVX-NEXT: retq
454 ;
455 ; VLX-LABEL: test_arg_i64:
456 ; VLX: # BB#0:
457 ; VLX-NEXT: movntiq %rdi, (%rsi)
458 ; VLX-NEXT: retq
459 store i64 %arg, i64* %dst, align 1, !nontemporal !1
460 ret void
461 }
462
463 ; And now XMM versions.
292464
293465 define void @test_arg_v4f32(<4 x float> %arg, <4 x float>* %dst) {
294466 ; SSE-LABEL: test_arg_v4f32: