@@ -395,42 +395,6 @@ static <E,F> Conversion<E,F> ofReinterpret(Class<E> from, Class<F> to) {
395
395
return ConversionImpl .ofReinterpret (dom , ran ).check (from , to );
396
396
}
397
397
398
- /**
399
- * An in-place version of a narrowing
400
- * conversion between two types.
401
- * The output of the conversion must be no larger
402
- * than the type {@code E}.
403
- * Any unused lane bits are ignored and
404
- * overwritten by zero bits (not a copied sign bit).
405
- * @param <E> the domain and range type (boxed version of a lane type)
406
- * @param conv the narrowing conversion to treat in-place
407
- * @return a Java narrowing conversion,
408
- * stored back to the original lane of type {@code E}
409
- */
410
- @ ForceInline
411
- static <E > Conversion <E ,E > ofNarrowing (Conversion <E ,?> conv ) {
412
- Class <E > lt = conv .domainType ();
413
- return ConversionImpl .ofInplace ((ConversionImpl <?,?>) conv , false ).check (lt , lt );
414
- }
415
-
416
- /**
417
- * An in-place version of a widening
418
- * conversion between two types.
419
- * The input of the conversion must be no larger
420
- * than the type {@code E}.
421
- * Any unused lane bits are ignored and
422
- * overwritten by the result.
423
- * @param <E> the domain and range type (boxed version of a lane type)
424
- * @param conv the widening conversion to treat in-place
425
- * @return a Java widening conversion,
426
- * loading its input from same lane of type {@code E}
427
- */
428
- @ ForceInline
429
- static <E > Conversion <E ,E > ofWidening (Conversion <?,E > conv ) {
430
- Class <E > lt = conv .rangeType ();
431
- return ConversionImpl .ofInplace ((ConversionImpl <?,?>) conv , true ).check (lt , lt );
432
- }
433
-
434
398
}
435
399
436
400
/*package-private*/
@@ -467,8 +431,7 @@ static boolean opKind(Operator op, int bit) {
467
431
VO_DOM_SHIFT = 4 ,
468
432
VO_DOM_RAN_MASK = 0x0FF ,
469
433
VO_KIND_CAST = 0x000 ,
470
- VO_KIND_BITWISE = 0x100 ,
471
- VO_KIND_INPLACE = 0x200 ;
434
+ VO_KIND_BITWISE = 0x100 ;
472
435
473
436
private static final HashMap <Integer , String > OPC_NAME
474
437
= new HashMap <>();
@@ -666,58 +629,6 @@ static boolean opKind(Operator op, int bit) {
666
629
public static final Conversion <Short ,Integer > S2I = convert ("S2I" , 'C' , short .class , int .class , VO_KIND_CAST , VO_ALL );
667
630
/** Convert {@code shortVal} to {@code (long)shortVal}. */
668
631
public static final Conversion <Short ,Long > S2L = convert ("S2L" , 'C' , short .class , long .class , VO_KIND_CAST , VO_ALL );
669
- /** In-place narrow {@code doubleVal} to {@code (byte)doubleVal} inside double. */
670
- public static final Conversion <Double ,Double > INPLACE_D2B = convert ("INPLACE_D2B" , 'N' , double .class , double .class , VO_KIND_INPLACE + 0x78 , VO_ALL );
671
- /** In-place narrow {@code doubleVal} to {@code (float)doubleVal} inside double. */
672
- public static final Conversion <Double ,Double > INPLACE_D2F = convert ("INPLACE_D2F" , 'N' , double .class , double .class , VO_KIND_INPLACE + 0x76 , VO_ALL );
673
- /** In-place narrow {@code doubleVal} to {@code (int)doubleVal} inside double. */
674
- public static final Conversion <Double ,Double > INPLACE_D2I = convert ("INPLACE_D2I" , 'N' , double .class , double .class , VO_KIND_INPLACE + 0x7a , VO_ALL );
675
- /** In-place narrow {@code doubleVal} to {@code (short)doubleVal} inside double. */
676
- public static final Conversion <Double ,Double > INPLACE_D2S = convert ("INPLACE_D2S" , 'N' , double .class , double .class , VO_KIND_INPLACE + 0x79 , VO_ALL );
677
- /** In-place narrow {@code floatVal} to {@code (byte)floatVal} inside float. */
678
- public static final Conversion <Float ,Float > INPLACE_F2B = convert ("INPLACE_F2B" , 'N' , float .class , float .class , VO_KIND_INPLACE + 0x68 , VO_ALL );
679
- /** In-place narrow {@code floatVal} to {@code (short)floatVal} inside float. */
680
- public static final Conversion <Float ,Float > INPLACE_F2S = convert ("INPLACE_F2S" , 'N' , float .class , float .class , VO_KIND_INPLACE + 0x69 , VO_ALL );
681
- /** In-place narrow {@code intVal} to {@code (byte)intVal} inside int. */
682
- public static final Conversion <Integer ,Integer > INPLACE_I2B = convert ("INPLACE_I2B" , 'N' , int .class , int .class , VO_KIND_INPLACE + 0xa8 , VO_ALL );
683
- /** In-place narrow {@code intVal} to {@code (short)intVal} inside int. */
684
- public static final Conversion <Integer ,Integer > INPLACE_I2S = convert ("INPLACE_I2S" , 'N' , int .class , int .class , VO_KIND_INPLACE + 0xa9 , VO_ALL );
685
- /** In-place narrow {@code longVal} to {@code (byte)longVal} inside long. */
686
- public static final Conversion <Long ,Long > INPLACE_L2B = convert ("INPLACE_L2B" , 'N' , long .class , long .class , VO_KIND_INPLACE + 0xb8 , VO_ALL );
687
- /** In-place narrow {@code longVal} to {@code (float)longVal} inside long. */
688
- public static final Conversion <Long ,Long > INPLACE_L2F = convert ("INPLACE_L2F" , 'N' , long .class , long .class , VO_KIND_INPLACE + 0xb6 , VO_ALL );
689
- /** In-place narrow {@code longVal} to {@code (int)longVal} inside long. */
690
- public static final Conversion <Long ,Long > INPLACE_L2I = convert ("INPLACE_L2I" , 'N' , long .class , long .class , VO_KIND_INPLACE + 0xba , VO_ALL );
691
- /** In-place narrow {@code longVal} to {@code (short)longVal} inside long. */
692
- public static final Conversion <Long ,Long > INPLACE_L2S = convert ("INPLACE_L2S" , 'N' , long .class , long .class , VO_KIND_INPLACE + 0xb9 , VO_ALL );
693
- /** In-place narrow {@code shortVal} to {@code (byte)shortVal} inside short. */
694
- public static final Conversion <Short ,Short > INPLACE_S2B = convert ("INPLACE_S2B" , 'N' , short .class , short .class , VO_KIND_INPLACE + 0x98 , VO_ALL );
695
- /** In-place widen {@code byteVal} inside double to {@code (double)byteVal}. */
696
- public static final Conversion <Double ,Double > INPLACE_B2D = convert ("INPLACE_B2D" , 'W' , double .class , double .class , VO_KIND_INPLACE + 0x87 , VO_ALL );
697
- /** In-place widen {@code byteVal} inside float to {@code (float)byteVal}. */
698
- public static final Conversion <Float ,Float > INPLACE_B2F = convert ("INPLACE_B2F" , 'W' , float .class , float .class , VO_KIND_INPLACE + 0x86 , VO_ALL );
699
- /** In-place widen {@code byteVal} inside int to {@code (int)byteVal}. */
700
- public static final Conversion <Integer ,Integer > INPLACE_B2I = convert ("INPLACE_B2I" , 'W' , int .class , int .class , VO_KIND_INPLACE + 0x8a , VO_ALL );
701
- /** In-place widen {@code byteVal} inside long to {@code (long)byteVal}. */
702
- public static final Conversion <Long ,Long > INPLACE_B2L = convert ("INPLACE_B2L" , 'W' , long .class , long .class , VO_KIND_INPLACE + 0x8b , VO_ALL );
703
- /** In-place widen {@code byteVal} inside short to {@code (short)byteVal}. */
704
- public static final Conversion <Short ,Short > INPLACE_B2S = convert ("INPLACE_B2S" , 'W' , short .class , short .class , VO_KIND_INPLACE + 0x89 , VO_ALL );
705
- /** In-place widen {@code floatVal} inside double to {@code (double)floatVal}. */
706
- public static final Conversion <Double ,Double > INPLACE_F2D = convert ("INPLACE_F2D" , 'W' , double .class , double .class , VO_KIND_INPLACE + 0x67 , VO_ALL );
707
- /** In-place widen {@code floatVal} inside long to {@code (long)floatVal}. */
708
- public static final Conversion <Long ,Long > INPLACE_F2L = convert ("INPLACE_F2L" , 'W' , long .class , long .class , VO_KIND_INPLACE + 0x6b , VO_ALL );
709
- /** In-place widen {@code intVal} inside double to {@code (double)intVal}. */
710
- public static final Conversion <Double ,Double > INPLACE_I2D = convert ("INPLACE_I2D" , 'W' , double .class , double .class , VO_KIND_INPLACE + 0xa7 , VO_ALL );
711
- /** In-place widen {@code intVal} inside long to {@code (long)intVal}. */
712
- public static final Conversion <Long ,Long > INPLACE_I2L = convert ("INPLACE_I2L" , 'W' , long .class , long .class , VO_KIND_INPLACE + 0xab , VO_ALL );
713
- /** In-place widen {@code shortVal} inside double to {@code (double)shortVal}. */
714
- public static final Conversion <Double ,Double > INPLACE_S2D = convert ("INPLACE_S2D" , 'W' , double .class , double .class , VO_KIND_INPLACE + 0x97 , VO_ALL );
715
- /** In-place widen {@code shortVal} inside float to {@code (float)shortVal}. */
716
- public static final Conversion <Float ,Float > INPLACE_S2F = convert ("INPLACE_S2F" , 'W' , float .class , float .class , VO_KIND_INPLACE + 0x96 , VO_ALL );
717
- /** In-place widen {@code shortVal} inside int to {@code (int)shortVal}. */
718
- public static final Conversion <Integer ,Integer > INPLACE_S2I = convert ("INPLACE_S2I" , 'W' , int .class , int .class , VO_KIND_INPLACE + 0x9a , VO_ALL );
719
- /** In-place widen {@code shortVal} inside long to {@code (long)shortVal}. */
720
- public static final Conversion <Long ,Long > INPLACE_S2L = convert ("INPLACE_S2L" , 'W' , long .class , long .class , VO_KIND_INPLACE + 0x9b , VO_ALL );
721
632
/** Reinterpret bits of {@code doubleVal} as {@code long}. As if by {@link Double#doubleToRawLongBits(double)} */
722
633
public static final Conversion <Double ,Long > REINTERPRET_D2L = convert ("REINTERPRET_D2L" , 'R' , double .class , long .class , VO_KIND_BITWISE , VO_ALL );
723
634
/** Reinterpret bits of {@code floatVal} as {@code int}. As if by {@link Float#floatToRawIntBits(float)} */
@@ -796,9 +707,6 @@ private static Comparison compare(String name, String opName, int opCode, int fl
796
707
if (opCode >= 0 ) {
797
708
if ((opCode & VO_DOM_RAN_MASK ) == 0 ) {
798
709
opCode += domran ;
799
- } else {
800
- // only the widening or narrowing guys specify their own opcode dom/ran
801
- assert (dom == ran && "WN" .indexOf (kind ) >= 0 );
802
710
}
803
711
if ((flags & VO_PRIVATE ) == 0 )
804
712
CONV_OPC_NAME .put (opCode , name );
@@ -1032,19 +940,6 @@ static ConversionImpl<?,?> ofReinterpret(LaneType dom, LaneType ran) {
1032
940
// }
1033
941
return findConv ('R' , dom , ran );
1034
942
}
1035
- static ConversionImpl <?,?> ofInplace (ConversionImpl <?,?> conv ,
1036
- boolean widening ) {
1037
- int domSize = conv .dom .elementSize ;
1038
- int ranSize = conv .ran .elementSize ;
1039
- if (domSize >= ranSize && widening )
1040
- throw new IllegalArgumentException (conv + ": must be a widening conversion" );
1041
- if (domSize <= ranSize && !widening )
1042
- throw new IllegalArgumentException (conv + ": must be a narrowing conversion" );
1043
- if (conv .kind != 'C' )
1044
- throw new IllegalArgumentException (conv + ": must be a standard Java conversion" );
1045
- char kind = (widening ? 'W' : 'N' );
1046
- return findConv (kind , conv .dom , conv .ran );
1047
- }
1048
943
1049
944
@ ForceInline
1050
945
private static ConversionImpl <?,?>
@@ -1088,16 +983,6 @@ static String a2b(LaneType dom, LaneType ran) {
1088
983
name = "ZERO_EXTEND_" +a2b (dom , ran );
1089
984
opCode = VO_KIND_BITWISE ;
1090
985
break ;
1091
- case 'W' :
1092
- name = "INPLACE_" +a2b (dom , ran );
1093
- opCode += VO_KIND_INPLACE ;
1094
- domType = ranType ; // slice narrow domain from range
1095
- break ;
1096
- case 'N' :
1097
- name = "INPLACE_" +a2b (dom , ran );
1098
- opCode += VO_KIND_INPLACE ;
1099
- ranType = domType ; // zero-fill narrow range
1100
- break ;
1101
986
default : throw new AssertionError ();
1102
987
}
1103
988
ConversionImpl <?,?> conv = convert (name , kind , domType , ranType , opCode , VO_ALL );
@@ -1184,12 +1069,10 @@ private static boolean genCode() {
1184
1069
ArrayList <String > defs = new ArrayList <>();
1185
1070
for (LaneType l1 : LaneType .values ()) {
1186
1071
for (LaneType l2 : LaneType .values ()) {
1187
- for (int i = 0 ; i <= 2 ; i ++) {
1072
+ for (int i = 0 ; i <= 1 ; i ++) {
1188
1073
ConversionImpl <?,?> c ;
1189
1074
try {
1190
- c = ((i == 0 ) ? ofCast (l1 , l2 ) :
1191
- (i == 1 ) ? ofReinterpret (l1 , l2 ) :
1192
- ofInplace (ofCast (l1 , l2 ), (l1 .elementSize < l2 .elementSize )));
1075
+ c = ((i == 0 ) ? ofCast (l1 , l2 ) : ofReinterpret (l1 , l2 ));
1193
1076
} catch (IllegalArgumentException ex ) {
1194
1077
assert ((i == 1 && l1 .elementSize != l2 .elementSize ) ||
1195
1078
(i == 2 && l1 .elementSize == l2 .elementSize ));
@@ -1206,7 +1089,6 @@ private static boolean genCode() {
1206
1089
switch (opc & ~VO_DOM_RAN_MASK ) {
1207
1090
case VO_KIND_CAST : opcs = "VO_KIND_CAST" ; break ;
1208
1091
case VO_KIND_BITWISE : opcs = "VO_KIND_BITWISE" ; break ;
1209
- case VO_KIND_INPLACE : opcs = "VO_KIND_INPLACE" ; break ;
1210
1092
default : opcs = Integer .toHexString (opc );
1211
1093
}
1212
1094
String code = c .genCode (opcs );
0 commit comments