Skip to content

Commit 0f5d9ec

Browse files
diaolo01artkhyzha
authored andcommitted
[litmus] Guard ifetch support changes for non-vmsa+ifetch tests
1 parent 9bbf595 commit 0f5d9ec

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

litmus/preSi.ml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,10 @@ module Make
726726
(fun (p,lbl) ->
727727
let lbl_var = OutUtils.fmt_lbl_var p lbl in
728728
O.fi "ins_t *%s;" lbl_var;
729-
O.fi "pteval_t *%s;" (OutUtils.fmt_pte_tag lbl_var);
730-
O.fi "pteval_t %s;" (OutUtils.fmt_phy_tag lbl_var);) CfgLoc.all_labels ;
729+
if Cfg.is_kvm then begin
730+
O.fi "pteval_t *%s;" (OutUtils.fmt_pte_tag lbl_var);
731+
O.fi "pteval_t %s;" (OutUtils.fmt_phy_tag lbl_var);
732+
end;) CfgLoc.all_labels ;
731733
if do_precise then O.fi "ins_t *ret[N];" ;
732734
O.o "} labels_t;" ;
733735
O.o ""
@@ -1490,7 +1492,7 @@ module Make
14901492
O.o "static void labels_init(vars_t *_vars) {" ;
14911493
if do_label_init || do_precise then
14921494
O.fi "labels_t *lbls = &_vars->labels;" ;
1493-
if Misc.consp CfgLoc.all_labels then
1495+
if Cfg.is_kvm && Misc.consp CfgLoc.all_labels then
14941496
O.oi "pteval_t *_p;" ;
14951497
O.o "";
14961498
List.iter (fun (p,lbl) ->
@@ -1501,12 +1503,19 @@ module Make
15011503
sprintf "_vars->%s" (LangUtils.code_fun p)
15021504
else
15031505
LangUtils.code_fun p in
1506+
let prelude =
1507+
if do_self then
1508+
sprintf "_vars->%s" (OutUtils.fmt_prelude p)
1509+
else
1510+
sprintf "prelude_size((ins_t *)%s)" (LangUtils.code_fun p) in
15041511
let rhs =
1505-
sprintf "((ins_t *)%s)+_vars->%s+%d"
1506-
proc (OutUtils.fmt_prelude p) off in
1512+
sprintf "((ins_t *)%s)+%s+%d"
1513+
proc prelude off in
15071514
O.fi "%s = %s;" lhs rhs;
1508-
O.fi "lbls->%s = _p = litmus_tr_pte((void *)%s);" (OutUtils.fmt_pte_tag lbl_var) lhs;
1509-
O.fi "lbls->%s = *_p;" (OutUtils.fmt_phy_tag lbl_var);)
1515+
if Cfg.is_kvm then begin
1516+
O.fi "lbls->%s = _p = litmus_tr_pte((void *)%s);" (OutUtils.fmt_pte_tag lbl_var) lhs;
1517+
O.fi "lbls->%s = *_p;" (OutUtils.fmt_phy_tag lbl_var);
1518+
end;)
15101519
CfgLoc.all_labels ;
15111520
if do_precise then begin
15121521
List.iter

0 commit comments

Comments
 (0)