summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Pulte2015-11-05 08:45:31 +0000
committerChristopher Pulte2015-11-05 08:45:31 +0000
commitbf36f5273afa8a63adcd739e09f29bd0f64d9527 (patch)
treefe31b8b6d0ce14d073b474e4c31ddf229301e5de /src
parent0f935fbc68d0000bbb97eccfe54f54292cb2b36f (diff)
some progress on lem backend: rewrite away mutable variable assignments, rewrite for-loops, if/case-expressions to return updated variables
Diffstat (limited to 'src')
-rw-r--r--src/gen_lib/sail_values.lem69
-rw-r--r--src/gen_lib/state.lem18
-rw-r--r--src/gen_lib/vector.lem10
-rw-r--r--src/pretty_print.ml272
-rw-r--r--src/rewriter.ml396
-rw-r--r--src/rewriter.mli2
-rw-r--r--src/test/power.sail8935
7 files changed, 9385 insertions, 317 deletions
diff --git a/src/gen_lib/sail_values.lem b/src/gen_lib/sail_values.lem
index 8048c676..bd295616 100644
--- a/src/gen_lib/sail_values.lem
+++ b/src/gen_lib/sail_values.lem
@@ -4,12 +4,12 @@ open import Vector
open import Arch
let to_bool = function
- | Zero -> false
- | One -> true
-(* | Undef -> assert false *)
+ | B0 -> false
+ | B1 -> true
+(* | BU -> assert false *)
end
-let get_blist (Vector bs _) = bs
+let get_elements (Vector elements _) = elements
let get_start (Vector _ s) = s
let length (Vector bs _) = length bs
@@ -19,7 +19,6 @@ let vector_access (Vector bs start) n =
else List.index bs (start - n) in
b
-
let write_two_registers r1 r2 vec =
let size = length_register r1 in
let start = get_start vec in
@@ -39,30 +38,30 @@ let rec replace bs ((n : nat),b') = match (n,bs) with
end
let make_indexed_vector entries default start length =
- let default = match default with Nothing -> Undef | Just v -> v end in
+ let default = match default with Nothing -> BU | Just v -> v end in
Vector (List.foldl replace (replicate length default) entries) start
let vector_concat (Vector bs start) (Vector bs' _) = Vector(bs ++ bs') start
-let has_undef (Vector bs _) = List.any (function Undef -> true | _ -> false end) bs
+let has_undef (Vector bs _) = List.any (function BU -> true | _ -> false end) bs
let most_significant (Vector bs _) =
let (b :: _) = bs in b
let bitwise_not_bit = function
- | One -> Zero
- | Zero -> One
- | _ -> Undef
+ | B1 -> B0
+ | B0 -> B1
+ | _ -> BU
end
let bitwise_not (Vector bs start) =
Vector (List.map bitwise_not_bit bs) start
-let bool_to_bit b = if b then One else Zero
+let bool_to_bit b = if b then B1 else B0
let bitwise_binop_bit op = function
- | (Undef,_) -> Undef (*Do we want to do this or to respect | of One and & of Zero rules?*)
- | (_,Undef) -> Undef (*Do we want to do this or to respect | of One and & of Zero rules?*)
+ | (BU,_) -> BU (*Do we want to do this or to respect | of B1 and & of B0 rules?*)
+ | (_,BU) -> BU (*Do we want to do this or to respect | of B1 and & of B0 rules?*)
| (x,y) -> bool_to_bit (op (to_bool x) (to_bool y))
end
@@ -82,13 +81,13 @@ let unsigned (Vector bs _ as v) : integer =
match has_undef v with
| true ->
fst (List.foldl
- (fun (acc,exp) b -> (acc + (if b = One then integerPow 2 exp else 0),exp +1)) (0,0) bs)
+ (fun (acc,exp) b -> (acc + (if b = B1 then integerPow 2 exp else 0),exp +1)) (0,0) bs)
end
let signed v =
match most_significant v with
- | One -> 0 - (1 + (unsigned (bitwise_not v)))
- | Zero -> unsigned v
+ | B1 -> 0 - (1 + (unsigned (bitwise_not v)))
+ | B0 -> unsigned v
end
let to_num sign = if sign then signed else unsigned
@@ -126,21 +125,21 @@ let rec divide_by_2 bs i (n : integer) =
then bs
else
if (n mod 2 = 1)
- then divide_by_2 (replace bs (i,One)) (i - 1) (n / 2)
+ then divide_by_2 (replace bs (i,B1)) (i - 1) (n / 2)
else divide_by_2 bs (i-1) (n div 2)
let rec add_one_bit bs co i =
if i < 0 then bs
else match (List.index bs i,co) with
- | (Just Zero,false) -> replace bs (i,One)
- | (Just Zero,true) -> add_one_bit (replace bs (i,One)) true (i-1)
- | (Just One, false) -> add_one_bit (replace bs (i,Zero)) true (i-1)
- | (Just One, true) -> add_one_bit bs true (i-1)
+ | (Just B0,false) -> replace bs (i,B1)
+ | (Just B0,true) -> add_one_bit (replace bs (i,B1)) true (i-1)
+ | (Just B1, false) -> add_one_bit (replace bs (i,B0)) true (i-1)
+ | (Just B1, true) -> add_one_bit bs true (i-1)
(* | Vundef,_ -> assert false*)
end
let to_vec len (n : integer) =
- let bs = List.replicate len Zero in
+ let bs = List.replicate len B0 in
let start = if is_inc then 0 else len-1 in
if n = 0 then Vector bs start
else if n > 0
@@ -152,7 +151,7 @@ let to_vec len (n : integer) =
let to_vec_undef len =
- Vector (replicate len Undef) (if is_inc then 0 else len-1)
+ Vector (replicate len BU) (if is_inc then 0 else len-1)
let add = uncurry integerAdd
let add_signed = uncurry integerAdd
@@ -212,7 +211,7 @@ let add_vec_vec_range_signed = arith_op_vec_vec_range integerAdd true
let arith_op_vec_bit op sign (size : nat) (l,r) =
let l' = to_num sign l in
- let n = op l' match r with | One -> (1 : integer) | _ -> 0 end in
+ let n = op l' match r with | B1 -> (1 : integer) | _ -> 0 end in
to_vec (length l * size) n
let add_vec_bit = arith_op_vec_bit integerAdd false 1
@@ -231,7 +230,7 @@ let rec arith_op_overflow_vec (op : integer -> integer -> integer) sign size (l,
let overflow =
if n <= get_max_representable_in sign len &&
n >= get_min_representable_in sign len
- then Zero else One in
+ then B0 else B1 in
let c_out = most_significant one_more_size_u in
(correct_size_num,overflow,c_out)
@@ -247,8 +246,8 @@ let rec arith_op_overflow_vec_bit (op : integer -> integer -> integer) sign (siz
let l' = to_num sign l in
let l_u = to_num false l in
let (n,nu,changed) = match r_bit with
- | One -> (op l' 1, op l_u 1, true)
- | Zero -> (l',l_u,false)
+ | B1 -> (op l' 1, op l_u 1, true)
+ | B0 -> (l',l_u,false)
end in
(* | _ -> assert false *)
let correct_size_num = to_vec act_size n in
@@ -257,8 +256,8 @@ let rec arith_op_overflow_vec_bit (op : integer -> integer -> integer) sign (siz
if changed
then
if n <= get_max_representable_in sign act_size && n >= get_min_representable_in sign act_size
- then Zero else One
- else One in
+ then B0 else B1
+ else B1 in
(correct_size_num,overflow,most_significant one_larger)
let add_overflow_vec_bit_signed = arith_op_overflow_vec_bit integerAdd true 1
@@ -272,12 +271,12 @@ let shift_op_vec op (((Vector bs start) as l),r) =
let n = r in
match op with
| LL (*"<<"*) ->
- let right_vec = Vector (List.replicate n Zero) 0 in
+ let right_vec = Vector (List.replicate n B0) 0 in
let left_vec = read_vector_subrange is_inc l n (if is_inc then len + start else start - len) in
vector_concat left_vec right_vec
| RR (*">>"*) ->
let right_vec = read_vector_subrange is_inc l start n in
- let left_vec = Vector (List.replicate n Zero) 0 in
+ let left_vec = Vector (List.replicate n B0) 0 in
vector_concat left_vec right_vec
| LLL (*"<<<"*) ->
let left_vec = read_vector_subrange is_inc l n (if is_inc then len + start else start - len) in
@@ -307,7 +306,7 @@ let rec arith_op_vec_no0 (op : integer -> integer -> integer) sign size (((Vecto
end in
if representable
then to_vec act_size n'
- else Vector (List.replicate act_size Undef) start
+ else Vector (List.replicate act_size BU) start
let mod_vec = arith_op_vec_no0 integerMod false 1
let quot_vec = arith_op_vec_no0 integerDiv false 1
@@ -331,9 +330,9 @@ let arith_op_overflow_no0_vec op sign size (((Vector _ start) as l),r) =
if representable then
(to_vec act_size n',to_vec (act_size + 1) n_u')
else
- (Vector (List.replicate act_size Undef) start,
- Vector (List.replicate (act_size + 1) Undef) start) in
- let overflow = if representable then Zero else One in
+ (Vector (List.replicate act_size BU) start,
+ Vector (List.replicate (act_size + 1) BU) start) in
+ let overflow = if representable then B0 else B1 in
(correct_size_num,overflow,most_significant one_more)
let quot_overflow_vec = arith_op_overflow_no0_vec integerDiv false 1
diff --git a/src/gen_lib/state.lem b/src/gen_lib/state.lem
index 462eeec2..ce3be419 100644
--- a/src/gen_lib/state.lem
+++ b/src/gen_lib/state.lem
@@ -1,3 +1,5 @@
+open import Pervasives
+
type M 's 'a = <| runState : 's -> ('a * 's) |>
val return : forall 's 'a. 'a -> M 's 'a
@@ -8,3 +10,19 @@ let bind m f = <| runState = (fun s -> let (a,s) = m.runState s in (f a).runStat
let (>>=) = bind
let (>>) m n = m >>= fun _ -> n
+
+
+val foreach_inc : forall 's 'vars. (nat * nat * nat) -> (nat -> 'vars -> M 's 'vars) ->
+ 'vars -> M 's 'vars
+let rec foreach_inc (i,stop,by) body vars =
+ if i <= stop
+ then (body i vars >>= fun vars -> foreach_inc (i + by,stop,by) body vars)
+ else return vars
+
+
+val foreach_dec : forall 's 'vars. (nat * nat * nat) -> (nat -> 'vars -> M 's 'vars) ->
+ 'vars -> M 's 'vars
+let rec foreach_dec (i,stop,by) body vars =
+ if i >= stop
+ then (body i vars >>= fun vars -> foreach_dec (i - by,stop,by) body vars)
+ else return vars
diff --git a/src/gen_lib/vector.lem b/src/gen_lib/vector.lem
index e7b20aeb..fe70c9c0 100644
--- a/src/gen_lib/vector.lem
+++ b/src/gen_lib/vector.lem
@@ -1,8 +1,14 @@
open import Pervasives
-type bit = Zero | One | Undef
+type bit = B0 | B1 | BU
type vector = Vector of list bit * nat
+
+let vector_access (Vector bs start) n =
+ let (Just b) = if is_inc then List.index bs (n - start)
+ else List.index bs (start - n) in
+ b
+
let read_vector_subrange is_inc (Vector bs start) n m =
let (length,offset) = if is_inc then (m-n+1,n-start) else (n-m+1,start-n) in
let (_,suffix) = List.splitAt offset bs in
@@ -14,3 +20,5 @@ let write_vector_subrange is_inc (Vector bs start) n m (Vector bs' _) =
let (prefix,_) = List.splitAt offset bs in
let (_,suffix) = List.splitAt (offset + length) bs in
Vector (prefix ++ (List.take length bs') ++ suffix) start
+
+let hd (x :: xs) = x
diff --git a/src/pretty_print.ml b/src/pretty_print.ml
index a4042588..9b1bf6f7 100644
--- a/src/pretty_print.ml
+++ b/src/pretty_print.ml
@@ -1642,7 +1642,7 @@ let doc_exp_ocaml, doc_let_ocaml =
parens ((string (if is_bitv then "set_vector_subrange_bit" else "set_vector_subrange_vec")) ^^ space ^^
string reg ^^ space ^^ doc_int start ^^ space ^^ doc_int stop ^^ space ^^ exp e_new_v)
| Alias_pair(reg1,reg2) ->
- parens ((string "set_two_regs") ^^ space ^^ string reg1 ^^ space ^^ string reg2 ^^ space ^^ exp e_new_v))
+ parens ((string "set_two_regs") ^^ space ^^ string reg1 ^^ space ^^ string reg2 ^^ space ^^ exp e_new_v))
| _ ->
parens (separate space [string "set_register"; doc_id_ocaml id; exp e_new_v]))
@@ -1800,17 +1800,16 @@ let pp_defs_ocaml f d top_line opens =
(****************************************************************************
- * PPrint-based sail-to-lem pretty printer
+ * PPrint-based sail-to-lem pprinter
****************************************************************************)
let langlebar = string "<|"
let ranglebar = string "|>"
let anglebars = enclose langlebar ranglebar
-
let doc_id_lem (Id_aux(i,_)) =
match i with
- | Id("bit") -> string "vbit"
+ | Id("bit") -> string "bit"
| Id i -> string (if i.[0] = '\'' || is_number(i.[0])
then "_" ^ i else i)
| DeIid x ->
@@ -1820,7 +1819,7 @@ let doc_id_lem (Id_aux(i,_)) =
let doc_id_lem_type (Id_aux(i,_)) =
match i with
- | Id("bit") -> string "vbit"
+ | Id("bit") -> string "bit"
| Id i -> string i
| DeIid x ->
(* add an extra space through empty to avoid a closing-comment
@@ -1829,7 +1828,7 @@ let doc_id_lem_type (Id_aux(i,_)) =
let doc_id_lem_ctor (Id_aux(i,_)) =
match i with
- | Id("bit") -> string "vbit"
+ | Id("bit") -> string "bit"
| Id i -> string (String.capitalize i)
| DeIid x ->
(* add an extra space through empty to avoid a closing-comment
@@ -1880,14 +1879,14 @@ let doc_typ_lem, doc_atomic_typ_lem =
let doc_lit_lem in_pat (L_aux(l,_)) =
utf8string (match l with
| L_unit -> "()"
- | L_zero -> "Zero"
- | L_one -> "One"
- | L_true -> "One"
- | L_false -> "Zero"
+ | L_zero -> "B0"
+ | L_one -> "B1"
+ | L_false -> "B0"
+ | L_true -> "B1"
| L_num i -> (* if in_pat then string_of_int i else "(big_int_of_int " ^ string_of_int i ^ ")" *) string_of_int i
| L_hex n -> failwith "Shouldn't happen" (*"(num_to_vec " ^ ("0x" ^ n) ^ ")" (*shouldn't happen*)*)
| L_bin n -> failwith "Shouldn't happen" (*"(num_to_vec " ^ ("0b" ^ n) ^ ")" (*shouldn't happen*)*)
- | L_undef -> "Undef"
+ | L_undef -> "BU"
| L_string s -> "\"" ^ s ^ "\"")
(* typ_doc is the doc for the type being quantified *)
@@ -1920,13 +1919,13 @@ let doc_pat_lem =
let non_bit_print () =
parens
(separate space [string "Vector";
- (separate space [squarebars (separate_map semi pat pats);
+ (separate space [brackets (separate_map semi pat pats);
underscore;underscore])]) in
(match annot with
| Base(([],t),_,_,_,_,_) ->
if is_bit_vector t
then parens (separate space [string "Vector";
- (separate space [squarebars (separate_map semi pat pats);
+ (separate space [brackets (separate_map semi pat pats);
underscore;underscore])])
else non_bit_print()
| _ -> non_bit_print ())
@@ -1963,40 +1962,7 @@ let doc_exp_lem, doc_let_lem =
(prefix 2 1 (string "then") (exp t)) ^/^
(prefix 2 1 (string "else") (exp e))
) ^^ hardline
- | E_for(id,exp1,exp2,exp3,(Ord_aux(order,_)),exp4) ->
- let var= doc_id_lem id in
- let (compare,next) = if order = Ord_inc then string "<=",string "+" else string ">=",string "-" in
- let by = exp exp3 in
- let stop = exp exp2 in
- (*takes over two names but doesn't require building a closure*)
- parens
- (separate space [(string "let (__stop,__by) = ") ^^ (parens (doc_op comma stop by));
- string "in" ^/^ empty;
- string "let rec foreach";
- var;
- equals;
- string "if";
- parens (doc_op compare var (string "__stop") );
- string "then";
- parens (exp exp4 ^^ space ^^ semi ^^ (string "foreach") ^^
- parens (doc_op next var (string "__by")));
- string "in";
- string "foreach";
- exp exp1])
- (*Requires fewer introduced names but introduces a closure*)
- (*let forL = if order = Ord_inc then string "foreach_inc" else string "foreach_dec" in
- forL ^^ space ^^ (group (exp exp1)) ^^ (group (exp exp2)) ^^ (group (exp full_exp3)) ^/^
- group ((string "fun") ^^ space ^^ (doc_id id) ^^ space ^^ arrow ^/^ (exp exp4))
-
- (* this way requires the following Lem declarations first
-
- let rec foreach_inc i stop by body =
- if i <= stop then (body i; foreach_inc (i + by) stop by body) else ()
-
- let rec foreach_dec i stop by body =
- if i >= stop then (body i; foreach_dec (i - by) stop by body) else ()
-
- *)*)
+ | E_for(id,exp1,exp2,exp3,(Ord_aux(order,_)),exp4) -> failwith "shouldn't happen"
| E_let(leb,e) -> (let_exp leb) ^^ space ^^ string "in" ^/^ (exp e)
| E_app(f,args) ->
let call = match annot with
@@ -2039,19 +2005,30 @@ let doc_exp_lem, doc_let_lem =
| _ -> doc_id_lem id)
| Base(_,(Constructor i |Enum i),_,_,_,_) -> doc_id_lem_ctor id
| Base((_,t),Alias alias_info,_,_,_,_) ->
- (match alias_info with
+ (match alias_info with
| Alias_field(reg,field) ->
- let field_f = match t.t with
- | Tid "bit" | Tabbrev(_,{t=Tid "bit"}) -> string "get_register_field_bit"
- | _ -> string "get_register_field_vec" in
- parens (separate space [field_f; string reg; string_lit (string field)])
+ (match t.t with
+ | Tid "bit"
+ | Tabbrev(_,{t=Tid "bit"}) ->
+ parens (string "hd" ^^ space ^^
+ parens (separate space [string "read_register"; string reg]))
+ | _ -> string "read_register" ^^ space ^^ string reg)
| Alias_extract(reg,start,stop) ->
if start = stop
- then parens (separate space [string "bit_vector_access";string reg;doc_int start])
- else parens
- (separate space [string "read_vector_subrange"; string reg; doc_int start; doc_int stop])
+ then
+ parens
+ (separate space
+ [string "vector_access"; doc_int start;
+ parens (string "read_register" ^^ space ^^ string reg)])
+ else
+ parens
+ (separate space
+ [string "vector_subrange"; doc_int start; doc_int stop;
+ parens (string "read_register" ^^ space ^^ string reg)])
| Alias_pair(reg1,reg2) ->
- parens (separate space [string "vector_concat"; string reg1; string reg2]))
+ parens (separate space [string "vector_concat";
+ parens (string "read_register" ^^ space ^^ string reg1);
+ parens (string "read_register" ^^ space ^^ string reg2)]))
| _ -> doc_id_lem id)
| E_lit lit -> doc_lit_lem false lit
| E_cast(typ,e) ->
@@ -2070,7 +2047,6 @@ let doc_exp_lem, doc_let_lem =
match t.t with
| Tapp("vector", [TA_nexp start; _; TA_ord order; _])
| Tabbrev(_,{t= Tapp("vector", [TA_nexp start; _; TA_ord order; _])}) ->
- let call = string "Vector" in
let dir,dir_out = match order.order with
| Oinc -> true,"true"
| _ -> false, "false" in
@@ -2078,38 +2054,36 @@ let doc_exp_lem, doc_let_lem =
| Nconst i -> string_of_big_int i
| N2n(_,Some i) -> string_of_big_int i
| _ -> if dir then "0" else string_of_int (List.length exps) in
- parens (separate space [call; parens (separate comma_sp [squarebars (separate_map semi exp exps);
- string start;
- string dir_out])]))
+ parens (separate space [string "Vector"; brackets (separate_map semi exp exps);
+ string start;
+ string dir_out]))
| E_vector_indexed (iexps, (Def_val_aux (default,_))) ->
(match annot with
| Base((_,t),_,_,_,_,_) ->
match t.t with
| Tapp("vector", [TA_nexp start; TA_nexp len; TA_ord order; _])
- | Tabbrev(_,{t= Tapp("vector", [TA_nexp start; TA_nexp len; TA_ord order; _])}) ->
- let call = if is_bit_vector t then (string "make_indexed_bitv") else (string "make_indexed_v") in
- let dir,dir_out = match order.order with
- | Oinc -> true,"true"
- | _ -> false, "false" in
- let start = match start.nexp with
- | Nconst i | N2n(_,Some i)-> string_of_big_int i
- | N2n({nexp=Nconst i},_) -> string_of_int (Util.power 2 (int_of_big_int i))
- | _ -> if dir then "0" else string_of_int (List.length iexps) in
- let size = match len.nexp with
- | Nconst i | N2n(_,Some i)-> string_of_big_int i
- | N2n({nexp=Nconst i},_) -> string_of_int (Util.power 2 (int_of_big_int i))
- in
- let default_string =
- (match default with
- | Def_val_empty -> string "None"
- | Def_val_dec e -> parens (string "Some " ^^ (exp e))) in
- let iexp (i,e) = parens (separate_map comma_sp (fun x -> x) [(doc_int i); (exp e)]) in
- parens (separate space [call;
- (brackets (separate_map semi iexp iexps));
- default_string;
- string start;
- string size;
- string dir_out]))
+ | Tabbrev(_,{t= Tapp("vector", [TA_nexp start; TA_nexp len; TA_ord order; _])})
+ | Tapp("reg", [TA_typ {t =Tapp("vector", [TA_nexp start; TA_nexp len; TA_ord order; _])}]) ->
+ let call = string "make_indexed_vector" in
+ let dir = match order.order with | Oinc -> true | _ -> false in
+ let start = match start.nexp with
+ | Nconst i | N2n(_,Some i)-> string_of_big_int i
+ | N2n({nexp=Nconst i},_) -> string_of_int (Util.power 2 (int_of_big_int i))
+ | _ -> if dir then "0" else string_of_int (List.length iexps) in
+ let size = match len.nexp with
+ | Nconst i | N2n(_,Some i)-> string_of_big_int i
+ | N2n({nexp=Nconst i},_) -> string_of_int (Util.power 2 (int_of_big_int i))
+ in
+ let default_string =
+ (match default with
+ | Def_val_empty -> string "None"
+ | Def_val_dec e -> parens (string "Some " ^^ (exp e))) in
+ let iexp (i,e) = parens (separate_map comma_sp (fun x -> x) [(doc_int i); (exp e)]) in
+ parens (separate space [call;
+ (brackets (separate_map semi iexp iexps));
+ default_string;
+ string start;
+ string size]))
| E_vector_update(v,e1,e2) ->
(*Has never happened to date*)
brackets (doc_op (string "with") (exp v) (doc_op equals (exp e1) (exp e2)))
@@ -2133,17 +2107,38 @@ let doc_exp_lem, doc_let_lem =
| _ -> doc_id_lem id in
parens (separate space [call; parens (separate_map comma exp [e1;e2])])
| E_internal_let(lexp, eq_exp, in_exp) ->
- separate space [string "let";
- doc_lexp_lem true lexp; (*Rewriter/typecheck should ensure this is only cast or id*)
- equals;
- exp eq_exp;
- string "in";
- exp in_exp]
-
+ (separate
+ space
+ [string "let";
+ doc_lexp_lem true lexp; (*Rewriter/typecheck should ensure this is only cast or id*)
+ coloneq;
+ exp eq_exp;
+ string "in"]) ^/^
+ exp in_exp
+(* | E_internal_plet (_,E_aux (E_for(id,exp1,exp2,exp3,(Ord_aux(order,_)),exp4),_),e2) ->
+ let updated_vars = parens (separate_map comma (fun x -> string x) (find_updated_vars exp4)) in
+ let start = group (exp exp1) in
+ let stop = group (exp exp2) in
+ let by = group (exp exp3) in
+ let var = doc_id_lem id in
+ let body = exp exp4 in
+ let forL = if order = Ord_inc then string "foreach_inc" else string "foreach_dec" in
+ parens (
+ prefix
+ 2 1
+ (forL ^^ space ^^ start ^^ stop ^^ by)
+ (group (
+ prefix
+ 2 1
+ (separate space [string "fun";updated_vars;var;arrow])
+ (parens (body ^/^
+ (string "return") ^^ space ^^ updated_vars))
+ )
+ )
+ ) ^^ space ^^ (separate space [string ">>=";string "fun";arrow]) *)
| E_internal_plet (pat,e1,e2) ->
(separate space [exp e1; string ">>= fun"; doc_pat_lem pat;arrow]) ^/^
exp e2
-
| E_internal_return (e1) ->
separate space [string "return"; exp e1;]
and let_exp (LB_aux(lb,_)) = match lb with
@@ -2161,9 +2156,9 @@ let doc_exp_lem, doc_let_lem =
and doc_lexp_lem top_call ((LEXP_aux(lexp,(l,annot))) as le) =
let exp = top_exp in
match lexp with
- | LEXP_vector(v,e) -> parens ((string "vector_access") ^^ space ^^ (doc_lexp_lem false v)) ^^ dot ^^ parens (exp e)
+ | LEXP_vector(v,e) -> doc_lexp_array_lem le
| LEXP_vector_range(v,e1,e2) ->
- parens ((string "read_vector_subrange") ^^ space ^^ (doc_lexp_lem false v) ^^ space ^^ (exp e1) ^^ space ^^ (exp e2))
+ parens ((string "vector_subrange") ^^ space ^^ (doc_lexp_lem false v) ^^ space ^^ (exp e1) ^^ space ^^ (exp e2))
| LEXP_field(v,id) -> (doc_lexp_lem false v) ^^ dot ^^ doc_id_lem id
| LEXP_id id | LEXP_cast(_,id) ->
let name = doc_id_lem id in
@@ -2178,9 +2173,12 @@ let doc_exp_lem, doc_let_lem =
| Base((_,t),_,_,_,_,_) ->
let t_act = match t.t with | Tapp("reg",[TA_typ t]) | Tabbrev(_,{t=Tapp("reg",[TA_typ t])}) -> t | _ -> t in
(match t_act.t with
- | Tid "bit" | Tabbrev(_,{t=Tid "bit"}) ->
- parens ((string "get_barray") ^^ space ^^ doc_lexp_lem false v) ^^ dot ^^ parens (top_exp e)
- | _ -> parens ((string "get_varray") ^^ space ^^ doc_lexp_lem false v) ^^ dot ^^ parens (top_exp e))
+ | Tid "bit"
+ | Tabbrev(_,{t=Tid "bit"}) ->
+ parens (string "get_elements" ^^ space ^^ doc_lexp_lem false v) ^^ dot ^^
+ parens (top_exp e)
+ | _ -> parens (string "get_elements" ^^ space ^^ doc_lexp_lem false v) ^^ dot ^^
+ parens (top_exp e))
| _ ->
parens ((string "get_varray") ^^ space ^^ doc_lexp_lem false v) ^^ dot ^^ parens (top_exp e))
| _ -> empty
@@ -2202,31 +2200,31 @@ let doc_exp_lem, doc_let_lem =
match lexp with
| LEXP_vector(v,e) ->
doc_op (string "<-")
- (group (parens ((string (if is_bit then "get_barray" else "get_varray")) ^^ space ^^ doc_lexp_lem false v)) ^^
- dot ^^ parens (exp e))
+ (group (parens (string "get_elements" ^^ space ^^ doc_lexp_lem false v)) ^^
+ dot ^^ parens (exp e))
(exp e_new_v)
| LEXP_vector_range(v,e1,e2) ->
- parens ((string (if is_bitv then "write_vector_subrange_bit" else "write_vector_subrange_v")) ^^ space ^^
- doc_lexp_lem false v ^^ space ^^ exp e1 ^^ space ^^ exp e2 ^^ space ^^ exp e_new_v)
+ parens (string "write_vector_subrange" ^^ space ^^
+ doc_lexp_lem false v ^^ space ^^ exp e1 ^^ space ^^ exp e2 ^^ space ^^ exp e_new_v)
| LEXP_field(v,id) ->
- parens ((string (if is_bit then "write_register_field_bit" else "write_register_field_v")) ^^ space ^^
- doc_lexp_lem false v ^^ space ^^string_lit (doc_id id) ^^ space ^^ exp e_new_v)
+ parens (string "write_register" ^^ space ^^
+ doc_lexp_lem false v ^^ space ^^ string_lit (doc_id id) ^^ space ^^ exp e_new_v)
| LEXP_id id | LEXP_cast (_,id) ->
(match annot with
| Base(_,Alias alias_info,_,_,_,_) ->
(match alias_info with
| Alias_field(reg,field) ->
- parens ((if is_bit then string "write_register_field_bit" else string "write_register_field_v") ^^ space ^^
- string reg ^^ space ^^string_lit (string field) ^^ space ^^ exp e_new_v)
+ parens (string "write_register" ^^ space ^^
+ string reg ^^ space ^^ string_lit (string field) ^^ space ^^ exp e_new_v)
| Alias_extract(reg,start,stop) ->
if start = stop
then
doc_op (string "<-")
- (group (parens ((string (if is_bit then "get_barray" else "get_varray")) ^^ space ^^ string reg)) ^^
+ (group (parens (string "get_elements" ^^ space ^^ string reg)) ^^
dot ^^ parens (doc_int start))
(exp e_new_v)
else
- parens ((string (if is_bitv then "write_vector_subrange_bit" else "write_vector_subrange_v")) ^^ space ^^
+ parens (string "write_vector_subrange" ^^ space ^^
string reg ^^ space ^^ doc_int start ^^ space ^^ doc_int stop ^^ space ^^ exp e_new_v)
| Alias_pair(reg1,reg2) ->
parens ((string "write_two_regs") ^^ space ^^ string reg1 ^^ space ^^ string reg2 ^^ space ^^ exp e_new_v))
@@ -2259,13 +2257,10 @@ let doc_typdef_lem (TD_aux(td,_)) = match td with
(concat [string "type"; space; doc_id_lem_type id;])
(doc_typquant_lem typq (anglebars fs_doc))
| TD_variant(id,nm,typq,ar,_) ->
- let n = List.length ar in
let ar_doc = group (separate_map (break 1) doc_type_union_lem ar) in
doc_op equals
(concat [string "type"; space; doc_id_lem_type id;])
- (if n > 246
- then brackets (space ^^(doc_typquant_lem typq ar_doc))
- else (doc_typquant_lem typq ar_doc))
+ (doc_typquant_lem typq ar_doc)
| TD_enum(id,nm,enums,_) ->
let enums_doc = group (separate_map (break 1 ^^ pipe) doc_id_lem_ctor enums) in
doc_op equals
@@ -2316,15 +2311,15 @@ let doc_dec_lem (DEC_aux (reg,(l,annot))) =
| DEC_typ_alias(typ,id,alspec) -> empty (*
doc_op equals (string "register alias" ^^ space ^^ doc_atomic_typ typ) (doc_alias alspec) *)
-let doc_def_lem def = group (match def with
+let doc_def_lem def = match def with
| DEF_default df -> empty
| DEF_spec v_spec -> empty (*unless we want to have a separate pass to create mli files*)
- | DEF_type t_def -> doc_typdef_lem t_def
- | DEF_fundef f_def -> doc_fundef_lem f_def
- | DEF_val lbind -> doc_let_lem lbind
- | DEF_reg_dec dec -> doc_dec_lem dec
+ | DEF_type t_def -> group (doc_typdef_lem t_def) ^/^ hardline
+ | DEF_fundef f_def -> group (doc_fundef_lem f_def) ^/^ hardline
+ | DEF_val lbind -> group (doc_let_lem lbind) ^/^ hardline
+ | DEF_reg_dec dec -> empty (*group (doc_dec_lem dec) ^/^ hardline *)
| DEF_scattered sdef -> empty (*shoulnd't still be here*)
- ) ^^ hardline
+
let reg_decls defs =
@@ -2496,7 +2491,7 @@ let reg_decls defs =
let doc_defs_lem (Defs(defs)) =
let (decls,defs) = reg_decls defs in
- (decls,separate_map hardline doc_def_lem defs)
+ (decls,separate_map empty doc_def_lem defs)
let pp_defs_lem f_arch f d top_line opens =
@@ -2511,43 +2506,4 @@ let pp_defs_lem f_arch f d top_line opens =
(string "(*" ^^ (string top_line) ^^ string "*)" ^/^
(separate_map
hardline
- (fun lib -> separate space [string "open import";string lib]) ["Pervasives";"State";"Vector"]) ^/^ decls);
-
-
-
-(*
- | E_for(id,exp1,exp2,exp3,(Ord_aux(order,_)),exp4) ->
-
- let updated_vars =
- let vars = List.map (function Id_aux (Id name,_) -> name
- | Id_aux (DeIid name,_) -> name)
- (Analyser.find_updated_vars exp4) in
- "[" ^ String.concat ";" vars ^ "]" in
-
- let start = group (exp exp1) in
- let stop = group (exp exp2) in
- let by = group (exp exp3) in
- let var = doc_id_lem id in
- let body = exp exp4 in
-
- let forL = if order = Ord_inc then string "foreach_inc" else string "foreach_dec" in
- forL ^^ space ^^ start ^^ stop ^^ by ^/^
- group (
- (string "fun") ^^ space ^^ updated_vars ^^ space var ^^ space ^^ arrow ^/^
- body ^/^
- (string "return") ^^ space ^^ updated_vars
- )
-
- (* this way requires the following Lem declarations first
-
- let rec foreach_inc i stop by body =
- if i <= stop then (body i; foreach_inc (i + by) stop by body) else ()
-
- let rec foreach_dec i stop by body =
- if i >= stop then (body i; foreach_dec (i - by) stop by body) else ()
-
- and we need to make sure not to use the "ignore bind" function >> for sequentially
- composing the for-loop with another expression, so we don't "forget" the updated
- variables
- *)
-*)
+ (fun lib -> separate space [string "open import";string lib]) ["Pervasives";"State";"Vector"]) ^/^ decls)
diff --git a/src/rewriter.ml b/src/rewriter.ml
index 39234b11..68bb2c2a 100644
--- a/src/rewriter.ml
+++ b/src/rewriter.ml
@@ -17,6 +17,15 @@ type 'a rewriters = { rewrite_exp : 'a rewriters -> (nexp_map * 'a namemap) opt
rewrite_defs : 'a rewriters -> 'a defs -> 'a defs;
}
+
+let fresh_name_counter = ref 0
+
+let fresh_name () =
+ let current = !fresh_name_counter in
+ let () = fresh_name_counter := (current + 1) in
+ current
+
+
let rec partial_assoc (eq: 'a -> 'a -> bool) (v: 'a) (ls : ('a *'b) list ) : 'b option = match ls with
| [] -> None
| (v1,v2)::ls -> if (eq v1 v) then Some v2 else partial_assoc eq v ls
@@ -593,7 +602,6 @@ let id_exp_alg =
}
-let remove_vector_concat_pat_counter = ref 0
let remove_vector_concat_pat pat =
(* ivc: bool that indicates whether the exp is in a vector_concat pattern *)
let remove_tannot_in_vector_concats =
@@ -624,8 +632,7 @@ let remove_vector_concat_pat pat =
let pat = (fold_pat remove_tannot_in_vector_concats pat) false in
let fresh_name () =
- let current = !remove_vector_concat_pat_counter in
- let () = remove_vector_concat_pat_counter := (current + 1) in
+ let current = fresh_name () in
Id_aux (Id ("__v" ^ string_of_int current), Parse_ast.Unknown) in
(* expects that P_typ elements have been removed from AST,
@@ -956,24 +963,26 @@ let rewrite_defs_ocaml defs =
-let geteffs_annot = function
- | (_,Base (_,_,_,_,effs,_)) -> effs
- | (_,NoTyp) -> failwith "no effect information"
+let geteffs_annot (_,t) = match t with
+ | Base (_,_,_,_,effs,_) -> effs
+ | NoTyp -> failwith "no effect information"
| _ -> failwith "a_normalise doesn't support Overload"
-let geteffs (E_aux (_,a)) = geteffs_annot a
-
-let gettype (E_aux (_,(_,a))) =
- match a with
+let gettype_annot (_,t) = match t with
| Base((_,t),_,_,_,_,_) -> t
| NoTyp -> failwith "no type information"
| _ -> failwith "a_normalise doesn't support Overload"
-
+let gettype (E_aux (_,a)) = gettype_annot a
+let geteffs (E_aux (_,a)) = geteffs_annot a
+
let effectful_effs {effect = Eset effs} =
List.exists
- (fun (BE_aux (be,_)) -> match be with BE_nondet | BE_unspec | BE_undef -> false | _ -> true)
- effs
+ (fun (BE_aux (be,_)) ->
+ match be with
+ | BE_nondet | BE_unspec | BE_undef | BE_lset -> false
+ | _ -> true
+ ) effs
let effectful eaux =
effectful_effs (geteffs eaux)
@@ -992,8 +1001,11 @@ let remove_blocks_exp_alg =
let rec f = function
| [e] -> e (* check with Kathy if that annotation is fine *)
| e :: es -> letbind_wild e (f es)
- | [] -> failwith "empty block encountered" in
-
+ | e -> E_aux (E_lit (L_aux (L_unit,Unknown)), (Unknown,simple_annot ({t = Tid "unit"}))) in
+(*
+ | [] -> E_aux (E_lit (L_aux (L_unit,Unknown)), (Unknown,simple_annot ({t = Tid "unit"})))
+ | e :: es -> letbind_wild e (f es) in
+ *)
let e_aux = function
| (E_block es,annot) -> f es
| (e,annot) -> E_aux (e,annot) in
@@ -1001,26 +1013,23 @@ let remove_blocks_exp_alg =
{ id_exp_alg with e_aux = e_aux }
-let a_normalise_counter = ref 0
+
+let fresh_id annot =
+ let current = fresh_name () in
+ let id = Id_aux (Id ("__w" ^ string_of_int current), Parse_ast.Unknown) in
+ let annot_var = (Parse_ast.Unknown,simple_annot (gettype_annot annot)) in
+ E_aux (E_id id, annot_var)
let letbind (v : 'a exp) (body : 'a exp -> 'a exp) : 'a exp =
(* body is a function : E_id variable -> actual body *)
-
- let fresh_id () =
- let current = !a_normalise_counter in
- let () = a_normalise_counter := (current + 1) in
- Id_aux (Id ("__w" ^ string_of_int current), Parse_ast.Unknown) in
-
- let freshid = fresh_id () in
- let annot_var = (Parse_ast.Unknown,simple_annot (gettype v)) in
- let eid = E_aux (E_id freshid, annot_var) in
-
- let body = body eid in
+ let (E_aux (_,annot)) = v in
+ let ((E_aux (E_id id,_)) as e_id) = fresh_id annot in
+ let body = body e_id in
- let annot_pat = (Parse_ast.Unknown,simple_annot_efr (gettype v) (geteffs v)) in
+ let annot_pat = (Parse_ast.Unknown,simple_annot (gettype v)) in
let annot_lb = annot_pat in
- let annot_let = (Parse_ast.Unknown,simple_annot_efr {t = Tid "unit"} (eff_union v body)) in
- let pat = P_aux (P_id freshid,annot_pat) in
+ let annot_let = (Parse_ast.Unknown,simple_annot_efr (gettype body) (eff_union v body)) in
+ let pat = P_aux (P_id id,annot_pat) in
if effectful v
then E_aux (E_internal_plet (pat,v,body),annot_let)
@@ -1034,11 +1043,15 @@ let rec value ((E_aux (exp_aux,_)) as exp) =
| E_tuple es
| E_vector es
| E_list es -> List.fold_left (&&) true (List.map value es)
- | _ -> false
+ | _ -> false
let only_local_eff (l,(Base ((t_params,t),tag,nexps,eff,effsum,bounds))) =
(l,Base ((t_params,t),tag,nexps,eff,eff,bounds))
+let local_eff_plus eff2 (l,(Base ((t_params,t),tag,nexps,eff,effsum,bounds))) =
+ let effsum = union_effects eff eff2 in
+ (l,Base ((t_params,t),tag,nexps,eff,effsum,bounds))
+
let rec mapCont (f : 'b -> ('b -> 'a exp) -> 'a exp) (l : 'b list) (k : 'b list -> 'a exp) : 'a exp =
match l with
| [] -> k []
@@ -1093,23 +1106,34 @@ and n_lexp (lexp : 'a lexp) (k : 'a lexp -> 'a exp) : 'a exp =
n_exp_nameL es (fun es -> k (LEXP_aux (LEXP_memory (id,es),only_local_eff annot)))
| LEXP_cast (typ,id) -> k (LEXP_aux (LEXP_cast (typ,id),only_local_eff annot))
| LEXP_vector (lexp,id) ->
- n_lexp lexp (fun lexp -> k (LEXP_aux (LEXP_vector (lexp,id),only_local_eff annot)))
+ let (LEXP_aux (_,annot)) = lexp in
+ let effs = geteffs_annot annot in
+ n_lexp lexp (fun lexp -> k (LEXP_aux (LEXP_vector (lexp,id),local_eff_plus effs annot)))
| LEXP_vector_range (lexp,exp1,exp2) ->
n_lexp lexp (fun lexp ->
+ let (LEXP_aux (_,annot)) = lexp in
+ let effs = geteffs_annot annot in
n_exp_name exp1 (fun exp1 ->
n_exp_name exp2 (fun exp2 ->
- k (LEXP_aux (LEXP_vector_range (lexp,exp1,exp2),only_local_eff annot)))))
+ k (LEXP_aux (LEXP_vector_range (lexp,exp1,exp2),local_eff_plus effs annot)))))
| LEXP_field (lexp,id) ->
- n_lexp lexp (fun lexp ->
- k (LEXP_aux (LEXP_field (lexp,id),only_local_eff annot)))
+ n_lexp lexp (fun lexp ->
+ let (LEXP_aux (_,annot)) = lexp in
+ let effs = geteffs_annot annot in
+ k (LEXP_aux (LEXP_field (lexp,id),local_eff_plus effs annot)))
and n_exp_term (new_return : bool) (exp : 'a exp) : 'a exp =
let (E_aux (_,annot)) = exp in
let exp = if new_return then E_aux (E_internal_return exp,annot) else exp in
+ (* changed this from n_exp to n_exp_name so that when we return updated variables
+ * from a for-loop, for example, we can just add those into the returned tuple and
+ * don't need to a-normalise again *)
n_exp exp (fun exp -> exp)
and n_exp (exp : 'a exp) (k : 'a exp -> 'a exp) : 'a exp =
+(* if not (effectful exp) then k exp else comment out this line for full a-normalisation *)
+
let (E_aux (exp_aux,annot)) = exp in
let rewrap_effs effsum exp_aux = (* explicitly give effect sum *)
@@ -1125,7 +1149,7 @@ and n_exp (exp : 'a exp) (k : 'a exp -> 'a exp) : 'a exp =
| E_id id -> k exp (* if value exp then return exp else letbind exp *)
| E_lit _ -> k exp
| E_cast (typ,exp') ->
- n_exp_name exp' (fun exp' ->
+ n_exp exp' (fun exp' ->
k (rewrap_localeff (E_cast (typ,exp'))))
| E_app (id,exps) ->
n_exp_nameL exps (fun exps ->
@@ -1149,7 +1173,7 @@ and n_exp (exp : 'a exp) (k : 'a exp -> 'a exp) : 'a exp =
n_exp_name start (fun start ->
n_exp_name stop (fun stop ->
n_exp_name by (fun by ->
- let body = n_exp_term (effectful body) body in
+ let body = n_exp_term (false) body in
k (rewrap_effs (geteffs body) (E_for (id,start,stop,by,dir,body))))))
| E_vector exps ->
n_exp_nameL exps (fun exps ->
@@ -1230,8 +1254,7 @@ and n_exp (exp : 'a exp) (k : 'a exp -> 'a exp) : 'a exp =
(if effectful exp1
then n_exp_name exp1
else n_exp exp1) (fun exp1 ->
- n_exp exp2 (fun exp2 ->
- k (rewrap_effs (geteffs exp2) (E_internal_let (lexp,exp1,exp2)))))
+ (rewrap_effs (geteffs exp2) (E_internal_let (lexp,exp1,n_exp exp2 k))))
| E_internal_return exp1 ->
n_exp_name exp1 (fun exp1 ->
k (rewrap_localeff (E_internal_return exp1)))
@@ -1251,10 +1274,305 @@ let rewrite_defs_a_normalise =
; rewrite_defs = rewrite_defs_base
}
+let dedup eq = List.fold_left (fun acc e -> if List.exists (eq e) acc then acc else e :: acc) []
+
+let eqidtyp (id1,_) (id2,_) =
+ let name1 = match id1 with Id_aux ((Id name | DeIid name),_) -> name in
+ let name2 = match id1 with Id_aux ((Id name | DeIid name),_) -> name in
+ name1 = name2
+
+let find_updated_vars exp =
+ let names =
+ fold_exp
+ { e_block = (fun es -> List.flatten es)
+ ; e_nondet = (fun es -> List.flatten es)
+ ; e_id = (fun _ -> [])
+ ; e_lit = (fun _ -> [])
+ ; e_cast = (fun (_,e) -> e)
+ ; e_app = (fun (_,es) -> List.flatten es)
+ ; e_app_infix = (fun (e1,_,e2) -> e1 @ e2)
+ ; e_tuple = (fun es -> List.flatten es)
+ ; e_if = (fun (e1,e2,e3) -> e1 @ e2 @ e3)
+ ; e_for = (fun (_,e1,e2,e3,_,e4) -> e1 @ e2 @ e3 @ e4)
+ ; e_vector = (fun es -> List.flatten es)
+ ; e_vector_indexed = (fun (es,opt2) -> (List.flatten (List.map snd es)) @ opt2)
+ ; e_vector_access = (fun (e1,e2) -> e1 @ e2)
+ ; e_vector_subrange = (fun (e1,e2,e3) -> e1 @ e2 @ e3)
+ ; e_vector_update = (fun (e1,e2,e3) -> e1 @ e2 @ e3)
+ ; e_vector_update_subrange = (fun (e1,e2,e3,e4) -> e1 @ e2 @ e3 @ e4)
+ ; e_vector_append = (fun (e1,e2) -> e1 @ e2)
+ ; e_list = (fun es -> List.flatten es)
+ ; e_cons = (fun (e1,e2) -> e1 @ e2)
+ ; e_record = (fun fexps -> fexps)
+ ; e_record_update = (fun (e1,fexp) -> e1 @ fexp)
+ ; e_field = (fun (e1,id) -> e1)
+ ; e_case = (fun (e1,pexps) -> e1 @ List.flatten pexps)
+ ; e_let = (fun (lb,e2) -> lb @ e2)
+ ; e_assign = (fun ((None,[(id,b)]),e2) -> if b then id :: e2 else e2)
+ ; e_exit = (fun e1 -> e1)
+ ; e_internal_cast = (fun (_,e1) -> e1)
+ ; e_internal_exp = (fun _ -> [])
+ ; e_internal_exp_user = (fun _ -> [])
+ ; e_internal_let = (fun ((None,[(id,_)]), e2, e3) -> List.filter (eqidtyp id) (e2 @ e3))
+ ; e_internal_plet = (fun (_, e1, e2) -> e1 @ e2)
+ ; e_internal_return = (fun e -> e)
+ ; e_aux = (fun (e,_) -> e)
+ ; lEXP_id = (fun id -> (Some id,[]))
+ ; lEXP_memory = (fun (_,_) -> (None,[]))
+ ; lEXP_cast = (fun (_,id) -> (Some id,[]))
+ ; lEXP_vector = (fun ((None,lexp),_) -> (None,lexp))
+ ; lEXP_vector_range = (fun ((None,lexp),_,_) -> (None,lexp))
+ ; lEXP_field = (fun ((None,lexp),_) -> (None,lexp))
+ ; lEXP_aux =
+ (function
+ | ((Some id,[]),annot) ->
+ let effs = geteffs_annot annot in
+ let b =
+ match effs with
+ | {effect = Eset [BE_aux (BE_lset,_)]} -> true
+ | _ -> false in
+ (None,[((id,annot),b)])
+ | ((None,es),_) -> (None,es)
+ )
+ ; fE_Fexp = (fun (_,e) -> e)
+ ; fE_aux = (fun (fexp,_) -> fexp)
+ ; fES_Fexps = (fun (fexps,_) -> List.flatten fexps)
+ ; fES_aux = (fun (fexp,_) -> fexp)
+ ; def_val_empty = []
+ ; def_val_dec = (fun e -> e)
+ ; def_val_aux = (fun (defval,_) -> defval)
+ ; pat_exp = (fun (_,e) -> e)
+ ; pat_aux = (fun (pexp,_) -> pexp)
+ ; lB_val_explicit = (fun (_,_,e) -> e)
+ ; lB_val_implicit = (fun (_,e) -> e)
+ ; lB_aux = (fun (lb,_) -> lb)
+ ; pat_alg = id_pat_alg
+ } exp in
+ dedup eqidtyp names
+
+
+
+let swaptyp t (l,(Base ((t_params,_),tag,nexps,eff,effsum,bounds))) =
+ (l,Base ((t_params,t),tag,nexps,eff,effsum,bounds))
+
+let mktup es =
+ if es = [] then
+ E_aux (E_lit (L_aux (L_unit,Unknown)),(Unknown,simple_annot unit_t))
+ else
+ let effs = List.fold_left (fun acc e -> union_effects acc (geteffs e)) {effect = Eset []} es in
+ let typs = List.map gettype es in
+ E_aux (E_tuple es,(Parse_ast.Unknown,simple_annot_efr {t = Ttup typs} effs))
+
+let mktup_pat es =
+ if es = [] then
+ P_aux (P_wild,(Unknown,simple_annot unit_t))
+ else
+ let typs = List.map gettype es in
+ let pats = List.map (fun (E_aux (E_id id,_) as exp) ->
+ P_aux (P_id id,(Unknown,simple_annot (gettype exp)))) es in
+ P_aux (P_tup pats,(Parse_ast.Unknown,simple_annot {t = Ttup typs}))
+
+
+let rec rewrite_for_if_case ((E_aux (expaux,annot)) as exp) =
+
+ let rec add_vars ((E_aux (expaux,annot)) as exp) vars =
+ let rewrap expaux = E_aux (expaux,annot) in
+ match expaux with
+ | E_let (lb,exp) -> rewrap (E_let (lb,add_vars exp vars))
+ | E_internal_let (lexp,exp1,exp2) -> rewrap (E_internal_let (lexp,exp1,add_vars exp2 vars))
+ | E_internal_plet (pat,exp1,exp2) -> rewrap (E_internal_plet (pat,exp1,add_vars exp2 vars))
+ | E_internal_return exp2 ->
+ E_aux (E_internal_return (add_vars exp2 vars),
+ swaptyp {t = Ttup [gettype exp;gettype vars]} annot)
+ | _ ->
+ (* after a-normalisation this will be pure:
+ * if the whole body of the function/if-expression/case-expression/for-loop was
+ * pure, then it's still pure; if it wasn't then the body was wrapped in E_return
+ * and (in this case) exp is a name contained in E_return that by definition of
+ * value must be pure
+ *)
+ let () = assert (not (effectful exp)) in
+ E_aux (E_tuple [exp;vars],swaptyp {t = Ttup [gettype exp;gettype vars]} annot)in
+
+ let rewrite (E_aux (eaux,annot)) =
+ match eaux with
+ | E_for(id,exp1,exp2,exp3,order,exp4) ->
+ let vars = List.map (fun (var,(l,t)) -> E_aux (E_id var,(l,t))) (find_updated_vars exp4) in
+ let vartuple = mktup vars in
+ let exp4 = rewrite_for_if_case (add_vars exp4 vartuple) in
+ let funcl = match order with
+ | Ord_aux (Ord_inc,_) -> Id_aux (Id "foreach_inc",Unknown)
+ | Ord_aux (Ord_dec,_) -> Id_aux (Id "foreach_dec",Unknown) in
+ Some (E_aux (E_app (funcl,[mktup [exp1;exp2;exp3];exp4;vartuple]),
+ swaptyp (gettype exp4) annot),vars)
+ | E_if (c,e1,e2) ->
+ let vars = List.map (fun (var,(l,t)) -> E_aux (E_id var,(l,t)))
+ (dedup eqidtyp (find_updated_vars e1 @ find_updated_vars e2)) in
+ if vars = [] then None else
+ let vartuple = mktup vars in
+ let e1 = rewrite_for_if_case (add_vars e1 vartuple) in
+ let e2 = rewrite_for_if_case (add_vars e2 vartuple) in
+ (* after a-normalisation c shouldn't need rewriting *)
+ let t = gettype e1 in
+ (* let () = assert (simple_annot t = simple_annot (gettype e2)) in *)
+ Some (E_aux (E_if (c,e1,e2), swaptyp t annot),vars)
+ | E_case (e1,ps) ->
+ (* after a-normalisation e1 shouldn't need rewriting *)
+ let vars =
+ let f acc (Pat_aux (Pat_exp (_,e),_)) = acc @ find_updated_vars e in
+ List.map (fun (var,(l,t)) -> E_aux (E_id var,(l,t)))
+ (dedup eqidtyp (List.fold_left f [] ps)) in
+ if vars = [] then None else
+ let vartuple = mktup vars in
+ let typ =
+ let (Pat_aux (Pat_exp (_,first),_)) = List.hd ps in
+ gettype first in
+ let (ps,typ) =
+ let f (acc,typ) (Pat_aux (Pat_exp (p,e),pannot)) =
+ let etyp = gettype e in
+ let () = assert (simple_annot etyp = simple_annot typ) in
+ let e = rewrite_for_if_case (add_vars e vartuple) in
+ let pannot = swaptyp (gettype e) pannot in
+ (acc @ [Pat_aux (Pat_exp (p,e),pannot)],typ) in
+ List.fold_left f ([],typ) ps in
+ Some (E_aux (E_case (e1,ps), swaptyp typ annot),vars)
+ | _ ->
+ (* assumes everying's a-normlised: an expression is a sequence of let-expressions,
+ * "control-flow" structures and a return value, possibly wrapped in E_return *)
+ None in
+
+ match expaux with
+ | E_let (lb,body) ->
+ let body = rewrite_for_if_case body in
+ let lb = match lb with
+ | LB_aux (LB_val_implicit (pat,v),lbannot) ->
+ (match rewrite v with
+ | Some (v,vars) ->
+ let varpat = mktup_pat vars in
+ let (P_aux (_,pannot)) = pat in
+ let pat = P_aux (P_tup [pat;varpat],swaptyp (gettype v) annot) in
+ let lbannot = swaptyp (gettype v) lbannot in
+ LB_aux (LB_val_implicit (pat,v),lbannot)
+ | None -> lb)
+ | LB_aux (LB_val_explicit (typ,pat,v),lbannot) ->
+ (match rewrite v with
+ | Some (v,vars) ->
+ let varpat = mktup_pat vars in
+ let (P_aux (_,pannot)) = pat in
+ let pat = P_aux (P_tup [pat;varpat],swaptyp (gettype v) annot) in
+ let lbannot = swaptyp (gettype v) lbannot in
+ LB_aux (LB_val_implicit (pat,v),lbannot)
+ | None -> lb) in
+ (* as let-expressions have type unit exp's annot doesn't need to change *)
+ E_aux (E_let (lb,body),annot)
+ | E_internal_plet (pat,v,body) ->
+ let body = rewrite_for_if_case body in
+ (match rewrite v with
+ | Some (v,vars) ->
+ let varpat = mktup_pat vars in
+ let (P_aux (_,pannot)) = pat in
+ let pat = P_aux (P_tup [pat;varpat],swaptyp (gettype v) annot) in
+ (* as let-expressions have type unit exp's annot doesn't need to change *)
+ E_aux (E_internal_plet (pat,v,body),annot)
+ | None -> E_aux (E_internal_plet (pat,v,body),annot))
+ | E_internal_let (lexp,v,body) ->
+ (* because we need patterns and internal_plets are needed to distinguish monadic
+ * expressions E_internal_lets are rewritten to E_lets. We only need them for OCaml
+ * anyways. *)
+ let body = rewrite_for_if_case body in
+ let id = match lexp with
+ | LEXP_aux (LEXP_id id,_) -> id
+ | LEXP_aux (LEXP_cast (_,id),_) -> id in
+ let pat = P_aux (P_id id, (Parse_ast.Unknown,simple_annot (gettype v))) in
+ let lb = (match rewrite v with
+ | Some (v,vars) ->
+ let varpat = mktup_pat vars in
+ let (P_aux (_,pannot)) = pat in
+ let pat = P_aux (P_tup [pat;varpat],swaptyp (gettype v) annot) in
+ let lbannot = (Parse_ast.Unknown,simple_annot_efr (gettype v) (geteffs v)) in
+ LB_aux (LB_val_implicit (pat,v),lbannot)
+ | None ->
+ let lbannot = (Parse_ast.Unknown,simple_annot_efr (gettype v) (geteffs v)) in
+ LB_aux (LB_val_implicit (pat,v),lbannot)) in
+ E_aux (E_let (lb,body),annot)
+ (* In tail-position only for-loops matter: if if-expressions or pattern-matching expressions
+ * are in tail-position their updated variables won't be read anyways. For for-loops, however,
+ * we do have to rewrite but also make sure the return type is as expected. *)
+ | E_for _ ->
+ let (Some (exp,_)) = rewrite exp in
+ let annot_pat = (Parse_ast.Unknown,simple_annot (gettype exp)) in
+ let pat = (P_aux (P_wild,annot_pat)) in
+ let body = E_aux (E_lit (L_aux (L_unit,Unknown)),(Unknown,simple_annot unit_t)) in
+ let annot_lb = annot_pat in
+ let annot_let = (Parse_ast.Unknown,simple_annot unit_t) in
+ if effectful exp
+ then E_aux (E_internal_plet (pat,exp,body),annot_let)
+ else E_aux (E_let (LB_aux (LB_val_implicit (pat,exp),annot_lb),body),annot_let)
+
+ | _ -> exp
+
+let replace_e_assign =
+
+ let e_aux (expaux,annot) =
+
+ let letbind (E_aux (E_id id,_) as e_id) (v : 'a exp) (body : 'a exp) : 'a exp =
+ (* body is a function : E_id variable -> actual body *)
+ let (E_aux (_,annot)) = v in
+ let annot_pat = (Parse_ast.Unknown,simple_annot (gettype v)) in
+ let annot_lb = annot_pat in
+ let annot_let = (Parse_ast.Unknown,simple_annot_efr (gettype body) (geteffs body)) in
+ let pat = P_aux (P_id id,annot_pat) in
+ E_aux (E_let (LB_aux (LB_val_implicit (pat,v),annot_lb),body),annot_let) in
+
+ let f v body = function
+ | LEXP_aux (LEXP_id id,annot) ->
+ let eid = E_aux (E_id id,(Unknown,simple_annot (gettype v))) in
+ letbind eid v body
+ | LEXP_aux (LEXP_vector (LEXP_aux (LEXP_id id,annot2),i),annot) ->
+ let eid = E_aux (E_id id,(Unknown,simple_annot (gettype_annot annot2))) in
+ let v = E_aux (E_vector_update (eid,i,v),(Unknown,simple_annot (gettype_annot annot))) in
+ letbind eid v body
+ | LEXP_aux (LEXP_vector_range (LEXP_aux (LEXP_id id,annot2),i,j),annot) ->
+ let eid = E_aux (E_id id,(Unknown,simple_annot (gettype_annot annot2))) in
+ let v = E_aux (E_vector_update_subrange (eid,i,j,v),
+ (Unknown,simple_annot (gettype_annot annot))) in
+ letbind eid v body in
+
+ match expaux with
+ | E_let (LB_aux (LB_val_explicit (_,_,E_aux (E_assign (lexp,v),annot2)),_),body)
+ | E_let (LB_aux (LB_val_implicit (_,E_aux (E_assign (lexp,v),annot2)),_),body)
+ when
+ let {effect = Eset effs} = geteffs_annot annot2 in
+ List.exists (function BE_aux (BE_lset,_) -> true | _ -> false) effs ->
+ f v body lexp
+ | E_let (lb,body) -> E_aux (E_let (lb,body),annot)
+ (* E_internal_plet is only used for effectful terms, shouldn't be needed to deal with here *)
+ | E_internal_let (LEXP_aux ((LEXP_id id | LEXP_cast (_,id)),_),v,body) ->
+ let (E_aux (_,pannot)) = v in
+ let lbannot = (Parse_ast.Unknown,simple_annot_efr (gettype body) (geteffs body)) in
+ E_aux (E_let (LB_aux (LB_val_implicit (P_aux (P_id id,pannot),v),lbannot),body),annot)
+ | _ -> E_aux (expaux,annot) in
+
+ { id_exp_alg with e_aux = e_aux }
+
+let rewrite_defs_remove_e_assign =
+ let rewrite_exp _ _ e = (fold_exp replace_e_assign) (rewrite_for_if_case e) in
+ rewrite_defs_base
+ {rewrite_exp = rewrite_exp
+ ; rewrite_pat = rewrite_pat
+ ; rewrite_let = rewrite_let
+ ; rewrite_lexp = rewrite_lexp
+ ; rewrite_fun = rewrite_fun
+ ; rewrite_def = rewrite_def
+ ; rewrite_defs = rewrite_defs_base
+ }
+
+
let rewrite_defs_lem defs =
let defs = rewrite_defs_remove_vector_concat defs in
let defs = rewrite_defs_exp_lift_assign defs in
let defs = rewrite_defs_a_normalise defs in
+ let defs = rewrite_defs_remove_e_assign defs in
defs
diff --git a/src/rewriter.mli b/src/rewriter.mli
index 971e3611..44ba1d1f 100644
--- a/src/rewriter.mli
+++ b/src/rewriter.mli
@@ -106,3 +106,5 @@ type ('a,'exp,'exp_aux,'lexp,'lexp_aux,'fexp,'fexp_aux,'fexps,'fexps_aux,
val fold_exp : ('a,'exp,'exp_aux,'lexp,'lexp_aux,'fexp,'fexp_aux,'fexps,'fexps_aux,
'opt_default_aux,'opt_default,'pexp,'pexp_aux,'letbind_aux,'letbind,
'pat,'pat_aux,'fpat,'fpat_aux) exp_alg -> 'a exp -> 'exp
+
+val id_pat_alg : ('a,'a pat, 'a pat_aux, 'a fpat, 'a fpat_aux) pat_alg
diff --git a/src/test/power.sail b/src/test/power.sail
index dcbed61b..232f542a 100644
--- a/src/test/power.sail
+++ b/src/test/power.sail
@@ -1,8 +1,58 @@
val extern forall Nat 'm, Nat 'n. (implicit<'m>,bit['n]) -> bit['m] effect pure EXTS
(* XXX binary coded decimal *)
-function forall Type 'a . 'a DEC_TO_BCD ( x ) = x
-function forall Type 'a . 'a BCD_TO_DEC ( x ) = x
+(*function bit[12] DEC_TO_BCD ( (bit[10]) declet ) = {
+ (bit[4]) hundreds := 0;
+ (bit[4]) tens := 0;
+ (bit[4]) ones := 0;
+ foreach (i from 0 to 9) {
+ if hundreds >= 5 then hundreds := hundreds + 3;
+ if tens >= 5 then tens := tens + 3;
+ if ones >= 5 then ones := ones + 3;
+ hundreds := hundreds << 1;
+ hundreds[3] := tens[0];
+ tens := tens << 1;
+ tens[3] := ones[0];
+ ones := ones << 1;
+ ones[3] := declet[i] };
+ hundreds:tens:ones }*)
+
+function bit[12] DEC_TO_BCD ( (bit[10]) [p,q,r,s,t,u,v,w,x,y]) = {
+ a := ((~(s) & v & w) | (t & v & w & s) | (v & w & ~(x)));
+ b := ((p & s & x & ~(t)) | (p & ~(w)) | (p & ~(v)));
+ c := ((q & s & x & ~(t)) | (q & ~(w)) | (q & ~(v)));
+ d := r;
+
+ e := ((v & ~(w) & x) | (s & v & w & x) | (~(t) & v & x & w));
+ f := ((p & t & v & w & x & ~(s)) | (s & ~(x) & v) | (s & ~(v)));
+ g := ((q & t & w & v & x & ~(s)) | (t & ~(x) & v) | (t & ~(v)));
+ h := u;
+
+ i := ((t & v & w & x) | (s & v & w & x) | (v & ~(w) & ~(x)));
+ j := ((p & ~(s) & ~(t) & w & v) | (s & v & ~(w) & x) | (p & w & ~(x) & v) | (w & ~(v)));
+ k := ((q & ~(s) & ~(t) & v & w) | (t & v & ~(w) & x) | (q & v & w & ~(x)) | (x & ~(v)));
+ m := y;
+ [a,b,c,d,e,f,g,h,i,j,k,m]
+}
+
+(*function bit[10] BCD_TO_DEC ( (bit[12]) bcd ) =
+ (bit[10]) (([|2** 10|]) (bcd[0..3] * 100)) + ([|2** 7|]) ((([|2** 7|]) (bcd[4..7] * 10)) + bcd[8..11])
+*)
+
+function bit[10] BCD_TO_DEC ( (bit[12]) [a,b,c,d,e,f,g,h,i,j,k,m] ) = {
+ p := ((f & a & i & ~(e)) | (j & a & ~(i)) | (b & ~(a)));
+ q := ((g & a & i & ~(e)) | (k & a & ~(i)) | (c & ~(a)));
+ r := d;
+ s := ((j & ~(a) & e & ~(i)) | (f & ~(i) & ~(e)) | (f & ~(a) & ~(e)) | (e & i));
+ t := ((k & ~(a) & e & ~(i)) | (g & ~(i) & ~(e)) | (g & ~(a) & ~(e)) | (a & i));
+ u := h;
+ v := (a | e | i);
+ w := ((~(e) & j & ~(i)) | (e & i) | a);
+ x := ((~(a) & k & ~(i)) | (a & i) | e);
+ y := m;
+ [p,q,r,s,t,u,v,w,x,y]
+}
+
(* XXX carry out *)
function forall Nat 'a . bit carry_out ( (bit['a]) _,carry ) = carry
(* XXX Storage control *)
@@ -16,7 +66,7 @@ val extern forall Nat 'k, Nat 'r,
(bit[64], [|'k|]) -> [|0:'r|] effect pure countLeadingZeroes
function forall Nat 'n, Nat 'm .
- bit['m] EXTS_EXPLICIT((bit['n]) v, ([|'m|]) m) =
+ bit['m] EXTS_EXPLICIT((bit['n]) v, ([:'m:]) m) =
(v[0] ^^ (m - length(v))) : v
val forall Nat 'n, Nat 'm, 0 <= 'n, 'n <= 'm, 'm <= 63 .
@@ -38,7 +88,7 @@ function (bit[64]) MASK(start, stop) = {
val forall Nat 'n, 0 <= 'n, 'n <= 63 .
(bit[64], [|'n|]) -> bit[64] effect pure ROTL
-function (bit[64]) ROTL(v, n) = v[n .. 63] : v[0 .. (n-1)]
+function (bit[64]) ROTL(v, n) = v[n .. 63] : v[0 .. (n - 1)]
(* Branch facility registers *)
@@ -115,18 +165,14 @@ let (vector <0, 32, inc, (register<(bit[64])>) >) GPR =
register (bit[32:63]) VRSAVE
+register (bit[64]) SPRG3
register (bit[64]) SPRG4
register (bit[64]) SPRG5
register (bit[64]) SPRG6
register (bit[64]) SPRG7
-(* XXX bogus, length should be 1024 with many more values - cf. mfspr
- definition - eg. SPRG4 to SPRG7 are at offsets 260 to 263, VRSAVE is 256,
- etc. *)
-let (vector <0, 10, inc, (register<(bit[64])>) >) SPR =
- [ undefined, XER, undefined, undefined,
- undefined, undefined, undefined, undefined,
- LR, CTR
+let (vector <0, 1024, inc, (register<(bit[64])>) >) SPR =
+ [ 1=XER, 8=LR, 9=CTR(*, 256=VRSAVE (*32 bit, so not 64, caught by type checker at last*)*), 259=SPRG3, 260=SPRG4, 261=SPRG5, 262=SPRG6, 263=SPRG7
]
(* XXX DCR is implementation-dependent; also, some DCR are only 32 bits
@@ -136,7 +182,7 @@ let (vector <0, 10, inc, (register<(bit[64])>) >) SPR =
register (vector <0, 64, inc, bit>) DCR0
register (vector <0, 64, inc, bit>) DCR1
let (vector <0, 2** 64, inc, (register<(vector<0, 64, inc, bit>)>) >) DCR =
- [ 0=DCR0, 1=DCR1 ]
+ [ 0=DCR0, 1=DCR1 ; default=undefined]
(* Floating-point registers *)
@@ -237,7 +283,6 @@ let (vector <0, 32, inc, (register<(bit[128])>)>) FPRp =
FPRp22, 24 = FPRp24, 26 = FPRp26, 28 = FPRp28, 30 = FPRp30 ]
-(* XXX *)
val bit[32] -> bit[64] effect pure DOUBLE
val bit[64] -> bit[32] effect { undef } SINGLE
@@ -253,12 +298,12 @@ function bit[64] DOUBLE word = {
} else if word[1..8] == 0 & word[9..31] != 0
then {
sign := word[0];
- exp := 0-126;
+ exp := 0 - 126;
(bit[53]) frac := 0b0 : word[9..31] : 0b00000000000000000000000000000;
foreach (i from 0 to 52) {
if frac[0] == 0
then { frac[0..52] := frac[1..52] : 0b0;
- exp := exp -1; }
+ exp := exp - 1; }
else ()
};
temp[0] := sign;
@@ -285,7 +330,7 @@ function bit[32] SINGLE ((bit[64]) frs) = {
(bit[10]) exp := frs[1..11] - 1023;
(bit[53]) frac := 0b1 : frs[12..63];
foreach (i from 0 to 53) {
- if exp < (0-126)
+ if exp < (0 - 126)
then { frac[0..52] := 0b0 : frac[0..51];
exp := exp + 1; }
else ()};
@@ -341,19 +386,19 @@ typedef vscr = register bits [ 96 : 127 ] {
register (vscr) VSCR
(* XXX extend with zeroes -- the resulting size in completely unknown and depends of context *)
-val extern forall Nat 'n, Nat 'm. bit['n] -> bit['m] effect pure EXTZ
+val extern forall Nat 'n, Nat 'm. (implicit<'m>,bit['n]) -> bit['m] effect pure EXTZ
(* Chop has a very weird definition where the resulting size depends of
context, but in practice it is used with the following definition everywhere,
except in vaddcuw which probably needs to be patched accordingly. *)
-val forall Nat 'n, Nat 'm, 'm <= 'n. (bit['n], [|'m|]) -> bit['m] effect pure Chop
-function forall Nat 'm. (bit['m]) Chop(x, y) = x[0..y]
+val forall Nat 'n, Nat 'm, 'm <= 'n. (bit['n], [:'m:]) -> bit['m] effect pure Chop
+function forall Nat 'n, Nat 'm. (bit['m]) Chop(x, y) = x[0..y]
-val forall Nat 'n, Nat 'm, Nat 'k, 'n <= 0, 0 <= 'm.
- (implicit<'k>, int, [|'n|], [|'m|]) -> bit['k] effect { wreg } Clamp
+val forall Nat 'o, Nat 'n, Nat 'm, Nat 'k, 'n <= 0.
+ (implicit<'k>, [:'o:], [:'n:], [|'m|]) -> bit['k] effect { wreg } Clamp
-function forall Nat 'n, Nat 'm, Nat 'k, 'n <= 0, 0 <= 'm. (bit['k])
-Clamp((int) x, ([|'n|]) y, ([|'m|]) z) = {
+function forall Nat 'o,Nat 'n, Nat 'm, Nat 'k, 'n <= 0. (bit['k])
+Clamp(([:'o:]) x, ([:'n:]) y, ([|'m|]) z) = {
([|'n:'m|]) result := 0;
if (x<y) then {
result := y;
@@ -395,13 +440,15 @@ val extern unit -> unit effect { barr } H_Sync (*corresponds to Sync in barrier
val extern unit -> unit effect { barr } LW_Sync
val extern unit -> unit effect { barr } EIEIO_Sync
+val extern unit -> unit effect { depend } recalculate_dependency
+
val forall Nat 'n, Nat 'm, 'n *8 = 'm. (implicit<'m>,(bit['m])) -> (bit['m]) effect pure byte_reverse
function forall Nat 'n, Nat 'm, 'n*8 = 'm. (bit['m]) effect pure byte_reverse((bit['m]) input) = {
(bit['m]) output := 0;
j := length(input);
foreach (i from 0 to (length(input)) by 8) {
- output[i..i+7] := input[j-7 ..j];
- j := j-8; };
+ output[i..i+7] := input[j - 7 ..j];
+ j := j - 8; };
output
}
@@ -413,10 +460,12 @@ register (bit[1]) bigendianmode
val (bit[64],bit) -> unit effect {rreg,wreg} set_overflow_cr0
function (unit) set_overflow_cr0(target_register,new_xer_so) = {
+ m:= 0;
+ (bit[3]) c:= 0;
+ (bit[64]) zero := 0;
(if mode64bit
then m := 0
else m := 32);
- (bit[64]) zero := 0;
(if target_register[m..63] <_s zero[m..63]
then c := 0b100
else if target_register[m..63] >_s zero[m..63]
@@ -430,6 +479,14 @@ function (unit) set_SO_OV(overflow) = {
XER.SO := (XER.SO | overflow);
}
+function forall Nat 'n. (bit['n]) zero_or_undef ((bit['n]) x) = {
+ (bit['n]) out := 0;
+ foreach (i from 0 to ((length(x)) - 1)) {
+ out[i] := if x[i] then undefined else 0
+ };
+ out
+}
+
scattered function unit execute
scattered typedef ast = const union
@@ -524,6 +581,125 @@ function clause execute (Bcctr (BO, BI, BH, LK)) =
if LK then LR := CIA + 4 else ()
}
+union ast member (bit[5], bit[5], bit[5]) Crand
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0100000001 :
+(bit[1]) _ as instr) =
+ Crand (BT,BA,BB)
+
+function clause execute (Crand (BT, BA, BB)) =
+ CR[BT + 32] := (CR[BA + 32] & CR[BB + 32])
+
+union ast member (bit[5], bit[5], bit[5]) Crnand
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0011100001 :
+(bit[1]) _ as instr) =
+ Crnand (BT,BA,BB)
+
+function clause execute (Crnand (BT, BA, BB)) =
+ CR[BT + 32] := ~ (CR[BA + 32] & CR[BB + 32])
+
+union ast member (bit[5], bit[5], bit[5]) Cror
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0111000001 :
+(bit[1]) _ as instr) =
+ Cror (BT,BA,BB)
+
+function clause execute (Cror (BT, BA, BB)) =
+ CR[BT + 32] := (CR[BA + 32] | CR[BB + 32])
+
+union ast member (bit[5], bit[5], bit[5]) Crxor
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0011000001 :
+(bit[1]) _ as instr) =
+ Crxor (BT,BA,BB)
+
+function clause execute (Crxor (BT, BA, BB)) =
+ CR[BT + 32] := CR[BA + 32] ^ CR[BB + 32]
+
+union ast member (bit[5], bit[5], bit[5]) Crnor
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0000100001 :
+(bit[1]) _ as instr) =
+ Crnor (BT,BA,BB)
+
+function clause execute (Crnor (BT, BA, BB)) =
+ CR[BT + 32] := ~ (CR[BA + 32] | CR[BB + 32])
+
+union ast member (bit[5], bit[5], bit[5]) Creqv
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0100100001 :
+(bit[1]) _ as instr) =
+ Creqv (BT,BA,BB)
+
+function clause execute (Creqv (BT, BA, BB)) =
+ CR[BT + 32] := CR[BA + 32] ^ ~ (CR[BB + 32])
+
+union ast member (bit[5], bit[5], bit[5]) Crandc
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0010000001 :
+(bit[1]) _ as instr) =
+ Crandc (BT,BA,BB)
+
+function clause execute (Crandc (BT, BA, BB)) =
+ CR[BT + 32] := (CR[BA + 32] & ~ (CR[BB + 32]))
+
+union ast member (bit[5], bit[5], bit[5]) Crorc
+
+function clause decode (0b010011 :
+(bit[5]) BT :
+(bit[5]) BA :
+(bit[5]) BB :
+0b0110100001 :
+(bit[1]) _ as instr) =
+ Crorc (BT,BA,BB)
+
+function clause execute (Crorc (BT, BA, BB)) =
+ CR[BT + 32] := (CR[BA + 32] | ~ (CR[BB + 32]))
+
+union ast member (bit[3], bit[3]) Mcrf
+
+function clause decode (0b010011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[3]) BFA :
+(bit[2]) _ :
+(bit[5]) _ :
+0b0000000000 :
+(bit[1]) _ as instr) =
+ Mcrf (BF,BFA)
+
+function clause execute (Mcrf (BF, BFA)) =
+ CR[4 * BF + 32..4 * BF + 35] := CR[4 * BFA + 32 .. 4 * BFA + 35]
+
union ast member (bit[7]) Sc
function clause decode (0b010001 :
@@ -538,6 +714,58 @@ function clause decode (0b010001 :
function clause execute (Sc (LEV)) = ()
+union ast member (bit[7]) Scv
+
+function clause decode (0b010001 :
+(bit[5]) _ :
+(bit[5]) _ :
+(bit[4]) _ :
+(bit[7]) LEV :
+(bit[3]) _ :
+0b0 :
+0b1 as instr) =
+ Scv (LEV)
+
+function clause execute (Scv (LEV)) = ()
+
+union ast member (bit[5], bit[5], bit[16]) Lbz
+
+function clause decode (0b100010 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Lbz (RT,RA,D)
+
+function clause execute (Lbz (RT, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ GPR[RT] :=
+ 0b00000000000000000000000000000000000000000000000000000000 : MEMr (EA,1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lbzx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001010111 :
+(bit[1]) _ as instr) =
+ Lbzx (RT,RA,RB)
+
+function clause execute (Lbzx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] :=
+ 0b00000000000000000000000000000000000000000000000000000000 : MEMr (EA,1)
+ }
+
union ast member (bit[5], bit[5], bit[16]) Lbzu
function clause decode (0b100011 :
@@ -550,9 +778,9 @@ function clause execute (Lbzu (RT, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
+ GPR[RA] := EA;
GPR[RT] :=
- 0b00000000000000000000000000000000000000000000000000000000 : MEMr (EA,1);
- GPR[RA] := EA
+ 0b00000000000000000000000000000000000000000000000000000000 : MEMr (EA,1)
}
union ast member (bit[5], bit[5], bit[5]) Lbzux
@@ -569,9 +797,45 @@ function clause execute (Lbzux (RT, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
+ GPR[RA] := EA;
GPR[RT] :=
- 0b00000000000000000000000000000000000000000000000000000000 : MEMr (EA,1);
- GPR[RA] := EA
+ 0b00000000000000000000000000000000000000000000000000000000 : MEMr (EA,1)
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Lhz
+
+function clause decode (0b101000 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Lhz (RT,RA,D)
+
+function clause execute (Lhz (RT, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ GPR[RT] := 0b000000000000000000000000000000000000000000000000 : MEMr (EA,2)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lhzx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0100010111 :
+(bit[1]) _ as instr) =
+ Lhzx (RT,RA,RB)
+
+function clause execute (Lhzx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := 0b000000000000000000000000000000000000000000000000 : MEMr (EA,2)
}
union ast member (bit[5], bit[5], bit[16]) Lhzu
@@ -586,8 +850,8 @@ function clause execute (Lhzu (RT, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
- GPR[RT] := 0b000000000000000000000000000000000000000000000000 : MEMr (EA,2);
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := 0b000000000000000000000000000000000000000000000000 : MEMr (EA,2)
}
union ast member (bit[5], bit[5], bit[5]) Lhzux
@@ -604,8 +868,44 @@ function clause execute (Lhzux (RT, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- GPR[RT] := 0b000000000000000000000000000000000000000000000000 : MEMr (EA,2);
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := 0b000000000000000000000000000000000000000000000000 : MEMr (EA,2)
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Lha
+
+function clause decode (0b101010 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Lha (RT,RA,D)
+
+function clause execute (Lha (RT, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ GPR[RT] := EXTS (MEMr (EA,2))
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lhax
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0101010111 :
+(bit[1]) _ as instr) =
+ Lhax (RT,RA,RB)
+
+function clause execute (Lhax (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := EXTS (MEMr (EA,2))
}
union ast member (bit[5], bit[5], bit[16]) Lhau
@@ -620,8 +920,8 @@ function clause execute (Lhau (RT, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
- GPR[RT] := EXTS (MEMr (EA,2));
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := EXTS (MEMr (EA,2))
}
union ast member (bit[5], bit[5], bit[5]) Lhaux
@@ -638,8 +938,8 @@ function clause execute (Lhaux (RT, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- GPR[RT] := EXTS (MEMr (EA,2));
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := EXTS (MEMr (EA,2))
}
union ast member (bit[5], bit[5], bit[16]) Lwz
@@ -659,6 +959,25 @@ function clause execute (Lwz (RT, RA, D)) =
GPR[RT] := 0b00000000000000000000000000000000 : MEMr (EA,4)
}
+union ast member (bit[5], bit[5], bit[5]) Lwzx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000010111 :
+(bit[1]) _ as instr) =
+ Lwzx (RT,RA,RB)
+
+function clause execute (Lwzx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := 0b00000000000000000000000000000000 : MEMr (EA,4)
+ }
+
union ast member (bit[5], bit[5], bit[16]) Lwzu
function clause decode (0b100001 :
@@ -671,8 +990,8 @@ function clause execute (Lwzu (RT, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
- GPR[RT] := 0b00000000000000000000000000000000 : MEMr (EA,4);
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := 0b00000000000000000000000000000000 : MEMr (EA,4)
}
union ast member (bit[5], bit[5], bit[5]) Lwzux
@@ -689,8 +1008,45 @@ function clause execute (Lwzux (RT, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- GPR[RT] := 0b00000000000000000000000000000000 : MEMr (EA,4);
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := 0b00000000000000000000000000000000 : MEMr (EA,4)
+ }
+
+union ast member (bit[5], bit[5], bit[14]) Lwa
+
+function clause decode (0b111010 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[14]) DS :
+0b10 as instr) =
+ Lwa (RT,RA,DS)
+
+function clause execute (Lwa (RT, RA, DS)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (DS : 0b00);
+ GPR[RT] := EXTS (MEMr (EA,4))
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lwax
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0101010101 :
+(bit[1]) _ as instr) =
+ Lwax (RT,RA,RB)
+
+function clause execute (Lwax (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := EXTS (MEMr (EA,4))
}
union ast member (bit[5], bit[5], bit[5]) Lwaux
@@ -707,8 +1063,8 @@ function clause execute (Lwaux (RT, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- GPR[RT] := EXTS (MEMr (EA,4));
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := EXTS (MEMr (EA,4))
}
union ast member (bit[5], bit[5], bit[14]) Ld
@@ -729,6 +1085,25 @@ function clause execute (Ld (RT, RA, DS)) =
GPR[RT] := MEMr (EA,8)
}
+union ast member (bit[5], bit[5], bit[5]) Ldx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000010101 :
+(bit[1]) _ as instr) =
+ Ldx (RT,RA,RB)
+
+function clause execute (Ldx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := MEMr (EA,8)
+ }
+
union ast member (bit[5], bit[5], bit[14]) Ldu
function clause decode (0b111010 :
@@ -742,8 +1117,8 @@ function clause execute (Ldu (RT, RA, DS)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (DS : 0b00);
- GPR[RT] := MEMr (EA,8);
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := MEMr (EA,8)
}
union ast member (bit[5], bit[5], bit[5]) Ldux
@@ -760,8 +1135,44 @@ function clause execute (Ldux (RT, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- GPR[RT] := MEMr (EA,8);
- GPR[RA] := EA
+ GPR[RA] := EA;
+ GPR[RT] := MEMr (EA,8)
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Stb
+
+function clause decode (0b100110 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Stb (RS,RA,D)
+
+function clause execute (Stb (RS, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ MEMw(EA,1) := (GPR[RS])[56 .. 63]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stbx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0011010111 :
+(bit[1]) _ as instr) =
+ Stbx (RS,RA,RB)
+
+function clause execute (Stbx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,1) := (GPR[RS])[56 .. 63]
}
union ast member (bit[5], bit[5], bit[16]) Stbu
@@ -776,8 +1187,8 @@ function clause execute (Stbu (RS, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
- MEMw(EA,1) := (GPR[RS])[56 .. 63];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,1) := (GPR[RS])[56 .. 63]
}
union ast member (bit[5], bit[5], bit[5]) Stbux
@@ -794,8 +1205,44 @@ function clause execute (Stbux (RS, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- MEMw(EA,1) := (GPR[RS])[56 .. 63];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,1) := (GPR[RS])[56 .. 63]
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Sth
+
+function clause decode (0b101100 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Sth (RS,RA,D)
+
+function clause execute (Sth (RS, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ MEMw(EA,2) := (GPR[RS])[48 .. 63]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Sthx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0110010111 :
+(bit[1]) _ as instr) =
+ Sthx (RS,RA,RB)
+
+function clause execute (Sthx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,2) := (GPR[RS])[48 .. 63]
}
union ast member (bit[5], bit[5], bit[16]) Sthu
@@ -810,8 +1257,8 @@ function clause execute (Sthu (RS, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
- MEMw(EA,2) := (GPR[RS])[48 .. 63];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,2) := (GPR[RS])[48 .. 63]
}
union ast member (bit[5], bit[5], bit[5]) Sthux
@@ -828,8 +1275,8 @@ function clause execute (Sthux (RS, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- MEMw(EA,2) := (GPR[RS])[48 .. 63];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,2) := (GPR[RS])[48 .. 63]
}
union ast member (bit[5], bit[5], bit[16]) Stw
@@ -849,6 +1296,25 @@ function clause execute (Stw (RS, RA, D)) =
MEMw(EA,4) := (GPR[RS])[32 .. 63]
}
+union ast member (bit[5], bit[5], bit[5]) Stwx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010010111 :
+(bit[1]) _ as instr) =
+ Stwx (RS,RA,RB)
+
+function clause execute (Stwx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,4) := (GPR[RS])[32 .. 63]
+ }
+
union ast member (bit[5], bit[5], bit[16]) Stwu
function clause decode (0b100101 :
@@ -861,8 +1327,8 @@ function clause execute (Stwu (RS, RA, D)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (D);
- MEMw(EA,4) := (GPR[RS])[32 .. 63];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,4) := (GPR[RS])[32 .. 63]
}
union ast member (bit[5], bit[5], bit[5]) Stwux
@@ -879,8 +1345,8 @@ function clause execute (Stwux (RS, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- MEMw(EA,4) := (GPR[RS])[32 .. 63];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,4) := (GPR[RS])[32 .. 63]
}
union ast member (bit[5], bit[5], bit[14]) Std
@@ -901,6 +1367,25 @@ function clause execute (Std (RS, RA, DS)) =
MEMw(EA,8) := GPR[RS]
}
+union ast member (bit[5], bit[5], bit[5]) Stdx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010010101 :
+(bit[1]) _ as instr) =
+ Stdx (RS,RA,RB)
+
+function clause execute (Stdx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,8) := GPR[RS]
+ }
+
union ast member (bit[5], bit[5], bit[14]) Stdu
function clause decode (0b111110 :
@@ -914,8 +1399,8 @@ function clause execute (Stdu (RS, RA, DS)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + EXTS (DS : 0b00);
- MEMw(EA,8) := GPR[RS];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,8) := GPR[RS]
}
union ast member (bit[5], bit[5], bit[5]) Stdux
@@ -932,8 +1417,8 @@ function clause execute (Stdux (RS, RA, RB)) =
{
(bit[64]) EA := 0;
EA := GPR[RA] + GPR[RB];
- MEMw(EA,8) := GPR[RS];
- GPR[RA] := EA
+ GPR[RA] := EA;
+ MEMw(EA,8) := GPR[RS]
}
union ast member (bit[5], bit[5], bit[12], bit[4]) Lq
@@ -992,6 +1477,142 @@ function clause execute (Stq (RSp, RA, DS)) =
MEMw(EA,8) := RSp
}
+union ast member (bit[5], bit[5], bit[5]) Lhbrx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1100010110 :
+(bit[1]) _ as instr) =
+ Lhbrx (RT,RA,RB)
+
+function clause execute (Lhbrx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ load_data := MEMr (EA,2);
+ GPR[RT] :=
+ 0b000000000000000000000000000000000000000000000000 :
+ load_data[8 .. 15] : load_data[0 .. 7]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Sthbrx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1110010110 :
+(bit[1]) _ as instr) =
+ Sthbrx (RS,RA,RB)
+
+function clause execute (Sthbrx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,2) := (GPR[RS])[56 .. 63] : (GPR[RS])[48 .. 55]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lwbrx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1000010110 :
+(bit[1]) _ as instr) =
+ Lwbrx (RT,RA,RB)
+
+function clause execute (Lwbrx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ load_data := MEMr (EA,4);
+ GPR[RT] :=
+ 0b00000000000000000000000000000000 :
+ load_data[24 .. 31] :
+ load_data[16 .. 23] : load_data[8 .. 15] : load_data[0 .. 7]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stwbrx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1010010110 :
+(bit[1]) _ as instr) =
+ Stwbrx (RS,RA,RB)
+
+function clause execute (Stwbrx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,4) :=
+ (GPR[RS])[56 .. 63] :
+ (GPR[RS])[48 .. 55] : (GPR[RS])[40 .. 47] : (GPR[RS])[32 .. 39]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Ldbrx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1000010100 :
+(bit[1]) _ as instr) =
+ Ldbrx (RT,RA,RB)
+
+function clause execute (Ldbrx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ load_data := MEMr (EA,8);
+ GPR[RT] :=
+ load_data[56 .. 63] :
+ load_data[48 .. 55] :
+ load_data[40 .. 47] :
+ load_data[32 .. 39] :
+ load_data[24 .. 31] :
+ load_data[16 .. 23] : load_data[8 .. 15] : load_data[0 .. 7]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stdbrx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1010010100 :
+(bit[1]) _ as instr) =
+ Stdbrx (RS,RA,RB)
+
+function clause execute (Stdbrx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,8) :=
+ (GPR[RS])[56 .. 63] :
+ (GPR[RS])[48 .. 55] :
+ (GPR[RS])[40 .. 47] :
+ (GPR[RS])[32 .. 39] :
+ (GPR[RS])[24 .. 31] :
+ (GPR[RS])[16 .. 23] : (GPR[RS])[8 .. 15] : (GPR[RS])[0 .. 7]
+ }
+
union ast member (bit[5], bit[5], bit[16]) Lmw
function clause decode (0b101110 :
@@ -1016,6 +1637,31 @@ function clause execute (Lmw (RT, RA, D)) =
}
}
+union ast member (bit[5], bit[5], bit[16]) Stmw
+
+function clause decode (0b101111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Stmw (RS,RA,D)
+
+function clause execute (Stmw (RS, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ size := ([|32|]) (32 - RS) * 4;
+ (bit[994]) buffer := [0 = 0,993 = 0; default=0];
+ i := 0;
+ foreach (r from RS to 31 by 1 in inc)
+ {
+ buffer[i..i + 31] := (GPR[r])[32 .. 63];
+ i := i + 32
+ };
+ MEMw(EA,size) := buffer[0 .. size * 8]
+ }
+
union ast member (bit[5], bit[5], bit[5]) Lswi
function clause decode (0b011111 :
@@ -1030,7 +1676,7 @@ function clause execute (Lswi (RT, RA, NB)) =
{
(bit[64]) EA := 0;
if RA == 0 then EA := 0 else EA := GPR[RA];
- ([|32|]) r := 0;
+ ([|31|]) r := 0;
r := RT - 1;
([|32|]) size := if NB == 0 then 32 else NB;
(bit[256]) membuffer := MEMr (EA,size);
@@ -1040,7 +1686,7 @@ function clause execute (Lswi (RT, RA, NB)) =
{
if i == 32
then {
- r := ([|32|]) (r + 1) mod 32;
+ r := ([|31|]) (r + 1) mod 32;
GPR[r] := 0
}
else ();
@@ -1052,6 +1698,118 @@ function clause execute (Lswi (RT, RA, NB)) =
}
}
+union ast member (bit[5], bit[5], bit[5]) Lswx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1000010101 :
+(bit[1]) _ as instr) =
+ Lswx (RT,RA,RB)
+
+function clause execute (Lswx (RT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ ([|31|]) r := 0;
+ EA := b + GPR[RB];
+ r := RT - 1;
+ i := 32;
+ ([|64|]) n_top := XER[57 .. 63];
+ recalculate_dependency (());
+ if n_top == 0
+ then GPR[RT] := undefined
+ else {
+ (bit[512]) membuffer := MEMr (EA,n_top);
+ j := 0;
+ n_r := n_top quot 4;
+ n_mod := n_top mod 4;
+ n_r := if n_mod == 0 then n_r else n_r + 1;
+ foreach (n from n_r to 1 by 1 in dec)
+ {
+ r := ([|32|]) (r + 1) mod 32;
+ (bit[64]) temp := 0;
+ if n == 1
+ then switch n_mod {
+ case 0 -> temp[32..63] := membuffer[j .. j + 31]
+ case 1 -> temp[32..39] := membuffer[j .. j + 7]
+ case 2 -> temp[32..47] := membuffer[j .. j + 15]
+ case 3 -> temp[32..55] := membuffer[j .. j + 23]
+ }
+ else temp[32..63] := membuffer[j .. j + 31];
+ j := j + 32;
+ GPR[r] := temp
+ }
+ }
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stswi
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) NB :
+0b1011010101 :
+(bit[1]) _ as instr) =
+ Stswi (RS,RA,NB)
+
+function clause execute (Stswi (RS, RA, NB)) =
+ {
+ (bit[64]) EA := 0;
+ if RA == 0 then EA := 0 else EA := GPR[RA];
+ ([|31|]) r := 0;
+ r := RS - 1;
+ ([|32|]) size := if NB == 0 then 32 else NB;
+ (bit[256]) membuffer := [0 = 0,255 = 0; default=0];
+ j := 0;
+ i := 32;
+ foreach (n from (if NB == 0 then 32 else NB) to 1 by 1 in dec)
+ {
+ if i == 32 then r := ([|32|]) (r + 1) mod 32 else ();
+ membuffer[j..j + 7] := (GPR[r])[i .. i + 7];
+ j := j + 8;
+ i := i + 8;
+ if i == 64 then i := 32 else ()
+ };
+ MEMw(EA,size) := membuffer[0 .. size * 8]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stswx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1010010101 :
+(bit[1]) _ as instr) =
+ Stswx (RS,RA,RB)
+
+function clause execute (Stswx (RS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ ([|31|]) r := 0;
+ EA := b + GPR[RB];
+ r := RS - 1;
+ i := 32;
+ ([|64|]) n_top := XER[57 .. 63];
+ recalculate_dependency (());
+ (bit[512]) membuffer := [0 = 0,511 = 0; default=0];
+ j := 0;
+ foreach (n from n_top to 1 by 1 in dec)
+ {
+ if i == 32 then r := ([|32|]) (r + 1) mod 32 else ();
+ membuffer[j..j + 7] := (GPR[r])[i .. i + 7];
+ i := i + 8;
+ j := j + 8;
+ if i == 64 then i := 32 else ()
+ };
+ if ~ (n_top == 0) then MEMw(EA,n_top) := membuffer[0 .. n_top * 8] else ()
+ }
+
union ast member (bit[5], bit[5], bit[16]) Addi
function clause decode (0b001110 :
@@ -1113,19 +1871,21 @@ function clause decode (0b011111 :
Subf (RT,RA,RB,OE,Rc)
function clause execute (Subf (RT, RA, RB, OE, Rc)) =
- let (t, overflow, _) = (~ (GPR[RA]) +_s GPR[RB]) in
- {
- (bit[64]) temp := t + 1;
- GPR[RT] := temp;
- if Rc
- then {
- xer_so := XER.SO;
- if OE & overflow then xer_so := overflow else ();
- set_overflow_cr0 (temp,xer_so)
+ let (t1, o1, _) = (~ (GPR[RA]) +_s GPR[RB]) in
+ let (t2, o2, _) = (t1 +_s (bit) 1) in
+ {
+ (bit[64]) temp := t2;
+ overflow := (o1 | o2);
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ if OE then set_SO_OV (overflow) else ()
}
- else ();
- if OE then set_SO_OV (overflow) else ()
- }
union ast member (bit[5], bit[5], bit[16]) Addic
@@ -1155,7 +1915,254 @@ function clause execute (AddicDot (RT, RA, SI)) =
{
GPR[RT] := temp;
CA := carry;
- set_overflow_cr0 (temp,overflow)
+ set_overflow_cr0 (temp,overflow | XER.SO)
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Subfic
+
+function clause decode (0b001000 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[16]) SI as instr) =
+ Subfic (RT,RA,SI)
+
+function clause execute (Subfic (RT, RA, SI)) =
+ let (t1, o1, c1) = (~ (GPR[RA]) +_s EXTS (SI)) in
+ let (t2, o2, c2) = (t1 +_s (bit) 1) in
+ {
+ (bit[64]) temp := t2;
+ GPR[RT] := temp;
+ CA := (c1 | c2)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Addc
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b000001010 :
+[Rc] as instr) =
+ Addc (RT,RA,RB,OE,Rc)
+
+function clause execute (Addc (RT, RA, RB, OE, Rc)) =
+ let (temp, overflow, carry) = (GPR[RA] +_s GPR[RB]) in
+ {
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Subfc
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b000001000 :
+[Rc] as instr) =
+ Subfc (RT,RA,RB,OE,Rc)
+
+function clause execute (Subfc (RT, RA, RB, OE, Rc)) =
+ let (t1, o1, c1) = (~ (GPR[RA]) +_s GPR[RB]) in
+ let (t2, o2, c2) = (t1 +_s (bit) 1) in
+ {
+ (bit[64]) temp := t2;
+ overflow := (o1 | o2);
+ carry := (c1 | c2);
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Adde
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b010001010 :
+[Rc] as instr) =
+ Adde (RT,RA,RB,OE,Rc)
+
+function clause execute (Adde (RT, RA, RB, OE, Rc)) =
+ let (t1, o1, c1) = (GPR[RA] +_s GPR[RB]) in
+ let (t2, o2, c2) = (t1 +_s (bit) CA) in
+ {
+ (bit[64]) temp := t2;
+ overflow := (o1 | o2);
+ carry := (c1 | c2);
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Subfe
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b010001000 :
+[Rc] as instr) =
+ Subfe (RT,RA,RB,OE,Rc)
+
+function clause execute (Subfe (RT, RA, RB, OE, Rc)) =
+ let (t1, o1, c1) = (~ (GPR[RA]) +_s GPR[RB]) in
+ let (t2, o2, c2) = (t1 +_s (bit) CA) in
+ {
+ (bit[64]) temp := t2;
+ overflow := (o1 | o2);
+ carry := (c1 | c2);
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit, bit) Addme
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) _ :
+[OE] :
+0b011101010 :
+[Rc] as instr) =
+ Addme (RT,RA,OE,Rc)
+
+function clause execute (Addme (RT, RA, OE, Rc)) =
+ let (t1, o1, c1) = (GPR[RA] +_s CA) in
+ let (t2, o2, c2) =
+ (t1 +_s 0b1111111111111111111111111111111111111111111111111111111111111111) in
+ {
+ (bit[64]) temp := t2;
+ overflow := (o1 | o2);
+ carry := (c1 | c2);
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit, bit) Subfme
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) _ :
+[OE] :
+0b011101000 :
+[Rc] as instr) =
+ Subfme (RT,RA,OE,Rc)
+
+function clause execute (Subfme (RT, RA, OE, Rc)) =
+ let (t1, o1, c1) = (~ (GPR[RA]) +_s CA) in
+ let (t2, o2, c2) =
+ (t1 +_s 0b1111111111111111111111111111111111111111111111111111111111111111) in
+ {
+ (bit[64]) temp := t2;
+ overflow := (o1 | o2);
+ carry := (c1 | c2);
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit, bit) Addze
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) _ :
+[OE] :
+0b011001010 :
+[Rc] as instr) =
+ Addze (RT,RA,OE,Rc)
+
+function clause execute (Addze (RT, RA, OE, Rc)) =
+ let (temp, overflow, carry) = (GPR[RA] +_s CA) in
+ {
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit, bit) Subfze
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) _ :
+[OE] :
+0b011001000 :
+[Rc] as instr) =
+ Subfze (RT,RA,OE,Rc)
+
+function clause execute (Subfze (RT, RA, OE, Rc)) =
+ let (temp, overflow, carry) = (~ (GPR[RA]) +_s CA) in
+ {
+ GPR[RT] := temp;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (temp,xer_so)
+ }
+ else ();
+ CA := carry;
+ if OE then set_SO_OV (overflow) else ()
}
union ast member (bit[5], bit[5], bit, bit) Neg
@@ -1173,9 +2180,24 @@ function clause execute (Neg (RT, RA, OE, Rc)) =
let (temp, overflow, _) = (~ (GPR[RA]) +_s (bit) 1) in
{
GPR[RT] := temp;
- if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ();
+ if OE then set_SO_OV (overflow) else ()
}
+union ast member (bit[5], bit[5], bit[16]) Mulli
+
+function clause decode (0b000111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[16]) SI as instr) =
+ Mulli (RT,RA,SI)
+
+function clause execute (Mulli (RT, RA, SI)) =
+ {
+ (bit[128]) prod := GPR[RA] *_s EXTS (SI);
+ GPR[RT] := prod[64 .. 127]
+ }
+
union ast member (bit[5], bit[5], bit[5], bit, bit) Mullw
function clause decode (0b011111 :
@@ -1201,6 +2223,411 @@ function clause execute (Mullw (RT, RA, RB, OE, Rc)) =
if OE then set_SO_OV (overflow) else ()
}
+union ast member (bit[5], bit[5], bit[5], bit) Mulhw
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[1]) _ :
+0b001001011 :
+[Rc] as instr) =
+ Mulhw (RT,RA,RB,Rc)
+
+function clause execute (Mulhw (RT, RA, RB, Rc)) =
+ {
+ (bit[64]) prod := 0;
+ (bit) overflow := 0;
+ let (p, o, _) = ((GPR[RA])[32 .. 63] *_s (GPR[RB])[32 .. 63]) in
+ {
+ prod := p;
+ overflow := o
+ };
+ (GPR[RT])[32..63] := prod[0 .. 31];
+ (GPR[RT])[0..31] := undefined;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if mode64bit
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (prod,xer_so)
+ }
+ else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulhwu
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[1]) _ :
+0b000001011 :
+[Rc] as instr) =
+ Mulhwu (RT,RA,RB,Rc)
+
+function clause execute (Mulhwu (RT, RA, RB, Rc)) =
+ {
+ (bit[64]) prod := (GPR[RA])[32 .. 63] * (GPR[RB])[32 .. 63];
+ (GPR[RT])[32..63] := prod[0 .. 31];
+ (GPR[RT])[0..31] := undefined;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if mode64bit
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (prod,xer_so)
+ }
+ else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divw
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111101011 :
+[Rc] as instr) =
+ Divw (RT,RA,RB,OE,Rc)
+
+function clause execute (Divw (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[32]) dividend := (GPR[RA])[32 .. 63];
+ (bit[32]) divisor := (GPR[RB])[32 .. 63];
+ (bit[64]) divided :=
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot_s divisor) in
+ {
+ divided[32..63] := d;
+ overflow := o
+ };
+ (GPR[RT])[32..63] := divided[32 .. 63];
+ (GPR[RT])[0..31] := undefined;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ if mode64bit | overflow
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (divided,xer_so)
+ }
+ else ();
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divwu
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111001011 :
+[Rc] as instr) =
+ Divwu (RT,RA,RB,OE,Rc)
+
+function clause execute (Divwu (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[32]) dividend := (GPR[RA])[32 .. 63];
+ (bit[32]) divisor := (GPR[RB])[32 .. 63];
+ (bit[64]) divided :=
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot divisor) in
+ {
+ divided[32..63] := d;
+ overflow := o
+ };
+ (GPR[RT])[32..63] := divided[32 .. 63];
+ (GPR[RT])[0..31] := undefined;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ if mode64bit | overflow
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (divided,xer_so)
+ }
+ else ();
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divwe
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110101011 :
+[Rc] as instr) =
+ Divwe (RT,RA,RB,OE,Rc)
+
+function clause execute (Divwe (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[64]) dividend :=
+ (GPR[RA])[32 .. 63] : 0b00000000000000000000000000000000;
+ (bit[32]) divisor := (GPR[RB])[32 .. 63];
+ (bit[64]) divided :=
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot_s divisor) in
+ {
+ divided[32..63] := d[32 .. 63];
+ overflow := o
+ };
+ (GPR[RT])[32..63] := divided[32 .. 63];
+ (GPR[RT])[0..31] := undefined;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ if mode64bit | overflow
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (divided,xer_so)
+ }
+ else ();
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divweu
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110001011 :
+[Rc] as instr) =
+ Divweu (RT,RA,RB,OE,Rc)
+
+function clause execute (Divweu (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[64]) dividend :=
+ (GPR[RA])[32 .. 63] : 0b00000000000000000000000000000000;
+ (bit[32]) divisor := (GPR[RB])[32 .. 63];
+ (bit[64]) divided :=
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot divisor) in
+ {
+ divided[32..63] := d[32 .. 63];
+ overflow := o
+ };
+ (GPR[RT])[32..63] := divided[32 .. 63];
+ (GPR[RT])[0..31] := undefined;
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ if mode64bit | overflow
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (divided,xer_so)
+ }
+ else ();
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Mulld
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b011101001 :
+[Rc] as instr) =
+ Mulld (RT,RA,RB,OE,Rc)
+
+function clause execute (Mulld (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[128]) prod := 0;
+ (bit) overflow := 0;
+ let (p, o, _) = (GPR[RA] *_s GPR[RB]) in
+ {
+ prod := p;
+ overflow := o
+ };
+ GPR[RT] := prod[64 .. 127];
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ set_overflow_cr0 (prod[64 .. 127],xer_so)
+ }
+ else ();
+ if OE then set_SO_OV (overflow) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulhd
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[1]) _ :
+0b001001001 :
+[Rc] as instr) =
+ Mulhd (RT,RA,RB,Rc)
+
+function clause execute (Mulhd (RT, RA, RB, Rc)) =
+ {
+ (bit[128]) prod := GPR[RA] *_s GPR[RB];
+ GPR[RT] := prod[0 .. 63];
+ if Rc then set_overflow_cr0 (prod[0 .. 63],XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulhdu
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[1]) _ :
+0b000001001 :
+[Rc] as instr) =
+ Mulhdu (RT,RA,RB,Rc)
+
+function clause execute (Mulhdu (RT, RA, RB, Rc)) =
+ {
+ (bit[128]) prod := GPR[RA] * GPR[RB];
+ GPR[RT] := prod[0 .. 63];
+ if Rc then set_overflow_cr0 (prod[0 .. 63],XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divd
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111101001 :
+[Rc] as instr) =
+ Divd (RT,RA,RB,OE,Rc)
+
+function clause execute (Divd (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[64]) dividend := GPR[RA];
+ (bit[64]) divisor := GPR[RB];
+ (bit[64]) divided :=
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot_s divisor) in
+ {
+ divided := d;
+ overflow := o
+ };
+ GPR[RT] := divided;
+ if OE then set_SO_OV (overflow) else ();
+ if Rc then set_overflow_cr0 (divided,overflow | XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divdu
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111001001 :
+[Rc] as instr) =
+ Divdu (RT,RA,RB,OE,Rc)
+
+function clause execute (Divdu (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[64]) dividend := GPR[RA];
+ (bit[64]) divisor := GPR[RB];
+ (bit[64]) divided :=
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot divisor) in
+ {
+ divided := d;
+ overflow := o
+ };
+ GPR[RT] := divided;
+ if OE then set_SO_OV (overflow) else ();
+ if Rc then set_overflow_cr0 (divided,overflow | XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divde
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110101001 :
+[Rc] as instr) =
+ Divde (RT,RA,RB,OE,Rc)
+
+function clause execute (Divde (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[128]) dividend :=
+ GPR[RA] :
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit[64]) divisor := GPR[RB];
+ (bit[128]) divided := 0;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot_s divisor) in
+ {
+ divided := d;
+ overflow := o
+ };
+ GPR[RT] := divided[64 .. 127];
+ if OE then set_SO_OV (overflow) else ();
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ if overflow
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (divided[64 .. 127],xer_so)
+ }
+ else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Divdeu
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110001001 :
+[Rc] as instr) =
+ Divdeu (RT,RA,RB,OE,Rc)
+
+function clause execute (Divdeu (RT, RA, RB, OE, Rc)) =
+ {
+ (bit[128]) dividend :=
+ GPR[RA] :
+ 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit[64]) divisor := GPR[RB];
+ (bit[128]) divided := 0;
+ (bit) overflow := 0;
+ let (d, o, _) = (dividend quot divisor) in
+ {
+ divided := d;
+ overflow := o
+ };
+ GPR[RT] := divided[64 .. 127];
+ if OE then set_SO_OV (overflow) else ();
+ if Rc
+ then {
+ xer_so := XER.SO;
+ if OE & overflow then xer_so := overflow else ();
+ if overflow
+ then CR.CR0 := [undefined,undefined,undefined,xer_so]
+ else set_overflow_cr0 (divided[64 .. 127],xer_so)
+ }
+ else ()
+ }
+
union ast member (bit[3], bit, bit[5], bit[16]) Cmpi
function clause decode (0b001011 :
@@ -1250,6 +2677,177 @@ function clause execute (Cmp (BF, L, RA, RB)) =
CR[4 * BF + 32..4 * BF + 35] := c : [XER.SO]
}
+union ast member (bit[3], bit, bit[5], bit[16]) Cmpli
+
+function clause decode (0b001010 :
+(bit[3]) BF :
+(bit[1]) _ :
+[L] :
+(bit[5]) RA :
+(bit[16]) UI as instr) =
+ Cmpli (BF,L,RA,UI)
+
+function clause execute (Cmpli (BF, L, RA, UI)) =
+ {
+ (bit[64]) a := 0;
+ (bit[3]) c := 0;
+ if L == 0
+ then a := 0b00000000000000000000000000000000 : (GPR[RA])[32 .. 63]
+ else a := GPR[RA];
+ if a <_u 0b000000000000000000000000000000000000000000000000 : UI
+ then c := 0b100
+ else if a >_u 0b000000000000000000000000000000000000000000000000 : UI
+ then c := 0b010
+ else c := 0b001;
+ CR[4 * BF + 32..4 * BF + 35] := c : [XER.SO]
+ }
+
+union ast member (bit[3], bit, bit[5], bit[5]) Cmpl
+
+function clause decode (0b011111 :
+(bit[3]) BF :
+(bit[1]) _ :
+[L] :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000100000 :
+(bit[1]) _ as instr) =
+ Cmpl (BF,L,RA,RB)
+
+function clause execute (Cmpl (BF, L, RA, RB)) =
+ {
+ (bit[64]) a := 0;
+ (bit[64]) b := 0;
+ (bit[3]) c := 0;
+ if L == 0
+ then {
+ a := 0b00000000000000000000000000000000 : (GPR[RA])[32 .. 63];
+ b := 0b00000000000000000000000000000000 : (GPR[RB])[32 .. 63]
+ }
+ else {
+ a := GPR[RA];
+ b := GPR[RB]
+ };
+ if a <_u b then c := 0b100 else if a >_u b then c := 0b010 else c := 0b001;
+ CR[4 * BF + 32..4 * BF + 35] := c : [XER.SO]
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Twi
+
+function clause decode (0b000011 :
+(bit[5]) TO :
+(bit[5]) RA :
+(bit[16]) SI as instr) =
+ Twi (TO,RA,SI)
+
+function clause execute (Twi (TO, RA, SI)) =
+ {
+ a := EXTS ((GPR[RA])[32 .. 63]);
+ if a < EXTS (SI) & TO[0] then trap () else ();
+ if a > EXTS (SI) & TO[1] then trap () else ();
+ if a == EXTS (SI) & TO[2] then trap () else ();
+ if a <_u EXTS (SI) & TO[3] then trap () else ();
+ if a >_u EXTS (SI) & TO[4] then trap () else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Tw
+
+function clause decode (0b011111 :
+(bit[5]) TO :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000000100 :
+(bit[1]) _ as instr) =
+ Tw (TO,RA,RB)
+
+function clause execute (Tw (TO, RA, RB)) =
+ {
+ a := EXTS ((GPR[RA])[32 .. 63]);
+ b := EXTS ((GPR[RB])[32 .. 63]);
+ if a < b & TO[0] then trap () else ();
+ if a > b & TO[1] then trap () else ();
+ if a == b & TO[2] then trap () else ();
+ if a <_u b & TO[3] then trap () else ();
+ if a >_u b & TO[4] then trap () else ()
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Tdi
+
+function clause decode (0b000010 :
+(bit[5]) TO :
+(bit[5]) RA :
+(bit[16]) SI as instr) =
+ Tdi (TO,RA,SI)
+
+function clause execute (Tdi (TO, RA, SI)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Td
+
+function clause decode (0b011111 :
+(bit[5]) TO :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001000100 :
+(bit[1]) _ as instr) =
+ Td (TO,RA,RB)
+
+function clause execute (Td (TO, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Isel
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[5]) BC :
+0b01111 :
+(bit[1]) _ as instr) =
+ Isel (RT,RA,RB,BC)
+
+function clause execute (Isel (RT, RA, RB, BC)) =
+ {
+ (bit[64]) a := 0;
+ if RA == 0 then a := 0 else a := GPR[RA];
+ if CR[BC + 32] == 1
+ then {
+ GPR[RT] := a;
+ discard := GPR[RB]
+ }
+ else GPR[RT] := GPR[RB]
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Andi
+
+function clause decode (0b011100 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[16]) UI as instr) =
+ Andi (RS,RA,UI)
+
+function clause execute (Andi (RS, RA, UI)) =
+ {
+ (bit[64]) temp :=
+ (GPR[RS] & 0b000000000000000000000000000000000000000000000000 : UI);
+ GPR[RA] := temp;
+ set_overflow_cr0 (temp,XER.SO)
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Andis
+
+function clause decode (0b011101 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[16]) UI as instr) =
+ Andis (RS,RA,UI)
+
+function clause execute (Andis (RS, RA, UI)) =
+ {
+ (bit[64]) temp :=
+ (GPR[RS] & 0b00000000000000000000000000000000 : UI : 0b0000000000000000);
+ GPR[RA] := temp;
+ set_overflow_cr0 (temp,XER.SO)
+ }
+
union ast member (bit[5], bit[5], bit[16]) Ori
function clause decode (0b011000 :
@@ -1284,6 +2882,78 @@ function clause decode (0b011010 :
function clause execute (Xori (RS, RA, UI)) =
GPR[RA] := GPR[RS] ^ 0b000000000000000000000000000000000000000000000000 : UI
+union ast member (bit[5], bit[5], bit[16]) Xoris
+
+function clause decode (0b011011 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[16]) UI as instr) =
+ Xoris (RS,RA,UI)
+
+function clause execute (Xoris (RS, RA, UI)) =
+ GPR[RA] :=
+ GPR[RS] ^ 0b00000000000000000000000000000000 : UI : 0b0000000000000000
+
+union ast member (bit[5], bit[5], bit[5], bit) And
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000011100 :
+[Rc] as instr) =
+ And (RS,RA,RB,Rc)
+
+function clause execute (And (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := (GPR[RS] & GPR[RB]);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Xor
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0100111100 :
+[Rc] as instr) =
+ Xor (RS,RA,RB,Rc)
+
+function clause execute (Xor (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := 0;
+ if RS == RB
+ then {
+ temp := GPR[RS];
+ temp := 0;
+ GPR[RA] := 0
+ }
+ else {
+ temp := GPR[RS] ^ GPR[RB];
+ GPR[RA] := temp
+ };
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Nand
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0111011100 :
+[Rc] as instr) =
+ Nand (RS,RA,RB,Rc)
+
+function clause execute (Nand (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := ~ (GPR[RS] & GPR[RB]);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
union ast member (bit[5], bit[5], bit[5], bit) Or
function clause decode (0b011111 :
@@ -1301,6 +2971,225 @@ function clause execute (Or (RS, RA, RB, Rc)) =
if Rc then set_overflow_cr0 (temp,XER.SO) else ()
}
+union ast member (bit[5], bit[5], bit[5], bit) Nor
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001111100 :
+[Rc] as instr) =
+ Nor (RS,RA,RB,Rc)
+
+function clause execute (Nor (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := ~ (GPR[RS] | GPR[RB]);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Eqv
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0100011100 :
+[Rc] as instr) =
+ Eqv (RS,RA,RB,Rc)
+
+function clause execute (Eqv (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := GPR[RS] ^ ~ (GPR[RB]);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Andc
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000111100 :
+[Rc] as instr) =
+ Andc (RS,RA,RB,Rc)
+
+function clause execute (Andc (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := (GPR[RS] & ~ (GPR[RB]));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Orc
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0110011100 :
+[Rc] as instr) =
+ Orc (RS,RA,RB,Rc)
+
+function clause execute (Orc (RS, RA, RB, Rc)) =
+ {
+ (bit[64]) temp := (GPR[RS] | ~ (GPR[RB]));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit) Extsb
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b1110111010 :
+[Rc] as instr) =
+ Extsb (RS,RA,Rc)
+
+function clause execute (Extsb (RS, RA, Rc)) =
+ {
+ (bit[64]) temp := 0;
+ s := (GPR[RS])[56];
+ temp[56..63] := (GPR[RS])[56 .. 63];
+ (GPR[RA])[56..63] := temp[56 .. 63];
+ temp[0..55] := s ^^ 56;
+ (GPR[RA])[0..55] := temp[0 .. 55];
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit) Extsh
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b1110011010 :
+[Rc] as instr) =
+ Extsh (RS,RA,Rc)
+
+function clause execute (Extsh (RS, RA, Rc)) =
+ {
+ (bit[64]) temp := 0;
+ s := (GPR[RS])[48];
+ temp[48..63] := (GPR[RS])[48 .. 63];
+ (GPR[RA])[48..63] := temp[48 .. 63];
+ temp[0..47] := s ^^ 48;
+ (GPR[RA])[0..47] := temp[0 .. 47];
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit) Cntlzw
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0000011010 :
+[Rc] as instr) =
+ Cntlzw (RS,RA,Rc)
+
+function clause execute (Cntlzw (RS, RA, Rc)) =
+ {
+ temp := (bit[64]) (countLeadingZeroes (GPR[RS],32));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Cmpb
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0111111100 :
+(bit[1]) _ as instr) =
+ Cmpb (RS,RA,RB)
+
+function clause execute (Cmpb (RS, RA, RB)) =
+ foreach (n from 0 to 7 by 1 in inc)
+ if (GPR[RS])[8 * n .. 8 * n + 7] == (GPR[RB])[8 * n .. 8 * n + 7]
+ then (GPR[RA])[8 * n..8 * n + 7] := 0b11111111
+ else (GPR[RA])[8 * n..8 * n + 7] := (bit[8]) 0
+
+union ast member (bit[5], bit[5]) Popcntb
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0001111010 :
+(bit[1]) _ as instr) =
+ Popcntb (RS,RA)
+
+function clause execute (Popcntb (RS, RA)) =
+ foreach (i from 0 to 7 by 1 in inc)
+ {
+ ([|64|]) n := 0;
+ foreach (j from 0 to 7 by 1 in inc)
+ if (GPR[RS])[i * 8 + j] == 1 then n := n + 1 else ();
+ (GPR[RA])[i * 8..i * 8 + 7] := (bit[8]) n
+ }
+
+union ast member (bit[5], bit[5]) Popcntw
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0101111010 :
+(bit[1]) _ as instr) =
+ Popcntw (RS,RA)
+
+function clause execute (Popcntw (RS, RA)) =
+ foreach (i from 0 to 1 by 1 in inc)
+ {
+ ([|64|]) n := 0;
+ foreach (j from 0 to 31 by 1 in inc)
+ if (GPR[RS])[i * 32 + j] == 1 then n := n + 1 else ();
+ (GPR[RA])[i * 32..i * 32 + 31] := (bit[32]) n
+ }
+
+union ast member (bit[5], bit[5]) Prtyd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0010111010 :
+(bit[1]) _ as instr) =
+ Prtyd (RS,RA)
+
+function clause execute (Prtyd (RS, RA)) =
+ {
+ s := 0;
+ foreach (i from 0 to 7 by 1 in inc) s := s ^ (GPR[RS])[i * 8 + 7];
+ GPR[RA] :=
+ 0b000000000000000000000000000000000000000000000000000000000000000 : [s]
+ }
+
+union ast member (bit[5], bit[5]) Prtyw
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0010011010 :
+(bit[1]) _ as instr) =
+ Prtyw (RS,RA)
+
+function clause execute (Prtyw (RS, RA)) =
+ {
+ s := 0;
+ t := 0;
+ foreach (i from 0 to 3 by 1 in inc) s := s ^ (GPR[RS])[i * 8 + 7];
+ foreach (i from 4 to 7 by 1 in inc) t := t ^ (GPR[RS])[i * 8 + 7];
+ (GPR[RA])[0..31] := 0b0000000000000000000000000000000 : [s];
+ (GPR[RA])[32..63] := 0b0000000000000000000000000000000 : [t]
+ }
+
union ast member (bit[5], bit[5], bit) Extsw
function clause decode (0b011111 :
@@ -1315,12 +3204,160 @@ function clause execute (Extsw (RS, RA, Rc)) =
{
s := (GPR[RS])[32];
(bit[64]) temp := 0;
- temp := (GPR[RS])[32 .. 63];
- temp := s ^^ 32;
+ temp[32..63] := (GPR[RS])[32 .. 63];
+ temp[0..31] := s ^^ 32;
if Rc then set_overflow_cr0 (temp,XER.SO) else ();
GPR[RA] := temp
}
+union ast member (bit[5], bit[5], bit) Cntlzd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0000111010 :
+[Rc] as instr) =
+ Cntlzd (RS,RA,Rc)
+
+function clause execute (Cntlzd (RS, RA, Rc)) =
+ {
+ temp := (bit[64]) (countLeadingZeroes (GPR[RS],0));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5]) Popcntd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0111111010 :
+(bit[1]) _ as instr) =
+ Popcntd (RS,RA)
+
+function clause execute (Popcntd (RS, RA)) =
+ {
+ ([|64|]) n := 0;
+ foreach (i from 0 to 63 by 1 in inc)
+ if (GPR[RS])[i] == 1 then n := n + 1 else ();
+ GPR[RA] := (bit[64]) n
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Bpermd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0011111100 :
+(bit[1]) _ as instr) =
+ Bpermd (RS,RA,RB)
+
+function clause execute (Bpermd (RS, RA, RB)) =
+ {
+ (bit[8]) perm := 0;
+ foreach (i from 0 to 7 by 1 in inc)
+ {
+ index := (GPR[RS])[8 * i .. 8 * i + 7];
+ if index <_u (bit[8]) 64
+ then perm[i] := (GPR[RB])[index]
+ else {
+ perm[i] := 0;
+ discard := GPR[RB]
+ }
+ };
+ GPR[RA] :=
+ 0b00000000000000000000000000000000000000000000000000000000 : perm[0 .. 7]
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit[5], bit) Rlwinm
+
+function clause decode (0b010101 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) SH :
+(bit[5]) MB :
+(bit[5]) ME :
+[Rc] as instr) =
+ Rlwinm (RS,RA,SH,MB,ME,Rc)
+
+function clause execute (Rlwinm (RS, RA, SH, MB, ME, Rc)) =
+ {
+ n := SH;
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],n);
+ m := MASK (MB + 32,ME + 32);
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit[5], bit) Rlwnm
+
+function clause decode (0b010111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[5]) MB :
+(bit[5]) ME :
+[Rc] as instr) =
+ Rlwnm (RS,RA,RB,MB,ME,Rc)
+
+function clause execute (Rlwnm (RS, RA, RB, MB, ME, Rc)) =
+ {
+ n := (GPR[RB])[59 .. 63];
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],n);
+ m := MASK (MB + 32,ME + 32);
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit[5], bit) Rlwimi
+
+function clause decode (0b010100 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) SH :
+(bit[5]) MB :
+(bit[5]) ME :
+[Rc] as instr) =
+ Rlwimi (RS,RA,SH,MB,ME,Rc)
+
+function clause execute (Rlwimi (RS, RA, SH, MB, ME, Rc)) =
+ {
+ n := SH;
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],n);
+ m := MASK (MB + 32,ME + 32);
+ (bit[64]) temp := (r & m | GPR[RA] & ~ (m));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[6], bit[6], bit) Rldicl
+
+function clause decode (0b011110 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+(bit[6]) mb :
+0b000 :
+(bit[1]) _ :
+[Rc] as instr) =
+ Rldicl (RS,RA,instr[16 .. 20] : instr[30 .. 30],mb,Rc)
+
+function clause execute (Rldicl (RS, RA, sh, mb, Rc)) =
+ {
+ n := [sh[5]] : sh[0 .. 4];
+ r := ROTL (GPR[RS],n);
+ b := [mb[5]] : mb[0 .. 4];
+ m := MASK (b,63);
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
union ast member (bit[5], bit[5], bit[6], bit[6], bit) Rldicr
function clause decode (0b011110 :
@@ -1344,6 +3381,352 @@ function clause execute (Rldicr (RS, RA, sh, me, Rc)) =
if Rc then set_overflow_cr0 (temp,XER.SO) else ()
}
+union ast member (bit[5], bit[5], bit[6], bit[6], bit) Rldic
+
+function clause decode (0b011110 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+(bit[6]) mb :
+0b010 :
+(bit[1]) _ :
+[Rc] as instr) =
+ Rldic (RS,RA,instr[16 .. 20] : instr[30 .. 30],mb,Rc)
+
+function clause execute (Rldic (RS, RA, sh, mb, Rc)) =
+ {
+ n := [sh[5]] : sh[0 .. 4];
+ r := ROTL (GPR[RS],n);
+ b := [mb[5]] : mb[0 .. 4];
+ m := MASK (b,(bit[5]) (~ (n)));
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[6], bit) Rldcl
+
+function clause decode (0b011110 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[6]) mb :
+0b1000 :
+[Rc] as instr) =
+ Rldcl (RS,RA,RB,mb,Rc)
+
+function clause execute (Rldcl (RS, RA, RB, mb, Rc)) =
+ {
+ n := (GPR[RB])[58 .. 63];
+ r := ROTL (GPR[RS],n);
+ b := [mb[5]] : mb[0 .. 4];
+ m := MASK (b,63);
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[6], bit) Rldcr
+
+function clause decode (0b011110 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[6]) me :
+0b1001 :
+[Rc] as instr) =
+ Rldcr (RS,RA,RB,me,Rc)
+
+function clause execute (Rldcr (RS, RA, RB, me, Rc)) =
+ {
+ n := (GPR[RB])[58 .. 63];
+ r := ROTL (GPR[RS],n);
+ e := [me[5]] : me[0 .. 4];
+ m := MASK (0,e);
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[6], bit[6], bit) Rldimi
+
+function clause decode (0b011110 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+(bit[6]) mb :
+0b011 :
+(bit[1]) _ :
+[Rc] as instr) =
+ Rldimi (RS,RA,instr[16 .. 20] : instr[30 .. 30],mb,Rc)
+
+function clause execute (Rldimi (RS, RA, sh, mb, Rc)) =
+ {
+ n := [sh[5]] : sh[0 .. 4];
+ r := ROTL (GPR[RS],n);
+ b := [mb[5]] : mb[0 .. 4];
+ m := MASK (b,(bit[5]) (~ (n)));
+ (bit[64]) temp := (r & m | GPR[RA] & ~ (m));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Slw
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000011000 :
+[Rc] as instr) =
+ Slw (RS,RA,RB,Rc)
+
+function clause execute (Slw (RS, RA, RB, Rc)) =
+ {
+ n := (GPR[RB])[59 .. 63];
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],n);
+ if (GPR[RB])[58] == 0
+ then m := MASK (32,63 - n)
+ else m := 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Srw
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1000011000 :
+[Rc] as instr) =
+ Srw (RS,RA,RB,Rc)
+
+function clause execute (Srw (RS, RA, RB, Rc)) =
+ {
+ n := (GPR[RB])[59 .. 63];
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],64 - n);
+ if (GPR[RB])[58] == 0
+ then m := MASK (n + 32,63)
+ else m := 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Srawi
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) SH :
+0b1100111000 :
+[Rc] as instr) =
+ Srawi (RS,RA,SH,Rc)
+
+function clause execute (Srawi (RS, RA, SH, Rc)) =
+ {
+ n := SH;
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],64 - n);
+ m := MASK (n + 32,63);
+ s := (GPR[RS])[32];
+ (bit[64]) temp := (r & m | s ^^ 64 & ~ (m));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ();
+ XER.CA := if n >_u (bit[5]) 0 then s & ~ ((r & ~ (m)) == 0) else 0
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Sraw
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1100011000 :
+[Rc] as instr) =
+ Sraw (RS,RA,RB,Rc)
+
+function clause execute (Sraw (RS, RA, RB, Rc)) =
+ {
+ n := (GPR[RB])[59 .. 63];
+ r := ROTL ((GPR[RS])[32 .. 63] : (GPR[RS])[32 .. 63],64 - n);
+ if (GPR[RB])[58] == 0
+ then m := MASK (n + 32,63)
+ else m := 0b0000000000000000000000000000000000000000000000000000000000000000;
+ s := (GPR[RS])[32];
+ (bit[64]) temp := (r & m | s ^^ 64 & ~ (m));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ();
+ XER.CA := if n >_u (bit[5]) 0 then s & ~ ((r & ~ (m)) == 0) else 0
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Sld
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000011011 :
+[Rc] as instr) =
+ Sld (RS,RA,RB,Rc)
+
+function clause execute (Sld (RS, RA, RB, Rc)) =
+ {
+ n := (GPR[RB])[58 .. 63];
+ r := ROTL (GPR[RS],n);
+ if (GPR[RB])[57] == 0
+ then m := MASK (0,63 - n)
+ else m := 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Srd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1000011011 :
+[Rc] as instr) =
+ Srd (RS,RA,RB,Rc)
+
+function clause execute (Srd (RS, RA, RB, Rc)) =
+ {
+ n := (GPR[RB])[58 .. 63];
+ r := ROTL (GPR[RS],64 - n);
+ if (GPR[RB])[57] == 0
+ then m := MASK (n,63)
+ else m := 0b0000000000000000000000000000000000000000000000000000000000000000;
+ (bit[64]) temp := (r & m);
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ()
+ }
+
+union ast member (bit[5], bit[5], bit[6], bit) Sradi
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b110011101 :
+(bit[1]) _ :
+[Rc] as instr) =
+ Sradi (RS,RA,instr[16 .. 20] : instr[30 .. 30],Rc)
+
+function clause execute (Sradi (RS, RA, sh, Rc)) =
+ {
+ n := [sh[5]] : sh[0 .. 4];
+ r := ROTL (GPR[RS],64 - n);
+ m := MASK (n,63);
+ s := (GPR[RS])[0];
+ (bit[64]) temp := (r & m | s ^^ 64 & ~ (m));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ();
+ XER.CA := if n >_u (bit[5]) 0 then s & ~ ((r & ~ (m)) == 0) else 0
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Srad
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1100011010 :
+[Rc] as instr) =
+ Srad (RS,RA,RB,Rc)
+
+function clause execute (Srad (RS, RA, RB, Rc)) =
+ {
+ n := (GPR[RB])[58 .. 63];
+ r := ROTL (GPR[RS],64 - n);
+ if (GPR[RB])[57] == 0
+ then m := MASK (n,63)
+ else m := 0b0000000000000000000000000000000000000000000000000000000000000000;
+ s := (GPR[RS])[0];
+ (bit[64]) temp := (r & m | s ^^ 64 & ~ (m));
+ GPR[RA] := temp;
+ if Rc then set_overflow_cr0 (temp,XER.SO) else ();
+ XER.CA := if n >_u (bit[5]) 0 then s & ~ ((r & ~ (m)) == 0) else 0
+ }
+
+union ast member (bit[5], bit[5]) Cdtbcd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0100011010 :
+(bit[1]) _ as instr) =
+ Cdtbcd (RS,RA)
+
+function clause execute (Cdtbcd (RS, RA)) =
+ foreach (i from 0 to 1 by 1 in inc)
+ {
+ n := i * 32;
+ (GPR[RA])[n + 0..n + 7] := (bit[8]) 0;
+ (GPR[RA])[n + 8..n + 19] := DEC_TO_BCD ((GPR[RS])[n + 12 .. n + 21]);
+ (GPR[RA])[n + 20..n + 31] := DEC_TO_BCD ((GPR[RS])[n + 22 .. n + 31])
+ }
+
+union ast member (bit[5], bit[5]) Cbcdtd
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0100111010 :
+(bit[1]) _ as instr) =
+ Cbcdtd (RS,RA)
+
+function clause execute (Cbcdtd (RS, RA)) =
+ foreach (i from 0 to 1 by 1 in inc)
+ {
+ n := i * 32;
+ (GPR[RA])[n + 0..n + 11] := (bit[12]) 0;
+ (GPR[RA])[n + 12..n + 21] := BCD_TO_DEC ((GPR[RS])[n + 8 .. n + 19]);
+ (GPR[RA])[n + 22..n + 31] := BCD_TO_DEC ((GPR[RS])[n + 20 .. n + 31])
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Addg6s
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+(bit[1]) _ :
+0b001001010 :
+(bit[1]) _ as instr) =
+ Addg6s (RT,RA,RB)
+
+function clause execute (Addg6s (RT, RA, RB)) =
+ {
+ (bit[16]) dc := 0;
+ foreach (i from 0 to 15 by 1 in inc)
+ let (v, _, co) = ((GPR[RA])[4 * i .. 63] + (GPR[RB])[4 * i .. 63]) in
+ dc[i] := carry_out (v,co);
+ c :=
+ (dc[0] ^^ 4) :
+ (dc[1] ^^ 4) :
+ (dc[2] ^^ 4) :
+ (dc[3] ^^ 4) :
+ (dc[4] ^^ 4) :
+ (dc[5] ^^ 4) :
+ (dc[6] ^^ 4) :
+ (dc[7] ^^ 4) :
+ (dc[8] ^^ 4) :
+ (dc[9] ^^ 4) :
+ (dc[10] ^^ 4) :
+ (dc[11] ^^ 4) :
+ (dc[12] ^^ 4) :
+ (dc[13] ^^ 4) : (dc[14] ^^ 4) : (dc[15] ^^ 4);
+ GPR[RT] :=
+ (~ (c) &
+ 0b0110011001100110011001100110011001100110011001100110011001100110)
+ }
+
union ast member (bit[5], bit[10]) Mtspr
function clause decode (0b011111 :
@@ -1357,7 +3740,18 @@ function clause execute (Mtspr (RS, spr)) =
{
n := spr[5 .. 9] : spr[0 .. 4];
if n == 13
- then trap ()
+ then trap (())
+ else if n == 1
+ then {
+ (bit[64]) reg := GPR[RS];
+ (bit[32]) front := zero_or_undef (reg[0 .. 31]);
+ (bit) xer_so := reg[32];
+ (bit) xer_ov := reg[33];
+ (bit) xer_ca := reg[34];
+ (bit[22]) mid := zero_or_undef (reg[35 .. 56]);
+ (bit[7]) bot := reg[57 .. 63];
+ XER := front : [xer_so] : [xer_ov] : [xer_ca] : mid : bot
+ }
else if length (SPR[n]) == 64
then SPR[n] := GPR[RS]
else SPR[n] := (GPR[RS])[32 .. 63]
@@ -1417,6 +3811,149 @@ function clause decode (0b011111 :
function clause execute (Mfcr (RT)) =
GPR[RT] := 0b00000000000000000000000000000000 : CR
+union ast member (bit[5], bit[8]) Mtocrf
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+0b1 :
+(bit[8]) FXM :
+(bit[1]) _ :
+0b0010010000 :
+(bit[1]) _ as instr) =
+ Mtocrf (RS,FXM)
+
+function clause execute (Mtocrf (RS, FXM)) =
+ {
+ ([|7|]) n := 0;
+ count := 0;
+ foreach (i from 0 to 7 by 1 in inc)
+ if FXM[i] == 1
+ then {
+ n := i;
+ count := count + 1
+ }
+ else ();
+ if count == 1
+ then CR[4 * n + 32..4 * n + 35] := (GPR[RS])[4 * n + 32 .. 4 * n + 35]
+ else CR := undefined
+ }
+
+union ast member (bit[5], bit[8]) Mfocrf
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+0b1 :
+(bit[8]) FXM :
+(bit[1]) _ :
+0b0000010011 :
+(bit[1]) _ as instr) =
+ Mfocrf (RT,FXM)
+
+function clause execute (Mfocrf (RT, FXM)) =
+ {
+ ([|7|]) n := 0;
+ count := 0;
+ foreach (i from 0 to 7 by 1 in inc)
+ if FXM[i] == 1
+ then {
+ n := i;
+ count := count + 1
+ }
+ else ();
+ if count == 1
+ then {
+ (bit[64]) temp := undefined;
+ temp[4 * n + 32..4 * n + 35] := CR[4 * n + 32 .. 4 * n + 35];
+ GPR[RT] := temp
+ }
+ else GPR[RT] := undefined
+ }
+
+union ast member (bit[3]) Mcrxr
+
+function clause decode (0b011111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) _ :
+(bit[5]) _ :
+0b1000000000 :
+(bit[1]) _ as instr) =
+ Mcrxr (BF)
+
+function clause execute (Mcrxr (BF)) =
+ {
+ CR[4 * BF + 32..4 * BF + 35] := XER[32 .. 35];
+ XER[32..35] := 0b0000
+ }
+
+union ast member (bit[5], bit[5]) Mtdcrux
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0110100011 :
+(bit[1]) _ as instr) =
+ Mtdcrux (RS,RA)
+
+function clause execute (Mtdcrux (RS, RA)) =
+ {
+ DCRN := GPR[RA];
+ DCR[DCRN] := GPR[RS]
+ }
+
+union ast member (bit[5], bit[5]) Mfdcrux
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) _ :
+0b0100100011 :
+(bit[1]) _ as instr) =
+ Mfdcrux (RT,RA)
+
+function clause execute (Mfdcrux (RT, RA)) =
+ {
+ DCRN := GPR[RA];
+ GPR[RT] := DCR[DCRN]
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Lfs
+
+function clause decode (0b110000 :
+(bit[5]) FRT :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Lfs (FRT,RA,D)
+
+function clause execute (Lfs (FRT, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ FPR[FRT] := DOUBLE (MEMr (EA,4))
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lfsx
+
+function clause decode (0b011111 :
+(bit[5]) FRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1000010111 :
+(bit[1]) _ as instr) =
+ Lfsx (FRT,RA,RB)
+
+function clause execute (Lfsx (FRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ FPR[FRT] := DOUBLE (MEMr (EA,4))
+ }
+
union ast member (bit[5], bit[5], bit[16]) Lfsu
function clause decode (0b110001 :
@@ -1468,6 +4005,25 @@ function clause execute (Lfd (FRT, RA, D)) =
FPR[FRT] := MEMr (EA,8)
}
+union ast member (bit[5], bit[5], bit[5]) Lfdx
+
+function clause decode (0b011111 :
+(bit[5]) FRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1001010111 :
+(bit[1]) _ as instr) =
+ Lfdx (FRT,RA,RB)
+
+function clause execute (Lfdx (FRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ FPR[FRT] := MEMr (EA,8)
+ }
+
union ast member (bit[5], bit[5], bit[16]) Lfdu
function clause decode (0b110011 :
@@ -1502,6 +4058,80 @@ function clause execute (Lfdux (FRT, RA, RB)) =
GPR[RA] := EA
}
+union ast member (bit[5], bit[5], bit[5]) Lfiwax
+
+function clause decode (0b011111 :
+(bit[5]) FRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1101010111 :
+(bit[1]) _ as instr) =
+ Lfiwax (FRT,RA,RB)
+
+function clause execute (Lfiwax (FRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ FPR[FRT] := EXTS (MEMr (EA,4))
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lfiwzx
+
+function clause decode (0b011111 :
+(bit[5]) FRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1101110111 :
+(bit[1]) _ as instr) =
+ Lfiwzx (FRT,RA,RB)
+
+function clause execute (Lfiwzx (FRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ FPR[FRT] := 0b00000000000000000000000000000000 : MEMr (EA,4)
+ }
+
+union ast member (bit[5], bit[5], bit[16]) Stfs
+
+function clause decode (0b110100 :
+(bit[5]) FRS :
+(bit[5]) RA :
+(bit[16]) D as instr) =
+ Stfs (FRS,RA,D)
+
+function clause execute (Stfs (FRS, RA, D)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + EXTS (D);
+ MEMw(EA,4) := SINGLE (FPR[FRS])
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stfsx
+
+function clause decode (0b011111 :
+(bit[5]) FRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1010010111 :
+(bit[1]) _ as instr) =
+ Stfsx (FRS,RA,RB)
+
+function clause execute (Stfsx (FRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,4) := SINGLE (FPR[FRS])
+ }
+
union ast member (bit[5], bit[5], bit[16]) Stfsu
function clause decode (0b110101 :
@@ -1553,6 +4183,25 @@ function clause execute (Stfd (FRS, RA, D)) =
MEMw(EA,8) := FPR[FRS]
}
+union ast member (bit[5], bit[5], bit[5]) Stfdx
+
+function clause decode (0b011111 :
+(bit[5]) FRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1011010111 :
+(bit[1]) _ as instr) =
+ Stfdx (FRS,RA,RB)
+
+function clause execute (Stfdx (FRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,8) := FPR[FRS]
+ }
+
union ast member (bit[5], bit[5], bit[16]) Stfdu
function clause decode (0b110111 :
@@ -1587,6 +4236,25 @@ function clause execute (Stfdux (FRS, RA, RB)) =
GPR[RA] := EA
}
+union ast member (bit[5], bit[5], bit[5]) Stfiwx
+
+function clause decode (0b011111 :
+(bit[5]) FRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1111010111 :
+(bit[1]) _ as instr) =
+ Stfiwx (FRS,RA,RB)
+
+function clause execute (Stfiwx (FRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA,4) := (FPR[FRS])[32 .. 63]
+ }
+
union ast member (bit[5], bit[5], bit[14]) Lfdp
function clause decode (0b111001 :
@@ -1663,6 +4331,621 @@ function clause execute (Stfdpx (FRSp, RA, RB)) =
MEMw(EA,16) := FPRp[FRSp]
}
+union ast member (bit[5], bit[5], bit) Fmr
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0001001000 :
+[Rc] as instr) =
+ Fmr (FRT,FRB,Rc)
+
+function clause execute (Fmr (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fneg
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0000101000 :
+[Rc] as instr) =
+ Fneg (FRT,FRB,Rc)
+
+function clause execute (Fneg (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fabs
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0100001000 :
+[Rc] as instr) =
+ Fabs (FRT,FRB,Rc)
+
+function clause execute (Fabs (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fnabs
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0010001000 :
+[Rc] as instr) =
+ Fnabs (FRT,FRB,Rc)
+
+function clause execute (Fnabs (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fcpsgn
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0000001000 :
+[Rc] as instr) =
+ Fcpsgn (FRT,FRA,FRB,Rc)
+
+function clause execute (Fcpsgn (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fadds
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10101 :
+[Rc] as instr) =
+ Fadds (FRT,FRA,FRB,Rc)
+
+function clause execute (Fadds (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fadd
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10101 :
+[Rc] as instr) =
+ Fadd (FRT,FRA,FRB,Rc)
+
+function clause execute (Fadd (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fsubs
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10100 :
+[Rc] as instr) =
+ Fsubs (FRT,FRA,FRB,Rc)
+
+function clause execute (Fsubs (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fsub
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10100 :
+[Rc] as instr) =
+ Fsub (FRT,FRA,FRB,Rc)
+
+function clause execute (Fsub (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fmuls
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) _ :
+(bit[5]) FRC :
+0b11001 :
+[Rc] as instr) =
+ Fmuls (FRT,FRA,FRC,Rc)
+
+function clause execute (Fmuls (FRT, FRA, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fmul
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) _ :
+(bit[5]) FRC :
+0b11001 :
+[Rc] as instr) =
+ Fmul (FRT,FRA,FRC,Rc)
+
+function clause execute (Fmul (FRT, FRA, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fdivs
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10010 :
+[Rc] as instr) =
+ Fdivs (FRT,FRA,FRB,Rc)
+
+function clause execute (Fdivs (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Fdiv
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10010 :
+[Rc] as instr) =
+ Fdiv (FRT,FRA,FRB,Rc)
+
+function clause execute (Fdiv (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fsqrts
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10110 :
+[Rc] as instr) =
+ Fsqrts (FRT,FRB,Rc)
+
+function clause execute (Fsqrts (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fsqrt
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b10110 :
+[Rc] as instr) =
+ Fsqrt (FRT,FRB,Rc)
+
+function clause execute (Fsqrt (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fres
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b11000 :
+[Rc] as instr) =
+ Fres (FRT,FRB,Rc)
+
+function clause execute (Fres (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fre
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b11000 :
+[Rc] as instr) =
+ Fre (FRT,FRB,Rc)
+
+function clause execute (Fre (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Frsqrtes
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b11010 :
+[Rc] as instr) =
+ Frsqrtes (FRT,FRB,Rc)
+
+function clause execute (Frsqrtes (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Frsqrte
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+(bit[5]) _ :
+0b11010 :
+[Rc] as instr) =
+ Frsqrte (FRT,FRB,Rc)
+
+function clause execute (Frsqrte (FRT, FRB, Rc)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Ftdiv
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0010000000 :
+(bit[1]) _ as instr) =
+ Ftdiv (BF,FRA,FRB)
+
+function clause execute (Ftdiv (BF, FRA, FRB)) = ()
+
+union ast member (bit[3], bit[5]) Ftsqrt
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0010100000 :
+(bit[1]) _ as instr) =
+ Ftsqrt (BF,FRB)
+
+function clause execute (Ftsqrt (BF, FRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fmadds
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11101 :
+[Rc] as instr) =
+ Fmadds (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fmadds (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fmadd
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11101 :
+[Rc] as instr) =
+ Fmadd (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fmadd (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fmsubs
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11100 :
+[Rc] as instr) =
+ Fmsubs (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fmsubs (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fmsub
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11100 :
+[Rc] as instr) =
+ Fmsub (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fmsub (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fnmadds
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11111 :
+[Rc] as instr) =
+ Fnmadds (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fnmadds (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fnmadd
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11111 :
+[Rc] as instr) =
+ Fnmadd (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fnmadd (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fnmsubs
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11110 :
+[Rc] as instr) =
+ Fnmsubs (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fnmsubs (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fnmsub
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b11110 :
+[Rc] as instr) =
+ Fnmsub (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fnmsub (FRT, FRA, FRB, FRC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Frsp
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0000001100 :
+[Rc] as instr) =
+ Frsp (FRT,FRB,Rc)
+
+function clause execute (Frsp (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctid
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1100101110 :
+[Rc] as instr) =
+ Fctid (FRT,FRB,Rc)
+
+function clause execute (Fctid (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctidz
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1100101111 :
+[Rc] as instr) =
+ Fctidz (FRT,FRB,Rc)
+
+function clause execute (Fctidz (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctidu
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1110101110 :
+[Rc] as instr) =
+ Fctidu (FRT,FRB,Rc)
+
+function clause execute (Fctidu (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctiduz
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1110101111 :
+[Rc] as instr) =
+ Fctiduz (FRT,FRB,Rc)
+
+function clause execute (Fctiduz (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctiw
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0000001110 :
+[Rc] as instr) =
+ Fctiw (FRT,FRB,Rc)
+
+function clause execute (Fctiw (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctiwz
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0000001111 :
+[Rc] as instr) =
+ Fctiwz (FRT,FRB,Rc)
+
+function clause execute (Fctiwz (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctiwu
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0010001110 :
+[Rc] as instr) =
+ Fctiwu (FRT,FRB,Rc)
+
+function clause execute (Fctiwu (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fctiwuz
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0010001111 :
+[Rc] as instr) =
+ Fctiwuz (FRT,FRB,Rc)
+
+function clause execute (Fctiwuz (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fcfid
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1101001110 :
+[Rc] as instr) =
+ Fcfid (FRT,FRB,Rc)
+
+function clause execute (Fcfid (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fcfidu
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1111001110 :
+[Rc] as instr) =
+ Fcfidu (FRT,FRB,Rc)
+
+function clause execute (Fcfidu (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fcfids
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1101001110 :
+[Rc] as instr) =
+ Fcfids (FRT,FRB,Rc)
+
+function clause execute (Fcfids (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Fcfidus
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1111001110 :
+[Rc] as instr) =
+ Fcfidus (FRT,FRB,Rc)
+
+function clause execute (Fcfidus (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Frin
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0110001000 :
+[Rc] as instr) =
+ Frin (FRT,FRB,Rc)
+
+function clause execute (Frin (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Frip
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0111001000 :
+[Rc] as instr) =
+ Frip (FRT,FRB,Rc)
+
+function clause execute (Frip (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Friz
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0110101000 :
+[Rc] as instr) =
+ Friz (FRT,FRB,Rc)
+
+function clause execute (Friz (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Frim
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0111101000 :
+[Rc] as instr) =
+ Frim (FRT,FRB,Rc)
+
+function clause execute (Frim (FRT, FRB, Rc)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Fcmpu
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0000000000 :
+(bit[1]) _ as instr) =
+ Fcmpu (BF,FRA,FRB)
+
+function clause execute (Fcmpu (BF, FRA, FRB)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Fcmpo
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0000100000 :
+(bit[1]) _ as instr) =
+ Fcmpo (BF,FRA,FRB)
+
+function clause execute (Fcmpo (BF, FRA, FRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit) Fsel
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[5]) FRC :
+0b10111 :
+[Rc] as instr) =
+ Fsel (FRT,FRA,FRB,FRC,Rc)
+
+function clause execute (Fsel (FRT, FRA, FRB, FRC, Rc)) = ()
+
union ast member (bit[5], bit) Mffs
function clause decode (0b111111 :
@@ -1689,6 +4972,761 @@ function clause decode (0b111111 :
function clause execute (Mcrfs (BF, BFA)) = ()
+union ast member (bit[3], bit, bit[4], bit) Mtfsfi
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[4]) _ :
+[W] :
+(bit[4]) U :
+(bit[1]) _ :
+0b0010000110 :
+[Rc] as instr) =
+ Mtfsfi (BF,W,U,Rc)
+
+function clause execute (Mtfsfi (BF, W, U, Rc)) = ()
+
+union ast member (bit, bit[8], bit, bit[5], bit) Mtfsf
+
+function clause decode (0b111111 :
+[L] :
+(bit[8]) FLM :
+[W] :
+(bit[5]) FRB :
+0b1011000111 :
+[Rc] as instr) =
+ Mtfsf (L,FLM,W,FRB,Rc)
+
+function clause execute (Mtfsf (L, FLM, W, FRB, Rc)) = ()
+
+union ast member (bit[5], bit) Mtfsb0
+
+function clause decode (0b111111 :
+(bit[5]) BT :
+(bit[5]) _ :
+(bit[5]) _ :
+0b0001000110 :
+[Rc] as instr) =
+ Mtfsb0 (BT,Rc)
+
+function clause execute (Mtfsb0 (BT, Rc)) = ()
+
+union ast member (bit[5], bit) Mtfsb1
+
+function clause decode (0b111111 :
+(bit[5]) BT :
+(bit[5]) _ :
+(bit[5]) _ :
+0b0000100110 :
+[Rc] as instr) =
+ Mtfsb1 (BT,Rc)
+
+function clause execute (Mtfsb1 (BT, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Daddq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b0000000010 :
+[Rc] as instr) =
+ Daddq (FRTp,FRAp,FRBp,Rc)
+
+function clause execute (Daddq (FRTp, FRAp, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Dadd
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0000000010 :
+[Rc] as instr) =
+ Dadd (FRT,FRA,FRB,Rc)
+
+function clause execute (Dadd (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Dsubq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b1000000010 :
+[Rc] as instr) =
+ Dsubq (FRTp,FRAp,FRBp,Rc)
+
+function clause execute (Dsubq (FRTp, FRAp, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Dsub
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b1000000010 :
+[Rc] as instr) =
+ Dsub (FRT,FRA,FRB,Rc)
+
+function clause execute (Dsub (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Dmulq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b0000100010 :
+[Rc] as instr) =
+ Dmulq (FRTp,FRAp,FRBp,Rc)
+
+function clause execute (Dmulq (FRTp, FRAp, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Dmul
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0000100010 :
+[Rc] as instr) =
+ Dmul (FRT,FRA,FRB,Rc)
+
+function clause execute (Dmul (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Ddivq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b1000100010 :
+[Rc] as instr) =
+ Ddivq (FRTp,FRAp,FRBp,Rc)
+
+function clause execute (Ddivq (FRTp, FRAp, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Ddiv
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b1000100010 :
+[Rc] as instr) =
+ Ddiv (FRT,FRA,FRB,Rc)
+
+function clause execute (Ddiv (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dcmpuq
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b1010000010 :
+(bit[1]) _ as instr) =
+ Dcmpuq (BF,FRAp,FRBp)
+
+function clause execute (Dcmpuq (BF, FRAp, FRBp)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dcmpu
+
+function clause decode (0b111011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b1010000010 :
+(bit[1]) _ as instr) =
+ Dcmpu (BF,FRA,FRB)
+
+function clause execute (Dcmpu (BF, FRA, FRB)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dcmpoq
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b0010000010 :
+(bit[1]) _ as instr) =
+ Dcmpoq (BF,FRAp,FRBp)
+
+function clause execute (Dcmpoq (BF, FRAp, FRBp)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dcmpo
+
+function clause decode (0b111011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0010000010 :
+(bit[1]) _ as instr) =
+ Dcmpo (BF,FRA,FRB)
+
+function clause execute (Dcmpo (BF, FRA, FRB)) = ()
+
+union ast member (bit[3], bit[5], bit[6]) Dtstdcq
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRAp :
+(bit[6]) DCM :
+0b011000010 :
+(bit[1]) _ as instr) =
+ Dtstdcq (BF,FRAp,DCM)
+
+function clause execute (Dtstdcq (BF, FRAp, DCM)) = ()
+
+union ast member (bit[3], bit[5], bit[6]) Dtstdc
+
+function clause decode (0b111011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[6]) DCM :
+0b011000010 :
+(bit[1]) _ as instr) =
+ Dtstdc (BF,FRA,DCM)
+
+function clause execute (Dtstdc (BF, FRA, DCM)) = ()
+
+union ast member (bit[3], bit[5], bit[6]) Dtstdgq
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRAp :
+(bit[6]) DGM :
+0b011100010 :
+(bit[1]) _ as instr) =
+ Dtstdgq (BF,FRAp,DGM)
+
+function clause execute (Dtstdgq (BF, FRAp, DGM)) = ()
+
+union ast member (bit[3], bit[5], bit[6]) Dtstdg
+
+function clause decode (0b111011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[6]) DGM :
+0b011100010 :
+(bit[1]) _ as instr) =
+ Dtstdg (BF,FRA,DGM)
+
+function clause execute (Dtstdg (BF, FRA, DGM)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dtstexq
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+0b0010100010 :
+(bit[1]) _ as instr) =
+ Dtstexq (BF,FRAp,FRBp)
+
+function clause execute (Dtstexq (BF, FRAp, FRBp)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dtstex
+
+function clause decode (0b111011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b0010100010 :
+(bit[1]) _ as instr) =
+ Dtstex (BF,FRA,FRB)
+
+function clause execute (Dtstex (BF, FRA, FRB)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dtstsfq
+
+function clause decode (0b111111 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRBp :
+0b1010100010 :
+(bit[1]) _ as instr) =
+ Dtstsfq (BF,FRA,FRBp)
+
+function clause execute (Dtstsfq (BF, FRA, FRBp)) = ()
+
+union ast member (bit[3], bit[5], bit[5]) Dtstsf
+
+function clause decode (0b111011 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b1010100010 :
+(bit[1]) _ as instr) =
+ Dtstsf (BF,FRA,FRB)
+
+function clause execute (Dtstsf (BF, FRA, FRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit) Dquaiq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) TE :
+(bit[5]) FRBp :
+(bit[2]) RMC :
+0b01000011 :
+[Rc] as instr) =
+ Dquaiq (FRTp,TE,FRBp,RMC,Rc)
+
+function clause execute (Dquaiq (FRTp, TE, FRBp, RMC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit) Dquai
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) TE :
+(bit[5]) FRB :
+(bit[2]) RMC :
+0b01000011 :
+[Rc] as instr) =
+ Dquai (FRT,TE,FRB,RMC,Rc)
+
+function clause execute (Dquai (FRT, TE, FRB, RMC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit) Dquaq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[5]) FRBp :
+(bit[2]) RMC :
+0b00000011 :
+[Rc] as instr) =
+ Dquaq (FRTp,FRAp,FRBp,RMC,Rc)
+
+function clause execute (Dquaq (FRTp, FRAp, FRBp, RMC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit) Dqua
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[2]) RMC :
+0b00000011 :
+[Rc] as instr) =
+ Dqua (FRT,FRA,FRB,RMC,Rc)
+
+function clause execute (Dqua (FRT, FRA, FRB, RMC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit) Drrndq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRA :
+(bit[5]) FRBp :
+(bit[2]) RMC :
+0b00100011 :
+[Rc] as instr) =
+ Drrndq (FRTp,FRA,FRBp,RMC,Rc)
+
+function clause execute (Drrndq (FRTp, FRA, FRBp, RMC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit) Drrnd
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+(bit[2]) RMC :
+0b00100011 :
+[Rc] as instr) =
+ Drrnd (FRT,FRA,FRB,RMC,Rc)
+
+function clause execute (Drrnd (FRT, FRA, FRB, RMC, Rc)) = ()
+
+union ast member (bit[5], bit, bit[5], bit[2], bit) Drintxq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[4]) _ :
+[R] :
+(bit[5]) FRBp :
+(bit[2]) RMC :
+0b01100011 :
+[Rc] as instr) =
+ Drintxq (FRTp,R,FRBp,RMC,Rc)
+
+function clause execute (Drintxq (FRTp, R, FRBp, RMC, Rc)) = ()
+
+union ast member (bit[5], bit, bit[5], bit[2], bit) Drintx
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[4]) _ :
+[R] :
+(bit[5]) FRB :
+(bit[2]) RMC :
+0b01100011 :
+[Rc] as instr) =
+ Drintx (FRT,R,FRB,RMC,Rc)
+
+function clause execute (Drintx (FRT, R, FRB, RMC, Rc)) = ()
+
+union ast member (bit[5], bit, bit[5], bit[2], bit) Drintnq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[4]) _ :
+[R] :
+(bit[5]) FRBp :
+(bit[2]) RMC :
+0b11100011 :
+[Rc] as instr) =
+ Drintnq (FRTp,R,FRBp,RMC,Rc)
+
+function clause execute (Drintnq (FRTp, R, FRBp, RMC, Rc)) = ()
+
+union ast member (bit[5], bit, bit[5], bit[2], bit) Drintn
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[4]) _ :
+[R] :
+(bit[5]) FRB :
+(bit[2]) RMC :
+0b11100011 :
+[Rc] as instr) =
+ Drintn (FRT,R,FRB,RMC,Rc)
+
+function clause execute (Drintn (FRT, R, FRB, RMC, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dctdp
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0100000010 :
+[Rc] as instr) =
+ Dctdp (FRT,FRB,Rc)
+
+function clause execute (Dctdp (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dctqpq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0100000010 :
+[Rc] as instr) =
+ Dctqpq (FRTp,FRB,Rc)
+
+function clause execute (Dctqpq (FRTp, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Drsp
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1100000010 :
+[Rc] as instr) =
+ Drsp (FRT,FRB,Rc)
+
+function clause execute (Drsp (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Drdpq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) _ :
+(bit[5]) FRBp :
+0b1100000010 :
+[Rc] as instr) =
+ Drdpq (FRTp,FRBp,Rc)
+
+function clause execute (Drdpq (FRTp, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dcffix
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1100100010 :
+[Rc] as instr) =
+ Dcffix (FRT,FRB,Rc)
+
+function clause execute (Dcffix (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dcffixq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b1100100010 :
+[Rc] as instr) =
+ Dcffixq (FRTp,FRB,Rc)
+
+function clause execute (Dcffixq (FRTp, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dctfixq
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRBp :
+0b0100100010 :
+[Rc] as instr) =
+ Dctfixq (FRT,FRBp,Rc)
+
+function clause execute (Dctfixq (FRT, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dctfix
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0100100010 :
+[Rc] as instr) =
+ Dctfix (FRT,FRB,Rc)
+
+function clause execute (Dctfix (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[2], bit[5], bit) Ddedpdq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[2]) SP :
+(bit[3]) _ :
+(bit[5]) FRBp :
+0b0101000010 :
+[Rc] as instr) =
+ Ddedpdq (FRTp,SP,FRBp,Rc)
+
+function clause execute (Ddedpdq (FRTp, SP, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[2], bit[5], bit) Ddedpd
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[2]) SP :
+(bit[3]) _ :
+(bit[5]) FRB :
+0b0101000010 :
+[Rc] as instr) =
+ Ddedpd (FRT,SP,FRB,Rc)
+
+function clause execute (Ddedpd (FRT, SP, FRB, Rc)) = ()
+
+union ast member (bit[5], bit, bit[5], bit) Denbcdq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+[S] :
+(bit[4]) _ :
+(bit[5]) FRBp :
+0b1101000010 :
+[Rc] as instr) =
+ Denbcdq (FRTp,S,FRBp,Rc)
+
+function clause execute (Denbcdq (FRTp, S, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit, bit[5], bit) Denbcd
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+[S] :
+(bit[4]) _ :
+(bit[5]) FRB :
+0b1101000010 :
+[Rc] as instr) =
+ Denbcd (FRT,S,FRB,Rc)
+
+function clause execute (Denbcd (FRT, S, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dxexq
+
+function clause decode (0b111111 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRBp :
+0b0101100010 :
+[Rc] as instr) =
+ Dxexq (FRT,FRBp,Rc)
+
+function clause execute (Dxexq (FRT, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit) Dxex
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) _ :
+(bit[5]) FRB :
+0b0101100010 :
+[Rc] as instr) =
+ Dxex (FRT,FRB,Rc)
+
+function clause execute (Dxex (FRT, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Diexq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRA :
+(bit[5]) FRBp :
+0b1101100010 :
+[Rc] as instr) =
+ Diexq (FRTp,FRA,FRBp,Rc)
+
+function clause execute (Diexq (FRTp, FRA, FRBp, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Diex
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[5]) FRB :
+0b1101100010 :
+[Rc] as instr) =
+ Diex (FRT,FRA,FRB,Rc)
+
+function clause execute (Diex (FRT, FRA, FRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[6], bit) Dscliq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[6]) SH :
+0b001000010 :
+[Rc] as instr) =
+ Dscliq (FRTp,FRAp,SH,Rc)
+
+function clause execute (Dscliq (FRTp, FRAp, SH, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[6], bit) Dscli
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[6]) SH :
+0b001000010 :
+[Rc] as instr) =
+ Dscli (FRT,FRA,SH,Rc)
+
+function clause execute (Dscli (FRT, FRA, SH, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[6], bit) Dscriq
+
+function clause decode (0b111111 :
+(bit[5]) FRTp :
+(bit[5]) FRAp :
+(bit[6]) SH :
+0b001100010 :
+[Rc] as instr) =
+ Dscriq (FRTp,FRAp,SH,Rc)
+
+function clause execute (Dscriq (FRTp, FRAp, SH, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[6], bit) Dscri
+
+function clause decode (0b111011 :
+(bit[5]) FRT :
+(bit[5]) FRA :
+(bit[6]) SH :
+0b001100010 :
+[Rc] as instr) =
+ Dscri (FRT,FRA,SH,Rc)
+
+function clause execute (Dscri (FRT, FRA, SH, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Lvebx
+
+function clause decode (0b011111 :
+(bit[5]) VRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000000111 :
+(bit[1]) _ as instr) =
+ Lvebx (VRT,RA,RB)
+
+function clause execute (Lvebx (VRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ eb := EA[60 .. 63];
+ VR[VRT] := undefined;
+ if bigendianmode
+ then (VR[VRT])[8 * eb..8 * eb + 7] := MEMr (EA,1)
+ else (VR[VRT])[120 - 8 * eb..127 - 8 * eb] := MEMr (EA,1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lvehx
+
+function clause decode (0b011111 :
+(bit[5]) VRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000100111 :
+(bit[1]) _ as instr) =
+ Lvehx (VRT,RA,RB)
+
+function clause execute (Lvehx (VRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA :=
+ (b + GPR[RB] &
+ 0b1111111111111111111111111111111111111111111111111111111111111110);
+ eb := EA[60 .. 63];
+ VR[VRT] := undefined;
+ if bigendianmode
+ then (VR[VRT])[8 * eb..8 * eb + 15] := MEMr (EA,2)
+ else (VR[VRT])[112 - 8 * eb..127 - 8 * eb] := MEMr (EA,2)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lvewx
+
+function clause decode (0b011111 :
+(bit[5]) VRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001000111 :
+(bit[1]) _ as instr) =
+ Lvewx (VRT,RA,RB)
+
+function clause execute (Lvewx (VRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA :=
+ (b + GPR[RB] &
+ 0b1111111111111111111111111111111111111111111111111111111111111100);
+ eb := EA[60 .. 63];
+ VR[VRT] := undefined;
+ if bigendianmode
+ then (VR[VRT])[8 * eb..8 * eb + 31] := MEMr (EA,4)
+ else (VR[VRT])[96 - 8 * eb..127 - 8 * eb] := MEMr (EA,4)
+ }
+
union ast member (bit[5], bit[5], bit[5]) Lvx
function clause decode (0b011111 :
@@ -1710,6 +5748,98 @@ function clause execute (Lvx (VRT, RA, RB)) =
(EA & 0b1111111111111111111111111111111111111111111111111111111111110000,16)
}
+union ast member (bit[5], bit[5], bit[5]) Lvxl
+
+function clause decode (0b011111 :
+(bit[5]) VRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0101100111 :
+(bit[1]) _ as instr) =
+ Lvxl (VRT,RA,RB)
+
+function clause execute (Lvxl (VRT, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ VR[VRT] :=
+ MEMr
+ (EA & 0b1111111111111111111111111111111111111111111111111111111111110000,16);
+ mark_as_not_likely_to_be_needed_again_anytime_soon (EA)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stvebx
+
+function clause decode (0b011111 :
+(bit[5]) VRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010000111 :
+(bit[1]) _ as instr) =
+ Stvebx (VRS,RA,RB)
+
+function clause execute (Stvebx (VRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ eb := EA[60 .. 63];
+ if bigendianmode
+ then MEMw(EA,1) := VRS[8 * eb .. 8 * eb + 7]
+ else MEMw(EA,1) := VRS[120 - 8 * eb .. 127 - 8 * eb]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stvehx
+
+function clause decode (0b011111 :
+(bit[5]) VRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010100111 :
+(bit[1]) _ as instr) =
+ Stvehx (VRS,RA,RB)
+
+function clause execute (Stvehx (VRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA :=
+ (b + GPR[RB] &
+ 0b1111111111111111111111111111111111111111111111111111111111111110);
+ eb := EA[60 .. 63];
+ if bigendianmode
+ then MEMw(EA,2) := VRS[8 * eb .. 8 * eb + 15]
+ else MEMw(EA,2) := VRS[112 - 8 * eb .. 127 - 8 * eb]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stvewx
+
+function clause decode (0b011111 :
+(bit[5]) VRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0011000111 :
+(bit[1]) _ as instr) =
+ Stvewx (VRS,RA,RB)
+
+function clause execute (Stvewx (VRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA :=
+ (b + GPR[RB] &
+ 0b1111111111111111111111111111111111111111111111111111111111111100);
+ eb := EA[60 .. 63];
+ if bigendianmode
+ then MEMw(EA,4) := VRS[8 * eb .. 8 * eb + 31]
+ else MEMw(EA,4) := VRS[96 - 8 * eb .. 127 - 8 * eb]
+ }
+
union ast member (bit[5], bit[5], bit[5]) Stvx
function clause decode (0b011111 :
@@ -1730,6 +5860,2215 @@ function clause execute (Stvx (VRS, RA, RB)) =
VR[VRS]
}
+union ast member (bit[5], bit[5], bit[5]) Stvxl
+
+function clause decode (0b011111 :
+(bit[5]) VRS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0111100111 :
+(bit[1]) _ as instr) =
+ Stvxl (VRS,RA,RB)
+
+function clause execute (Stvxl (VRS, RA, RB)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ MEMw(EA & 0b1111111111111111111111111111111111111111111111111111111111110000,16) :=
+ VR[VRS];
+ mark_as_not_likely_to_be_needed_again_anytime_soon (EA)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Lvsl
+
+function clause decode (0b011111 :
+(bit[5]) VRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000000110 :
+(bit[1]) _ as instr) =
+ Lvsl (VRT,RA,RB)
+
+function clause execute (Lvsl (VRT, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Lvsr
+
+function clause decode (0b011111 :
+(bit[5]) VRT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000100110 :
+(bit[1]) _ as instr) =
+ Lvsr (VRT,RA,RB)
+
+function clause execute (Lvsr (VRT, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vpkpx
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01100001110 as instr) =
+ Vpkpx (VRT,VRA,VRB)
+
+function clause execute (Vpkpx (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i] := (VR[VRA])[i * 2 + 7];
+ (VR[VRT])[i + 1..i + 5] := (VR[VRA])[i * 2 + 8 .. i * 2 + 12];
+ (VR[VRT])[i + 6..i + 10] := (VR[VRA])[i * 2 + 16 .. i * 2 + 20];
+ (VR[VRT])[i + 11..i + 15] := (VR[VRA])[i * 2 + 24 .. i * 2 + 28];
+ (VR[VRT])[i + 64] := (VR[VRB])[i * 2 + 7];
+ (VR[VRT])[i + 65..i + 69] := (VR[VRB])[i * 2 + 8 .. i * 2 + 12];
+ (VR[VRT])[i + 70..i + 74] := (VR[VRB])[i * 2 + 16 .. i * 2 + 20];
+ (VR[VRT])[i + 75..i + 79] := (VR[VRB])[i * 2 + 24 .. i * 2 + 28]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkshss
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00110001110 as instr) =
+ Vpkshss (VRT,VRA,VRB)
+
+function clause execute (Vpkshss (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ {
+ (VR[VRT])[i..i + 7] :=
+ (Clamp (EXTS ((VR[VRA])[i * 2 .. i * 2 + 15]),0 - 128,127))[24 .. 31];
+ (VR[VRT])[i + 64..i + 71] :=
+ (Clamp (EXTS ((VR[VRB])[i * 2 .. i * 2 + 15]),0 - 128,127))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkshus
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00100001110 as instr) =
+ Vpkshus (VRT,VRA,VRB)
+
+function clause execute (Vpkshus (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ {
+ (VR[VRT])[i..i + 7] :=
+ (Clamp (EXTS ((VR[VRA])[i * 2 .. i * 2 + 15]),0,255))[24 .. 31];
+ (VR[VRT])[i + 64..i + 71] :=
+ (Clamp (EXTS ((VR[VRB])[i * 2 .. i * 2 + 15]),0,255))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkswss
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00111001110 as instr) =
+ Vpkswss (VRT,VRA,VRB)
+
+function clause execute (Vpkswss (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i..i + 15] :=
+ (Clamp
+ (EXTS ((VR[VRA])[i * 2 .. i * 2 + 31]),0 - 0b1000000000000000,0b1000000000000000 -
+ 1))[16 .. 31];
+ (VR[VRT])[i + 64..i + 79] :=
+ (Clamp
+ (EXTS ((VR[VRB])[i * 2 .. i * 2 + 31]),0 - 0b1000000000000000,0b1000000000000000 -
+ 1))[16 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkswus
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00101001110 as instr) =
+ Vpkswus (VRT,VRA,VRB)
+
+function clause execute (Vpkswus (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i..i + 15] :=
+ (Clamp (EXTS ((VR[VRA])[i * 2 .. i * 2 + 31]),0,0b10000000000000000 - 1))[16 ..
+ 31];
+ (VR[VRT])[i + 64..i + 79] :=
+ (Clamp (EXTS ((VR[VRB])[i * 2 .. i * 2 + 31]),0,0b10000000000000000 - 1))[16 ..
+ 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkuhum
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000001110 as instr) =
+ Vpkuhum (VRT,VRA,VRB)
+
+function clause execute (Vpkuhum (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ {
+ (VR[VRT])[i..i + 7] := (VR[VRA])[i * 2 + 8 .. i * 2 + 15];
+ (VR[VRT])[i + 64..i + 71] := (VR[VRB])[i * 2 + 8 .. i * 2 + 15]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkuhus
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00010001110 as instr) =
+ Vpkuhus (VRT,VRA,VRB)
+
+function clause execute (Vpkuhus (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ {
+ (VR[VRT])[i..i + 7] :=
+ (Clamp (EXTZ ((VR[VRA])[i * 2 .. i * 2 + 15]),0,255))[24 .. 31];
+ (VR[VRT])[i + 64..i + 71] :=
+ (Clamp (EXTZ ((VR[VRB])[i * 2 .. i * 2 + 15]),0,255))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkuwum
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001001110 as instr) =
+ Vpkuwum (VRT,VRA,VRB)
+
+function clause execute (Vpkuwum (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i..i + 15] := (VR[VRA])[i * 2 + 16 .. i * 2 + 31];
+ (VR[VRT])[i + 64..i + 79] := (VR[VRB])[i * 2 + 16 .. i * 2 + 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vpkuwus
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00011001110 as instr) =
+ Vpkuwus (VRT,VRA,VRB)
+
+function clause execute (Vpkuwus (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i..i + 15] :=
+ (Clamp (EXTZ ((VR[VRA])[i * 2 .. i * 2 + 31]),0,0b10000000000000000 - 1))[16 ..
+ 31];
+ (VR[VRT])[i + 64..i + 79] :=
+ (Clamp (EXTZ ((VR[VRB])[i * 2 .. i * 2 + 31]),0,0b10000000000000000 - 1))[16 ..
+ 31]
+ }
+
+union ast member (bit[5], bit[5]) Vupkhpx
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01101001110 as instr) =
+ Vupkhpx (VRT,VRB)
+
+function clause execute (Vupkhpx (VRT, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 7] := EXTS ((VR[VRB])[i .. i]);
+ (VR[VRT])[i * 2 + 8..i * 2 + 15] := EXTZ ((VR[VRB])[i + 1 .. i + 5]);
+ (VR[VRT])[i * 2 + 16..i * 2 + 23] := EXTZ ((VR[VRB])[i + 6 .. i + 10]);
+ (VR[VRT])[i * 2 + 24..i * 2 + 31] := EXTZ ((VR[VRB])[i + 11 .. i + 15])
+ }
+
+union ast member (bit[5], bit[5]) Vupkhsb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01000001110 as instr) =
+ Vupkhsb (VRT,VRB)
+
+function clause execute (Vupkhsb (VRT, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ (VR[VRT])[i * 2..i * 2 + 15] := EXTS ((VR[VRB])[i .. i + 7])
+
+union ast member (bit[5], bit[5]) Vupkhsh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01001001110 as instr) =
+ Vupkhsh (VRT,VRB)
+
+function clause execute (Vupkhsh (VRT, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ (VR[VRT])[i * 2..i * 2 + 31] := EXTS ((VR[VRB])[i .. i + 15])
+
+union ast member (bit[5], bit[5]) Vupklpx
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01111001110 as instr) =
+ Vupklpx (VRT,VRB)
+
+function clause execute (Vupklpx (VRT, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 7] := EXTS ((VR[VRB])[i + 64 .. i + 64]);
+ (VR[VRT])[i * 2 + 8..i * 2 + 15] := EXTZ ((VR[VRB])[i + 65 .. i + 69]);
+ (VR[VRT])[i * 2 + 16..i * 2 + 23] := EXTZ ((VR[VRB])[i + 70 .. i + 74]);
+ (VR[VRT])[i * 2 + 24..i * 2 + 31] := EXTZ ((VR[VRB])[i + 75 .. i + 79])
+ }
+
+union ast member (bit[5], bit[5]) Vupklsb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01010001110 as instr) =
+ Vupklsb (VRT,VRB)
+
+function clause execute (Vupklsb (VRT, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ (VR[VRT])[i * 2..i * 2 + 15] := EXTS ((VR[VRB])[i + 64 .. i + 71])
+
+union ast member (bit[5], bit[5]) Vupklsh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01011001110 as instr) =
+ Vupklsh (VRT,VRB)
+
+function clause execute (Vupklsh (VRT, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ (VR[VRT])[i * 2..i * 2 + 31] := EXTS ((VR[VRB])[i + 64 .. i + 79])
+
+union ast member (bit[5], bit[5], bit[5]) Vmrghb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000001100 as instr) =
+ Vmrghb (VRT,VRA,VRB)
+
+function clause execute (Vmrghb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 7] := (VR[VRA])[i .. i + 7];
+ (VR[VRT])[i * 2 + 8..i * 2 + 15] := (VR[VRB])[i .. i + 7]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmrghh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001001100 as instr) =
+ Vmrghh (VRT,VRA,VRB)
+
+function clause execute (Vmrghh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 15] := (VR[VRA])[i .. i + 15];
+ (VR[VRT])[i * 2 + 16..i * 2 + 31] := (VR[VRB])[i .. i + 15]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmrghw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00010001100 as instr) =
+ Vmrghw (VRT,VRA,VRB)
+
+function clause execute (Vmrghw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 32 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 31] := (VR[VRA])[i .. i + 31];
+ (VR[VRT])[i * 2 + 32..i * 2 + 63] := (VR[VRB])[i .. i + 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmrglb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00100001100 as instr) =
+ Vmrglb (VRT,VRA,VRB)
+
+function clause execute (Vmrglb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 8 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 7] := (VR[VRA])[i + 64 .. i + 71];
+ (VR[VRT])[i * 2 + 8..i * 2 + 15] := (VR[VRB])[i + 64 .. i + 71]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmrglh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00101001100 as instr) =
+ Vmrglh (VRT,VRA,VRB)
+
+function clause execute (Vmrglh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 16 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 15] := (VR[VRA])[i + 64 .. i + 79];
+ (VR[VRT])[i * 2 + 16..i * 2 + 31] := (VR[VRB])[i + 64 .. i + 79]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmrglw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00110001100 as instr) =
+ Vmrglw (VRT,VRA,VRB)
+
+function clause execute (Vmrglw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 63 by 32 in inc)
+ {
+ (VR[VRT])[i * 2..i * 2 + 31] := (VR[VRA])[i + 64 .. i + 95];
+ (VR[VRT])[i * 2 + 32..i * 2 + 63] := (VR[VRB])[i + 64 .. i + 95]
+ }
+
+union ast member (bit[5], bit[4], bit[5]) Vspltb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[1]) _ :
+(bit[4]) UIM :
+(bit[5]) VRB :
+0b01000001100 as instr) =
+ Vspltb (VRT,UIM,VRB)
+
+function clause execute (Vspltb (VRT, UIM, VRB)) =
+ {
+ b := UIM : 0b000;
+ foreach (i from 0 to 127 by 8 in inc)
+ (VR[VRT])[i..i + 7] := (VR[VRB])[b .. b + 7]
+ }
+
+union ast member (bit[5], bit[3], bit[5]) Vsplth
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[2]) _ :
+(bit[3]) UIM :
+(bit[5]) VRB :
+0b01001001100 as instr) =
+ Vsplth (VRT,UIM,VRB)
+
+function clause execute (Vsplth (VRT, UIM, VRB)) =
+ {
+ b := UIM : 0b0000;
+ foreach (i from 0 to 127 by 16 in inc)
+ (VR[VRT])[i..i + 15] := (VR[VRB])[b .. b + 15]
+ }
+
+union ast member (bit[5], bit[2], bit[5]) Vspltw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[3]) _ :
+(bit[2]) UIM :
+(bit[5]) VRB :
+0b01010001100 as instr) =
+ Vspltw (VRT,UIM,VRB)
+
+function clause execute (Vspltw (VRT, UIM, VRB)) =
+ {
+ b := UIM : 0b00000;
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := (VR[VRB])[b .. b + 31]
+ }
+
+union ast member (bit[5], bit[5]) Vspltisb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) SIM :
+(bit[5]) _ :
+0b01100001100 as instr) =
+ Vspltisb (VRT,SIM)
+
+function clause execute (Vspltisb (VRT, SIM)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ (VR[VRT])[i..i + 7] := EXTS_EXPLICIT (SIM,8)
+
+union ast member (bit[5], bit[5]) Vspltish
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) SIM :
+(bit[5]) _ :
+0b01101001100 as instr) =
+ Vspltish (VRT,SIM)
+
+function clause execute (Vspltish (VRT, SIM)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ (VR[VRT])[i..i + 15] := EXTS_EXPLICIT (SIM,16)
+
+union ast member (bit[5], bit[5]) Vspltisw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) SIM :
+(bit[5]) _ :
+0b01110001100 as instr) =
+ Vspltisw (VRT,SIM)
+
+function clause execute (Vspltisw (VRT, SIM)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := EXTS_EXPLICIT (SIM,32)
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vperm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b101011 as instr) =
+ Vperm (VRT,VRA,VRB,VRC)
+
+function clause execute (Vperm (VRT, VRA, VRB, VRC)) =
+ {
+ (bit[256]) temp := VR[VRA] : VR[VRB];
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ b := (VR[VRC])[i + 3 .. i + 7] : 0b000;
+ (VR[VRT])[i..i + 7] := temp[b .. b + 7]
+ }
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vsel
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b101010 as instr) =
+ Vsel (VRT,VRA,VRB,VRC)
+
+function clause execute (Vsel (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vsl
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00111000100 as instr) =
+ Vsl (VRT,VRA,VRB)
+
+function clause execute (Vsl (VRT, VRA, VRB)) =
+ {
+ sh := (VR[VRB])[125 .. 127];
+ t := 1;
+ foreach (i from 0 to 127 by 8 in inc)
+ t := (t & (VR[VRB])[i + 5 .. i + 7] == sh);
+ if t == 1 then VR[VRT] := VR[VRA] << sh else VR[VRT] := undefined
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[4]) Vsldoi
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[1]) _ :
+(bit[4]) SHB :
+0b101100 as instr) =
+ Vsldoi (VRT,VRA,VRB,SHB)
+
+function clause execute (Vsldoi (VRT, VRA, VRB, SHB)) =
+ VR[VRT] := (VR[VRA] : VR[VRB])[8 * SHB .. 8 * SHB + 127]
+
+union ast member (bit[5], bit[5], bit[5]) Vslo
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10000001100 as instr) =
+ Vslo (VRT,VRA,VRB)
+
+function clause execute (Vslo (VRT, VRA, VRB)) =
+ {
+ shb := (VR[VRB])[121 .. 124];
+ VR[VRT] := VR[VRA] << (shb : 0b000)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsr
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01011000100 as instr) =
+ Vsr (VRT,VRA,VRB)
+
+function clause execute (Vsr (VRT, VRA, VRB)) =
+ {
+ sh := (VR[VRB])[125 .. 127];
+ t := 1;
+ foreach (i from 0 to 127 by 8 in inc)
+ t := (t & (VR[VRB])[i + 5 .. i + 7] == sh);
+ if t == 1 then VR[VRT] := VR[VRA] >> sh else VR[VRT] := undefined
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsro
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10001001100 as instr) =
+ Vsro (VRT,VRA,VRB)
+
+function clause execute (Vsro (VRT, VRA, VRB)) =
+ {
+ shb := (VR[VRB])[121 .. 124];
+ VR[VRT] := VR[VRA] >> (shb : 0b000)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vaddcuw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00110000000 as instr) =
+ Vaddcuw (VRT,VRA,VRB)
+
+function clause execute (Vaddcuw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 31]);
+ bop := EXTZ ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop (aop + bop >> 32,1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vaddsbs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01100000000 as instr) =
+ Vaddsbs (VRT,VRA,VRB)
+
+function clause execute (Vaddsbs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTS (VRA[i .. i + 7]);
+ bop := EXTS (VRB[i .. i + 7]);
+ (VR[VRT])[i..i + 7] := (Clamp (aop + bop,0 - 128,127))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vaddshs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01101000000 as instr) =
+ Vaddshs (VRT,VRA,VRB)
+
+function clause execute (Vaddshs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 15]);
+ bop := EXTS ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] :=
+ (Clamp (aop + bop,0 - 0b1000000000000000,0b1000000000000000 - 1))[16 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vaddsws
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01110000000 as instr) =
+ Vaddsws (VRT,VRA,VRB)
+
+function clause execute (Vaddsws (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 31]);
+ bop := EXTS ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp
+ (aop + bop,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vaddubm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000000000 as instr) =
+ Vaddubm (VRT,VRA,VRB)
+
+function clause execute (Vaddubm (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 7]);
+ bop := EXTZ ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 7] := Chop (aop + bop,8)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vadduhm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001000000 as instr) =
+ Vadduhm (VRT,VRA,VRB)
+
+function clause execute (Vadduhm (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 15]);
+ bop := EXTZ ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] := Chop (aop + bop,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vadduwm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00010000000 as instr) =
+ Vadduwm (VRT,VRA,VRB)
+
+function clause execute (Vadduwm (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 31]);
+ bop := EXTZ ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop (aop + bop,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vaddubs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01000000000 as instr) =
+ Vaddubs (VRT,VRA,VRB)
+
+function clause execute (Vaddubs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 7]);
+ bop := EXTZ ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 7] := (Clamp (aop + bop,0,255))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vadduhs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01001000000 as instr) =
+ Vadduhs (VRT,VRA,VRB)
+
+function clause execute (Vadduhs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 15]);
+ bop := EXTZ ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] :=
+ (Clamp (aop + bop,0,0b10000000000000000 - 1))[16 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vadduws
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01010000000 as instr) =
+ Vadduws (VRT,VRA,VRB)
+
+function clause execute (Vadduws (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 31]);
+ bop := EXTZ ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp (aop + bop,0,0b100000000000000000000000000000000 - 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubcuw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10110000000 as instr) =
+ Vsubcuw (VRT,VRA,VRB)
+
+function clause execute (Vsubcuw (VRT, VRA, VRB)) =
+ {
+ (bit[32]) temp := 0;
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := (VR[VRA])[i .. i + 31];
+ bop := (VR[VRB])[i .. i + 31];
+ temp := (bit[32]) (EXTZ (aop) + EXTZ (~ (bop))) + 1 >> 32;
+ (VR[VRT])[i..i + 31] := (temp & 0b00000000000000000000000000000001)
+ }
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubsbs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11100000000 as instr) =
+ Vsubsbs (VRT,VRA,VRB)
+
+function clause execute (Vsubsbs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 7]);
+ bop := EXTS ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 7] :=
+ (Clamp ((bit[32]) (aop + ~ (bop)) + 1,0 - 128,127))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubshs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11101000000 as instr) =
+ Vsubshs (VRT,VRA,VRB)
+
+function clause execute (Vsubshs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 15]);
+ bop := EXTS ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] :=
+ (Clamp
+ ((bit[32]) (aop + ~ (bop)) + 1,0 - 0b1000000000000000,0b1000000000000000 -
+ 1))[16 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubsws
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11110000000 as instr) =
+ Vsubsws (VRT,VRA,VRB)
+
+function clause execute (Vsubsws (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 31]);
+ bop := EXTS ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp
+ ((bit[32]) (aop + ~ (bop)) + 1,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsububm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10000000000 as instr) =
+ Vsububm (VRT,VRA,VRB)
+
+function clause execute (Vsububm (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 7]);
+ bop := EXTZ ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 7] := Chop ((bit[32]) (aop + ~ (bop)) + 1,8)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubuhm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10001000000 as instr) =
+ Vsubuhm (VRT,VRA,VRB)
+
+function clause execute (Vsubuhm (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 15]);
+ bop := EXTZ ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 16] := Chop ((bit[32]) (aop + ~ (bop)) + 1,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubuwm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10010000000 as instr) =
+ Vsubuwm (VRT,VRA,VRB)
+
+function clause execute (Vsubuwm (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 31]);
+ bop := EXTZ ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop ((bit[64]) (aop + ~ (bop)) + 1,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsububs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11000000000 as instr) =
+ Vsububs (VRT,VRA,VRB)
+
+function clause execute (Vsububs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 7]);
+ bop := EXTZ ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 7] :=
+ (Clamp ((bit[32]) (aop + ~ (bop)) + 1,0,255))[24 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubuhs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11001000000 as instr) =
+ Vsubuhs (VRT,VRA,VRB)
+
+function clause execute (Vsubuhs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 15]);
+ bop := EXTZ ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] :=
+ (Clamp ((bit[32]) (aop + ~ (bop)) + 1,0,0b10000000000000000 - 1))[16 .. 31]
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsubuws
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11010000000 as instr) =
+ Vsubuws (VRT,VRA,VRB)
+
+function clause execute (Vsubuws (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 31]);
+ bop := EXTZ ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp
+ ((bit[64]) (aop + ~ (bop)) + 1,0,0b100000000000000000000000000000000 - 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmulesb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01100001000 as instr) =
+ Vmulesb (VRT,VRA,VRB)
+
+function clause execute (Vmulesb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ prod := EXTS ((VR[VRA])[i .. i + 7]) * EXTS ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 15] := Chop (prod,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmulesh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01101001000 as instr) =
+ Vmulesh (VRT,VRA,VRB)
+
+function clause execute (Vmulesh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ prod := EXTS ((VR[VRA])[i .. i + 15]) * EXTS ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 31] := Chop (prod,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmuleub
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01000001000 as instr) =
+ Vmuleub (VRT,VRA,VRB)
+
+function clause execute (Vmuleub (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ prod := EXTZ ((VR[VRA])[i .. i + 7]) * EXTZ ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 15] := Chop (prod,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmuleuh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01001001000 as instr) =
+ Vmuleuh (VRT,VRA,VRB)
+
+function clause execute (Vmuleuh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ prod := EXTZ ((VR[VRA])[i .. i + 15]) * EXTZ ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 31] := Chop (prod,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmulosb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00100001000 as instr) =
+ Vmulosb (VRT,VRA,VRB)
+
+function clause execute (Vmulosb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ prod :=
+ EXTS ((VR[VRA])[i + 8 .. i + 15]) * EXTS ((VR[VRB])[i + 8 .. i + 15]);
+ (VR[VRT])[i..i + 15] := Chop (prod,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmulosh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00101001000 as instr) =
+ Vmulosh (VRT,VRA,VRB)
+
+function clause execute (Vmulosh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ prod :=
+ EXTS ((VR[VRA])[i + 16 .. i + 31]) * EXTS ((VR[VRB])[i + 16 .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop (prod,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmuloub
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000001000 as instr) =
+ Vmuloub (VRT,VRA,VRB)
+
+function clause execute (Vmuloub (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ prod :=
+ EXTZ ((VR[VRA])[i + 8 .. i + 15]) * EXTZ ((VR[VRB])[i + 8 .. i + 15]);
+ (VR[VRT])[i..i + 15] := Chop (prod,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmulouh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001001000 as instr) =
+ Vmulouh (VRT,VRA,VRB)
+
+function clause execute (Vmulouh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ prod :=
+ EXTZ ((VR[VRA])[i + 16 .. i + 31]) * EXTZ ((VR[VRB])[i + 16 .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop (prod,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmhaddshs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100000 as instr) =
+ Vmhaddshs (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmhaddshs (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmhraddshs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100001 as instr) =
+ Vmhraddshs (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmhraddshs (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmladduhm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100010 as instr) =
+ Vmladduhm (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmladduhm (VRT, VRA, VRB, VRC)) =
+ {
+ (bit[16]) prod := 0;
+ (bit[16]) sum := 0;
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ prod := EXTZ ((VR[VRA])[i .. i + 15]) * EXTZ ((VR[VRB])[i .. i + 15]);
+ sum := Chop (prod,16) + (VR[VRC])[i .. i + 15];
+ (VR[VRT])[i..i + 15] := Chop (sum,16)
+ }
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmsumubm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100100 as instr) =
+ Vmsumubm (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmsumubm (VRT, VRA, VRB, VRC)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTZ ((VR[VRC])[i .. i + 31]);
+ foreach (j from 0 to 31 by 8 in inc)
+ {
+ prod :=
+ EXTZ ((VR[VRA])[i + j .. i + j + 7]) *
+ EXTZ ((VR[VRB])[i + j .. i + j + 7]);
+ temp := temp + prod
+ };
+ (VR[VRT])[i..i + 31] := Chop (temp,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmsummbm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100101 as instr) =
+ Vmsummbm (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmsummbm (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmsumshm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b101000 as instr) =
+ Vmsumshm (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmsumshm (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmsumshs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b101001 as instr) =
+ Vmsumshs (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmsumshs (VRT, VRA, VRB, VRC)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTS ((VR[VRC])[i .. i + 31]);
+ foreach (j from 0 to 31 by 16 in inc)
+ {
+ prod :=
+ EXTS ((VR[VRA])[i + j .. i + j + 15]) *
+ EXTS ((VR[VRB])[i + j .. i + j + 15]);
+ temp := temp + prod
+ };
+ (VR[VRT])[i..i + 31] :=
+ Clamp
+ (temp,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmsumuhm
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100110 as instr) =
+ Vmsumuhm (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmsumuhm (VRT, VRA, VRB, VRC)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTZ ((VR[VRC])[i .. i + 31]);
+ foreach (j from 0 to 31 by 16 in inc)
+ {
+ prod :=
+ EXTZ ((VR[VRA])[i + j .. i + j + 15]) *
+ EXTZ ((VR[VRB])[i + j .. i + j + 15]);
+ temp := temp + prod
+ };
+ (VR[VRT])[i..i + 31] := Chop (temp,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmsumuhs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b100111 as instr) =
+ Vmsumuhs (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmsumuhs (VRT, VRA, VRB, VRC)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTZ ((VR[VRC])[i .. i + 31]);
+ foreach (j from 0 to 31 by 16 in inc)
+ {
+ prod :=
+ EXTZ ((VR[VRA])[i + j .. i + j + 15]) *
+ EXTZ ((VR[VRB])[i + j .. i + j + 15]);
+ temp := temp + prod
+ };
+ (VR[VRT])[i..i + 31] :=
+ Clamp (temp,0,0b100000000000000000000000000000000 - 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsumsws
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11110001000 as instr) =
+ Vsumsws (VRT,VRA,VRB)
+
+function clause execute (Vsumsws (VRT, VRA, VRB)) =
+ {
+ temp := EXTS ((VR[VRB])[96 .. 127]);
+ foreach (i from 0 to 127 by 32 in inc)
+ temp := temp + EXTS ((VR[VRA])[i .. i + 31]);
+ (VR[VRT])[0..31] := 0b00000000000000000000000000000000;
+ (VR[VRT])[32..63] := 0b00000000000000000000000000000000;
+ (VR[VRT])[64..95] := 0b00000000000000000000000000000000;
+ (VR[VRT])[96..127] :=
+ Clamp
+ (temp,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsum2sws
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11010001000 as instr) =
+ Vsum2sws (VRT,VRA,VRB)
+
+function clause execute (Vsum2sws (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 64 in inc)
+ {
+ temp := EXTS ((VR[VRB])[i + 32 .. i + 63]);
+ foreach (j from 0 to 63 by 32 in inc)
+ temp := temp + EXTS ((VR[VRA])[i + j .. i + j + 31]);
+ (VR[VRT])[i..i + 63] :=
+ 0b00000000000000000000000000000000 :
+ Clamp
+ (temp,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsum4sbs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11100001000 as instr) =
+ Vsum4sbs (VRT,VRA,VRB)
+
+function clause execute (Vsum4sbs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTS ((VR[VRB])[i .. i + 31]);
+ foreach (j from 0 to 31 by 8 in inc)
+ temp := temp + EXTS ((VR[VRA])[i + j .. i + j + 7]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp
+ (temp,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsum4shs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11001001000 as instr) =
+ Vsum4shs (VRT,VRA,VRB)
+
+function clause execute (Vsum4shs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTS ((VR[VRB])[i .. i + 31]);
+ foreach (j from 0 to 31 by 16 in inc)
+ temp := temp + EXTS ((VR[VRA])[i + j .. i + j + 15]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp
+ (temp,0 - 0b10000000000000000000000000000000,0b10000000000000000000000000000000 -
+ 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsum4ubs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b11000001000 as instr) =
+ Vsum4ubs (VRT,VRA,VRB)
+
+function clause execute (Vsum4ubs (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ temp := EXTZ ((VR[VRB])[i .. i + 31]);
+ foreach (j from 0 to 31 by 8 in inc)
+ temp := temp + EXTZ ((VR[VRA])[i + j .. i + j + 7]);
+ (VR[VRT])[i..i + 31] :=
+ Clamp (temp,0,0b100000000000000000000000000000000 - 1)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vavgsb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10100000010 as instr) =
+ Vavgsb (VRT,VRA,VRB)
+
+function clause execute (Vavgsb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 7]);
+ bop := EXTS ((VR[VRB])[i .. i + 7]);
+ (VR[VRT])[i..i + 7] := Chop ((bit[32]) (aop + bop) + 1 >> 1,8)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vavgsh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10101000010 as instr) =
+ Vavgsh (VRT,VRA,VRB)
+
+function clause execute (Vavgsh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 15]);
+ bop := EXTS ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] := Chop ((bit[32]) (aop + bop) + 1 >> 1,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vavgsw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10110000010 as instr) =
+ Vavgsw (VRT,VRA,VRB)
+
+function clause execute (Vavgsw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTS ((VR[VRA])[i .. i + 31]);
+ bop := EXTS ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop ((bit[32]) (aop + bop) + 1 >> 1,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vavgub
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10000000010 as instr) =
+ Vavgub (VRT,VRA,VRB)
+
+function clause execute (Vavgub (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vavguh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10001000010 as instr) =
+ Vavguh (VRT,VRA,VRB)
+
+function clause execute (Vavguh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 15]);
+ bop := EXTZ ((VR[VRB])[i .. i + 15]);
+ (VR[VRT])[i..i + 15] := Chop ((bit[32]) (aop + bop) + 1 >> 1,16)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vavguw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10010000010 as instr) =
+ Vavguw (VRT,VRA,VRB)
+
+function clause execute (Vavguw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ aop := EXTZ ((VR[VRA])[i .. i + 31]);
+ bop := EXTZ ((VR[VRB])[i .. i + 31]);
+ (VR[VRT])[i..i + 31] := Chop ((bit[32]) (aop + bop) + 1 >> 1,32)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxsb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00100000010 as instr) =
+ Vmaxsb (VRT,VRA,VRB)
+
+function clause execute (Vmaxsb (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxsh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00101000010 as instr) =
+ Vmaxsh (VRT,VRA,VRB)
+
+function clause execute (Vmaxsh (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxsw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00110000010 as instr) =
+ Vmaxsw (VRT,VRA,VRB)
+
+function clause execute (Vmaxsw (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxub
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000000010 as instr) =
+ Vmaxub (VRT,VRA,VRB)
+
+function clause execute (Vmaxub (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxuh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001000010 as instr) =
+ Vmaxuh (VRT,VRA,VRB)
+
+function clause execute (Vmaxuh (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxuw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00010000010 as instr) =
+ Vmaxuw (VRT,VRA,VRB)
+
+function clause execute (Vmaxuw (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminsb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01100000010 as instr) =
+ Vminsb (VRT,VRA,VRB)
+
+function clause execute (Vminsb (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminsh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01101000010 as instr) =
+ Vminsh (VRT,VRA,VRB)
+
+function clause execute (Vminsh (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminsw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01110000010 as instr) =
+ Vminsw (VRT,VRA,VRB)
+
+function clause execute (Vminsw (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminub
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01000000010 as instr) =
+ Vminub (VRT,VRA,VRB)
+
+function clause execute (Vminub (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminuh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01001000010 as instr) =
+ Vminuh (VRT,VRA,VRB)
+
+function clause execute (Vminuh (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminuw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01010000010 as instr) =
+ Vminuw (VRT,VRA,VRB)
+
+function clause execute (Vminuw (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpequb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b0000000110 as instr) =
+ Vcmpequb (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpequb (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpequh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b0001000110 as instr) =
+ Vcmpequh (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpequh (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpequw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b0010000110 as instr) =
+ Vcmpequw (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpequw (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtsb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1100000110 as instr) =
+ Vcmpgtsb (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtsb (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtsh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1101000110 as instr) =
+ Vcmpgtsh (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtsh (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtsw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1110000110 as instr) =
+ Vcmpgtsw (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtsw (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtub
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1000000110 as instr) =
+ Vcmpgtub (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtub (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtuh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1001000110 as instr) =
+ Vcmpgtuh (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtuh (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtuw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1010000110 as instr) =
+ Vcmpgtuw (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtuw (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vand
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10000000100 as instr) =
+ Vand (VRT,VRA,VRB)
+
+function clause execute (Vand (VRT, VRA, VRB)) = VR[VRT] := (VR[VRA] & VR[VRB])
+
+union ast member (bit[5], bit[5], bit[5]) Vandc
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10001000100 as instr) =
+ Vandc (VRT,VRA,VRB)
+
+function clause execute (Vandc (VRT, VRA, VRB)) =
+ VR[VRT] := (VR[VRA] & ~ (VR[VRB]))
+
+union ast member (bit[5], bit[5], bit[5]) Vnor
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10100000100 as instr) =
+ Vnor (VRT,VRA,VRB)
+
+function clause execute (Vnor (VRT, VRA, VRB)) =
+ VR[VRT] := ~ (VR[VRA] | VR[VRB])
+
+union ast member (bit[5], bit[5], bit[5]) Vor
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10010000100 as instr) =
+ Vor (VRT,VRA,VRB)
+
+function clause execute (Vor (VRT, VRA, VRB)) = VR[VRT] := (VR[VRA] | VR[VRB])
+
+union ast member (bit[5], bit[5], bit[5]) Vxor
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10011000100 as instr) =
+ Vxor (VRT,VRA,VRB)
+
+function clause execute (Vxor (VRT, VRA, VRB)) = VR[VRT] := VR[VRA] ^ VR[VRB]
+
+union ast member (bit[5], bit[5], bit[5]) Vrlb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000000100 as instr) =
+ Vrlb (VRT,VRA,VRB)
+
+function clause execute (Vrlb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ sh := (VR[VRB])[i + 5 .. i + 7];
+ (VR[VRT])[i..i + 7] := (VR[VRA])[i .. i + 7] << sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vrlh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001000100 as instr) =
+ Vrlh (VRT,VRA,VRB)
+
+function clause execute (Vrlh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ sh := (VR[VRB])[i + 12 .. i + 15];
+ (VR[VRT])[i..i + 15] := (VR[VRA])[i .. i + 15] << sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vrlw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00010000100 as instr) =
+ Vrlw (VRT,VRA,VRB)
+
+function clause execute (Vrlw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ sh := (VR[VRB])[i + 27 .. i + 31];
+ (VR[VRT])[i..i + 31] := (VR[VRA])[i .. i + 31] << sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vslb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00100000100 as instr) =
+ Vslb (VRT,VRA,VRB)
+
+function clause execute (Vslb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ sh := (VR[VRB])[i + 5 .. i + 7];
+ (VR[VRT])[i..i + 7] := (VR[VRA])[i .. i + 7] << sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vslh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00101000100 as instr) =
+ Vslh (VRT,VRA,VRB)
+
+function clause execute (Vslh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ sh := (VR[VRB])[i + 12 .. i + 15];
+ (VR[VRT])[i..i + 15] := (VR[VRA])[i .. i + 15] << sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vslw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00110000100 as instr) =
+ Vslw (VRT,VRA,VRB)
+
+function clause execute (Vslw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ sh := (VR[VRB])[i + 27 .. i + 31];
+ (VR[VRT])[i..i + 31] := (VR[VRA])[i .. i + 31] << sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsrb
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01000000100 as instr) =
+ Vsrb (VRT,VRA,VRB)
+
+function clause execute (Vsrb (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 8 in inc)
+ {
+ sh := (VR[VRB])[i + 5 .. i + 7];
+ (VR[VRT])[i..i + 7] := (VR[VRA])[i .. i + 7] >> sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsrh
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01001000100 as instr) =
+ Vsrh (VRT,VRA,VRB)
+
+function clause execute (Vsrh (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 16 in inc)
+ {
+ sh := (VR[VRB])[i + 12 .. i + 15];
+ (VR[VRT])[i..i + 15] := (VR[VRA])[i .. i + 15] >> sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsrw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01010000100 as instr) =
+ Vsrw (VRT,VRA,VRB)
+
+function clause execute (Vsrw (VRT, VRA, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ {
+ sh := (VR[VRB])[i + 27 .. i + 31];
+ (VR[VRT])[i..i + 31] := (VR[VRA])[i .. i + 31] >> sh
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Vsrab
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01100000100 as instr) =
+ Vsrab (VRT,VRA,VRB)
+
+function clause execute (Vsrab (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vsrah
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01101000100 as instr) =
+ Vsrah (VRT,VRA,VRB)
+
+function clause execute (Vsrah (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vsraw
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b01110000100 as instr) =
+ Vsraw (VRT,VRA,VRB)
+
+function clause execute (Vsraw (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vaddfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00000001010 as instr) =
+ Vaddfp (VRT,VRA,VRB)
+
+function clause execute (Vaddfp (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vsubfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b00001001010 as instr) =
+ Vsubfp (VRT,VRA,VRB)
+
+function clause execute (Vsubfp (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vmaddfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b101110 as instr) =
+ Vmaddfp (VRT,VRA,VRB,VRC)
+
+function clause execute (Vmaddfp (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5]) Vnmsubfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+(bit[5]) VRC :
+0b101111 as instr) =
+ Vnmsubfp (VRT,VRA,VRB,VRC)
+
+function clause execute (Vnmsubfp (VRT, VRA, VRB, VRC)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vmaxfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10000001010 as instr) =
+ Vmaxfp (VRT,VRA,VRB)
+
+function clause execute (Vmaxfp (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vminfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+0b10001001010 as instr) =
+ Vminfp (VRT,VRA,VRB)
+
+function clause execute (Vminfp (VRT, VRA, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vctsxs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) UIM :
+(bit[5]) VRB :
+0b01111001010 as instr) =
+ Vctsxs (VRT,UIM,VRB)
+
+function clause execute (Vctsxs (VRT, UIM, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := ConvertSPtoSXWsaturate ((VR[VRB])[i .. i + 31],UIM)
+
+union ast member (bit[5], bit[5], bit[5]) Vctuxs
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) UIM :
+(bit[5]) VRB :
+0b01110001010 as instr) =
+ Vctuxs (VRT,UIM,VRB)
+
+function clause execute (Vctuxs (VRT, UIM, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := ConvertSPtoUXWsaturate ((VR[VRB])[i .. i + 31],UIM)
+
+union ast member (bit[5], bit[5], bit[5]) Vcfsx
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) UIM :
+(bit[5]) VRB :
+0b01101001010 as instr) =
+ Vcfsx (VRT,UIM,VRB)
+
+function clause execute (Vcfsx (VRT, UIM, VRB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Vcfux
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) UIM :
+(bit[5]) VRB :
+0b01100001010 as instr) =
+ Vcfux (VRT,UIM,VRB)
+
+function clause execute (Vcfux (VRT, UIM, VRB)) = ()
+
+union ast member (bit[5], bit[5]) Vrfim
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01011001010 as instr) =
+ Vrfim (VRT,VRB)
+
+function clause execute (Vrfim (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[0..31] := RoundToSPIntFloor ((VR[VRB])[0 .. 31])
+
+union ast member (bit[5], bit[5]) Vrfin
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01000001010 as instr) =
+ Vrfin (VRT,VRB)
+
+function clause execute (Vrfin (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[0..31] := RoundToSPIntNear ((VR[VRB])[0 .. 31])
+
+union ast member (bit[5], bit[5]) Vrfip
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01010001010 as instr) =
+ Vrfip (VRT,VRB)
+
+function clause execute (Vrfip (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[0..31] := RoundToSPIntCeil ((VR[VRB])[0 .. 31])
+
+union ast member (bit[5], bit[5]) Vrfiz
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b01001001010 as instr) =
+ Vrfiz (VRT,VRB)
+
+function clause execute (Vrfiz (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[0..31] := RoundToSPIntTrunc ((VR[VRB])[0 .. 31])
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpbfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1111000110 as instr) =
+ Vcmpbfp (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpbfp (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpeqfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b0011000110 as instr) =
+ Vcmpeqfp (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpeqfp (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgefp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b0111000110 as instr) =
+ Vcmpgefp (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgefp (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Vcmpgtfp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) VRA :
+(bit[5]) VRB :
+[Rc] :
+0b1011000110 as instr) =
+ Vcmpgtfp (VRT,VRA,VRB,Rc)
+
+function clause execute (Vcmpgtfp (VRT, VRA, VRB, Rc)) = ()
+
+union ast member (bit[5], bit[5]) Vexptefp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b00110001010 as instr) =
+ Vexptefp (VRT,VRB)
+
+function clause execute (Vexptefp (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := Power2EstimateSP ((VR[VRB])[i .. i + 31])
+
+union ast member (bit[5], bit[5]) Vlogefp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b00111001010 as instr) =
+ Vlogefp (VRT,VRB)
+
+function clause execute (Vlogefp (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := LogBase2EstimateSP ((VR[VRB])[i .. i + 31])
+
+union ast member (bit[5], bit[5]) Vrefp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b00100001010 as instr) =
+ Vrefp (VRT,VRB)
+
+function clause execute (Vrefp (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] := ReciprocalEstimateSP ((VR[VRB])[i .. i + 31])
+
+union ast member (bit[5], bit[5]) Vrsqrtefp
+
+function clause decode (0b000100 :
+(bit[5]) VRT :
+(bit[5]) _ :
+(bit[5]) VRB :
+0b00101001010 as instr) =
+ Vrsqrtefp (VRT,VRB)
+
+function clause execute (Vrsqrtefp (VRT, VRB)) =
+ foreach (i from 0 to 127 by 32 in inc)
+ (VR[VRT])[i..i + 31] :=
+ ReciprocalSquareRootEstimateSP ((VR[VRB])[i .. i + 31])
+
union ast member (bit[5]) Mtvscr
function clause decode (0b000100 :
@@ -1753,6 +8092,2409 @@ function clause execute (Mfvscr (VRT)) =
0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 :
VSCR
+union ast member (bit[5], bit[5], bit[5], bit) Lxsdx
+
+function clause decode (0b011111 :
+(bit[5]) T :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1001001100 :
+[TX] as instr) =
+ Lxsdx (T,RA,RB,TX)
+
+function clause execute (Lxsdx (T, RA, RB, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Lxvd2x
+
+function clause decode (0b011111 :
+(bit[5]) T :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1101001100 :
+[TX] as instr) =
+ Lxvd2x (T,RA,RB,TX)
+
+function clause execute (Lxvd2x (T, RA, RB, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Lxvdsx
+
+function clause decode (0b011111 :
+(bit[5]) T :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0101001100 :
+[TX] as instr) =
+ Lxvdsx (T,RA,RB,TX)
+
+function clause execute (Lxvdsx (T, RA, RB, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Lxvw4x
+
+function clause decode (0b011111 :
+(bit[5]) T :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1100001100 :
+[TX] as instr) =
+ Lxvw4x (T,RA,RB,TX)
+
+function clause execute (Lxvw4x (T, RA, RB, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Stxsdx
+
+function clause decode (0b011111 :
+(bit[5]) S :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1011001100 :
+[SX] as instr) =
+ Stxsdx (S,RA,RB,SX)
+
+function clause execute (Stxsdx (S, RA, RB, SX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Stxvd2x
+
+function clause decode (0b011111 :
+(bit[5]) S :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1111001100 :
+[SX] as instr) =
+ Stxvd2x (S,RA,RB,SX)
+
+function clause execute (Stxvd2x (S, RA, RB, SX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Stxvw4x
+
+function clause decode (0b011111 :
+(bit[5]) S :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1110001100 :
+[SX] as instr) =
+ Stxvw4x (S,RA,RB,SX)
+
+function clause execute (Stxvw4x (S, RA, RB, SX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsabsdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101011001 :
+[BX] :
+[TX] as instr) =
+ Xsabsdp (T,B,BX,TX)
+
+function clause execute (Xsabsdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsadddp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00100000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsadddp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsadddp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[3], bit[5], bit[5], bit, bit) Xscmpodp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) A :
+(bit[5]) B :
+0b00101011 :
+[AX] :
+[BX] :
+(bit[1]) _ as instr) =
+ Xscmpodp (BF,A,B,AX,BX)
+
+function clause execute (Xscmpodp (BF, A, B, AX, BX)) = ()
+
+union ast member (bit[3], bit[5], bit[5], bit, bit) Xscmpudp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) A :
+(bit[5]) B :
+0b00100011 :
+[AX] :
+[BX] :
+(bit[1]) _ as instr) =
+ Xscmpudp (BF,A,B,AX,BX)
+
+function clause execute (Xscmpudp (BF, A, B, AX, BX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xscpsgndp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10110000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xscpsgndp (T,A,B,AX,BX,TX)
+
+function clause execute (Xscpsgndp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvdpsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b100001001 :
+[BX] :
+[TX] as instr) =
+ Xscvdpsp (T,B,BX,TX)
+
+function clause execute (Xscvdpsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvdpsxds
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101011000 :
+[BX] :
+[TX] as instr) =
+ Xscvdpsxds (T,B,BX,TX)
+
+function clause execute (Xscvdpsxds (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvdpsxws
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001011000 :
+[BX] :
+[TX] as instr) =
+ Xscvdpsxws (T,B,BX,TX)
+
+function clause execute (Xscvdpsxws (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvdpuxds
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101001000 :
+[BX] :
+[TX] as instr) =
+ Xscvdpuxds (T,B,BX,TX)
+
+function clause execute (Xscvdpuxds (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvdpuxws
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001001000 :
+[BX] :
+[TX] as instr) =
+ Xscvdpuxws (T,B,BX,TX)
+
+function clause execute (Xscvdpuxws (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvspdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101001001 :
+[BX] :
+[TX] as instr) =
+ Xscvspdp (T,B,BX,TX)
+
+function clause execute (Xscvspdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvsxddp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101111000 :
+[BX] :
+[TX] as instr) =
+ Xscvsxddp (T,B,BX,TX)
+
+function clause execute (Xscvsxddp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xscvuxddp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101101000 :
+[BX] :
+[TX] as instr) =
+ Xscvuxddp (T,B,BX,TX)
+
+function clause execute (Xscvuxddp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsdivdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00111000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsdivdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsdivdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmaddmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00101001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmaddmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmaddmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmaddadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00100001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmaddadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmaddadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmaxdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10100000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmaxdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmaxdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmindp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10101000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmindp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmindp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmsubmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00111001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmsubmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmsubmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmsubadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00110001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmsubadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmsubadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsmuldp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00110000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsmuldp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsmuldp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsnabsdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101101001 :
+[BX] :
+[TX] as instr) =
+ Xsnabsdp (T,B,BX,TX)
+
+function clause execute (Xsnabsdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsnegdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b101111001 :
+[BX] :
+[TX] as instr) =
+ Xsnegdp (T,B,BX,TX)
+
+function clause execute (Xsnegdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsnmaddmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10101001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsnmaddmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsnmaddmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsnmaddadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10100001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsnmaddadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsnmaddadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsnmsubmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10111001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsnmsubmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsnmsubmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xsnmsubadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10110001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xsnmsubadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xsnmsubadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsrdpi
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001001001 :
+[BX] :
+[TX] as instr) =
+ Xsrdpi (T,B,BX,TX)
+
+function clause execute (Xsrdpi (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsrdpic
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001101011 :
+[BX] :
+[TX] as instr) =
+ Xsrdpic (T,B,BX,TX)
+
+function clause execute (Xsrdpic (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsrdpim
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001111001 :
+[BX] :
+[TX] as instr) =
+ Xsrdpim (T,B,BX,TX)
+
+function clause execute (Xsrdpim (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsrdpip
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001101001 :
+[BX] :
+[TX] as instr) =
+ Xsrdpip (T,B,BX,TX)
+
+function clause execute (Xsrdpip (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsrdpiz
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001011001 :
+[BX] :
+[TX] as instr) =
+ Xsrdpiz (T,B,BX,TX)
+
+function clause execute (Xsrdpiz (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsredp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001011010 :
+[BX] :
+[TX] as instr) =
+ Xsredp (T,B,BX,TX)
+
+function clause execute (Xsredp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xsrsqrtedp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001001010 :
+[BX] :
+[TX] as instr) =
+ Xsrsqrtedp (T,B,BX,TX)
+
+function clause execute (Xsrsqrtedp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xssqrtdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b001001011 :
+[BX] :
+[TX] as instr) =
+ Xssqrtdp (T,B,BX,TX)
+
+function clause execute (Xssqrtdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xssubdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00101000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xssubdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xssubdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[3], bit[5], bit[5], bit, bit) Xstdivdp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) A :
+(bit[5]) B :
+0b00111101 :
+[AX] :
+[BX] :
+(bit[1]) _ as instr) =
+ Xstdivdp (BF,A,B,AX,BX)
+
+function clause execute (Xstdivdp (BF, A, B, AX, BX)) = ()
+
+union ast member (bit[3], bit[5], bit) Xstsqrtdp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) _ :
+(bit[5]) B :
+0b001101010 :
+[BX] :
+(bit[1]) _ as instr) =
+ Xstsqrtdp (BF,B,BX)
+
+function clause execute (Xstsqrtdp (BF, B, BX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvabsdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111011001 :
+[BX] :
+[TX] as instr) =
+ Xvabsdp (T,B,BX,TX)
+
+function clause execute (Xvabsdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvabssp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110011001 :
+[BX] :
+[TX] as instr) =
+ Xvabssp (T,B,BX,TX)
+
+function clause execute (Xvabssp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvadddp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01100000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvadddp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvadddp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvaddsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01000000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvaddsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvaddsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit, bit) Xvcmpeqdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+[Rc] :
+0b1100011 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcmpeqdp (T,A,B,Rc,AX,BX,TX)
+
+function clause execute (Xvcmpeqdp (T, A, B, Rc, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit, bit) Xvcmpeqsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+[Rc] :
+0b1000011 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcmpeqsp (T,A,B,Rc,AX,BX,TX)
+
+function clause execute (Xvcmpeqsp (T, A, B, Rc, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit, bit) Xvcmpgedp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+[Rc] :
+0b1110011 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcmpgedp (T,A,B,Rc,AX,BX,TX)
+
+function clause execute (Xvcmpgedp (T, A, B, Rc, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit, bit) Xvcmpgesp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+[Rc] :
+0b1010011 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcmpgesp (T,A,B,Rc,AX,BX,TX)
+
+function clause execute (Xvcmpgesp (T, A, B, Rc, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit, bit) Xvcmpgtdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+[Rc] :
+0b1101011 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcmpgtdp (T,A,B,Rc,AX,BX,TX)
+
+function clause execute (Xvcmpgtdp (T, A, B, Rc, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit, bit) Xvcmpgtsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+[Rc] :
+0b1001011 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcmpgtsp (T,A,B,Rc,AX,BX,TX)
+
+function clause execute (Xvcmpgtsp (T, A, B, Rc, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvcpsgndp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11110000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcpsgndp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvcpsgndp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvcpsgnsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11010000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvcpsgnsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvcpsgnsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvdpsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110001001 :
+[BX] :
+[TX] as instr) =
+ Xvcvdpsp (T,B,BX,TX)
+
+function clause execute (Xvcvdpsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvdpsxds
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111011000 :
+[BX] :
+[TX] as instr) =
+ Xvcvdpsxds (T,B,BX,TX)
+
+function clause execute (Xvcvdpsxds (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvdpsxws
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011011000 :
+[BX] :
+[TX] as instr) =
+ Xvcvdpsxws (T,B,BX,TX)
+
+function clause execute (Xvcvdpsxws (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvdpuxds
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111001000 :
+[BX] :
+[TX] as instr) =
+ Xvcvdpuxds (T,B,BX,TX)
+
+function clause execute (Xvcvdpuxds (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvdpuxws
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011001000 :
+[BX] :
+[TX] as instr) =
+ Xvcvdpuxws (T,B,BX,TX)
+
+function clause execute (Xvcvdpuxws (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvspdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111001001 :
+[BX] :
+[TX] as instr) =
+ Xvcvspdp (T,B,BX,TX)
+
+function clause execute (Xvcvspdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvspsxds
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110011000 :
+[BX] :
+[TX] as instr) =
+ Xvcvspsxds (T,B,BX,TX)
+
+function clause execute (Xvcvspsxds (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvspsxws
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010011000 :
+[BX] :
+[TX] as instr) =
+ Xvcvspsxws (T,B,BX,TX)
+
+function clause execute (Xvcvspsxws (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvspuxds
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110001000 :
+[BX] :
+[TX] as instr) =
+ Xvcvspuxds (T,B,BX,TX)
+
+function clause execute (Xvcvspuxds (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvspuxws
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010001000 :
+[BX] :
+[TX] as instr) =
+ Xvcvspuxws (T,B,BX,TX)
+
+function clause execute (Xvcvspuxws (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvsxddp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111111000 :
+[BX] :
+[TX] as instr) =
+ Xvcvsxddp (T,B,BX,TX)
+
+function clause execute (Xvcvsxddp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvsxdsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110111000 :
+[BX] :
+[TX] as instr) =
+ Xvcvsxdsp (T,B,BX,TX)
+
+function clause execute (Xvcvsxdsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvsxwdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011111000 :
+[BX] :
+[TX] as instr) =
+ Xvcvsxwdp (T,B,BX,TX)
+
+function clause execute (Xvcvsxwdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvsxwsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010111000 :
+[BX] :
+[TX] as instr) =
+ Xvcvsxwsp (T,B,BX,TX)
+
+function clause execute (Xvcvsxwsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvuxddp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111101000 :
+[BX] :
+[TX] as instr) =
+ Xvcvuxddp (T,B,BX,TX)
+
+function clause execute (Xvcvuxddp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvuxdsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110101000 :
+[BX] :
+[TX] as instr) =
+ Xvcvuxdsp (T,B,BX,TX)
+
+function clause execute (Xvcvuxdsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvuxwdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011101000 :
+[BX] :
+[TX] as instr) =
+ Xvcvuxwdp (T,B,BX,TX)
+
+function clause execute (Xvcvuxwdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvcvuxwsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010101000 :
+[BX] :
+[TX] as instr) =
+ Xvcvuxwsp (T,B,BX,TX)
+
+function clause execute (Xvcvuxwsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvdivdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01111000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvdivdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvdivdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvdivsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01011000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvdivsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvdivsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmaddmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01101001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmaddmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmaddmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmaddadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01100001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmaddadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmaddadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmaddmsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01001001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmaddmsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmaddmsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmaddasp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01000001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmaddasp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmaddasp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmaxdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11100000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmaxdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmaxdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmaxsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11000000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmaxsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmaxsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmindp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11101000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmindp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmindp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvminsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11001000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvminsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvminsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmsubmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01111001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmsubmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmsubmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmsubadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01110001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmsubadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmsubadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmsubmsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01011001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmsubmsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmsubmsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmsubasp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01010001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmsubasp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmsubasp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmuldp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01110000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmuldp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmuldp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvmulsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01010000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvmulsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvmulsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvnabsdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111101001 :
+[BX] :
+[TX] as instr) =
+ Xvnabsdp (T,B,BX,TX)
+
+function clause execute (Xvnabsdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvnabssp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110101001 :
+[BX] :
+[TX] as instr) =
+ Xvnabssp (T,B,BX,TX)
+
+function clause execute (Xvnabssp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvnegdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b111111001 :
+[BX] :
+[TX] as instr) =
+ Xvnegdp (T,B,BX,TX)
+
+function clause execute (Xvnegdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvnegsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b110111001 :
+[BX] :
+[TX] as instr) =
+ Xvnegsp (T,B,BX,TX)
+
+function clause execute (Xvnegsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmaddmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11101001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmaddmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmaddmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmaddadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11100001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmaddadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmaddadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmaddmsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11001001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmaddmsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmaddmsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmaddasp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11000001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmaddasp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmaddasp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmsubmdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11111001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmsubmdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmsubmdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmsubadp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11110001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmsubadp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmsubadp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmsubmsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11011001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmsubmsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmsubmsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvnmsubasp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b11010001 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvnmsubasp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvnmsubasp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrdpi
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011001001 :
+[BX] :
+[TX] as instr) =
+ Xvrdpi (T,B,BX,TX)
+
+function clause execute (Xvrdpi (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrdpic
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011101011 :
+[BX] :
+[TX] as instr) =
+ Xvrdpic (T,B,BX,TX)
+
+function clause execute (Xvrdpic (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrdpim
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011111001 :
+[BX] :
+[TX] as instr) =
+ Xvrdpim (T,B,BX,TX)
+
+function clause execute (Xvrdpim (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrdpip
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011101001 :
+[BX] :
+[TX] as instr) =
+ Xvrdpip (T,B,BX,TX)
+
+function clause execute (Xvrdpip (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrdpiz
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011011001 :
+[BX] :
+[TX] as instr) =
+ Xvrdpiz (T,B,BX,TX)
+
+function clause execute (Xvrdpiz (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvredp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011011010 :
+[BX] :
+[TX] as instr) =
+ Xvredp (T,B,BX,TX)
+
+function clause execute (Xvredp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvresp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010011010 :
+[BX] :
+[TX] as instr) =
+ Xvresp (T,B,BX,TX)
+
+function clause execute (Xvresp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrspi
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010001001 :
+[BX] :
+[TX] as instr) =
+ Xvrspi (T,B,BX,TX)
+
+function clause execute (Xvrspi (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrspic
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010101011 :
+[BX] :
+[TX] as instr) =
+ Xvrspic (T,B,BX,TX)
+
+function clause execute (Xvrspic (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrspim
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010111001 :
+[BX] :
+[TX] as instr) =
+ Xvrspim (T,B,BX,TX)
+
+function clause execute (Xvrspim (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrspip
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010101001 :
+[BX] :
+[TX] as instr) =
+ Xvrspip (T,B,BX,TX)
+
+function clause execute (Xvrspip (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrspiz
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010011001 :
+[BX] :
+[TX] as instr) =
+ Xvrspiz (T,B,BX,TX)
+
+function clause execute (Xvrspiz (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrsqrtedp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011001010 :
+[BX] :
+[TX] as instr) =
+ Xvrsqrtedp (T,B,BX,TX)
+
+function clause execute (Xvrsqrtedp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvrsqrtesp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010001010 :
+[BX] :
+[TX] as instr) =
+ Xvrsqrtesp (T,B,BX,TX)
+
+function clause execute (Xvrsqrtesp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvsqrtdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b011001011 :
+[BX] :
+[TX] as instr) =
+ Xvsqrtdp (T,B,BX,TX)
+
+function clause execute (Xvsqrtdp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit, bit) Xvsqrtsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) _ :
+(bit[5]) B :
+0b010001011 :
+[BX] :
+[TX] as instr) =
+ Xvsqrtsp (T,B,BX,TX)
+
+function clause execute (Xvsqrtsp (T, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvsubdp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01101000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvsubdp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvsubdp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xvsubsp
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b01001000 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xvsubsp (T,A,B,AX,BX,TX)
+
+function clause execute (Xvsubsp (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[3], bit[5], bit[5], bit, bit) Xvtdivdp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) A :
+(bit[5]) B :
+0b01111101 :
+[AX] :
+[BX] :
+(bit[1]) _ as instr) =
+ Xvtdivdp (BF,A,B,AX,BX)
+
+function clause execute (Xvtdivdp (BF, A, B, AX, BX)) = ()
+
+union ast member (bit[3], bit[5], bit[5], bit, bit) Xvtdivsp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) A :
+(bit[5]) B :
+0b01011101 :
+[AX] :
+[BX] :
+(bit[1]) _ as instr) =
+ Xvtdivsp (BF,A,B,AX,BX)
+
+function clause execute (Xvtdivsp (BF, A, B, AX, BX)) = ()
+
+union ast member (bit[3], bit[5], bit) Xvtsqrtdp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) _ :
+(bit[5]) B :
+0b011101010 :
+[BX] :
+(bit[1]) _ as instr) =
+ Xvtsqrtdp (BF,B,BX)
+
+function clause execute (Xvtsqrtdp (BF, B, BX)) = ()
+
+union ast member (bit[3], bit[5], bit) Xvtsqrtsp
+
+function clause decode (0b111100 :
+(bit[3]) BF :
+(bit[2]) _ :
+(bit[5]) _ :
+(bit[5]) B :
+0b010101010 :
+[BX] :
+(bit[1]) _ as instr) =
+ Xvtsqrtsp (BF,B,BX)
+
+function clause execute (Xvtsqrtsp (BF, B, BX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxland
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10000010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxland (T,A,B,AX,BX,TX)
+
+function clause execute (Xxland (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxlandc
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10001010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxlandc (T,A,B,AX,BX,TX)
+
+function clause execute (Xxlandc (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxlnor
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10100010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxlnor (T,A,B,AX,BX,TX)
+
+function clause execute (Xxlnor (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxlor
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10010010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxlor (T,A,B,AX,BX,TX)
+
+function clause execute (Xxlor (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxlxor
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b10011010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxlxor (T,A,B,AX,BX,TX)
+
+function clause execute (Xxlxor (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxmrghw
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00010010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxmrghw (T,A,B,AX,BX,TX)
+
+function clause execute (Xxmrghw (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit, bit) Xxmrglw
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b00110010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxmrglw (T,A,B,AX,BX,TX)
+
+function clause execute (Xxmrglw (T, A, B, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit, bit, bit) Xxpermdi
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b0 :
+(bit[2]) DM :
+0b01010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxpermdi (T,A,B,DM,AX,BX,TX)
+
+function clause execute (Xxpermdi (T, A, B, DM, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[5], bit, bit, bit, bit) Xxsel
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+(bit[5]) C :
+0b11 :
+[CX] :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxsel (T,A,B,C,CX,AX,BX,TX)
+
+function clause execute (Xxsel (T, A, B, C, CX, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit[2], bit, bit, bit) Xxsldwi
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[5]) A :
+(bit[5]) B :
+0b0 :
+(bit[2]) SHW :
+0b00010 :
+[AX] :
+[BX] :
+[TX] as instr) =
+ Xxsldwi (T,A,B,SHW,AX,BX,TX)
+
+function clause execute (Xxsldwi (T, A, B, SHW, AX, BX, TX)) = ()
+
+union ast member (bit[5], bit[2], bit[5], bit, bit) Xxspltw
+
+function clause decode (0b111100 :
+(bit[5]) T :
+(bit[3]) _ :
+(bit[2]) UIM :
+(bit[5]) B :
+0b010100100 :
+[BX] :
+[TX] as instr) =
+ Xxspltw (T,UIM,B,BX,TX)
+
+function clause execute (Xxspltw (T, UIM, B, BX, TX)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Dlmzb
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001001110 :
+[Rc] as instr) =
+ Dlmzb (RS,RA,RB,Rc)
+
+function clause execute (Dlmzb (RS, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Macchw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b010101100 :
+[Rc] as instr) =
+ Macchw (RT,RA,RB,OE,Rc)
+
+function clause execute (Macchw (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Macchws
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b011101100 :
+[Rc] as instr) =
+ Macchws (RT,RA,RB,OE,Rc)
+
+function clause execute (Macchws (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Macchwu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b010001100 :
+[Rc] as instr) =
+ Macchwu (RT,RA,RB,OE,Rc)
+
+function clause execute (Macchwu (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Macchwsu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b011001100 :
+[Rc] as instr) =
+ Macchwsu (RT,RA,RB,OE,Rc)
+
+function clause execute (Macchwsu (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Machhw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b000101100 :
+[Rc] as instr) =
+ Machhw (RT,RA,RB,OE,Rc)
+
+function clause execute (Machhw (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Machhws
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b001101100 :
+[Rc] as instr) =
+ Machhws (RT,RA,RB,OE,Rc)
+
+function clause execute (Machhws (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Machhwu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b000001100 :
+[Rc] as instr) =
+ Machhwu (RT,RA,RB,OE,Rc)
+
+function clause execute (Machhwu (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Machhwsu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b001001100 :
+[Rc] as instr) =
+ Machhwsu (RT,RA,RB,OE,Rc)
+
+function clause execute (Machhwsu (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Maclhw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110101100 :
+[Rc] as instr) =
+ Maclhw (RT,RA,RB,OE,Rc)
+
+function clause execute (Maclhw (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Maclhws
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111101100 :
+[Rc] as instr) =
+ Maclhws (RT,RA,RB,OE,Rc)
+
+function clause execute (Maclhws (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Maclhwu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110001100 :
+[Rc] as instr) =
+ Maclhwu (RT,RA,RB,OE,Rc)
+
+function clause execute (Maclhwu (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Maclhwsu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111001100 :
+[Rc] as instr) =
+ Maclhwsu (RT,RA,RB,OE,Rc)
+
+function clause execute (Maclhwsu (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulchw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010101000 :
+[Rc] as instr) =
+ Mulchw (RT,RA,RB,Rc)
+
+function clause execute (Mulchw (RT, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulchwu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010001000 :
+[Rc] as instr) =
+ Mulchwu (RT,RA,RB,Rc)
+
+function clause execute (Mulchwu (RT, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulhhw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000101000 :
+[Rc] as instr) =
+ Mulhhw (RT,RA,RB,Rc)
+
+function clause execute (Mulhhw (RT, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Mulhhwu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000001000 :
+[Rc] as instr) =
+ Mulhhwu (RT,RA,RB,Rc)
+
+function clause execute (Mulhhwu (RT, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Mullhw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0110101000 :
+[Rc] as instr) =
+ Mullhw (RT,RA,RB,Rc)
+
+function clause execute (Mullhw (RT, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Mullhwu
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0110001000 :
+[Rc] as instr) =
+ Mullhwu (RT,RA,RB,Rc)
+
+function clause execute (Mullhwu (RT, RA, RB, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Nmacchw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b010101110 :
+[Rc] as instr) =
+ Nmacchw (RT,RA,RB,OE,Rc)
+
+function clause execute (Nmacchw (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Nmacchws
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b011101110 :
+[Rc] as instr) =
+ Nmacchws (RT,RA,RB,OE,Rc)
+
+function clause execute (Nmacchws (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Nmachhw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b000101110 :
+[Rc] as instr) =
+ Nmachhw (RT,RA,RB,OE,Rc)
+
+function clause execute (Nmachhw (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Nmachhws
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b001101110 :
+[Rc] as instr) =
+ Nmachhws (RT,RA,RB,OE,Rc)
+
+function clause execute (Nmachhws (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Nmaclhw
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b110101110 :
+[Rc] as instr) =
+ Nmaclhw (RT,RA,RB,OE,Rc)
+
+function clause execute (Nmaclhw (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit, bit) Nmaclhws
+
+function clause decode (0b000100 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+[OE] :
+0b111101110 :
+[Rc] as instr) =
+ Nmaclhws (RT,RA,RB,OE,Rc)
+
+function clause execute (Nmaclhws (RT, RA, RB, OE, Rc)) = ()
+
+union ast member (bit[5], bit[5]) Icbi
+
+function clause decode (0b011111 :
+(bit[5]) _ :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1111010110 :
+(bit[1]) _ as instr) =
+ Icbi (RA,RB)
+
+function clause execute (Icbi (RA, RB)) = ()
+
+union ast member (bit[4], bit[5], bit[5]) Icbt
+
+function clause decode (0b011111 :
+(bit[1]) _ :
+(bit[4]) CT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000010110 :
+(bit[1]) _ as instr) =
+ Icbt (CT,RA,RB)
+
+function clause execute (Icbt (CT, RA, RB)) = ()
+
+union ast member (bit[5], bit[5]) Dcba
+
+function clause decode (0b011111 :
+(bit[5]) _ :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1011110110 :
+(bit[1]) _ as instr) =
+ Dcba (RA,RB)
+
+function clause execute (Dcba (RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Dcbt
+
+function clause decode (0b011111 :
+(bit[5]) TH :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0100010110 :
+(bit[1]) _ as instr) =
+ Dcbt (TH,RA,RB)
+
+function clause execute (Dcbt (TH, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Dcbtst
+
+function clause decode (0b011111 :
+(bit[5]) TH :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0011110110 :
+(bit[1]) _ as instr) =
+ Dcbtst (TH,RA,RB)
+
+function clause execute (Dcbtst (TH, RA, RB)) = ()
+
+union ast member (bit[5], bit[5]) Dcbz
+
+function clause decode (0b011111 :
+(bit[5]) _ :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1111110110 :
+(bit[1]) _ as instr) =
+ Dcbz (RA,RB)
+
+function clause execute (Dcbz (RA, RB)) = ()
+
+union ast member (bit[5], bit[5]) Dcbst
+
+function clause decode (0b011111 :
+(bit[5]) _ :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000110110 :
+(bit[1]) _ as instr) =
+ Dcbst (RA,RB)
+
+function clause execute (Dcbst (RA, RB)) = ()
+
+union ast member (bit[2], bit[5], bit[5]) Dcbf
+
+function clause decode (0b011111 :
+(bit[3]) _ :
+(bit[2]) L :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001010110 :
+(bit[1]) _ as instr) =
+ Dcbf (L,RA,RB)
+
+function clause execute (Dcbf (L, RA, RB)) = ()
+
+union ast member Isync
+
+function clause decode (0b010011 :
+(bit[5]) _ :
+(bit[5]) _ :
+(bit[5]) _ :
+0b0010010110 :
+(bit[1]) _ as instr) =
+ Isync ()
+
+function clause execute Isync = I_Sync (())
+
+union ast member (bit[5], bit[5], bit[5], bit) Lbarx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000110100 :
+[EH] as instr) =
+ Lbarx (RT,RA,RB,EH)
+
+function clause execute (Lbarx (RT, RA, RB, EH)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] :=
+ 0b00000000000000000000000000000000000000000000000000000000 :
+ MEMr_reserve (EA,1)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Lharx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001110100 :
+[EH] as instr) =
+ Lharx (RT,RA,RB,EH)
+
+function clause execute (Lharx (RT, RA, RB, EH)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] :=
+ 0b000000000000000000000000000000000000000000000000 : MEMr_reserve (EA,2)
+ }
+
+union ast member (bit[5], bit[5], bit[5], bit) Lwarx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0000010100 :
+[EH] as instr) =
+ Lwarx (RT,RA,RB,EH)
+
+function clause execute (Lwarx (RT, RA, RB, EH)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := 0b00000000000000000000000000000000 : MEMr_reserve (EA,4)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stbcx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1010110110 :
+0b1 as instr) =
+ Stbcx (RS,RA,RB)
+
+function clause execute (Stbcx (RS, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Sthcx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b1011010110 :
+0b1 as instr) =
+ Sthcx (RS,RA,RB)
+
+function clause execute (Sthcx (RS, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5]) Stwcx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0010010110 :
+0b1 as instr) =
+ Stwcx (RS,RA,RB)
+
+function clause execute (Stwcx (RS, RA, RB)) = ()
+
+union ast member (bit[5], bit[5], bit[5], bit) Ldarx
+
+function clause decode (0b011111 :
+(bit[5]) RT :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0001010100 :
+[EH] as instr) =
+ Ldarx (RT,RA,RB,EH)
+
+function clause execute (Ldarx (RT, RA, RB, EH)) =
+ {
+ (bit[64]) b := 0;
+ (bit[64]) EA := 0;
+ if RA == 0 then b := 0 else b := GPR[RA];
+ EA := b + GPR[RB];
+ GPR[RT] := MEMr_reserve (EA,8)
+ }
+
+union ast member (bit[5], bit[5], bit[5]) Stdcx
+
+function clause decode (0b011111 :
+(bit[5]) RS :
+(bit[5]) RA :
+(bit[5]) RB :
+0b0011010110 :
+0b1 as instr) =
+ Stdcx (RS,RA,RB)
+
+function clause execute (Stdcx (RS, RA, RB)) = ()
+
union ast member (bit[2]) Sync
function clause decode (0b011111 :
@@ -1767,6 +10509,18 @@ function clause decode (0b011111 :
function clause execute (Sync (L)) =
switch L { case 0b00 -> { H_Sync (()) } case 0b01 -> { LW_Sync (()) } }
+union ast member Eieio
+
+function clause decode (0b011111 :
+(bit[5]) _ :
+(bit[5]) _ :
+(bit[5]) _ :
+0b1101010110 :
+(bit[1]) _ as instr) =
+ Eieio ()
+
+function clause execute Eieio = EIEIO_Sync (())
+
union ast member (bit[5]) Mbar
function clause decode (0b011111 :
@@ -1779,6 +10533,19 @@ function clause decode (0b011111 :
function clause execute (Mbar (MO)) = ()
+union ast member (bit[2]) Wait
+
+function clause decode (0b011111 :
+(bit[3]) _ :
+(bit[2]) WC :
+(bit[5]) _ :
+(bit[5]) _ :
+0b0000111110 :
+(bit[1]) _ as instr) =
+ Wait (WC)
+
+function clause execute (Wait (WC)) = ()
+
typedef decode_failure = enumerate { no_matching_pattern; unsupported_instruction; illegal_instruction }
@@ -1827,7 +10594,7 @@ function bit illegal_instructions_pred ((ast) instr) = {
let ceil =
(if (n mod 4) == 0
then n quot 4 else (n quot 4) + 1) in
- (RT <= RA) & (RA <= ((bit[5]) (((bit[5]) (RT + ceil)) -1)))
+ (RT <= RA) & (RA <= ((bit[5]) (((bit[5]) (RT + ceil)) - 1)))
(* Can't read XER at the time meant, so will need to rethink *)
(* case (Lswx(RT,RA,RB)) ->
let (([|32|]) n) = (XER[57..63]) in