Skip to content

Commit

Permalink
[herd] Fix load gather to use base, offsets as iico_data input
Browse files Browse the repository at this point in the history
  • Loading branch information
crvdgc committed Sep 18, 2024
1 parent 6512dcf commit 24b0b91
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions herd/AArch64Sem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2928,24 +2928,25 @@ module Make
let nelem = scalable_nelem r in
let esize = scalable_esize r in
let>= pred = read_reg_predicate false p ii in
let<>= (base, offsets) =
any_active p pred psize nelem ii (ma >>| mo) (M.unitT M.A.V.(zero, zero))
in
let op idx =
let load =
let>= lane = scalable_getlane offsets idx esize in
let>= lane = demote lane in
let>= o = memext_sext e k lane in
let>= addr = M.add base o in
let>= v = do_read_mem_ret sz Annot.N aexp Access.VIR addr ii in
let>= v = promote v in
M.op1 (Op.LeftShift (idx * esize)) v
in
is_active_element p pred psize idx ii load (no_action ii >>! M.A.V.zero)
in
let ops = List.map op (Misc.interval 0 nelem) in
let>= result = para_fold_right (M.op Op.Or) ops mzero in
write_reg_scalable r result ii
M.data_input_union
(any_active p pred psize nelem ii (ma >>| mo) (M.unitT M.A.V.(zero, zero)))
begin fun (base, offsets) ->
let op idx =
let load =
let>= lane = scalable_getlane offsets idx esize in
let>= lane = demote lane in
let>= o = memext_sext e k lane in
let>= addr = M.add base o in
let>= v = do_read_mem_ret sz Annot.N aexp Access.VIR addr ii in
let>= v = promote v in
M.op1 (Op.LeftShift (idx * esize)) v
in
is_active_element p pred psize idx ii load (no_action ii >>! M.A.V.zero)
in
let ops = List.map op (Misc.interval 0 nelem) in
let>= result = para_fold_right (M.op Op.Or) ops mzero in
write_reg_scalable r result ii
end

let store_scatter_predicated_elem_or_merge sz p ma mo rs e k ii =
let r = List.hd rs in
Expand Down

0 comments on commit 24b0b91

Please sign in to comment.