1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
3 ; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s
4 ; RUN: llc < %s -mtriple=x86_64-nacl | FileCheck %s
6 define zeroext i16 @t1(i32 %on_off) nounwind {
9 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
10 ; CHECK-NEXT: leal -2(%rdi,%rdi), %eax
11 ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
13 %t0 = sub i32 %on_off, 1
15 %t2 = trunc i32 %t1 to i16
16 %t3 = zext i16 %t2 to i32
17 %t4 = trunc i32 %t3 to i16
21 define i32 @t2(i32 %on_off) nounwind {
24 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
25 ; CHECK-NEXT: leal -2(%rdi,%rdi), %eax
26 ; CHECK-NEXT: movzwl %ax, %eax
28 %t0 = sub i32 %on_off, 1
30 %t2 = and i32 %t1, 65535