@@ -246,7 +246,8 @@ def english_upper(s):
246
246
'P' : 'OBJECT' ,
247
247
}
248
248
249
- noobj = '?bBhHiIlLqQefdgFDGmM'
249
+ no_obj_bool = 'bBhHiIlLqQefdgFDGmM'
250
+ noobj = '?' + no_obj_bool
250
251
all = '?bBhHiIlLqQefdgFDGOmM'
251
252
252
253
O = 'O'
@@ -280,6 +281,7 @@ def english_upper(s):
280
281
nocmplxP = nocmplx + P
281
282
notimes_or_obj = bints + inexact
282
283
nodatetime_or_obj = bints + inexact
284
+ no_bool_times_obj = ints + inexact
283
285
284
286
# Find which code corresponds to int64.
285
287
int64 = ''
@@ -299,7 +301,9 @@ def english_upper(s):
299
301
Ufunc (2 , 1 , Zero ,
300
302
docstrings .get ('numpy.core.umath.add' ),
301
303
'PyUFunc_AdditionTypeResolver' ,
302
- TD (notimes_or_obj , simd = [('avx2' , ints )], dispatch = [('loops_arithm_fp' , 'fdFD' )]),
304
+ TD ('?' , cfunc_alias = 'logical_or' , dispatch = [('loops_logical' , '?' )]),
305
+ TD (no_bool_times_obj , simd = [('avx2' , ints )],
306
+ dispatch = [('loops_arithm_fp' , 'fdFD' )]),
303
307
[TypeDescription ('M' , FullTypeDescr , 'Mm' , 'M' ),
304
308
TypeDescription ('m' , FullTypeDescr , 'mm' , 'm' ),
305
309
TypeDescription ('M' , FullTypeDescr , 'mM' , 'M' ),
@@ -310,7 +314,8 @@ def english_upper(s):
310
314
Ufunc (2 , 1 , None , # Zero is only a unit to the right, not the left
311
315
docstrings .get ('numpy.core.umath.subtract' ),
312
316
'PyUFunc_SubtractionTypeResolver' ,
313
- TD (ints + inexact , simd = [('avx2' , ints )], dispatch = [('loops_arithm_fp' , 'fdFD' )]),
317
+ TD (no_bool_times_obj , simd = [('avx2' , ints )],
318
+ dispatch = [('loops_arithm_fp' , 'fdFD' )]),
314
319
[TypeDescription ('M' , FullTypeDescr , 'Mm' , 'M' ),
315
320
TypeDescription ('m' , FullTypeDescr , 'mm' , 'm' ),
316
321
TypeDescription ('M' , FullTypeDescr , 'MM' , 'm' ),
@@ -321,7 +326,10 @@ def english_upper(s):
321
326
Ufunc (2 , 1 , One ,
322
327
docstrings .get ('numpy.core.umath.multiply' ),
323
328
'PyUFunc_MultiplicationTypeResolver' ,
324
- TD (notimes_or_obj , simd = [('avx2' , ints )], dispatch = [('loops_arithm_fp' , 'fdFD' )]),
329
+ TD ('?' , cfunc_alias = 'logical_and' ,
330
+ dispatch = [('loops_logical' , '?' )]),
331
+ TD (no_bool_times_obj , simd = [('avx2' , ints )],
332
+ dispatch = [('loops_arithm_fp' , 'fdFD' )]),
325
333
[TypeDescription ('m' , FullTypeDescr , 'mq' , 'm' ),
326
334
TypeDescription ('m' , FullTypeDescr , 'qm' , 'm' ),
327
335
TypeDescription ('m' , FullTypeDescr , 'md' , 'm' ),
@@ -412,8 +420,8 @@ def english_upper(s):
412
420
Ufunc (1 , 1 , None ,
413
421
docstrings .get ('numpy.core.umath.absolute' ),
414
422
'PyUFunc_AbsoluteTypeResolver' ,
415
- TD (bints + flts + timedeltaonly , dispatch = [('loops_unary_fp' , 'fd' )]) ,
416
- TD ( '?' , dispatch = [ ('loops_logical' , '?' )]),
423
+ TD (bints + flts + timedeltaonly , dispatch = [('loops_unary_fp' , 'fd' ),
424
+ ('loops_logical' , '?' )]),
417
425
TD (cmplx , simd = [('avx512f' , cmplxvec )], out = ('f' , 'd' , 'g' )),
418
426
TD (O , f = 'PyNumber_Absolute' ),
419
427
),
@@ -497,46 +505,51 @@ def english_upper(s):
497
505
Ufunc (2 , 1 , True_ ,
498
506
docstrings .get ('numpy.core.umath.logical_and' ),
499
507
'PyUFunc_SimpleBinaryComparisonTypeResolver' ,
500
- TD ('?' , dispatch = [('loops_logical ' , '?' )]) ,
501
- TD ( nodatetime_or_obj , out = '?' , simd = [('avx2 ' , ints )]),
508
+ TD (nodatetime_or_obj , out = '?' , simd = [('avx2 ' , ints )] ,
509
+ dispatch = [('loops_logical ' , '?' )]),
502
510
TD (O , f = 'npy_ObjectLogicalAnd' ),
503
511
),
504
512
'logical_not' :
505
513
Ufunc (1 , 1 , None ,
506
514
docstrings .get ('numpy.core.umath.logical_not' ),
507
515
None ,
508
- TD ('?' , dispatch = [('loops_logical ' , '?' )]) ,
509
- TD ( nodatetime_or_obj , out = '?' , simd = [('avx2 ' , ints )]),
516
+ TD (nodatetime_or_obj , out = '?' , simd = [('avx2 ' , ints )] ,
517
+ dispatch = [('loops_logical ' , '?' )]),
510
518
TD (O , f = 'npy_ObjectLogicalNot' ),
511
519
),
512
520
'logical_or' :
513
521
Ufunc (2 , 1 , False_ ,
514
522
docstrings .get ('numpy.core.umath.logical_or' ),
515
523
'PyUFunc_SimpleBinaryComparisonTypeResolver' ,
516
- TD ('?' , dispatch = [('loops_logical ' , '?' )]) ,
517
- TD ( nodatetime_or_obj , out = '?' , simd = [('avx2 ' , ints )]),
524
+ TD (nodatetime_or_obj , out = '?' , simd = [('avx2 ' , ints )] ,
525
+ dispatch = [('loops_logical ' , '?' )]),
518
526
TD (O , f = 'npy_ObjectLogicalOr' ),
519
527
),
520
528
'logical_xor' :
521
529
Ufunc (2 , 1 , False_ ,
522
530
docstrings .get ('numpy.core.umath.logical_xor' ),
523
531
'PyUFunc_SimpleBinaryComparisonTypeResolver' ,
524
- TD (nodatetime_or_obj , out = '?' ),
532
+ TD ('?' , out = '?' , cfunc_alias = 'not_equal' ,
533
+ dispatch = [('loops_comparison' , '?' )]),
534
+ TD (no_bool_times_obj , out = '?' ),
525
535
# TODO: using obj.logical_xor() seems pretty much useless:
526
536
TD (P , f = 'logical_xor' ),
527
537
),
528
538
'maximum' :
529
539
Ufunc (2 , 1 , ReorderableNone ,
530
540
docstrings .get ('numpy.core.umath.maximum' ),
531
541
'PyUFunc_SimpleUniformOperationTypeResolver' ,
532
- TD (noobj , dispatch = [('loops_minmax' , ints + 'fdg' )]),
542
+ TD ('?' , cfunc_alias = 'logical_or' , dispatch = [('loops_logical' , '?' )]),
543
+ TD (no_obj_bool , dispatch = [('loops_minmax' , ints + 'fdg' )]),
533
544
TD (O , f = 'npy_ObjectMax' )
534
545
),
535
546
'minimum' :
536
547
Ufunc (2 , 1 , ReorderableNone ,
537
548
docstrings .get ('numpy.core.umath.minimum' ),
538
549
'PyUFunc_SimpleUniformOperationTypeResolver' ,
539
- TD (noobj , dispatch = [('loops_minmax' , ints + 'fdg' )]),
550
+ TD ('?' , cfunc_alias = 'logical_and' ,
551
+ dispatch = [('loops_logical' , '?' )]),
552
+ TD (no_obj_bool , dispatch = [('loops_minmax' , ints + 'fdg' )]),
540
553
TD (O , f = 'npy_ObjectMin' )
541
554
),
542
555
'clip' :
@@ -550,14 +563,17 @@ def english_upper(s):
550
563
Ufunc (2 , 1 , ReorderableNone ,
551
564
docstrings .get ('numpy.core.umath.fmax' ),
552
565
'PyUFunc_SimpleUniformOperationTypeResolver' ,
553
- TD (noobj , dispatch = [('loops_minmax' , 'fdg' )]),
566
+ TD ('?' , cfunc_alias = 'logical_or' , dispatch = [('loops_logical' , '?' )]),
567
+ TD (no_obj_bool , dispatch = [('loops_minmax' , 'fdg' )]),
554
568
TD (O , f = 'npy_ObjectMax' )
555
569
),
556
570
'fmin' :
557
571
Ufunc (2 , 1 , ReorderableNone ,
558
572
docstrings .get ('numpy.core.umath.fmin' ),
559
573
'PyUFunc_SimpleUniformOperationTypeResolver' ,
560
- TD (noobj , dispatch = [('loops_minmax' , 'fdg' )]),
574
+ TD ('?' , cfunc_alias = 'logical_and' ,
575
+ dispatch = [('loops_logical' , '?' )]),
576
+ TD (no_obj_bool , dispatch = [('loops_minmax' , 'fdg' )]),
561
577
TD (O , f = 'npy_ObjectMin' )
562
578
),
563
579
'logaddexp' :
@@ -576,28 +592,34 @@ def english_upper(s):
576
592
Ufunc (2 , 1 , AllOnes ,
577
593
docstrings .get ('numpy.core.umath.bitwise_and' ),
578
594
None ,
579
- TD (bints , simd = [('avx2' , ints )]),
595
+ TD ('?' , cfunc_alias = 'logical_and' ,
596
+ dispatch = [('loops_logical' , '?' )]),
597
+ TD (ints , simd = [('avx2' , ints )]),
580
598
TD (O , f = 'PyNumber_And' ),
581
599
),
582
600
'bitwise_or' :
583
601
Ufunc (2 , 1 , Zero ,
584
602
docstrings .get ('numpy.core.umath.bitwise_or' ),
585
603
None ,
586
- TD (bints , simd = [('avx2' , ints )]),
604
+ TD ('?' , cfunc_alias = 'logical_or' , dispatch = [('loops_logical' , '?' )]),
605
+ TD (ints , simd = [('avx2' , ints )]),
587
606
TD (O , f = 'PyNumber_Or' ),
588
607
),
589
608
'bitwise_xor' :
590
609
Ufunc (2 , 1 , Zero ,
591
610
docstrings .get ('numpy.core.umath.bitwise_xor' ),
592
611
None ,
593
- TD (bints , simd = [('avx2' , ints )]),
612
+ TD ('?' , cfunc_alias = 'not_equal' , dispatch = [('loops_comparison' , '?' )]),
613
+ TD (ints , simd = [('avx2' , ints )]),
594
614
TD (O , f = 'PyNumber_Xor' ),
595
615
),
596
616
'invert' :
597
617
Ufunc (1 , 1 , None ,
598
618
docstrings .get ('numpy.core.umath.invert' ),
599
619
None ,
600
- TD (bints , simd = [('avx2' , ints )]),
620
+ TD ('?' , cfunc_alias = 'logical_not' ,
621
+ dispatch = [('loops_logical' , '?' )]),
622
+ TD (ints , simd = [('avx2' , ints )]),
601
623
TD (O , f = 'PyNumber_Invert' ),
602
624
),
603
625
'left_shift' :
0 commit comments