@@ -151,6 +151,8 @@ module Unop = struct
151151 | Regexp_plus
152152 | Regexp_opt
153153 | Regexp_comp
154+ | Rotl of int
155+ | Rotr of int
154156 [@@ deriving ord ]
155157
156158 let hash = function
@@ -188,6 +190,8 @@ module Unop = struct
188190 | Regexp_plus -> 25
189191 | Regexp_opt -> 26
190192 | Regexp_comp -> 27
193+ | Rotl n -> combine 28 n
194+ | Rotr n -> combine 29 n
191195
192196 let equal o1 o2 =
193197 match (o1, o2) with
@@ -220,11 +224,12 @@ module Unop = struct
220224 | Regexp_opt , Regexp_opt
221225 | Regexp_comp , Regexp_comp ->
222226 true
227+ | Rotl a , Rotl b | Rotr a , Rotr b -> a = b
223228 | ( ( Neg | Not | Clz | Popcnt | Ctz | Abs | Sqrt | Is_normal | Is_subnormal
224229 | Is_negative | Is_positive | Is_infinite | Is_nan | Is_zero | Ceil
225230 | Floor | Trunc | Nearest | Head | Tail | Reverse | Length | Trim
226231 | Regexp_star | Regexp_loop _ | Regexp_plus | Regexp_opt | Regexp_comp
227- )
232+ | Rotl _ | Rotr _ )
228233 , _ ) ->
229234 false
230235
@@ -257,6 +262,8 @@ module Unop = struct
257262 | Regexp_plus -> Fmt. string fmt " +"
258263 | Regexp_opt -> Fmt. string fmt " opt"
259264 | Regexp_comp -> Fmt. string fmt " comp"
265+ | Rotl n -> Fmt. pf fmt " (rotl %d)" n
266+ | Rotr n -> Fmt. pf fmt " (rotr %d)" n
260267end
261268
262269module Binop = struct
@@ -279,8 +286,8 @@ module Binop = struct
279286 | Min
280287 | Max
281288 | Copysign
282- | Rotl
283- | Rotr
289+ | Ext_rotl
290+ | Ext_rotr
284291 | At
285292 | List_cons
286293 | List_append
@@ -315,8 +322,8 @@ module Binop = struct
315322 | Min -> 15
316323 | Max -> 16
317324 | Copysign -> 17
318- | Rotl -> 18
319- | Rotr -> 19
325+ | Ext_rotl -> 18
326+ | Ext_rotr -> 19
320327 | At -> 20
321328 | List_cons -> 21
322329 | List_append -> 22
@@ -351,8 +358,8 @@ module Binop = struct
351358 | Min , Min
352359 | Max , Max
353360 | Copysign , Copysign
354- | Rotl , Rotl
355- | Rotr , Rotr
361+ | Ext_rotl , Ext_rotl
362+ | Ext_rotr , Ext_rotr
356363 | At , At
357364 | List_cons , List_cons
358365 | List_append , List_append
@@ -366,8 +373,8 @@ module Binop = struct
366373 | Regexp_diff , Regexp_diff ->
367374 true
368375 | ( ( Add | Sub | Mul | Div | DivU | Rem | RemU | Shl | ShrA | ShrL | And
369- | Or | Xor | Implies | Pow | Min | Max | Copysign | Rotl | Rotr | At
370- | List_cons | List_append | String_prefix | String_suffix
376+ | Or | Xor | Implies | Pow | Min | Max | Copysign | Ext_rotr | Ext_rotl
377+ | At | List_cons | List_append | String_prefix | String_suffix
371378 | String_contains | String_last_index | String_in_re | Regexp_range
372379 | Regexp_inter | Regexp_diff )
373380 , _ ) ->
@@ -392,8 +399,8 @@ module Binop = struct
392399 | Min -> Fmt. string fmt " min"
393400 | Max -> Fmt. string fmt " max"
394401 | Copysign -> Fmt. string fmt " copysign"
395- | Rotl -> Fmt. string fmt " rotl "
396- | Rotr -> Fmt. string fmt " rotr "
402+ | Ext_rotl -> Fmt. string fmt " ext_rotl "
403+ | Ext_rotr -> Fmt. string fmt " ext_rotr "
397404 | At -> Fmt. string fmt " at"
398405 | List_cons -> Fmt. string fmt " cons"
399406 | List_append -> Fmt. string fmt " append"
0 commit comments