1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+movdiri -mattr=+movdir64b | FileCheck %s --check-prefix=X64
3; RUN: llc < %s -mtriple=i386-unknown-unknown -mattr=+movdiri -mattr=+movdir64b | FileCheck %s --check-prefix=X32
4
5define void @test_movdiri(i8* %p, i32 %v) {
6; X64-LABEL: test_movdiri:
7; X64:       # %bb.0: # %entry
8; X64-NEXT:    movdiri %esi, (%rdi)
9; X64-NEXT:    retq
10;
11; X32-LABEL: test_movdiri:
12; X32:       # %bb.0: # %entry
13; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
14; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
15; X32-NEXT:    movdiri %eax, (%ecx)
16; X32-NEXT:    retl
17entry:
18  call void @llvm.x86.directstore32(i8* %p, i32 %v)
19  ret void
20}
21
22declare void @llvm.x86.directstore32(i8*, i32)
23
24define void @test_movdir64b(i8* %dst, i8* %src) {
25; X64-LABEL: test_movdir64b:
26; X64:       # %bb.0: # %entry
27; X64-NEXT:    movdir64b (%rsi), %rdi
28; X64-NEXT:    retq
29;
30; X32-LABEL: test_movdir64b:
31; X32:       # %bb.0: # %entry
32; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
33; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
34; X32-NEXT:    movdir64b (%eax), %ecx
35; X32-NEXT:    retl
36entry:
37  call void @llvm.x86.movdir64b(i8* %dst, i8* %src)
38  ret void
39}
40
41declare void @llvm.x86.movdir64b(i8*, i8*)
42