Home | History | Annotate | Download | only in R600
      1 ; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck %s
      2 
      3 ; Tests for indirect addressing on SI, which is implemented using dynamic
      4 ; indexing of vectors.
      5 
      6 ; CHECK: extract_w_offset
      7 ; CHECK: S_MOV_B32 m0
      8 ; CHECK-NEXT: V_MOVRELS_B32_e32
      9 define void @extract_w_offset(float addrspace(1)* %out, i32 %in) {
     10 entry:
     11   %0 = add i32 %in, 1
     12   %1 = extractelement <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, i32 %0
     13   store float %1, float addrspace(1)* %out
     14   ret void
     15 }
     16 
     17 ; CHECK: extract_wo_offset
     18 ; CHECK: S_MOV_B32 m0
     19 ; CHECK-NEXT: V_MOVRELS_B32_e32
     20 define void @extract_wo_offset(float addrspace(1)* %out, i32 %in) {
     21 entry:
     22   %0 = extractelement <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, i32 %in
     23   store float %0, float addrspace(1)* %out
     24   ret void
     25 }
     26 
     27 ; CHECK: insert_w_offset
     28 ; CHECK: S_MOV_B32 m0
     29 ; CHECK-NEXT: V_MOVRELD_B32_e32
     30 define void @insert_w_offset(float addrspace(1)* %out, i32 %in) {
     31 entry:
     32   %0 = add i32 %in, 1
     33   %1 = insertelement <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, float 5.0, i32 %0
     34   %2 = extractelement <4 x float> %1, i32 2
     35   store float %2, float addrspace(1)* %out
     36   ret void
     37 }
     38 
     39 ; CHECK: insert_wo_offset
     40 ; CHECK: S_MOV_B32 m0
     41 ; CHECK-NEXT: V_MOVRELD_B32_e32
     42 define void @insert_wo_offset(float addrspace(1)* %out, i32 %in) {
     43 entry:
     44   %0 = insertelement <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, float 5.0, i32 %in
     45   %1 = extractelement <4 x float> %0, i32 2
     46   store float %1, float addrspace(1)* %out
     47   ret void
     48 }
     49