2017-09-19 21:43:09 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefix=LNX1
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s --check-prefix=LNX2
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-nacl | FileCheck %s --check-prefix=NACL
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s --check-prefix=WIN
|
2007-03-29 02:03:14 +08:00
|
|
|
|
2007-03-29 02:11:17 +08:00
|
|
|
define i64 @test2(i64 %a) {
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX1-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LNX1: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX1-NEXT: leaq (,%rdi,4), %rax
|
|
|
|
; LNX1-NEXT: orq %rdi, %rax
|
|
|
|
; LNX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; LNX2-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LNX2: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX2-NEXT: leaq (,%rdi,4), %rax
|
|
|
|
; LNX2-NEXT: orq %rdi, %rax
|
|
|
|
; LNX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; NACL-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; NACL: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; NACL-NEXT: leaq (,%rdi,4), %rax
|
|
|
|
; NACL-NEXT: orq %rdi, %rax
|
|
|
|
; NACL-NEXT: retq
|
|
|
|
;
|
|
|
|
; WIN-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; WIN: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; WIN-NEXT: leaq (,%rcx,4), %rax
|
|
|
|
; WIN-NEXT: orq %rcx, %rax
|
|
|
|
; WIN-NEXT: retq
|
|
|
|
%tmp2 = shl i64 %a, 2
|
2007-03-29 02:11:17 +08:00
|
|
|
%tmp3 = or i64 %tmp2, %a
|
2017-09-19 21:43:09 +08:00
|
|
|
ret i64 %tmp3
|
2007-03-29 02:11:17 +08:00
|
|
|
}
|
|
|
|
|
2011-03-16 21:53:07 +08:00
|
|
|
define i32 @test(i32 %a) {
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX1-LABEL: test:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LNX1: # %bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
; LNX1-NEXT: # kill: def $edi killed $edi def $rdi
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX1-NEXT: leal (%rdi,%rdi,2), %eax
|
|
|
|
; LNX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; LNX2-LABEL: test:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LNX2: # %bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
; LNX2-NEXT: # kill: def $edi killed $edi def $rdi
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX2-NEXT: leal (%rdi,%rdi,2), %eax
|
|
|
|
; LNX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; NACL-LABEL: test:
|
2017-12-05 01:18:51 +08:00
|
|
|
; NACL: # %bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
; NACL-NEXT: # kill: def $edi killed $edi def $rdi
|
2017-09-19 21:43:09 +08:00
|
|
|
; NACL-NEXT: leal (%rdi,%rdi,2), %eax
|
|
|
|
; NACL-NEXT: retq
|
|
|
|
;
|
|
|
|
; WIN-LABEL: test:
|
2017-12-05 01:18:51 +08:00
|
|
|
; WIN: # %bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
; WIN-NEXT: # kill: def $ecx killed $ecx def $rcx
|
2017-09-19 21:43:09 +08:00
|
|
|
; WIN-NEXT: leal (%rcx,%rcx,2), %eax
|
|
|
|
; WIN-NEXT: retq
|
|
|
|
%tmp2 = mul i32 %a, 3
|
|
|
|
ret i32 %tmp2
|
2011-03-16 21:53:07 +08:00
|
|
|
}
|
|
|
|
|
2007-03-29 02:11:17 +08:00
|
|
|
define i64 @test3(i64 %a) {
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX1-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LNX1: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX1-NEXT: leaq (,%rdi,8), %rax
|
|
|
|
; LNX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; LNX2-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LNX2: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; LNX2-NEXT: leaq (,%rdi,8), %rax
|
|
|
|
; LNX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; NACL-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; NACL: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; NACL-NEXT: leaq (,%rdi,8), %rax
|
|
|
|
; NACL-NEXT: retq
|
|
|
|
;
|
|
|
|
; WIN-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; WIN: # %bb.0:
|
2017-09-19 21:43:09 +08:00
|
|
|
; WIN-NEXT: leaq (,%rcx,8), %rax
|
|
|
|
; WIN-NEXT: retq
|
|
|
|
%tmp2 = shl i64 %a, 3
|
|
|
|
ret i64 %tmp2
|
2007-03-29 02:11:17 +08:00
|
|
|
}
|
|
|
|
|