1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs -global-isel-abort=2 < %s -o - | FileCheck %s --check-prefix=X64
4 ; TODO merge with ext.ll after i64 sext supported on 32bit platform
6 define i64 @test_zext_i1(i8 %a) {
7 ; X64-LABEL: test_zext_i1:
9 ; X64-NEXT: movl %edi, %eax
10 ; X64-NEXT: andq $1, %rax
12 %val = trunc i8 %a to i1
13 %r = zext i1 %val to i64
17 define i64 @test_sext_i8(i8 %val) {
18 ; X64-LABEL: test_sext_i8:
20 ; X64-NEXT: movl %edi, %eax
21 ; X64-NEXT: shlq $56, %rax
22 ; X64-NEXT: sarq $56, %rax
24 %r = sext i8 %val to i64
28 define i64 @test_sext_i16(i16 %val) {
29 ; X64-LABEL: test_sext_i16:
31 ; X64-NEXT: movl %edi, %eax
32 ; X64-NEXT: shlq $48, %rax
33 ; X64-NEXT: sarq $48, %rax
35 %r = sext i16 %val to i64
39 define i64 @test_sext_i32(i32 %val) {
40 ; X64-LABEL: test_sext_i32:
42 ; X64-NEXT: movslq %edi, %rax
44 %r = sext i32 %val to i64
48 define i64 @test_zext_i8_to_i64(i8 %x, i8 %y) {
49 ; X64-LABEL: test_zext_i8_to_i64:
51 ; X64-NEXT: addb %dil, %sil
52 ; X64-NEXT: movzbl %sil, %eax
55 %b = zext i8 %a to i64
59 define i64 @test_zext_i16_to_i64(i16 %x, i16 %y) {
60 ; X64-LABEL: test_zext_i16_to_i64:
62 ; X64-NEXT: addw %di, %si
63 ; X64-NEXT: movzwl %si, %eax
66 %b = zext i16 %a to i64
70 define i64 @test_zext_i32_to_i64(i32 %x, i32 %y) {
71 ; X64-LABEL: test_zext_i32_to_i64:
73 ; X64-NEXT: addl %edi, %esi
74 ; X64-NEXT: movl %esi, %eax
77 %b = zext i32 %a to i64