< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template

Print this page
rev 49829 : Suball for short+byte intrinsics


 577     // Type specific horizontal reductions
 578 
 579 #if[BITWISE]
 580     @Override
 581     @ForceInline
 582     public $type$ addAll() {
 583         return ($type$) VectorIntrinsics.reductionCoerced(
 584             VECTOR_OP_ADD, $vectortype$.class, $type$.class, LENGTH,
 585             this,
 586             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a + b)));
 587     }
 588 
 589     @Override
 590     @ForceInline
 591     public $type$ andAll() {
 592         return ($type$) VectorIntrinsics.reductionCoerced(
 593             VECTOR_OP_AND, $vectortype$.class, $type$.class, LENGTH,
 594             this,
 595             v -> (long) v.rOp(($type$) -1, (i, a, b) -> ($type$) (a & b)));
 596     }









 597 #end[BITWISE]
 598 #if[intOrLong]
 599 
 600     @Override
 601     @ForceInline
 602     public $type$ mulAll() {
 603         return ($type$) VectorIntrinsics.reductionCoerced(
 604             VECTOR_OP_MUL, $vectortype$.class, $type$.class, LENGTH,
 605             this,
 606             v -> (long) v.rOp(($type$) 1, (i, a, b) -> ($type$) (a * b)));
 607     }
 608 
 609     @Override
 610     @ForceInline
 611     public $type$ orAll() {
 612         return ($type$) VectorIntrinsics.reductionCoerced(
 613             VECTOR_OP_OR, $vectortype$.class, $type$.class, LENGTH,
 614             this,
 615             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a | b)));
 616     }
 617 
 618     @Override
 619     @ForceInline
 620     public $type$ xorAll() {
 621         return ($type$) VectorIntrinsics.reductionCoerced(
 622             VECTOR_OP_XOR, $vectortype$.class, $type$.class, LENGTH,
 623             this,
 624             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a ^ b)));
 625     }
 626 
 627     @Override
 628     @ForceInline
 629     public $type$ subAll() {
 630         return ($type$) VectorIntrinsics.reductionCoerced(
 631             VECTOR_OP_SUB, $vectortype$.class, $type$.class, LENGTH,
 632             this,
 633             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a - b)));
 634     }
 635 #end[intOrLong]
 636 #if[FP]
 637     @Override
 638     @ForceInline
 639     public $type$ addAll() {
 640         $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced(
 641                                 VECTOR_OP_ADD, $vectortype$.class, $type$.class, LENGTH,
 642                                 this,
 643                                 v -> {
 644                                     $type$ r = v.rOp(($type$) 0, (i, a, b) -> ($type$) (a + b));
 645                                     return (long)$Type$.$type$To$Bitstype$Bits(r);
 646                                 });
 647         return $Type$.$bitstype$BitsTo$Fptype$(bits);
 648     }
 649 
 650     @Override
 651     @ForceInline
 652     public $type$ subAll() {
 653         $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced(




 577     // Type specific horizontal reductions
 578 
 579 #if[BITWISE]
 580     @Override
 581     @ForceInline
 582     public $type$ addAll() {
 583         return ($type$) VectorIntrinsics.reductionCoerced(
 584             VECTOR_OP_ADD, $vectortype$.class, $type$.class, LENGTH,
 585             this,
 586             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a + b)));
 587     }
 588 
 589     @Override
 590     @ForceInline
 591     public $type$ andAll() {
 592         return ($type$) VectorIntrinsics.reductionCoerced(
 593             VECTOR_OP_AND, $vectortype$.class, $type$.class, LENGTH,
 594             this,
 595             v -> (long) v.rOp(($type$) -1, (i, a, b) -> ($type$) (a & b)));
 596     }
 597 
 598     @Override
 599     @ForceInline
 600     public $type$ subAll() {
 601         return ($type$) VectorIntrinsics.reductionCoerced(
 602             VECTOR_OP_SUB, $vectortype$.class, $type$.class, LENGTH,
 603             this,
 604             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a - b)));
 605     }
 606 #end[BITWISE]
 607 #if[intOrLong]
 608 
 609     @Override
 610     @ForceInline
 611     public $type$ mulAll() {
 612         return ($type$) VectorIntrinsics.reductionCoerced(
 613             VECTOR_OP_MUL, $vectortype$.class, $type$.class, LENGTH,
 614             this,
 615             v -> (long) v.rOp(($type$) 1, (i, a, b) -> ($type$) (a * b)));
 616     }
 617 
 618     @Override
 619     @ForceInline
 620     public $type$ orAll() {
 621         return ($type$) VectorIntrinsics.reductionCoerced(
 622             VECTOR_OP_OR, $vectortype$.class, $type$.class, LENGTH,
 623             this,
 624             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a | b)));
 625     }
 626 
 627     @Override
 628     @ForceInline
 629     public $type$ xorAll() {
 630         return ($type$) VectorIntrinsics.reductionCoerced(
 631             VECTOR_OP_XOR, $vectortype$.class, $type$.class, LENGTH,
 632             this,
 633             v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a ^ b)));









 634     }
 635 #end[intOrLong]
 636 #if[FP]
 637     @Override
 638     @ForceInline
 639     public $type$ addAll() {
 640         $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced(
 641                                 VECTOR_OP_ADD, $vectortype$.class, $type$.class, LENGTH,
 642                                 this,
 643                                 v -> {
 644                                     $type$ r = v.rOp(($type$) 0, (i, a, b) -> ($type$) (a + b));
 645                                     return (long)$Type$.$type$To$Bitstype$Bits(r);
 646                                 });
 647         return $Type$.$bitstype$BitsTo$Fptype$(bits);
 648     }
 649 
 650     @Override
 651     @ForceInline
 652     public $type$ subAll() {
 653         $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced(


< prev index next >