Home | History | Annotate | Download | only in R600
      1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
      2 
      3 ; SI-LABEL: @s_sext_i1_to_i32:
      4 ; SI: V_CNDMASK_B32_e64
      5 ; SI: S_ENDPGM
      6 define void @s_sext_i1_to_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) nounwind {
      7   %cmp = icmp eq i32 %a, %b
      8   %sext = sext i1 %cmp to i32
      9   store i32 %sext, i32 addrspace(1)* %out, align 4
     10   ret void
     11 }
     12 
     13 ; SI-LABEL: @test:
     14 ; SI: V_ASHR
     15 ; SI: S_ENDPG
     16 define void @test(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) nounwind {
     17 entry:
     18   %mul = mul i32 %a, %b
     19   %add = add i32 %mul, %c
     20   %sext = sext i32 %add to i64
     21   store i64 %sext, i64 addrspace(1)* %out, align 8
     22   ret void
     23 }
     24 
     25 ; SI-LABEL: @s_sext_i1_to_i64:
     26 ; SI: V_CNDMASK_B32_e64
     27 ; SI: V_CNDMASK_B32_e64
     28 ; SI: S_ENDPGM
     29 define void @s_sext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) nounwind {
     30   %cmp = icmp eq i32 %a, %b
     31   %sext = sext i1 %cmp to i64
     32   store i64 %sext, i64 addrspace(1)* %out, align 8
     33   ret void
     34 }
     35 
     36 ; SI-LABEL: @s_sext_i32_to_i64:
     37 ; SI: S_ASHR_I32
     38 ; SI: S_ENDPGM
     39 define void @s_sext_i32_to_i64(i64 addrspace(1)* %out, i32 %a) nounwind {
     40   %sext = sext i32 %a to i64
     41   store i64 %sext, i64 addrspace(1)* %out, align 8
     42   ret void
     43 }
     44 
     45 ; SI-LABEL: @v_sext_i32_to_i64:
     46 ; SI: V_ASHR
     47 ; SI: S_ENDPGM
     48 define void @v_sext_i32_to_i64(i64 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
     49   %val = load i32 addrspace(1)* %in, align 4
     50   %sext = sext i32 %val to i64
     51   store i64 %sext, i64 addrspace(1)* %out, align 8
     52   ret void
     53 }
     54 
     55 ; SI-LABEL: @s_sext_i16_to_i64:
     56 ; SI: S_ENDPGM
     57 define void @s_sext_i16_to_i64(i64 addrspace(1)* %out, i16 %a) nounwind {
     58   %sext = sext i16 %a to i64
     59   store i64 %sext, i64 addrspace(1)* %out, align 8
     60   ret void
     61 }
     62