Skip to content

Commit

Permalink
Merge pull request #17 from scchan/shfl_ds_perm
Browse files Browse the repository at this point in the history
fix shuffle due to dpp builtin interface change
  • Loading branch information
scchan committed Apr 6, 2016
2 parents 862e135 + 129d812 commit e43fe07
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions lib/amd_gcn.ll
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@





define linkonce_odr spir_func i32 @amdgcn_wave_rshift_1(i32 %v) #1 {
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 312, i1 0, i32 15, i32 15)
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 312, i32 15, i32 15, i1 0)
ret i32 %call
}

define linkonce_odr spir_func i32 @amdgcn_wave_rshift_zero_1(i32 %v) #1 {
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 312, i1 1, i32 15, i32 15)
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 312, i32 15, i32 15, i1 1)
ret i32 %call
}

define linkonce_odr spir_func i32 @amdgcn_wave_rrotate_1(i32 %v) #1 {
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 316, i1 0, i32 15, i32 15)
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 316, i32 15, i32 15, i1 0)
ret i32 %call
}



define linkonce_odr spir_func i32 @amdgcn_wave_lshift_1(i32 %v) #1 {
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 304, i1 0, i32 15, i32 15)
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 304, i32 15, i32 15, i1 0)
ret i32 %call
}

define linkonce_odr spir_func i32 @amdgcn_wave_lshift_zero_1(i32 %v) #1 {
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 304, i1 1, i32 15, i32 15)
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 304, i32 15, i32 15, i1 1)
ret i32 %call
}

define linkonce_odr spir_func i32 @amdgcn_wave_lrotate_1(i32 %v) #1 {
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 308, i1 0, i32 15, i32 15)
%call = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %v, i32 308, i32 15, i32 15, i1 0)
ret i32 %call
}

Expand All @@ -58,63 +54,63 @@ define linkonce_odr spir_func i32 @amdgcn_row_rshift(i32 %data, i32 %delta) #1 {
]

; <label>:1: ; preds = %0
%2 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 273, i1 0, i32 15, i32 15)
%2 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 273, i32 15, i32 15, i1 0)
ret i32 %2

; <label>:3: ; preds = %0
%4 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 274, i1 0, i32 15, i32 15)
%4 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 274, i32 15, i32 15, i1 0)
ret i32 %4

; <label>:5: ; preds = %0
%6 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 275, i1 0, i32 15, i32 15)
%6 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 275, i32 15, i32 15, i1 0)
ret i32 %6

; <label>:7: ; preds = %0
%8 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 276, i1 0, i32 15, i32 15)
%8 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 276, i32 15, i32 15, i1 0)
ret i32 %8

; <label>:9: ; preds = %0
%10 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 277, i1 0, i32 15, i32 15)
%10 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 277, i32 15, i32 15, i1 0)
ret i32 %10

; <label>:11: ; preds = %0
%12 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 278, i1 0, i32 15, i32 15)
%12 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 278, i32 15, i32 15, i1 0)
ret i32 %12

; <label>:13: ; preds = %0
%14 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 279, i1 0, i32 15, i32 15)
%14 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 279, i32 15, i32 15, i1 0)
ret i32 %14

; <label>:15: ; preds = %0
%16 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 280, i1 0, i32 15, i32 15)
%16 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 280, i32 15, i32 15, i1 0)
ret i32 %16

; <label>:17: ; preds = %0
%18 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 281, i1 0, i32 15, i32 15)
%18 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 281, i32 15, i32 15, i1 0)
ret i32 %18

; <label>:19: ; preds = %0
%20 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 282, i1 0, i32 15, i32 15)
%20 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 282, i32 15, i32 15, i1 0)
ret i32 %20

; <label>:21: ; preds = %0
%22 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 283, i1 0, i32 15, i32 15)
%22 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 283, i32 15, i32 15, i1 0)
ret i32 %22

; <label>:23: ; preds = %0
%24 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 284, i1 0, i32 15, i32 15)
%24 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 284, i32 15, i32 15, i1 0)
ret i32 %24

; <label>:25: ; preds = %0
%26 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 285, i1 0, i32 15, i32 15)
%26 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 285, i32 15, i32 15, i1 0)
ret i32 %26

; <label>:27: ; preds = %0
%28 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 286, i1 0, i32 15, i32 15)
%28 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 286, i32 15, i32 15, i1 0)
ret i32 %28

; <label>:29: ; preds = %0
%30 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 287, i1 0, i32 15, i32 15)
%30 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %data, i32 287, i32 15, i32 15, i1 0)
ret i32 %30

; <label>:31:
Expand All @@ -131,9 +127,9 @@ define linkonce_odr spir_func i32 @amdgcn_ds_bpermute(i32 %index, i32 %src) #1
ret i32 %call
}

; llvm.amdgcn.mov.dpp.i32 <src> <dpp_ctrl> <row_mask> <bank_mask> <bound_ctrl>
declare i32 @llvm.amdgcn.mov.dpp.i32(i32, i32, i32, i32, i1) #0

;llvm.amdgcn.mov.dpp.i32 <src> <dpp_ctrl> <bound_ctrl> <bank_mask> <row_mask>
declare i32 @llvm.amdgcn.mov.dpp.i32(i32, i32, i1, i32, i32) #0

;llvm.amdgcn.ds.permute <index> <src>
declare i32 @llvm.amdgcn.ds.permute(i32, i32) #0
Expand Down

0 comments on commit e43fe07

Please sign in to comment.