Skip to content

Commit

Permalink
[herd,SVE] Fix store predicated base iico_data dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
crvdgc committed Sep 19, 2024
1 parent 4a2f70e commit c2e76c5
Showing 1 changed file with 38 additions and 24 deletions.
62 changes: 38 additions & 24 deletions herd/AArch64Sem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2906,26 +2906,40 @@ module Make
let psize = predicate_psize r in
let esize = scalable_esize r in
let nregs = List.length rlist in
let>= pred = read_reg_predicate false p ii
and* base = ma
in
let ops i r =
let op idx =
let store =
let>= v = read_reg_scalable true r ii in
let offset = (idx * nregs + i) * MachSize.nbytes sz in
let>= addr = M.op1 (Op.AddK offset) base
and* v = scalable_getlane v idx esize >>= demote
let>= results =
let<>= base = ma
and* pred = read_reg_predicate false p ii
in
let ops i r =
let op idx =
let store =
let>= v = read_reg_scalable true r ii in
let offset = (idx * nregs + i) * MachSize.nbytes sz in
let>= addr = M.op1 (Op.AddK offset) base
and* v = scalable_getlane v idx esize >>= demote
in
M.unitT (Some (addr, v))
(* write_mem sz aexp Access.VIR addr v ii *)
in
write_mem sz aexp Access.VIR addr v ii
is_active_element p pred psize idx ii store (M.unitT None)
in
is_active_element p pred psize idx ii store (M.unitT ())
let ops = List.map op (Misc.interval 0 nelem) in
List.fold_right ( >>:: ) ops (M.unitT [])
(* List.fold_right M.seq_mem_list ops (M.unitT [()]) *)
in
let ops = List.map op (Misc.interval 0 nelem) in
List.fold_right M.seq_mem_list ops (M.unitT [()])
let ops = List.mapi ops rlist in
List.fold_right ( >>:: ) ops (M.unitT [])
in
let ops = List.mapi ops rlist in
List.fold_right M.seq_mem_list ops (M.unitT [[()]])
let f avs macc =
let avs = List.filter_map Fun.id avs in
let g (addr, v) macc =
M.seq_mem_list
(write_mem sz aexp Access.VIR addr v ii)
macc
in
List.fold_right g avs macc
in
List.fold_right f results (M.unitT [()])

let load_gather_predicated_elem_or_zero sz p ma mo rs e k ii =
let r = List.hd rs in
Expand Down Expand Up @@ -3634,19 +3648,19 @@ module Make
| I_ST3SP(var,rs,p,rA,MemExt.Imm (k,Idx))
| I_ST4SP(var,rs,p,rA,MemExt.Imm (k,Idx)) ->
check_sve inst;
!!!!(let sz = tr_simd_variant var in
let ma = get_ea_idx rA k ii in
store_predicated_elem_or_merge_m sz p ma rs ii >>|
M.unitT ())
!!!(let sz = tr_simd_variant var in
let ma = get_ea_idx rA k ii in
store_predicated_elem_or_merge_m sz p ma rs ii >>|
M.unitT ())
| I_ST1SP(var,rs,p,rA,MemExt.Reg (V64,rM,MemExt.LSL,s))
| I_ST2SP(var,rs,p,rA,MemExt.Reg (V64,rM,MemExt.LSL,s))
| I_ST3SP(var,rs,p,rA,MemExt.Reg (V64,rM,MemExt.LSL,s))
| I_ST4SP(var,rs,p,rA,MemExt.Reg (V64,rM,MemExt.LSL,s)) ->
check_sve inst;
!!!!(let sz = tr_simd_variant var in
let ma = get_ea_reg rA V64 rM MemExt.LSL s ii in
store_predicated_elem_or_merge_m sz p ma rs ii >>|
M.unitT ())
!!!(let sz = tr_simd_variant var in
let ma = get_ea_reg rA V64 rM MemExt.LSL s ii in
store_predicated_elem_or_merge_m sz p ma rs ii >>|
M.unitT ())
| I_ST1SP (var,rs,p,rA,MemExt.ZReg (rM,sext,s)) ->
check_sve inst;
!!!(let sz = tr_simd_variant var in
Expand Down

0 comments on commit c2e76c5

Please sign in to comment.