@@ -353,6 +353,9 @@ void _dump_red_pkt(struct red_pkt *pkt, char *dir)
353353#define COLL_OPCODE_BIT_AND 0x01
354354#define COLL_OPCODE_BIT_OR 0x02
355355#define COLL_OPCODE_BIT_XOR 0x03
356+ #define COLL_OPCODE_LOG_AND 0x04
357+ #define COLL_OPCODE_LOG_OR 0x05
358+ #define COLL_OPCODE_LOG_XOR 0x06
356359#define COLL_OPCODE_INT_MIN 0x10
357360#define COLL_OPCODE_INT_MAX 0x11
358361#define COLL_OPCODE_INT_MINMAXLOC 0x12
@@ -401,11 +404,17 @@ void cxip_coll_populate_opcodes(void)
401404 _int8_16_32_op_to_opcode [FI_BOR ] = COLL_OPCODE_BIT_OR ;
402405 _int8_16_32_op_to_opcode [FI_BAND ] = COLL_OPCODE_BIT_AND ;
403406 _int8_16_32_op_to_opcode [FI_BXOR ] = COLL_OPCODE_BIT_XOR ;
407+ _int8_16_32_op_to_opcode [FI_LOR ] = COLL_OPCODE_LOG_OR ;
408+ _int8_16_32_op_to_opcode [FI_LAND ] = COLL_OPCODE_LOG_AND ;
409+ _int8_16_32_op_to_opcode [FI_LXOR ] = COLL_OPCODE_LOG_XOR ;
404410
405411 /* operations supported by 32, 16, and 8 bit unsigned int operands */
406412 _uint8_16_32_op_to_opcode [FI_BOR ] = COLL_OPCODE_BIT_OR ;
407413 _uint8_16_32_op_to_opcode [FI_BAND ] = COLL_OPCODE_BIT_AND ;
408414 _uint8_16_32_op_to_opcode [FI_BXOR ] = COLL_OPCODE_BIT_XOR ;
415+ _uint8_16_32_op_to_opcode [FI_LOR ] = COLL_OPCODE_LOG_OR ;
416+ _uint8_16_32_op_to_opcode [FI_LAND ] = COLL_OPCODE_LOG_AND ;
417+ _uint8_16_32_op_to_opcode [FI_LXOR ] = COLL_OPCODE_LOG_XOR ;
409418
410419 /* operations supported by 64 bit signed int operands */
411420 _int64_op_to_opcode [FI_MIN ] = COLL_OPCODE_INT_MIN ;
@@ -417,6 +426,9 @@ void cxip_coll_populate_opcodes(void)
417426 _uint64_op_to_opcode [FI_BOR ] = COLL_OPCODE_BIT_OR ;
418427 _uint64_op_to_opcode [FI_BAND ] = COLL_OPCODE_BIT_AND ;
419428 _uint64_op_to_opcode [FI_BXOR ] = COLL_OPCODE_BIT_XOR ;
429+ _uint64_op_to_opcode [FI_LOR ] = COLL_OPCODE_LOG_OR ;
430+ _uint64_op_to_opcode [FI_LAND ] = COLL_OPCODE_LOG_AND ;
431+ _uint64_op_to_opcode [FI_LXOR ] = COLL_OPCODE_LOG_XOR ;
420432
421433 /* operations supported by 64 bit double operands */
422434 _flt_op_to_opcode [FI_MIN ] = COLL_OPCODE_FLT_MINNUM ;
@@ -429,6 +441,9 @@ void cxip_coll_populate_opcodes(void)
429441 _cxi_op_to_redtype [COLL_OPCODE_BIT_OR ] = REDTYPE_INT ;
430442 _cxi_op_to_redtype [COLL_OPCODE_BIT_AND ] = REDTYPE_INT ;
431443 _cxi_op_to_redtype [COLL_OPCODE_BIT_XOR ] = REDTYPE_INT ;
444+ _cxi_op_to_redtype [COLL_OPCODE_LOG_OR ] = REDTYPE_INT ;
445+ _cxi_op_to_redtype [COLL_OPCODE_LOG_AND ] = REDTYPE_INT ;
446+ _cxi_op_to_redtype [COLL_OPCODE_LOG_XOR ] = REDTYPE_INT ;
432447 _cxi_op_to_redtype [COLL_OPCODE_INT_MIN ] = REDTYPE_INT ;
433448 _cxi_op_to_redtype [COLL_OPCODE_INT_MAX ] = REDTYPE_INT ;
434449 _cxi_op_to_redtype [COLL_OPCODE_INT_SUM ] = REDTYPE_INT ;
@@ -1502,6 +1517,26 @@ static void _reduce(struct cxip_coll_data *accum,
15021517 accum -> intval .ival [i ] ^= coll_data -> intval .ival [i ];
15031518 /* overflow not possible */
15041519 break ;
1520+ case COLL_OPCODE_LOG_AND :
1521+ for (i = 0 ; i < 4 ; i ++ )
1522+ accum -> intval .ival [i ] = (accum -> intval .ival [i ] &&
1523+ coll_data -> intval .ival [i ]);
1524+ /* overflow not possible */
1525+ break ;
1526+ case COLL_OPCODE_LOG_OR :
1527+ for (i = 0 ; i < 4 ; i ++ )
1528+ accum -> intval .ival [i ] = (accum -> intval .ival [i ] ||
1529+ coll_data -> intval .ival [i ]);
1530+ /* overflow not possible */
1531+ break ;
1532+ case COLL_OPCODE_LOG_XOR :
1533+ for (i = 0 ; i < 4 ; i ++ )
1534+ accum -> intval .ival [i ] = ((accum -> intval .ival [i ] &&
1535+ !coll_data -> intval .ival [i ])
1536+ || (!accum -> intval .ival [i ] &&
1537+ coll_data -> intval .ival [i ]));
1538+ /* overflow not possible */
1539+ break ;
15051540 case COLL_OPCODE_INT_MIN :
15061541 for (i = 0 ; i < 4 ; i ++ )
15071542 if (accum -> intval .ival [i ] > coll_data -> intval .ival [i ])
0 commit comments