Home | History | Annotate | Download | only in X86
      1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
      2 ; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s --check-prefix=X86
      3 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefix=X64
      4 
      5 define signext i16 @foo(i16 signext %x) nounwind {
      6 ; X86-LABEL: foo:
      7 ; X86:       # %bb.0: # %entry
      8 ; X86-NEXT:    movl $21998, %eax # imm = 0x55EE
      9 ; X86-NEXT:    xorl {{[0-9]+}}(%esp), %eax
     10 ; X86-NEXT:    # kill: def $ax killed $ax killed $eax
     11 ; X86-NEXT:    retl
     12 ;
     13 ; X64-LABEL: foo:
     14 ; X64:       # %bb.0: # %entry
     15 ; X64-NEXT:    xorl $21998, %edi # imm = 0x55EE
     16 ; X64-NEXT:    movl %edi, %eax
     17 ; X64-NEXT:    retq
     18 entry:
     19   %0 = xor i16 %x, 21998
     20   ret i16 %0
     21 }
     22 
     23 define signext i16 @bar(i16 signext %x) nounwind {
     24 ; X86-LABEL: bar:
     25 ; X86:       # %bb.0: # %entry
     26 ; X86-NEXT:    movl $54766, %eax # imm = 0xD5EE
     27 ; X86-NEXT:    xorl {{[0-9]+}}(%esp), %eax
     28 ; X86-NEXT:    # kill: def $ax killed $ax killed $eax
     29 ; X86-NEXT:    retl
     30 ;
     31 ; X64-LABEL: bar:
     32 ; X64:       # %bb.0: # %entry
     33 ; X64-NEXT:    xorl $54766, %edi # imm = 0xD5EE
     34 ; X64-NEXT:    movl %edi, %eax
     35 ; X64-NEXT:    retq
     36 entry:
     37   %0 = xor i16 %x, 54766
     38   ret i16 %0
     39 }
     40 
     41 define signext i16 @baz(i16* %x, i16 signext %y) nounwind {
     42 ; X86-LABEL: baz:
     43 ; X86:       # %bb.0: # %entry
     44 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
     45 ; X86-NEXT:    movzwl (%eax), %eax
     46 ; X86-NEXT:    subw {{[0-9]+}}(%esp), %ax
     47 ; X86-NEXT:    retl
     48 ;
     49 ; X64-LABEL: baz:
     50 ; X64:       # %bb.0: # %entry
     51 ; X64-NEXT:    movzwl (%rdi), %eax
     52 ; X64-NEXT:    subl %esi, %eax
     53 ; X64-NEXT:    # kill: def $ax killed $ax killed $eax
     54 ; X64-NEXT:    retq
     55 entry:
     56   %0 = load i16, i16* %x
     57   %sub = sub i16 %0, %y
     58   ret i16 %sub
     59 }
     60 
     61 define void @bat(i16* %a, i16* %x, i16 signext %y) nounwind {
     62 ; X86-LABEL: bat:
     63 ; X86:       # %bb.0: # %entry
     64 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
     65 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
     66 ; X86-NEXT:    movzwl (%ecx), %ecx
     67 ; X86-NEXT:    subw {{[0-9]+}}(%esp), %cx
     68 ; X86-NEXT:    movw %cx, (%eax)
     69 ; X86-NEXT:    retl
     70 ;
     71 ; X64-LABEL: bat:
     72 ; X64:       # %bb.0: # %entry
     73 ; X64-NEXT:    movzwl (%rsi), %eax
     74 ; X64-NEXT:    subl %edx, %eax
     75 ; X64-NEXT:    movw %ax, (%rdi)
     76 ; X64-NEXT:    retq
     77 entry:
     78   %0 = load i16, i16* %x
     79   %sub = sub i16 %0, %y
     80   store i16 %sub, i16* %a
     81   ret void
     82 }
     83