2
2
3
3
use super :: int_types:: { get_log_width, int_type_var, ConstIntU , INT_TYPES , LOG_WIDTH_TYPE_PARAM } ;
4
4
use crate :: extension:: prelude:: { sum_with_error, BOOL_T } ;
5
- use crate :: extension:: { ConstFoldResult , CustomValidator , FoldOutput , ValidateJustArgs } ;
5
+ use crate :: extension:: { ConstFoldResult , CustomValidator , ValidateJustArgs } ;
6
6
use crate :: types:: { FunctionType , PolyFuncType } ;
7
7
use crate :: utils:: collect_array;
8
- use crate :: values :: Value ;
8
+
9
9
use crate :: {
10
10
extension:: { ExtensionId , ExtensionSet , SignatureError } ,
11
11
types:: { type_param:: TypeArg , Type , TypeRow } ,
@@ -72,22 +72,10 @@ fn idivmod_sig() -> PolyFuncType {
72
72
int_polytype ( 2 , intpair. clone ( ) , vec ! [ Type :: new_tuple( intpair) ] )
73
73
}
74
74
75
- fn zero ( width : u8 ) -> ops:: Const {
76
- ops:: Const :: new (
77
- ConstIntU :: new ( width, 0 ) . unwrap ( ) . into ( ) ,
78
- INT_TYPES [ 5 ] . to_owned ( ) ,
79
- )
80
- . unwrap ( )
81
- }
82
-
83
75
fn iadd_fold ( consts : & [ ( IncomingPort , ops:: Const ) ] ) -> ConstFoldResult {
84
76
// TODO get width from const
85
77
let width = 5 ;
86
78
match consts {
87
- [ ( p, c) ] if c == & zero ( width) => {
88
- let other_port: IncomingPort = if & IncomingPort :: from ( 0 ) == p { 1 } else { 0 } . into ( ) ;
89
- Some ( vec ! [ ( 0 . into( ) , other_port. into( ) ) ] )
90
- }
91
79
[ ( _, c1) , ( _, c2) ] => {
92
80
let [ c1, c2] : [ & ConstIntU ; 2 ] = [ c1, c2] . map ( |c| c. get_custom_value ( ) . unwrap ( ) ) ;
93
81
@@ -99,8 +87,7 @@ fn iadd_fold(consts: &[(IncomingPort, ops::Const)]) -> ConstFoldResult {
99
87
. into( ) ,
100
88
INT_TYPES [ 5 ] . to_owned( ) ,
101
89
)
102
- . unwrap( )
103
- . into( ) ,
90
+ . unwrap( ) ,
104
91
) ] )
105
92
}
106
93
0 commit comments