@@ -46,9 +46,6 @@ impl<'arena> Env<'arena> {
46
46
const S16_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , S16Type ) ;
47
47
const S32_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , S32Type ) ;
48
48
const S64_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , S64Type ) ;
49
- const ARRAY8_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , Array8Type ) ;
50
- const ARRAY16_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , Array16Type ) ;
51
- const ARRAY32_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , Array32Type ) ;
52
49
const ARRAY64_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , Array64Type ) ;
53
50
const POS_TYPE : Term < ' _ > = Term :: Prim ( Span :: Empty , PosType ) ;
54
51
@@ -68,9 +65,6 @@ impl<'arena> Env<'arena> {
68
65
env. define_prim ( F64Type , & UNIVERSE ) ;
69
66
env. define_prim_fun ( OptionType , [ & UNIVERSE ] , & UNIVERSE ) ;
70
67
env. define_prim_fun ( ArrayType , [ & UNIVERSE ] , & UNIVERSE ) ;
71
- env. define_prim_fun ( Array8Type , [ & U8_TYPE , & UNIVERSE ] , & UNIVERSE ) ;
72
- env. define_prim_fun ( Array16Type , [ & U16_TYPE , & UNIVERSE ] , & UNIVERSE ) ;
73
- env. define_prim_fun ( Array32Type , [ & U32_TYPE , & UNIVERSE ] , & UNIVERSE ) ;
74
68
env. define_prim_fun ( Array64Type , [ & U64_TYPE , & UNIVERSE ] , & UNIVERSE ) ;
75
69
env. define_prim ( PosType , & UNIVERSE ) ;
76
70
env. define_prim_fun ( RefType , [ & FORMAT_TYPE ] , & UNIVERSE ) ;
@@ -94,9 +88,6 @@ impl<'arena> Env<'arena> {
94
88
env. define_prim ( FormatF32Le , & FORMAT_TYPE ) ;
95
89
env. define_prim ( FormatF64Be , & FORMAT_TYPE ) ;
96
90
env. define_prim ( FormatF64Le , & FORMAT_TYPE ) ;
97
- env. define_prim_fun ( FormatRepeatLen8 , [ & U8_TYPE , & FORMAT_TYPE ] , & FORMAT_TYPE ) ;
98
- env. define_prim_fun ( FormatRepeatLen16 , [ & U16_TYPE , & FORMAT_TYPE ] , & FORMAT_TYPE ) ;
99
- env. define_prim_fun ( FormatRepeatLen32 , [ & U32_TYPE , & FORMAT_TYPE ] , & FORMAT_TYPE ) ;
100
91
env. define_prim_fun ( FormatRepeatLen64 , [ & U64_TYPE , & FORMAT_TYPE ] , & FORMAT_TYPE ) ;
101
92
env. define_prim_fun ( FormatRepeatUntilEnd , [ & FORMAT_TYPE ] , & FORMAT_TYPE ) ;
102
93
env. define_prim_fun ( FormatLimit8 , [ & U8_TYPE , & FORMAT_TYPE ] , & FORMAT_TYPE ) ;
@@ -197,6 +188,9 @@ impl<'arena> Env<'arena> {
197
188
env. define_prim_fun ( U8And , [ & U8_TYPE , & U8_TYPE ] , & U8_TYPE ) ;
198
189
env. define_prim_fun ( U8Or , [ & U8_TYPE , & U8_TYPE ] , & U8_TYPE ) ;
199
190
env. define_prim_fun ( U8Xor , [ & U8_TYPE , & U8_TYPE ] , & U8_TYPE ) ;
191
+ env. define_prim_fun ( U8ExtendU16 , [ & U8_TYPE ] , & U16_TYPE ) ;
192
+ env. define_prim_fun ( U8ExtendU32 , [ & U8_TYPE ] , & U32_TYPE ) ;
193
+ env. define_prim_fun ( U8ExtendU64 , [ & U8_TYPE ] , & U64_TYPE ) ;
200
194
201
195
env. define_prim_fun ( U16Eq , [ & U16_TYPE , & U16_TYPE ] , & BOOL_TYPE ) ;
202
196
env. define_prim_fun ( U16Neq , [ & U16_TYPE , & U16_TYPE ] , & BOOL_TYPE ) ;
@@ -214,6 +208,8 @@ impl<'arena> Env<'arena> {
214
208
env. define_prim_fun ( U16And , [ & U16_TYPE , & U16_TYPE ] , & U16_TYPE ) ;
215
209
env. define_prim_fun ( U16Or , [ & U16_TYPE , & U16_TYPE ] , & U16_TYPE ) ;
216
210
env. define_prim_fun ( U16Xor , [ & U16_TYPE , & U16_TYPE ] , & U16_TYPE ) ;
211
+ env. define_prim_fun ( U16ExtendU32 , [ & U16_TYPE ] , & U32_TYPE ) ;
212
+ env. define_prim_fun ( U16ExtendU64 , [ & U16_TYPE ] , & U64_TYPE ) ;
217
213
218
214
env. define_prim_fun ( U32Eq , [ & U32_TYPE , & U32_TYPE ] , & BOOL_TYPE ) ;
219
215
env. define_prim_fun ( U32Neq , [ & U32_TYPE , & U32_TYPE ] , & BOOL_TYPE ) ;
@@ -231,6 +227,7 @@ impl<'arena> Env<'arena> {
231
227
env. define_prim_fun ( U32And , [ & U32_TYPE , & U32_TYPE ] , & U32_TYPE ) ;
232
228
env. define_prim_fun ( U32Or , [ & U32_TYPE , & U32_TYPE ] , & U32_TYPE ) ;
233
229
env. define_prim_fun ( U32Xor , [ & U32_TYPE , & U32_TYPE ] , & U32_TYPE ) ;
230
+ env. define_prim_fun ( U32ExtendU64 , [ & U32_TYPE ] , & U64_TYPE ) ;
234
231
235
232
env. define_prim_fun ( U64Eq , [ & U64_TYPE , & U64_TYPE ] , & BOOL_TYPE ) ;
236
233
env. define_prim_fun ( U64Neq , [ & U64_TYPE , & U64_TYPE ] , & BOOL_TYPE ) ;
@@ -437,13 +434,7 @@ impl<'arena> Env<'arena> {
437
434
) ) ,
438
435
) )
439
436
} ;
440
- let array8_find_type = find_type ( & U8_TYPE , & ARRAY8_TYPE ) ;
441
- let array16_find_type = find_type ( & U16_TYPE , & ARRAY16_TYPE ) ;
442
- let array32_find_type = find_type ( & U32_TYPE , & ARRAY32_TYPE ) ;
443
437
let array64_find_type = find_type ( & U64_TYPE , & ARRAY64_TYPE ) ;
444
- env. define_prim ( Array8Find , array8_find_type) ;
445
- env. define_prim ( Array16Find , array16_find_type) ;
446
- env. define_prim ( Array32Find , array32_find_type) ;
447
438
env. define_prim ( Array64Find , array64_find_type) ;
448
439
449
440
// fun (@len : UN) (@A : Type) (index : UN) -> ArrayN len A -> A
@@ -486,13 +477,7 @@ impl<'arena> Env<'arena> {
486
477
) ) ,
487
478
) )
488
479
} ;
489
- let array8_index_type = array_index_type ( & U8_TYPE , & ARRAY8_TYPE ) ;
490
- let array16_index_type = array_index_type ( & U16_TYPE , & ARRAY16_TYPE ) ;
491
- let array32_index_type = array_index_type ( & U32_TYPE , & ARRAY32_TYPE ) ;
492
480
let array64_index_type = array_index_type ( & U64_TYPE , & ARRAY64_TYPE ) ;
493
- env. define_prim ( Array8Index , array8_index_type) ;
494
- env. define_prim ( Array16Index , array16_index_type) ;
495
- env. define_prim ( Array32Index , array32_index_type) ;
496
481
env. define_prim ( Array64Index , array64_index_type) ;
497
482
498
483
env. define_prim_fun ( PosAddU8 , [ & POS_TYPE , & U8_TYPE ] , & POS_TYPE ) ;
@@ -611,9 +596,6 @@ pub fn repr(prim: Prim) -> Step {
611
596
Prim :: FormatF32Le => step ! ( _, [ ] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: F32Type , [ ] ) ) ) ) ,
612
597
Prim :: FormatF64Be => step ! ( _, [ ] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: F64Type , [ ] ) ) ) ) ,
613
598
Prim :: FormatF64Le => step ! ( _, [ ] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: F64Type , [ ] ) ) ) ) ,
614
- Prim :: FormatRepeatLen8 => step ! ( env, [ len, elem] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: Array8Type , [ len. clone( ) , env. format_repr( elem) ] ) ) ) ) ,
615
- Prim :: FormatRepeatLen16 => step ! ( env, [ len, elem] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: Array16Type , [ len. clone( ) , env. format_repr( elem) ] ) ) ) ) ,
616
- Prim :: FormatRepeatLen32 => step ! ( env, [ len, elem] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: Array32Type , [ len. clone( ) , env. format_repr( elem) ] ) ) ) ) ,
617
599
Prim :: FormatRepeatLen64 => step ! ( env, [ len, elem] => Spanned :: empty( Arc :: new( Value :: prim( Prim :: Array64Type , [ len. clone( ) , env. format_repr( elem) ] ) ) ) ) ,
618
600
Prim :: FormatLimit8 => step ! ( env, [ _, elem] => env. format_repr( elem) ) ,
619
601
Prim :: FormatLimit16 => step ! ( env, [ _, elem] => env. format_repr( elem) ) ,
@@ -666,6 +648,9 @@ pub fn step(prim: Prim) -> Step {
666
648
Prim :: U8And => const_step ! ( [ x, xst: U8 , y, yst: U8 ] => Const :: U8 ( u8 :: bitand( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
667
649
Prim :: U8Or => const_step ! ( [ x, xst: U8 , y, yst: U8 ] => Const :: U8 ( u8 :: bitor( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
668
650
Prim :: U8Xor => const_step ! ( [ x, xst: U8 , y, yst: U8 ] => Const :: U8 ( u8 :: bitxor( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
651
+ Prim :: U8ExtendU16 => const_step ! ( [ x, xst: U8 ] => Const :: U16 ( u16 :: from( * x) , * xst) ) ,
652
+ Prim :: U8ExtendU32 => const_step ! ( [ x, xst: U8 ] => Const :: U32 ( u32 :: from( * x) , * xst) ) ,
653
+ Prim :: U8ExtendU64 => const_step ! ( [ x, xst: U8 ] => Const :: U64 ( u64 :: from( * x) , * xst) ) ,
669
654
670
655
Prim :: U16Eq => const_step ! ( [ x: U16 , y: U16 ] => Const :: Bool ( x == y) ) ,
671
656
Prim :: U16Neq => const_step ! ( [ x: U16 , y: U16 ] => Const :: Bool ( x != y) ) ,
@@ -683,6 +668,8 @@ pub fn step(prim: Prim) -> Step {
683
668
Prim :: U16And => const_step ! ( [ x, xst: U16 , y, yst: U16 ] => Const :: U16 ( u16 :: bitand( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
684
669
Prim :: U16Or => const_step ! ( [ x, xst: U16 , y, yst: U16 ] => Const :: U16 ( u16 :: bitor( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
685
670
Prim :: U16Xor => const_step ! ( [ x, xst: U16 , y, yst: U16 ] => Const :: U16 ( u16 :: bitxor( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
671
+ Prim :: U16ExtendU32 => const_step ! ( [ x, xst: U16 ] => Const :: U32 ( u32 :: from( * x) , * xst) ) ,
672
+ Prim :: U16ExtendU64 => const_step ! ( [ x, xst: U16 ] => Const :: U64 ( u64 :: from( * x) , * xst) ) ,
686
673
687
674
Prim :: U32Eq => const_step ! ( [ x: U32 , y: U32 ] => Const :: Bool ( x == y) ) ,
688
675
Prim :: U32Neq => const_step ! ( [ x: U32 , y: U32 ] => Const :: Bool ( x != y) ) ,
@@ -700,6 +687,7 @@ pub fn step(prim: Prim) -> Step {
700
687
Prim :: U32And => const_step ! ( [ x, xst: U32 , y, yst: U32 ] => Const :: U32 ( u32 :: bitand( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
701
688
Prim :: U32Or => const_step ! ( [ x, xst: U32 , y, yst: U32 ] => Const :: U32 ( u32 :: bitor( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
702
689
Prim :: U32Xor => const_step ! ( [ x, xst: U32 , y, yst: U32 ] => Const :: U32 ( u32 :: bitxor( * x, * y) , UIntStyle :: merge( * xst, * yst) ) ) ,
690
+ Prim :: U32ExtendU64 => const_step ! ( [ x, xst: U32 ] => Const :: U64 ( u64 :: from( * x) , * xst) ) ,
703
691
704
692
Prim :: U64Eq => const_step ! ( [ x: U64 , y: U64 ] => Const :: Bool ( x == y) ) ,
705
693
Prim :: U64Neq => const_step ! ( [ x: U64 , y: U64 ] => Const :: Bool ( x != y) ) ,
0 commit comments