1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -fixup-byte-word-insts=1 -mtriple=x86_64-- < %s | FileCheck --check-prefix=X64 --check-prefix=BWON64 %s
3 ; RUN: llc -verify-machineinstrs -fixup-byte-word-insts=0 -mtriple=x86_64-- < %s | FileCheck --check-prefix=X64 --check-prefix=BWOFF64 %s
4 ; RUN: llc -verify-machineinstrs -fixup-byte-word-insts=1 -mtriple=i386-- < %s | FileCheck --check-prefix=X32 --check-prefix=BWON32 %s
5 ; RUN: llc -verify-machineinstrs -fixup-byte-word-insts=0 -mtriple=i386-- < %s | FileCheck --check-prefix=X32 --check-prefix=BWOFF32 %s
7 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
9 define i8 @test_movb(i8 %a0) {
10 ; X64-LABEL: test_movb:
12 ; X64-NEXT: movl %edi, %eax
13 ; X64-NEXT: # kill: def $al killed $al killed $eax
16 ; X32-LABEL: test_movb:
18 ; X32-NEXT: movb {{[0-9]+}}(%esp), %al
23 define i16 @test_movw(i16 %a0) {
24 ; X64-LABEL: test_movw:
26 ; X64-NEXT: movl %edi, %eax
27 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
30 ; BWON32-LABEL: test_movw:
32 ; BWON32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
35 ; BWOFF32-LABEL: test_movw:
37 ; BWOFF32-NEXT: movw {{[0-9]+}}(%esp), %ax
42 ; Verify we don't mess with H-reg copies (only generated in 32-bit mode).
43 define i8 @test_movb_hreg(i16 %a0) {
44 ; X64-LABEL: test_movb_hreg:
46 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
47 ; X64-NEXT: movl %edi, %eax
48 ; X64-NEXT: shrl $8, %eax
49 ; X64-NEXT: addl %edi, %eax
50 ; X64-NEXT: # kill: def $al killed $al killed $eax
53 ; X32-LABEL: test_movb_hreg:
55 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
56 ; X32-NEXT: addb %al, %ah
57 ; X32-NEXT: movb %ah, %al
59 %tmp0 = trunc i16 %a0 to i8
60 %tmp1 = lshr i16 %a0, 8
61 %tmp2 = trunc i16 %tmp1 to i8
62 %tmp3 = add i8 %tmp0, %tmp2