@@ -1062,10 +1062,7 @@ macro_rules! op_mle3_range {
1062
1062
let $bb_out = $op;
1063
1063
$op_bb_out
1064
1064
} } ;
1065
- }
1066
1065
1067
- #[ macro_export]
1068
- macro_rules! op_mle3_range_pool {
1069
1066
( $x: ident, $a: ident, $b: ident, $res: ident, $x_vec: ident, $a_vec: ident, $b_vec: ident, $res_vec: ident, $op: expr, |$bb_out: ident| $op_bb_out: expr) => { {
1070
1067
let $x = if let Some ( ( start, offset) ) = $x. evaluations_range( ) {
1071
1068
& $x_vec[ start..] [ ..offset]
@@ -1091,7 +1088,7 @@ macro_rules! op_mle3_range_pool {
1091
1088
1092
1089
/// deal with x * a + b
1093
1090
#[ macro_export]
1094
- macro_rules! op_mle_xa_b_pool {
1091
+ macro_rules! op_mle_xa_b {
1095
1092
( |$x: ident, $a: ident, $b: ident, $res: ident| $op: expr, $pool_e: ident, $pool_b: ident, |$bb_out: ident| $op_bb_out: expr) => {
1096
1093
match ( & $x. evaluations( ) , & $a. evaluations( ) , & $b. evaluations( ) ) {
1097
1094
(
@@ -1100,7 +1097,7 @@ macro_rules! op_mle_xa_b_pool {
1100
1097
$crate:: mle:: FieldType :: Base ( b_vec) ,
1101
1098
) => {
1102
1099
let res_vec = $pool_b. borrow( ) ;
1103
- op_mle3_range_pool !(
1100
+ op_mle3_range !(
1104
1101
$x,
1105
1102
$a,
1106
1103
$b,
@@ -1119,7 +1116,7 @@ macro_rules! op_mle_xa_b_pool {
1119
1116
$crate:: mle:: FieldType :: Base ( b_vec) ,
1120
1117
) => {
1121
1118
let res_vec = $pool_e. borrow( ) ;
1122
- op_mle3_range_pool !(
1119
+ op_mle3_range !(
1123
1120
$x,
1124
1121
$a,
1125
1122
$b,
@@ -1138,7 +1135,7 @@ macro_rules! op_mle_xa_b_pool {
1138
1135
$crate:: mle:: FieldType :: Ext ( b_vec) ,
1139
1136
) => {
1140
1137
let res_vec = $pool_e. borrow( ) ;
1141
- op_mle3_range_pool !(
1138
+ op_mle3_range !(
1142
1139
$x,
1143
1140
$a,
1144
1141
$b,
@@ -1160,7 +1157,7 @@ macro_rules! op_mle_xa_b_pool {
1160
1157
}
1161
1158
} ;
1162
1159
( |$x: ident, $a: ident, $b: ident, $res: ident| $op: expr, $pool_e: ident, $pool_b: ident) => {
1163
- op_mle_xa_b_pool !( |$x, $a, $b, $res| $op, $pool_e, $pool_b, |out| out)
1160
+ op_mle_xa_b !( |$x, $a, $b, $res| $op, $pool_e, $pool_b, |out| out)
1164
1161
} ;
1165
1162
}
1166
1163
@@ -1297,15 +1294,6 @@ macro_rules! commutative_op_mle_pair {
1297
1294
_ => unreachable!( ) ,
1298
1295
}
1299
1296
} ;
1300
- ( |$a: ident, $b: ident| $op: expr) => {
1301
- commutative_op_mle_pair!( |$a, $b| $op, |out| out)
1302
- } ;
1303
- }
1304
-
1305
- /// macro support op(a, b) and tackles type matching internally.
1306
- /// Please noted that op must satisfy commutative rule w.r.t op(b, a) operand swap.
1307
- #[ macro_export]
1308
- macro_rules! commutative_op_mle_pair_pool {
1309
1297
( |$first: ident, $second: ident, $res: ident| $op: expr, $pool_e: ident, $pool_b: ident, |$bb_out: ident| $op_bb_out: expr) => {
1310
1298
match ( & $first. evaluations( ) , & $second. evaluations( ) ) {
1311
1299
( $crate:: mle:: FieldType :: Base ( base1) , $crate:: mle:: FieldType :: Base ( base2) ) => {
@@ -1374,6 +1362,9 @@ macro_rules! commutative_op_mle_pair_pool {
1374
1362
}
1375
1363
} ;
1376
1364
( |$a: ident, $b: ident, $res: ident| $op: expr, $pool_e: ident, $pool_b: ident) => {
1377
- commutative_op_mle_pair_pool!( |$a, $b, $res| $op, $pool_e, $pool_b, |out| out)
1365
+ commutative_op_mle_pair!( |$a, $b, $res| $op, $pool_e, $pool_b, |out| out)
1366
+ } ;
1367
+ ( |$a: ident, $b: ident| $op: expr) => {
1368
+ commutative_op_mle_pair!( |$a, $b| $op, |out| out)
1378
1369
} ;
1379
1370
}
0 commit comments