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 < %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: movq $56, %rcx
22 ; X64-NEXT: shlq %cl, %rax
23 ; X64-NEXT: movq $56, %rcx
24 ; X64-NEXT: sarq %cl, %rax
26 %r = sext i8 %val to i64
30 define i64 @test_sext_i16(i16 %val) {
31 ; X64-LABEL: test_sext_i16:
33 ; X64-NEXT: movl %edi, %eax
34 ; X64-NEXT: movq $48, %rcx
35 ; X64-NEXT: shlq %cl, %rax
36 ; X64-NEXT: movq $48, %rcx
37 ; X64-NEXT: sarq %cl, %rax
39 %r = sext i16 %val to i64
43 ; TODO enable after selection supported
44 ;define i64 @test_sext_i32(i32 %val) {
45 ; %r = sext i32 %val to i64