Changeset 106733 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Oct 28, 2024 3:47:44 AM (3 months ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-3.c32
r106620 r106733 14894 14894 PBS3EXTCTX pExtCtxOut; 14895 14895 PBS3EXTCTX pExtCtx = bs3CpuInstr3AllocExtCtxs(&pExtCtxOut); 14896 BS3SETREGCTX pSetRegCtx; 14897 14896 14898 if (!pExtCtx) 14897 14899 return 0; 14900 14901 pSetRegCtx.pExtCtx = pExtCtx; 14902 pSetRegCtx.pCtx = &Ctx; 14903 pSetRegCtx.fZeroYMMHi = false; 14904 pSetRegCtx.bMode = bMode; 14898 14905 14899 14906 /* Ensure the structures are allocated before we sample the stack pointer. */ … … 14970 14977 */ 14971 14978 /* initial value of destination register */ 14972 Bs3ExtCtxSetReg( pExtCtx, paTests[iTest].iMmDst, (void *)&paValues[iVal].uDstInit, SET_YmmHi);14979 Bs3ExtCtxSetReg(&pSetRegCtx, paTests[iTest].iMmDst, &paValues[iVal].uDstInit); 14973 14980 14974 14981 /* offsets register */ 14975 Bs3ExtCtxSetReg( pExtCtx, paTests[iTest].iMmOff, (void *)&paValues[iVal].uOffsets, SET_YmmHi);14982 Bs3ExtCtxSetReg(&pSetRegCtx, paTests[iTest].iMmOff, &paValues[iVal].uOffsets); 14976 14983 14977 14984 /* initial value of mask register */ 14978 Bs3ExtCtxSetReg( pExtCtx, paTests[iTest].iMmMsk, (void *)&paValues[iVal].uMask, SET_YmmHi);14985 Bs3ExtCtxSetReg(&pSetRegCtx, paTests[iTest].iMmMsk, &paValues[iVal].uMask); 14979 14986 14980 14987 /* Memory pointer. */ 14981 14988 puMemOp = fPf ? (PRTUINT256U)&pbBuf[X86_PAGE_SIZE * 2 + 256] : (PRTUINT256U)&pbBuf[X86_PAGE_SIZE]; 14982 14989 puMemOp = (PRTUINT256U)(((uint8_t BS3_FAR *)puMemOp) - paTests[iTest].cMemOpOffset); 14983 Bs3ExtCtxSetReg( pExtCtx, BS3_FSxREG(paTests[iTest].iGpMem), (void *)puMemOp, (void *)&Ctx);14990 Bs3ExtCtxSetReg(&pSetRegCtx, BS3_FSxREG(paTests[iTest].iGpMem), (void *)puMemOp); 14984 14991 14985 14992 /* … … 15001 15008 { 15002 15009 RTUINT256U zip = RTUINT256_INIT_C(0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000); 15003 Bs3ExtCtxSetReg( pExtCtx, paTests[iTest].iMmDst, (void *)&paValues[iVal].uDstOut, SET_YmmHi);15004 Bs3ExtCtxSetReg( pExtCtx, paTests[iTest].iMmMsk, (void *)&zip, SET_YmmHi);15010 Bs3ExtCtxSetReg(&pSetRegCtx, paTests[iTest].iMmDst, &paValues[iVal].uDstOut); 15011 Bs3ExtCtxSetReg(&pSetRegCtx, paTests[iTest].iMmMsk, &zip); 15005 15012 } 15006 15013 15007 15014 if (bXcptExpect == X86_XCPT_PF) 15008 Bs3ExtCtxSetReg( pExtCtx, paTests[iTest].iMmMsk, (void *)&paValues[iVal].uMaskPf, SET_YmmHi);15015 Bs3ExtCtxSetReg(&pSetRegCtx, paTests[iTest].iMmMsk, &paValues[iVal].uMaskPf); 15009 15016 15010 15017 #if defined(DEBUG_aeichner) /** @todo Necessary kludge on a i7-1068NG7. */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4-template.mac
r106721 r106733 874 874 ;; cvtpi2ps 875 875 ; 876 ; SSE-128, int32 -> fp32 (packed:2; from MMX register)876 ; SSE-128, fp32 <- int32 (packed:2; from MMX register) 877 877 EMIT_INSTR_PLUS_ICEBP cvtpi2ps, XMM1, MM1 878 878 EMIT_INSTR_PLUS_ICEBP cvtpi2ps, XMM1, FSxBX … … 883 883 ;; cvtps2pi 884 884 ; 885 ; SSE-128, fp32 -> int32 (packed:2; to MMX register)885 ; SSE-128, int32 <- fp32 (packed:2; to MMX register) 886 886 EMIT_INSTR_PLUS_ICEBP cvtps2pi, MM1, XMM1 887 887 EMIT_INSTR_PLUS_ICEBP cvtps2pi, MM1, FSxBX … … 891 891 ;; cvttps2pi 892 892 ; 893 ; SSE-128, fp32 -> int32 (packed:2; truncated; to MMX register)893 ; SSE-128, int32 <- fp32 (packed:2; truncated; to MMX register) 894 894 EMIT_INSTR_PLUS_ICEBP cvttps2pi, MM1, XMM1 895 895 EMIT_INSTR_PLUS_ICEBP cvttps2pi, MM1, FSxBX … … 899 899 ;; cvtsi2ss 900 900 ; 901 ; SSE-128, int32 -> fp32 (single)901 ; SSE-128, fp32 <- int32 (single) 902 902 EMIT_INSTR_PLUS_ICEBP cvtsi2ss, XMM1, EAX 903 903 EMIT_INSTR_PLUS_ICEBP cvtsi2ss, XMM1, FSxBX_D 904 904 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2ss, XMM8, R8D 905 905 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2ss, XMM8, FSxBX_D 906 ; SSE-128, int64 -> fp32(single)906 ; SSE-128, fp32 <- int64 (single) 907 907 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2ss, XMM1, RAX 908 908 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2ss, XMM1, FSxBX_Q 909 909 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2ss, XMM8, R8 910 910 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2ss, XMM8, FSxBX_Q 911 ; AVX-128, int32 -> fp32 (single)911 ; AVX-128, fp32 <- int32 (single) 912 912 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM2, EAX 913 913 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM2, FSxBX_D 914 914 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM9, R8D 915 915 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM9, FSxBX_D 916 ; AVX-128, int64 -> fp32(single)916 ; AVX-128, fp32 <- int64 (single) 917 917 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM2, RAX ;; @todo this assembles in 16/32 mode; SDM says VEX.W1 ignored in non-64 bit 918 918 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM2, FSxBX_Q ;; @todo this assembles in 16/32 mode; SDM says VEX.W1 ignored in non-64 bit 919 919 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM9, R8 920 920 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM9, FSxBX_Q 921 ; AVX-128, int32 -> fp32, same-reg (single)921 ; AVX-128, fp32 <- int32, same-reg (single) 922 922 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM1, EAX 923 923 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM1, FSxBX_D 924 924 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM8, R8D 925 925 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM8, FSxBX_D 926 ; AVX-128, int64 -> fp32, same-reg (single)926 ; AVX-128, fp32 <- int64, same-reg (single) 927 927 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM1, RAX ;; @todo this assembles in 16/32 mode, but should it...? 928 928 EMIT_INSTR_PLUS_ICEBP vcvtsi2ss, XMM1, XMM1, FSxBX_Q ;; @todo this assembles in 16/32 mode, but should it...? … … 930 930 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2ss, XMM8, XMM8, FSxBX_Q 931 931 ; @todo test with VEX.L=1 (as if asking for YMM)? SDM says 'unpredictable behavior'... 932 ; @todo same-reg int32 -> fp32 (SDM says W1 ignored in 32-bit modes) (see above)932 ; @todo same-reg fp32 <- int32 (SDM says W1 ignored in 32-bit modes) (see above) 933 933 934 934 ; 935 935 ;; cvtss2si 936 936 ; 937 ; SSE-128, fp32 -> int32937 ; SSE-128, int32 <- fp32 938 938 EMIT_INSTR_PLUS_ICEBP cvtss2si, EAX, XMM1 939 939 EMIT_INSTR_PLUS_ICEBP cvtss2si, EAX, FSxBX 940 940 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2si, R8D, XMM8 941 941 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2si, R8D, FSxBX 942 ; SSE-128, fp32 -> int64942 ; SSE-128, int64 <- fp32 943 943 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2si, RAX, XMM1 944 944 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2si, RAX, FSxBX 945 945 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2si, R8, XMM8 946 946 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2si, R8, FSxBX 947 ; AVX-128, fp32 -> int32947 ; AVX-128, int32 <- fp32 948 948 EMIT_INSTR_PLUS_ICEBP vcvtss2si, EAX, XMM1 949 949 EMIT_INSTR_PLUS_ICEBP vcvtss2si, EAX, FSxBX 950 950 EMIT_INSTR_PLUS_ICEBP_C64 vcvtss2si, R8D, XMM8 951 951 EMIT_INSTR_PLUS_ICEBP_C64 vcvtss2si, R8D, FSxBX 952 ; AVX-128, fp32 -> int64952 ; AVX-128, int64 <- fp32 953 953 EMIT_INSTR_PLUS_ICEBP vcvtss2si, RAX, XMM1 954 954 EMIT_INSTR_PLUS_ICEBP vcvtss2si, RAX, FSxBX … … 961 961 ;; cvttss2si 962 962 ; 963 ; SSE-128, fp32 -> int32 (single; truncated)963 ; SSE-128, int32 <- fp32 (single; truncated) 964 964 EMIT_INSTR_PLUS_ICEBP cvttss2si, EAX, XMM1 965 965 EMIT_INSTR_PLUS_ICEBP cvttss2si, EAX, FSxBX 966 966 EMIT_INSTR_PLUS_ICEBP_C64 cvttss2si, R8D, XMM8 967 967 EMIT_INSTR_PLUS_ICEBP_C64 cvttss2si, R8D, FSxBX 968 ; SSE-128, fp32 -> int64(single; truncated)968 ; SSE-128, int64 <- fp32 (single; truncated) 969 969 EMIT_INSTR_PLUS_ICEBP_C64 cvttss2si, RAX, XMM1 970 970 EMIT_INSTR_PLUS_ICEBP_C64 cvttss2si, RAX, FSxBX 971 971 EMIT_INSTR_PLUS_ICEBP_C64 cvttss2si, R8, XMM8 972 972 EMIT_INSTR_PLUS_ICEBP_C64 cvttss2si, R8, FSxBX 973 ; AVX-128, fp32 -> int32 (single; truncated)973 ; AVX-128, int32 <- fp32 (single; truncated) 974 974 EMIT_INSTR_PLUS_ICEBP vcvttss2si, EAX, XMM1 975 975 EMIT_INSTR_PLUS_ICEBP vcvttss2si, EAX, FSxBX 976 976 EMIT_INSTR_PLUS_ICEBP_C64 vcvttss2si, R8D, XMM8 977 977 EMIT_INSTR_PLUS_ICEBP_C64 vcvttss2si, R8D, FSxBX 978 ; AVX-128, fp32 -> int64(single; truncated)978 ; AVX-128, int64 <- fp32 (single; truncated) 979 979 EMIT_INSTR_PLUS_ICEBP vcvttss2si, RAX, XMM1 980 980 EMIT_INSTR_PLUS_ICEBP vcvttss2si, RAX, FSxBX … … 987 987 ;; cvtpi2pd 988 988 ; 989 ; SSE-128, int32 -> fp64(packed:2; from MMX register)989 ; SSE-128, fp64 <- int32 (packed:2; from MMX register) 990 990 EMIT_INSTR_PLUS_ICEBP cvtpi2pd, XMM1, MM1 991 991 EMIT_INSTR_PLUS_ICEBP cvtpi2pd, XMM1, FSxBX … … 997 997 ;; cvtpd2pi 998 998 ; 999 ; SSE-128, fp64 -> int32(packed:2; to MMX register)999 ; SSE-128, int32 <- fp64 (packed:2; to MMX register) 1000 1000 EMIT_INSTR_PLUS_ICEBP cvtpd2pi, MM1, XMM1 1001 1001 EMIT_INSTR_PLUS_ICEBP cvtpd2pi, MM1, FSxBX … … 1006 1006 ;; cvttpd2pi 1007 1007 ; 1008 ; SSE-128, fp64 -> int32(packed:2; truncated; to MMX register)1008 ; SSE-128, int32 <- fp64 (packed:2; truncated; to MMX register) 1009 1009 EMIT_INSTR_PLUS_ICEBP cvttpd2pi, MM1, XMM1 1010 1010 EMIT_INSTR_PLUS_ICEBP cvttpd2pi, MM1, FSxBX … … 1015 1015 ;; cvtsi2sd 1016 1016 ; 1017 ; SSE-128, int32 -> fp64(single)1017 ; SSE-128, fp64 <- int32 (single) 1018 1018 EMIT_INSTR_PLUS_ICEBP cvtsi2sd, XMM1, EAX 1019 1019 EMIT_INSTR_PLUS_ICEBP cvtsi2sd, XMM1, FSxBX_D 1020 1020 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2sd, XMM8, R8D 1021 1021 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2sd, XMM8, FSxBX_D 1022 ; SSE-128, int64 -> fp64 (single)1022 ; SSE-128, fp64 <- int64 (single) 1023 1023 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2sd, XMM1, RAX 1024 1024 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2sd, XMM1, FSxBX_Q 1025 1025 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2sd, XMM8, R8 1026 1026 EMIT_INSTR_PLUS_ICEBP_C64 cvtsi2sd, XMM8, FSxBX_Q 1027 ; AVX-128, int32 -> fp64(single)1027 ; AVX-128, fp64 <- int32 (single) 1028 1028 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM2, EAX 1029 1029 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM2, FSxBX_D 1030 1030 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2sd, XMM8, XMM9, EAX 1031 1031 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2sd, XMM8, XMM9, FSxBX_D 1032 ; AVX-128, int64 -> fp64 (single)1032 ; AVX-128, fp64 <- int64 (single) 1033 1033 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM2, RAX 1034 1034 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM2, FSxBX_Q 1035 1035 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2sd, XMM8, XMM9, RAX 1036 1036 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2sd, XMM8, XMM9, FSxBX_Q 1037 ; AVX-128, int32 -> fp64, same-reg (single)1037 ; AVX-128, fp64 <- int32, same-reg (single) 1038 1038 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM1, EAX 1039 1039 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM1, FSxBX_D 1040 1040 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2sd, XMM8, XMM8, EAX 1041 1041 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsi2sd, XMM8, XMM8, FSxBX_D 1042 ; AVX-128, int64 -> fp64, same-reg (single)1042 ; AVX-128, fp64 <- int64, same-reg (single) 1043 1043 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM1, RAX 1044 1044 EMIT_INSTR_PLUS_ICEBP vcvtsi2sd, XMM1, XMM1, FSxBX_Q … … 1051 1051 ;; cvtsd2si 1052 1052 ; 1053 ; SSE-128, fp64 -> int32(single)1053 ; SSE-128, int32 <- fp64 (single) 1054 1054 EMIT_INSTR_PLUS_ICEBP cvtsd2si, EAX, XMM1 1055 1055 EMIT_INSTR_PLUS_ICEBP cvtsd2si, EAX, FSxBX 1056 1056 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2si, R8D, XMM8 1057 1057 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2si, R8D, FSxBX 1058 ; SSE-128, fp64 -> int64 (single)1058 ; SSE-128, int64 <- fp64 (single) 1059 1059 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2si, RAX, XMM1 1060 1060 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2si, RAX, FSxBX 1061 1061 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2si, R8, XMM8 1062 1062 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2si, R8, FSxBX 1063 ; AVX-128, fp64 -> int32(single)1063 ; AVX-128, int32 <- fp64 (single) 1064 1064 EMIT_INSTR_PLUS_ICEBP vcvtsd2si, EAX, XMM1 1065 1065 EMIT_INSTR_PLUS_ICEBP vcvtsd2si, EAX, FSxBX 1066 1066 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsd2si, R8D, XMM8 1067 1067 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsd2si, R8D, FSxBX 1068 ; AVX-128, fp64 -> int64 (single)1068 ; AVX-128, int64 <- fp64 (single) 1069 1069 EMIT_INSTR_PLUS_ICEBP vcvtsd2si, RAX, XMM1 ;; @todo this assembles in 16/32 mode; SDM says VEX.W1 ignored in non-64 bit 1070 1070 EMIT_INSTR_PLUS_ICEBP vcvtsd2si, RAX, FSxBX ;; @todo this assembles in 16/32 mode; SDM says VEX.W1 ignored in non-64 bit … … 1072 1072 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsd2si, R8, FSxBX 1073 1073 ; @todo test with VEX.L=1 (as if asking for YMM)? SDM says 'unpredictable behavior'... 1074 ; @todo same-reg int32 -> fp32 (SDM says W1 ignored in 32-bit modes) (see above)1074 ; @todo same-reg fp32 <- int32 (SDM says W1 ignored in 32-bit modes) (see above) 1075 1075 1076 1076 ; 1077 1077 ;; cvttsd2si 1078 1078 ; 1079 ; SSE-128, fp64 -> int32(single; truncated)1079 ; SSE-128, int32 <- fp64 (single; truncated) 1080 1080 EMIT_INSTR_PLUS_ICEBP cvttsd2si, EAX, XMM1 1081 1081 EMIT_INSTR_PLUS_ICEBP cvttsd2si, EAX, FSxBX 1082 1082 EMIT_INSTR_PLUS_ICEBP_C64 cvttsd2si, R8D, XMM8 1083 1083 EMIT_INSTR_PLUS_ICEBP_C64 cvttsd2si, R8D, FSxBX 1084 ; SSE-128, fp64 -> int64 (single; truncated)1084 ; SSE-128, int64 <- fp64 (single; truncated) 1085 1085 EMIT_INSTR_PLUS_ICEBP_C64 cvttsd2si, RAX, XMM1 1086 1086 EMIT_INSTR_PLUS_ICEBP_C64 cvttsd2si, RAX, FSxBX 1087 1087 EMIT_INSTR_PLUS_ICEBP_C64 cvttsd2si, R8, XMM8 1088 1088 EMIT_INSTR_PLUS_ICEBP_C64 cvttsd2si, R8, FSxBX 1089 ; AVX-128, fp64 -> int32(single; truncated)1089 ; AVX-128, int32 <- fp64 (single; truncated) 1090 1090 EMIT_INSTR_PLUS_ICEBP vcvttsd2si, EAX, XMM1 1091 1091 EMIT_INSTR_PLUS_ICEBP vcvttsd2si, EAX, FSxBX 1092 1092 EMIT_INSTR_PLUS_ICEBP_C64 vcvttsd2si, R8D, XMM8 1093 1093 EMIT_INSTR_PLUS_ICEBP_C64 vcvttsd2si, R8D, FSxBX 1094 ; AVX-128, fp64 -> int64 (single; truncated)1094 ; AVX-128, int64 <- fp64 (single; truncated) 1095 1095 EMIT_INSTR_PLUS_ICEBP vcvttsd2si, RAX, XMM1 1096 1096 EMIT_INSTR_PLUS_ICEBP vcvttsd2si, RAX, FSxBX … … 1103 1103 ;; cvtdq2ps 1104 1104 ; 1105 ; SSE-128, int32 -> fp32 (packed:4)1105 ; SSE-128, fp32 <- int32 (packed:4) 1106 1106 EMIT_INSTR_PLUS_ICEBP cvtdq2ps, XMM1, XMM2 1107 1107 EMIT_INSTR_PLUS_ICEBP cvtdq2ps, XMM1, FSxBX 1108 1108 EMIT_INSTR_PLUS_ICEBP_C64 cvtdq2ps, XMM8, XMM9 1109 1109 EMIT_INSTR_PLUS_ICEBP_C64 cvtdq2ps, XMM8, FSxBX 1110 ; AVX-128, int32 -> fp32 (packed:4)1110 ; AVX-128, fp32 <- int32 (packed:4) 1111 1111 EMIT_INSTR_PLUS_ICEBP vcvtdq2ps, XMM1, XMM2 1112 1112 EMIT_INSTR_PLUS_ICEBP vcvtdq2ps, XMM1, FSxBX 1113 1113 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2ps, XMM8, XMM9 1114 1114 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2ps, XMM8, FSxBX 1115 ; AVX-256, int32 -> fp32 (packed:8)1115 ; AVX-256, fp32 <- int32 (packed:8) 1116 1116 EMIT_INSTR_PLUS_ICEBP vcvtdq2ps, YMM1, YMM2 1117 1117 EMIT_INSTR_PLUS_ICEBP vcvtdq2ps, YMM1, FSxBX 1118 1118 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2ps, YMM8, YMM9 1119 1119 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2ps, YMM8, FSxBX 1120 ; SSE-128, int32 -> fp32, same-reg (packed:4)1120 ; SSE-128, fp32 <- int32, same-reg (packed:4) 1121 1121 EMIT_INSTR_PLUS_ICEBP cvtdq2ps, XMM1, XMM1 1122 1122 EMIT_INSTR_PLUS_ICEBP_C64 cvtdq2ps, XMM8, XMM8 1123 ; AVX-128, int32 -> fp32, same-reg (packed:4)1123 ; AVX-128, fp32 <- int32, same-reg (packed:4) 1124 1124 EMIT_INSTR_PLUS_ICEBP vcvtdq2ps, XMM1, XMM1 1125 1125 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2ps, XMM8, XMM8 1126 ; AVX-256, int32 -> fp32, same-reg (packed:8)1126 ; AVX-256, fp32 <- int32, same-reg (packed:8) 1127 1127 EMIT_INSTR_PLUS_ICEBP vcvtdq2ps, YMM1, YMM1 1128 1128 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2ps, YMM8, YMM8 … … 1131 1131 ;; cvtps2dq 1132 1132 ; 1133 ; SSE-128, fp32 -> int32 (packed:4)1133 ; SSE-128, int32 <- fp32 (packed:4) 1134 1134 EMIT_INSTR_PLUS_ICEBP cvtps2dq, XMM1, XMM2 1135 1135 EMIT_INSTR_PLUS_ICEBP cvtps2dq, XMM1, FSxBX 1136 1136 EMIT_INSTR_PLUS_ICEBP_C64 cvtps2dq, XMM8, XMM9 1137 1137 EMIT_INSTR_PLUS_ICEBP_C64 cvtps2dq, XMM8, FSxBX 1138 ; AVX-128, fp32 -> int32 (packed:4)1138 ; AVX-128, int32 <- fp32 (packed:4) 1139 1139 EMIT_INSTR_PLUS_ICEBP vcvtps2dq, XMM1, XMM2 1140 1140 EMIT_INSTR_PLUS_ICEBP vcvtps2dq, XMM1, FSxBX 1141 1141 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2dq, XMM8, XMM9 1142 1142 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2dq, XMM8, FSxBX 1143 ; AVX-256, fp32 -> int32 (packed:8)1143 ; AVX-256, int32 <- fp32 (packed:8) 1144 1144 EMIT_INSTR_PLUS_ICEBP vcvtps2dq, YMM1, YMM2 1145 1145 EMIT_INSTR_PLUS_ICEBP vcvtps2dq, YMM1, FSxBX 1146 1146 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2dq, YMM8, YMM9 1147 1147 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2dq, YMM8, FSxBX 1148 ; SSE-128, fp32 -> int32, same-reg (packed:4)1148 ; SSE-128, int32 <- fp32, same-reg (packed:4) 1149 1149 EMIT_INSTR_PLUS_ICEBP cvtps2dq, XMM1, XMM1 1150 1150 EMIT_INSTR_PLUS_ICEBP_C64 cvtps2dq, XMM8, XMM8 1151 ; AVX-128, fp32 -> int32, same-reg (packed:4)1151 ; AVX-128, int32 <- fp32, same-reg (packed:4) 1152 1152 EMIT_INSTR_PLUS_ICEBP vcvtps2dq, XMM1, XMM1 1153 1153 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2dq, XMM8, XMM8 1154 ; AVX-256, fp32 -> int32, same-reg (packed:8)1154 ; AVX-256, int32 <- fp32, same-reg (packed:8) 1155 1155 EMIT_INSTR_PLUS_ICEBP vcvtps2dq, YMM1, YMM1 1156 1156 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2dq, YMM8, YMM8 … … 1159 1159 ;; cvttps2dq 1160 1160 ; 1161 ; SSE-128, fp32 -> int32 (packed:4; truncated)1161 ; SSE-128, int32 <- fp32 (packed:4; truncated) 1162 1162 EMIT_INSTR_PLUS_ICEBP cvttps2dq, XMM1, XMM2 1163 1163 EMIT_INSTR_PLUS_ICEBP cvttps2dq, XMM1, FSxBX_O 1164 1164 EMIT_INSTR_PLUS_ICEBP_C64 cvttps2dq, XMM8, XMM9 1165 1165 EMIT_INSTR_PLUS_ICEBP_C64 cvttps2dq, XMM8, FSxBX_O 1166 ; AVX-128, fp32 -> int32 (packed:4; truncated)1166 ; AVX-128, int32 <- fp32 (packed:4; truncated) 1167 1167 EMIT_INSTR_PLUS_ICEBP vcvttps2dq, XMM1, XMM2 1168 1168 EMIT_INSTR_PLUS_ICEBP vcvttps2dq, XMM1, FSxBX_O 1169 1169 EMIT_INSTR_PLUS_ICEBP_C64 vcvttps2dq, XMM8, XMM9 1170 1170 EMIT_INSTR_PLUS_ICEBP_C64 vcvttps2dq, XMM8, FSxBX_O 1171 ; AVX-256, fp32 -> int32 (packed:8; truncated)1171 ; AVX-256, int32 <- fp32 (packed:8; truncated) 1172 1172 EMIT_INSTR_PLUS_ICEBP vcvttps2dq, YMM1, YMM2 1173 1173 EMIT_INSTR_PLUS_ICEBP vcvttps2dq, YMM1, FSxBX_Y 1174 1174 EMIT_INSTR_PLUS_ICEBP_C64 vcvttps2dq, YMM8, YMM9 1175 1175 EMIT_INSTR_PLUS_ICEBP_C64 vcvttps2dq, YMM8, FSxBX_Y 1176 ; AVX-128, fp32 -> int32, same-reg (packed:4; truncated)1176 ; AVX-128, int32 <- fp32, same-reg (packed:4; truncated) 1177 1177 EMIT_INSTR_PLUS_ICEBP cvttps2dq, XMM1, XMM1 1178 1178 EMIT_INSTR_PLUS_ICEBP_C64 cvttps2dq, XMM8, XMM8 1179 ; AVX-128, fp32 -> int32, same-reg (packed:4; truncated)1179 ; AVX-128, int32 <- fp32, same-reg (packed:4; truncated) 1180 1180 EMIT_INSTR_PLUS_ICEBP vcvttps2dq, XMM1, XMM1 1181 1181 EMIT_INSTR_PLUS_ICEBP_C64 vcvttps2dq, XMM8, XMM8 1182 ; AVX-256, fp32 -> int32, same-reg (packed:8; truncated)1182 ; AVX-256, int32 <- fp32, same-reg (packed:8; truncated) 1183 1183 EMIT_INSTR_PLUS_ICEBP vcvttps2dq, YMM1, YMM1 1184 1184 EMIT_INSTR_PLUS_ICEBP_C64 vcvttps2dq, YMM8, YMM8 … … 1187 1187 ;; cvtdq2pd 1188 1188 ; 1189 ; SSE-128, int32 -> fp64(packed:2)1189 ; SSE-128, fp64 <- int32 (packed:2) 1190 1190 EMIT_INSTR_PLUS_ICEBP cvtdq2pd, XMM1, XMM2 1191 1191 EMIT_INSTR_PLUS_ICEBP cvtdq2pd, XMM1, FSxBX 1192 1192 EMIT_INSTR_PLUS_ICEBP_C64 cvtdq2pd, XMM8, XMM9 1193 1193 EMIT_INSTR_PLUS_ICEBP_C64 cvtdq2pd, XMM8, FSxBX 1194 ; AVX-128, int32 -> fp64(packed:2)1194 ; AVX-128, fp64 <- int32 (packed:2) 1195 1195 EMIT_INSTR_PLUS_ICEBP vcvtdq2pd, XMM1, XMM2 1196 1196 EMIT_INSTR_PLUS_ICEBP vcvtdq2pd, XMM1, FSxBX 1197 1197 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2pd, XMM8, XMM9 1198 1198 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2pd, XMM8, FSxBX 1199 ; AVX-256, int32 -> fp64(packed:4)1199 ; AVX-256, fp64 <- int32 (packed:4) 1200 1200 EMIT_INSTR_PLUS_ICEBP vcvtdq2pd, YMM1, XMM2 1201 1201 EMIT_INSTR_PLUS_ICEBP vcvtdq2pd, YMM1, FSxBX 1202 1202 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2pd, YMM8, XMM9 1203 1203 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2pd, YMM8, FSxBX 1204 ; SSE-128, int32 -> fp64, same-reg (packed:2)1204 ; SSE-128, fp64 <- int32, same-reg (packed:2) 1205 1205 EMIT_INSTR_PLUS_ICEBP cvtdq2pd, XMM1, XMM1 1206 1206 EMIT_INSTR_PLUS_ICEBP_C64 cvtdq2pd, XMM8, XMM8 1207 ; AVX-128, int32 -> fp64, same-reg (packed:2)1207 ; AVX-128, fp64 <- int32, same-reg (packed:2) 1208 1208 EMIT_INSTR_PLUS_ICEBP vcvtdq2pd, XMM1, XMM1 1209 1209 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2pd, XMM8, XMM8 1210 ; AVX-256, int32 -> fp64, same-reg (packed:4)1210 ; AVX-256, fp64 <- int32, same-reg (packed:4) 1211 1211 EMIT_INSTR_PLUS_ICEBP vcvtdq2pd, YMM1, XMM1 1212 1212 EMIT_INSTR_PLUS_ICEBP_C64 vcvtdq2pd, YMM8, XMM8 … … 1215 1215 ;; cvtpd2dq 1216 1216 ; 1217 ; SSE-128, fp64 -> int32(packed:2)1217 ; SSE-128, int32 <- fp64 (packed:2) 1218 1218 EMIT_INSTR_PLUS_ICEBP cvtpd2dq, XMM1, XMM2 1219 1219 EMIT_INSTR_PLUS_ICEBP cvtpd2dq, XMM1, FSxBX 1220 1220 EMIT_INSTR_PLUS_ICEBP_C64 cvtpd2dq, XMM8, XMM9 1221 1221 EMIT_INSTR_PLUS_ICEBP_C64 cvtpd2dq, XMM8, FSxBX 1222 ; AVX-128, fp64 -> int32(packed:2)1222 ; AVX-128, int32 <- fp64 (packed:2) 1223 1223 EMIT_INSTR_PLUS_ICEBP vcvtpd2dq, XMM1, XMM2 1224 1224 EMIT_INSTR_PLUS_ICEBP vcvtpd2dq, XMM1, FSxBX 1225 1225 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2dq, XMM8, XMM9 1226 1226 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2dq, XMM8, FSxBX 1227 ; AVX-256, fp64 -> int32(packed:4)1227 ; AVX-256, int32 <- fp64 (packed:4) 1228 1228 EMIT_INSTR_PLUS_ICEBP vcvtpd2dq, XMM1, YMM2 1229 1229 EMIT_INSTR_PLUS_ICEBP vcvtpd2dq, YMM1, FSxBX 1230 1230 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2dq, XMM8, YMM9 1231 1231 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2dq, YMM8, FSxBX 1232 ; SSE-128, fp64 -> int32, same-reg (packed:2)1232 ; SSE-128, int32 <- fp64, same-reg (packed:2) 1233 1233 EMIT_INSTR_PLUS_ICEBP cvtpd2dq, XMM1, XMM1 1234 1234 EMIT_INSTR_PLUS_ICEBP_C64 cvtpd2dq, XMM8, XMM8 1235 ; AVX-128, fp64 -> int32, same-reg (packed:2)1235 ; AVX-128, int32 <- fp64, same-reg (packed:2) 1236 1236 EMIT_INSTR_PLUS_ICEBP vcvtpd2dq, XMM1, XMM1 1237 1237 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2dq, XMM8, XMM8 1238 ; AVX-256, fp64 -> int32, same-reg (packed:4)1238 ; AVX-256, int32 <- fp64, same-reg (packed:4) 1239 1239 EMIT_INSTR_PLUS_ICEBP vcvtpd2dq, XMM1, YMM1 1240 1240 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2dq, XMM8, YMM8 … … 1243 1243 ;; cvttpd2dq 1244 1244 ; 1245 ; SSE-128, fp64 -> int32(packed:2; truncated)1245 ; SSE-128, int32 <- fp64 (packed:2; truncated) 1246 1246 EMIT_INSTR_PLUS_ICEBP cvttpd2dq, XMM1, XMM2 1247 1247 EMIT_INSTR_PLUS_ICEBP cvttpd2dq, XMM1, FSxBX_O 1248 1248 EMIT_INSTR_PLUS_ICEBP_C64 cvttpd2dq, XMM8, XMM9 1249 1249 EMIT_INSTR_PLUS_ICEBP_C64 cvttpd2dq, XMM8, FSxBX_O 1250 ; AVX-128, fp64 -> int32(packed:2; truncated)1250 ; AVX-128, int32 <- fp64 (packed:2; truncated) 1251 1251 EMIT_INSTR_PLUS_ICEBP vcvttpd2dq, XMM1, XMM2 1252 1252 EMIT_INSTR_PLUS_ICEBP vcvttpd2dq, XMM1, FSxBX_O 1253 1253 EMIT_INSTR_PLUS_ICEBP_C64 vcvttpd2dq, XMM8, XMM9 1254 1254 EMIT_INSTR_PLUS_ICEBP_C64 vcvttpd2dq, XMM8, FSxBX_O 1255 ; AVX-256, fp64 -> int32(packed:4; truncated)1255 ; AVX-256, int32 <- fp64 (packed:4; truncated) 1256 1256 EMIT_INSTR_PLUS_ICEBP vcvttpd2dq, XMM1, YMM2 1257 1257 EMIT_INSTR_PLUS_ICEBP vcvttpd2dq, XMM1, FSxBX_Y 1258 1258 EMIT_INSTR_PLUS_ICEBP_C64 vcvttpd2dq, XMM8, YMM9 1259 1259 EMIT_INSTR_PLUS_ICEBP_C64 vcvttpd2dq, XMM8, FSxBX_Y 1260 ; AVX-128, fp64 -> int32, same-reg (packed:2; truncated)1260 ; AVX-128, int32 <- fp64, same-reg (packed:2; truncated) 1261 1261 EMIT_INSTR_PLUS_ICEBP cvttpd2dq, XMM1, XMM1 1262 1262 EMIT_INSTR_PLUS_ICEBP_C64 cvttpd2dq, XMM8, XMM8 1263 ; AVX-128, fp64 -> int32, same-reg (packed:2; truncated)1263 ; AVX-128, int32 <- fp64, same-reg (packed:2; truncated) 1264 1264 EMIT_INSTR_PLUS_ICEBP vcvttpd2dq, XMM1, XMM1 1265 1265 EMIT_INSTR_PLUS_ICEBP_C64 vcvttpd2dq, XMM8, XMM8 1266 ; AVX-256, fp64 -> int32, same-reg (packed:4; truncated)1266 ; AVX-256, int32 <- fp64, same-reg (packed:4; truncated) 1267 1267 EMIT_INSTR_PLUS_ICEBP vcvttpd2dq, XMM1, YMM1 1268 1268 EMIT_INSTR_PLUS_ICEBP_C64 vcvttpd2dq, XMM8, YMM8 … … 1271 1271 ;; cvtpd2ps 1272 1272 ; 1273 ; SSE-128, fp 64 -> fp32(packed:2)1273 ; SSE-128, fp32 <- fp64 (packed:2) 1274 1274 EMIT_INSTR_PLUS_ICEBP cvtpd2ps, XMM1, XMM2 1275 1275 EMIT_INSTR_PLUS_ICEBP cvtpd2ps, XMM1, FSxBX 1276 1276 EMIT_INSTR_PLUS_ICEBP_C64 cvtpd2ps, XMM8, XMM9 1277 1277 EMIT_INSTR_PLUS_ICEBP_C64 cvtpd2ps, XMM8, FSxBX 1278 ; AVX-128, fp 64 -> fp32(packed:2)1278 ; AVX-128, fp32 <- fp64 (packed:2) 1279 1279 EMIT_INSTR_PLUS_ICEBP vcvtpd2ps, XMM1, XMM2 1280 1280 EMIT_INSTR_PLUS_ICEBP vcvtpd2ps, XMM1, FSxBX_O 1281 1281 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2ps, XMM8, XMM9 1282 1282 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2ps, XMM8, FSxBX_O 1283 ; AVX-256, fp 64 -> fp32(packed:4)1283 ; AVX-256, fp32 <- fp64 (packed:4) 1284 1284 EMIT_INSTR_PLUS_ICEBP vcvtpd2ps, XMM1, YMM2 1285 1285 EMIT_INSTR_PLUS_ICEBP vcvtpd2ps, XMM1, FSxBX_Y 1286 1286 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2ps, XMM8, YMM9 1287 1287 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2ps, XMM8, FSxBX_Y 1288 ; SSE-128, fp 64 -> fp32, same-reg (packed:2)1288 ; SSE-128, fp32 <- fp64, same-reg (packed:2) 1289 1289 EMIT_INSTR_PLUS_ICEBP cvtpd2ps, XMM1, XMM1 1290 1290 EMIT_INSTR_PLUS_ICEBP_C64 cvtpd2ps, XMM8, XMM8 1291 ; AVX-128, fp 64 -> fp32, same-reg (packed:2)1291 ; AVX-128, fp32 <- fp64, same-reg (packed:2) 1292 1292 EMIT_INSTR_PLUS_ICEBP vcvtpd2ps, XMM1, XMM1 1293 1293 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2ps, XMM8, XMM8 1294 ; AVX-256, fp 64 -> fp32, same-reg (packed:4)1294 ; AVX-256, fp32 <- fp64, same-reg (packed:4) 1295 1295 EMIT_INSTR_PLUS_ICEBP vcvtpd2ps, XMM1, YMM1 1296 1296 EMIT_INSTR_PLUS_ICEBP_C64 vcvtpd2ps, XMM8, YMM8 … … 1299 1299 ;; cvtps2pd 1300 1300 ; 1301 ; SSE-128, fp 32 -> fp64(packed:2)1301 ; SSE-128, fp64 <- fp32 (packed:2) 1302 1302 EMIT_INSTR_PLUS_ICEBP cvtps2pd, XMM1, XMM2 1303 1303 EMIT_INSTR_PLUS_ICEBP cvtps2pd, XMM1, FSxBX 1304 1304 EMIT_INSTR_PLUS_ICEBP_C64 cvtps2pd, XMM8, XMM9 1305 1305 EMIT_INSTR_PLUS_ICEBP_C64 cvtps2pd, XMM8, FSxBX 1306 ; AVX-128, fp 32 -> fp64(packed:2)1306 ; AVX-128, fp64 <- fp32 (packed:2) 1307 1307 EMIT_INSTR_PLUS_ICEBP vcvtps2pd, XMM1, XMM2 1308 1308 EMIT_INSTR_PLUS_ICEBP vcvtps2pd, XMM1, FSxBX 1309 1309 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2pd, XMM8, XMM9 1310 1310 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2pd, XMM8, FSxBX 1311 ; AVX-256, fp 32 -> fp64(packed:4)1311 ; AVX-256, fp64 <- fp32 (packed:4) 1312 1312 EMIT_INSTR_PLUS_ICEBP vcvtps2pd, YMM1, XMM2 1313 1313 EMIT_INSTR_PLUS_ICEBP vcvtps2pd, YMM1, FSxBX_O 1314 1314 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2pd, YMM8, XMM9 1315 1315 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2pd, YMM8, FSxBX_O 1316 ; SSE-128, fp 32 -> fp64, same-reg (packed:2)1316 ; SSE-128, fp64 <- fp32, same-reg (packed:2) 1317 1317 EMIT_INSTR_PLUS_ICEBP cvtps2pd, XMM1, XMM1 1318 1318 EMIT_INSTR_PLUS_ICEBP_C64 cvtps2pd, XMM8, XMM8 1319 ; AVX-128, fp 32 -> fp64, same-reg (packed:2)1319 ; AVX-128, fp64 <- fp32, same-reg (packed:2) 1320 1320 EMIT_INSTR_PLUS_ICEBP vcvtps2pd, XMM1, XMM1 1321 1321 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2pd, XMM8, XMM8 1322 ; AVX-256, fp 32 -> fp64, same-reg (packed:4)1322 ; AVX-256, fp64 <- fp32, same-reg (packed:4) 1323 1323 EMIT_INSTR_PLUS_ICEBP vcvtps2pd, YMM1, XMM1 1324 1324 EMIT_INSTR_PLUS_ICEBP_C64 vcvtps2pd, YMM8, XMM8 … … 1327 1327 ;; cvtsd2ss 1328 1328 ; 1329 ; SSE-128, fp 64 -> fp32(single)1329 ; SSE-128, fp32 <- fp64 (single) 1330 1330 EMIT_INSTR_PLUS_ICEBP cvtsd2ss, XMM1, XMM2 1331 1331 EMIT_INSTR_PLUS_ICEBP cvtsd2ss, XMM1, FSxBX 1332 1332 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2ss, XMM8, XMM9 1333 1333 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2ss, XMM8, FSxBX 1334 ; AVX-128, fp 64 -> fp32(single)1334 ; AVX-128, fp32 <- fp64 (single) 1335 1335 EMIT_INSTR_PLUS_ICEBP vcvtsd2ss, XMM1, XMM2, XMM3 1336 1336 EMIT_INSTR_PLUS_ICEBP vcvtsd2ss, XMM1, XMM2, FSxBX 1337 1337 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsd2ss, XMM8, XMM9, XMM10 1338 1338 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsd2ss, XMM8, XMM9, FSxBX 1339 ; SSE-128, fp 64 -> fp32, same-reg (single)1339 ; SSE-128, fp32 <- fp64, same-reg (single) 1340 1340 EMIT_INSTR_PLUS_ICEBP cvtsd2ss, XMM1, XMM1 1341 1341 EMIT_INSTR_PLUS_ICEBP_C64 cvtsd2ss, XMM8, XMM8 1342 ; AVX-128, fp 64 -> fp32, same-reg (single)1342 ; AVX-128, fp32 <- fp64, same-reg (single) 1343 1343 EMIT_INSTR_PLUS_ICEBP vcvtsd2ss, XMM1, XMM1, XMM1 1344 1344 EMIT_INSTR_PLUS_ICEBP_C64 vcvtsd2ss, XMM1, XMM1, XMM8 … … 1353 1353 ;; cvtss2sd 1354 1354 ; 1355 ; SSE-128, fp 32 -> fp64(single)1355 ; SSE-128, fp64 <- fp32 (single) 1356 1356 EMIT_INSTR_PLUS_ICEBP cvtss2sd, XMM1, XMM2 1357 1357 EMIT_INSTR_PLUS_ICEBP cvtss2sd, XMM1, FSxBX 1358 1358 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2sd, XMM8, XMM9 1359 1359 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2sd, XMM8, FSxBX 1360 ; AVX-128, fp 32 -> fp64(single)1360 ; AVX-128, fp64 <- fp32 (single) 1361 1361 EMIT_INSTR_PLUS_ICEBP vcvtss2sd, XMM1, XMM2, XMM3 1362 1362 EMIT_INSTR_PLUS_ICEBP vcvtss2sd, XMM1, XMM2, FSxBX 1363 1363 EMIT_INSTR_PLUS_ICEBP_C64 vcvtss2sd, XMM8, XMM9, XMM10 1364 1364 EMIT_INSTR_PLUS_ICEBP_C64 vcvtss2sd, XMM8, XMM9, FSxBX 1365 ; SSE-128, fp 32 -> fp64, same-reg (single)1365 ; SSE-128, fp64 <- fp32, same-reg (single) 1366 1366 EMIT_INSTR_PLUS_ICEBP cvtss2sd, XMM1, XMM1 1367 1367 EMIT_INSTR_PLUS_ICEBP_C64 cvtss2sd, XMM8, XMM8 1368 ; AVX-128, fp 32 -> fp64, same-reg (single)1368 ; AVX-128, fp64 <- fp32, same-reg (single) 1369 1369 EMIT_INSTR_PLUS_ICEBP vcvtss2sd, XMM1, XMM1, XMM1 1370 1370 EMIT_INSTR_PLUS_ICEBP_C64 vcvtss2sd, XMM1, XMM1, XMM8 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4.c32
r106721 r106733 281 281 #define FP32_ROW_UNUSED FP32_1(0), FP32_RAND_x7_V0 282 282 #define FP32_x6_UNUSED FP32_RAND_x6_V7 283 284 285 /* 286 * Macros to store integer values into floating point boxes, allowing testing 287 * of instructions which convert between types. 288 */ 289 #define FP32_INT_SIGN_PART(a_uInt32) ((((uint32_t)(a_uInt32)) >> 31) & 1) 290 #define FP32_INT_EXPN_PART(a_uInt32) ((((uint32_t)(a_uInt32)) >> 23) & 0xFF) 291 #define FP32_INT_FRAC_PART(a_uInt32) (((uint32_t)(a_uInt32)) & 0x7FFFFF) 292 #define FP32_INT(a_uInt32) RTFLOAT32U_INIT(FP32_INT_SIGN_PART(a_uInt32), FP32_INT_FRAC_PART(a_uInt32), FP32_INT_EXPN_PART(a_uInt32)) 293 #define FP32_INT_C(a_uInt32) FP32_INT(UINT32_C(a_uInt32)) 294 #define FP32_INT64(a_uInt64) FP32_INT((a_uInt64) & 0xFFFFFFFF), FP32_INT((a_uInt64) >> 32) 295 #define FP32_INT64_C(a_uInt64) FP32_INT64(UINT64_C(a_uInt64)) 296 297 #define FP64_INT_SIGN_PART(a_uInt64) ((((uint64_t)(a_uInt64)) >> 63) & 1) 298 #define FP64_INT_EXPN_PART(a_uInt64) ((((uint64_t)(a_uInt64)) >> 52) & 0x7FF) 299 #define FP64_INT_FRAC_PART(a_uInt64) (((uint64_t)(a_uInt64)) & 0xFFFFFFFFFFFFF) 300 #define FP64_INT(a_uInt64) RTFLOAT64U_INIT(FP64_INT_SIGN_PART(a_uInt64), FP64_INT_FRAC_PART(a_uInt64), FP64_INT_EXPN_PART(a_uInt64)) 301 #define FP64_INT_C(a_uInt64) FP64_INT(UINT64_C(a_uInt64)) 302 #define FP64_INT32(a_uInt32_1, a_uInt32_2) FP64_INT(((uint64_t)(a_uInt32_1)) | (((uint64_t)(a_uInt32_2)) << 32)) 303 #define FP64_INT32_C(a_uInt32_1, a_uInt32_2) FP64_INT32(UINT32_C(a_uInt32_1), UINT32_C(a_uInt32_2)) 283 304 284 305 /* … … 2552 2573 { 2553 2574 FPFNBS3FAR pfnWorker; /**< Test function worker. */ 2554 uint8_t bA vxMisalignXcpt; /**< AVX misalignmentexception. */2575 uint8_t bAltXcpt; /**< AVX misalignment exception, or always-expected exception. */ 2555 2576 uint8_t enmRm; /**< R/M type. */ 2556 2577 uint8_t enmType; /**< CPU instruction type (see T_XXX). */ … … 2562 2583 } BS3CPUINSTR4_TEST1_T; 2563 2584 2585 #define BS3_XCPT_ALWAYS 0x80 2586 #define BS3_XCPT_UD (X86_XCPT_UD | BS3_XCPT_ALWAYS) 2587 2564 2588 typedef struct BS3CPUINSTR4_TEST1_MODE_T 2565 2589 { … … 2576 2600 #define PASS_s_aValues PASS_s_aArray(s_aValues) 2577 2601 #define PASS_s_aValuesSR PASS_s_aArray(s_aValuesSR) 2602 #define PASS_s_aValues32 PASS_s_aArray(s_aValues32) 2603 #define PASS_s_aValues64 PASS_s_aArray(s_aValues64) 2578 2604 2579 2605 typedef struct BS3CPUINSTR4_TEST1_CTX_T … … 2661 2687 bool fFpXcptExpected; 2662 2688 uint8_t cbBytesExecuted; 2689 BS3SETREGCTX pSetRegCtx; 2663 2690 2664 2691 uint32_t uSpecifiedMask, uExpectedMask, uImpliedMask, uCombinedMask, uMaskedMask, uUnmaskedMask, uThisMask; … … 2830 2857 { 2831 2858 Bs3MemSet(puMemOpAlias, 0xcc, cbMemOp); 2859 //Bs3TestPrintf("memory operand (Dst); set %d bytes of dst to 0xCC\n", cbMemOp); 2832 2860 if (fNonFpOK) 2833 2861 MemOpExpect.ymm = pValues->uDstOut.ymm; 2834 2862 else 2835 2863 Bs3MemSet(&MemOpExpect, 0xcc, sizeof(MemOpExpect)); 2864 //Bs3TestPrintf("success expected; set %d bytes of expect to YMM value\n", sizeof(MemOpExpect)); 2836 2865 } 2866 2867 pSetRegCtx.pExtCtx = pExtCtx; 2868 pSetRegCtx.pCtx = pCtx; 2869 pSetRegCtx.fZeroYMMHi = fSseInstr; 2870 pSetRegCtx.bMode = bMode; 2837 2871 2838 2872 /* Source #1 (/ destination for SSE). */ … … 2840 2874 { 2841 2875 Bs3MemCpy(puMemOpAlias, &pValues->uSrc1, cbMemOp); 2876 //Bs3TestPrintf("memory operand (Src1); set %d bytes of src1 & expected to specified value\n", cbMemOp); 2842 2877 if (pTest->iRegDst >= FSxDI) 2843 2878 BS3_ASSERT(fSseInstr); … … 2845 2880 MemOpExpect.ymm = pValues->uSrc1.ymm; 2846 2881 } 2847 else Bs3ExtCtxSetReg( pExtCtx, pTest->iRegSrc1, (void*)&pValues->uSrc1, (void *)fSseInstr);2882 else Bs3ExtCtxSetReg(&pSetRegCtx, pTest->iRegSrc1, (void*)&pValues->uSrc1); 2848 2883 2849 2884 /* Source #2. */ … … 2852 2887 BS3_ASSERT(pTest->iRegDst < FSxDI && pTest->iRegSrc1 < FSxDI); 2853 2888 Bs3MemCpy(puMemOpAlias, &pValues->uSrc2, cbMemOp); 2889 //Bs3TestPrintf("memory operand (Src2); set %d bytes of src2 & expected to specified value\n", cbMemOp); 2854 2890 MemOpExpect.ymm = pValues->uSrc2.ymm; 2855 2891 } 2856 else Bs3ExtCtxSetReg( pExtCtx, pTest->iRegSrc2, (void*)&pValues->uSrc2, (void *)fSseInstr);2892 else Bs3ExtCtxSetReg(&pSetRegCtx, pTest->iRegSrc2, (void*)&pValues->uSrc2); 2857 2893 2858 2894 /* Memory pointer. */ … … 2884 2920 cErrors = Bs3TestSubErrorCount(); 2885 2921 if (fNonFpOK && !fFpXcptExpected && pTest->iRegDst < FSxDI) 2886 Bs3ExtCtxSetReg(pExtCtx, pTest->iRegDst, (void*)&pValues->uDstOut, (void *)fSseInstr); 2922 { 2923 //Bs3TestPrintf("after successful execution\n"); 2924 Bs3ExtCtxSetReg(&pSetRegCtx, pTest->iRegDst, (void*)&pValues->uDstOut); 2925 } 2887 2926 #if defined(DEBUG_aeichner) /** @todo Necessary kludge on a i7-1068NG7. */ 2888 2927 if ( pExtCtx->enmMethod == BS3EXTCTXMETHOD_XSAVE … … 3052 3091 uint8_t *puMemOpAlias = &g_pbBufAlias[(uintptr_t)puMemOp - (uintptr_t)pbBuf]; 3053 3092 uint8_t bXcptExpect = !g_afTypeSupports[pTest->enmType] ? X86_XCPT_UD 3093 : pTest->bAltXcpt & BS3_XCPT_ALWAYS && pTest->bAltXcpt != 255 ? pTest->bAltXcpt & ~BS3_XCPT_ALWAYS 3054 3094 : fSseInstr ? paConfigs[iCfg].bXcptSse 3055 3095 : BS3_MODE_IS_RM_OR_V86(bMode) ? X86_XCPT_UD : paConfigs[iCfg].bXcptAvx; … … 3071 3111 if (bRing != 3) 3072 3112 bXcptExpect = X86_XCPT_DB; 3073 else if (fAvxInstr )3074 bXcptExpect = pTest->bA vxMisalignXcpt; /* they generally don't raise #AC */3113 else if (fAvxInstr && pTest->bAltXcpt != 255) 3114 bXcptExpect = pTest->bAltXcpt; /* they generally don't raise #AC */ 3075 3115 } 3076 3116 … … 16313 16353 16314 16354 16315 #define FP32_INT_SIGN_PART(a_uInt32) ((((uint32_t)a_uInt32) >> 31) & 1)16316 #define FP32_INT_EXPN_PART(a_uInt32) ((((uint32_t)a_uInt32) >> 23) & 0xFF)16317 #define FP32_INT_FRAC_PART(a_uInt32) (((uint32_t)a_uInt32) & 0x7FFFFF)16318 #define FP32_INT(a_uInt32) RTFLOAT32U_INIT(FP32_INT_SIGN_PART(a_uInt32), FP32_INT_FRAC_PART(a_uInt32), FP32_INT_EXPN_PART(a_uInt32))16319 16320 #define FP64_INT_SIGN_PART(a_uInt64) ((((uint64_t)a_uInt64) >> 63) & 1)16321 #define FP64_INT_EXPN_PART(a_uInt64) ((((uint64_t)a_uInt64) >> 52) & 0x7FF)16322 #define FP64_INT_FRAC_PART(a_uInt64) (((uint64_t)a_uInt64) & 0xFFFFFFFFFFFFF)16323 #define FP64_INT(a_uInt64) RTFLOAT64U_INIT(FP64_INT_SIGN_PART(a_uInt64), FP64_INT_FRAC_PART(a_uInt64), FP64_INT_EXPN_PART(a_uInt64))16324 16325 16355 /* 16326 16356 * CVTPI2PS. … … 16334 16364 */ 16335 16365 /* 0*/{ { /*init dst */ { FP32_RAND_V1(0), FP32_RAND_V3(1), FP32_RAND_x6_V0 } }, 16336 { /* src mm */ { FP32_INT (0), FP32_INT(0),FP32_RAND_x6_V2 } },16366 { /* src mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_RAND_x6_V2 } }, 16337 16367 { /* => xmm */ { FP32_0(0), FP32_0(0), FP32_RAND_x6_V0 } }, 16338 16368 /*mxcsr:in */ 0, … … 16343 16373 */ 16344 16374 /* 1*/{ { /*init dst */ { FP32_NORM_V0(0), FP32_NORM_V4(0), FP32_RAND_x6_V3 } }, 16345 { /* src mm */ { FP32_INT (123456789), FP32_INT(-123456789),FP32_RAND_x6_V4 } },16375 { /* src mm */ { FP32_INT_C(123456789), FP32_INT_C(-123456789), FP32_RAND_x6_V4 } }, 16346 16376 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_V(1,0x6b79a3,0x99), FP32_RAND_x6_V3 } }, 16347 16377 /*123456792.0*/ /*-123456792.0*/ … … 16350 16380 /*256:out */ -1 }, 16351 16381 { { /*init dst */ { FP32_NORM_V1(0), FP32_NORM_V7(0), FP32_RAND_x6_V5 } }, 16352 { /* src mm */ { FP32_INT (-47), FP32_INT(42),FP32_RAND_x6_V1 } },16382 { /* src mm */ { FP32_INT_C(-47), FP32_INT_C(42), FP32_RAND_x6_V1 } }, 16353 16383 { /* => xmm */ { FP32_V(1,0x3c0000,0x84), FP32_V(0,0x280000,0x84), FP32_RAND_x6_V5 } }, 16354 16384 /*-47.0*/ /*42.0*/ … … 16364 16394 /*256:out */ -1 }, 16365 16395 { { /*init dst */ { FP32_NORM_V0(0), FP32_NORM_V4(0), FP32_RAND_x6_V7 } }, 16366 { /* src mm */ { FP32_INT (123456789), FP32_INT(-123456789),FP32_RAND_x6_V7 } },16396 { /* src mm */ { FP32_INT_C(123456789), FP32_INT_C(-123456789), FP32_RAND_x6_V7 } }, 16367 16397 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_V(1,0x6b79a3,0x99), FP32_RAND_x6_V7 } }, 16368 16398 /*123456792.0*/ /*-123456792.0*/ … … 16371 16401 /*256:out */ -1 }, 16372 16402 { { /*init dst */ { FP32_NORM_V0(0), FP32_NORM_V4(0), FP32_RAND_x6_V6 } }, 16373 { /* src mm */ { FP32_INT (123456789), FP32_INT(-123456789),FP32_RAND_x6_V4 } },16403 { /* src mm */ { FP32_INT_C(123456789), FP32_INT_C(-123456789), FP32_RAND_x6_V4 } }, 16374 16404 { /* => xmm */ { FP32_V(0,0x6b79a2,0x99), FP32_V(1,0x6b79a3,0x99), FP32_RAND_x6_V6 } }, 16375 16405 /*123456784.0*/ /*-123456792.0*/ … … 16378 16408 /*256:out */ -1 }, 16379 16409 { { /*init dst */ { FP32_NORM_V0(0), FP32_NORM_V4(0), FP32_RAND_x6_V2 } }, 16380 { /* src mm */ { FP32_INT (123456789), FP32_INT(-123456789),FP32_RAND_x6_V1 } },16410 { /* src mm */ { FP32_INT_C(123456789), FP32_INT_C(-123456789), FP32_RAND_x6_V1 } }, 16381 16411 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_V(1,0x6b79a2,0x99), FP32_RAND_x6_V2 } }, 16382 16412 /*123456792.0*/ /*-123456784.0*/ … … 16385 16415 /*256:out */ -1 }, 16386 16416 { { /*init dst */ { FP32_NORM_V0(0), FP32_NORM_V4(0), FP32_RAND_x6_V0 } }, 16387 { /* src mm */ { FP32_INT (123456789), FP32_INT(-123456789),FP32_RAND_x6_V5 } },16417 { /* src mm */ { FP32_INT_C(123456789), FP32_INT_C(-123456789), FP32_RAND_x6_V5 } }, 16388 16418 { /* => xmm */ { FP32_V(0,0x6b79a2,0x99), FP32_V(1,0x6b79a2,0x99), FP32_RAND_x6_V0 } }, 16389 16419 /*123456784.0*/ /*-123456784.0*/ … … 16432 16462 */ 16433 16463 /* 0*/{ { /* unused */ { FP32_ROW_UNUSED } }, 16434 { /* src xmm */ { FP32_0(0), FP32_0(1),FP32_RAND_x6_V1 } },16435 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16464 { /* src xmm */ { FP32_0(0), FP32_0(1), FP32_RAND_x6_V1 } }, 16465 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16436 16466 /*mxcsr:in */ 0, 16437 16467 /*128:out */ 0, … … 16451 16481 /* 2*/{ { /* unused */ { FP32_ROW_UNUSED } }, 16452 16482 { /* src xmm */ { FP32_V(0,0x712000,0x8f), FP32_V(1,0x712000,0x8f), FP32_RAND_x6_V0 } }, 16453 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16483 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16454 16484 /*mxcsr:in */ 0, 16455 16485 /*128:out */ 0, … … 16458 16488 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16459 16489 /*123456.1*/ /*-123456.1*/ 16460 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16490 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16461 16491 /*mxcsr:in */ 0, 16462 16492 /*128:out */ X86_MXCSR_PE, … … 16465 16495 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16466 16496 /*123456.1*/ /*-123456.1*/ 16467 { /* => mm */ { FP32_INT (123456), FP32_INT(-123457),FP32_x6_UNUSED } },16497 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123457), FP32_x6_UNUSED } }, 16468 16498 /*mxcsr:in */ X86_MXCSR_RC_DOWN, 16469 16499 /*128:out */ X86_MXCSR_PE | X86_MXCSR_RC_DOWN, … … 16472 16502 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16473 16503 /*123456.1*/ /*-123456.1*/ 16474 { /* => mm */ { FP32_INT (123457), FP32_INT(-123456),FP32_x6_UNUSED } },16504 { /* => mm */ { FP32_INT_C(123457), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16475 16505 /*mxcsr:in */ X86_MXCSR_RC_UP, 16476 16506 /*128:out */ X86_MXCSR_PE | X86_MXCSR_RC_UP, … … 16479 16509 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16480 16510 /*123456.1*/ /*-123456.1*/ 16481 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16511 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16482 16512 /*mxcsr:in */ X86_MXCSR_RC_ZERO, 16483 16513 /*128:out */ X86_MXCSR_PE | X86_MXCSR_RC_ZERO, … … 16486 16516 { /* src xmm */ { FP32_V(1,0x666666,0x7e), FP32_V(0,0x666666,0x7e), FP32_RAND_x6_V2 } }, 16487 16517 /*-0.9*/ /*0.9*/ 16488 { /* => mm */ { FP32_INT (-1), FP32_INT(1),FP32_x6_UNUSED } },16518 { /* => mm */ { FP32_INT_C(-1), FP32_INT_C(1), FP32_x6_UNUSED } }, 16489 16519 /*mxcsr:in */ X86_MXCSR_FZ, 16490 16520 /*128:out */ X86_MXCSR_PE | X86_MXCSR_FZ, … … 16492 16522 { { /* unused */ { FP32_ROW_UNUSED } }, 16493 16523 { /* src xmm */ { FP32_NORM_SAFE_INT_MAX(1), FP32_NORM_SAFE_INT_MAX(0), FP32_RAND_x6_V2 } }, 16494 { /* => mm */ { FP32_INT (-16777215), FP32_INT(16777215),FP32_x6_UNUSED } },16524 { /* => mm */ { FP32_INT_C(-16777215), FP32_INT_C(16777215), FP32_x6_UNUSED } }, 16495 16525 /*mxcsr:in */ 0, 16496 16526 /*128:out */ 0, … … 16501 16531 /* 9*/{ { /* unused */ { FP32_ROW_UNUSED } }, 16502 16532 { /* src xmm */ { FP32_DENORM_MAX(0), FP32_DENORM_MIN(1), FP32_RAND_x6_V2 } }, 16503 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16533 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16504 16534 /*mxcsr:in */ 0, 16505 16535 /*128:out */ X86_MXCSR_PE, … … 16507 16537 { { /* unused */ { FP32_ROW_UNUSED } }, 16508 16538 { /* src xmm */ { FP32_DENORM_MIN(0), FP32_DENORM_MAX(1), FP32_RAND_x6_V2 } }, 16509 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16539 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16510 16540 /*mxcsr:in */ X86_MXCSR_DAZ, 16511 16541 /*128:out */ X86_MXCSR_DAZ, … … 16573 16603 */ 16574 16604 /* 0*/{ { /* unused */ { FP32_ROW_UNUSED } }, 16575 { /* src xmm */ { FP32_0(0), FP32_0(1),FP32_RAND_x6_V1 } },16576 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16605 { /* src xmm */ { FP32_0(0), FP32_0(1), FP32_RAND_x6_V1 } }, 16606 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16577 16607 /*mxcsr:in */ 0, 16578 16608 /*128:out */ 0, … … 16592 16622 /* 2*/{ { /* unused */ { FP32_ROW_UNUSED } }, 16593 16623 { /* src xmm */ { FP32_V(0,0x712000,0x8f), FP32_V(1,0x712000,0x8f), FP32_RAND_x6_V0 } }, 16594 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16624 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16595 16625 /*mxcsr:in */ 0, 16596 16626 /*128:out */ 0, … … 16599 16629 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16600 16630 /*123456.1*/ /*-123456.1*/ 16601 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16631 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16602 16632 /*mxcsr:in */ 0, 16603 16633 /*128:out */ X86_MXCSR_PE, … … 16606 16636 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16607 16637 /*123456.1*/ /*-123456.1*/ 16608 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16638 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16609 16639 /*mxcsr:in */ X86_MXCSR_RC_DOWN, 16610 16640 /*128:out */ X86_MXCSR_PE | X86_MXCSR_RC_DOWN, … … 16613 16643 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16614 16644 /*123456.1*/ /*-123456.1*/ 16615 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16645 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16616 16646 /*mxcsr:in */ X86_MXCSR_RC_UP, 16617 16647 /*128:out */ X86_MXCSR_PE | X86_MXCSR_RC_UP, … … 16620 16650 { /* src xmm */ { FP32_V(0,0x71200d,0x8f), FP32_V(1,0x71200d,0x8f), FP32_RAND_x6_V2 } }, 16621 16651 /*123456.1*/ /*-123456.1*/ 16622 { /* => mm */ { FP32_INT (123456), FP32_INT(-123456),FP32_x6_UNUSED } },16652 { /* => mm */ { FP32_INT_C(123456), FP32_INT_C(-123456), FP32_x6_UNUSED } }, 16623 16653 /*mxcsr:in */ X86_MXCSR_RC_ZERO, 16624 16654 /*128:out */ X86_MXCSR_PE | X86_MXCSR_RC_ZERO, … … 16627 16657 { /* src xmm */ { FP32_V(1,0x666666,0x7e), FP32_V(0,0x666666,0x7e), FP32_RAND_x6_V2 } }, 16628 16658 /*-0.9*/ /*0.9*/ 16629 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16659 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16630 16660 /*mxcsr:in */ X86_MXCSR_FZ, 16631 16661 /*128:out */ X86_MXCSR_PE | X86_MXCSR_FZ, … … 16633 16663 { { /* unused */ { FP32_ROW_UNUSED } }, 16634 16664 { /* src xmm */ { FP32_NORM_SAFE_INT_MAX(1), FP32_NORM_SAFE_INT_MAX(0), FP32_RAND_x6_V2 } }, 16635 { /* => mm */ { FP32_INT (-16777215), FP32_INT(16777215),FP32_x6_UNUSED } },16665 { /* => mm */ { FP32_INT_C(-16777215), FP32_INT_C(16777215), FP32_x6_UNUSED } }, 16636 16666 /*mxcsr:in */ 0, 16637 16667 /*128:out */ 0, … … 16642 16672 /* 9*/{ { /* unused */ { FP32_ROW_UNUSED } }, 16643 16673 { /* src xmm */ { FP32_DENORM_MAX(0), FP32_DENORM_MIN(1), FP32_RAND_x6_V2 } }, 16644 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16674 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16645 16675 /*mxcsr:in */ 0, 16646 16676 /*128:out */ X86_MXCSR_PE, … … 16648 16678 { { /* unused */ { FP32_ROW_UNUSED } }, 16649 16679 { /* src xmm */ { FP32_DENORM_MIN(0), FP32_DENORM_MAX(1), FP32_RAND_x6_V2 } }, 16650 { /* => mm */ { FP32_INT (0), FP32_INT(0),FP32_x6_UNUSED } },16680 { /* => mm */ { FP32_INT_C(0), FP32_INT_C(0), FP32_x6_UNUSED } }, 16651 16681 /*mxcsr:in */ X86_MXCSR_DAZ, 16652 16682 /*128:out */ X86_MXCSR_DAZ, … … 16694 16724 { bs3CpuInstr4_cvttps2pi_MM1_XMM1_icebp_c64, 255, RM_REG, T_SSE, MM1, XMM1, NOREG, PASS_s_aValues }, 16695 16725 { bs3CpuInstr4_cvttps2pi_MM1_XMM8_icebp_c64, 255, RM_REG, T_SSE, MM1, XMM8, NOREG, PASS_s_aValues }, 16726 }; 16727 16728 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 16729 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 16730 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 16731 g_aXcptConfig5, RT_ELEMENTS(g_aXcptConfig5)); 16732 } 16733 16734 16735 /* 16736 * CVTSI2SS. 16737 */ 16738 BS3_DECL_FAR(uint8_t) bs3CpuInstr4_cvtsi2ss(uint8_t bMode) 16739 { 16740 static BS3CPUINSTR4_TEST1_VALUES_PS_T const s_aValues32[] = 16741 { 16742 /* 16743 * Zero. 16744 */ 16745 /* 0*/{ { /* src r32 */ { FP32_INT_C(0), FP32_RAND_x7_V0 } }, 16746 { /* src xmm */ { FP32_RAND_V1(0), FP32_RAND_x7_V2 } }, 16747 { /* => xmm */ { FP32_0(0), FP32_RAND_x7_V2 } }, 16748 /*mxcsr:in */ 0, 16749 /*128:out */ 0, 16750 /*256:out */ -1 }, 16751 /* 16752 * Normals & Precision. 16753 */ 16754 /* 1*/{ { /* src r32 */ { FP32_INT_C(123456789), FP32_RAND_x7_V4 } }, 16755 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16756 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_RAND_x7_V3 } }, 16757 /*123456792.0*/ 16758 /*mxcsr:in */ 0, 16759 /*128:out */ X86_MXCSR_PE, 16760 /*256:out */ -1 }, 16761 { { /* src r32 */ { FP32_INT_C(-123456789), FP32_RAND_x7_V4 } }, 16762 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16763 { /* => xmm */ { FP32_V(1,0x6b79a3,0x99), FP32_RAND_x7_V3 } }, 16764 /*-123456792.0*/ 16765 /*mxcsr:in */ 0, 16766 /*128:out */ X86_MXCSR_PE, 16767 /*256:out */ -1 }, 16768 { { /* src r32 */ { FP32_INT_C(-47), FP32_RAND_x7_V4 } }, 16769 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16770 { /* => xmm */ { FP32_V(1,0x3c0000,0x84), FP32_RAND_x7_V3 } }, 16771 /*-47.0*/ 16772 /*mxcsr:in */ 0, 16773 /*128:out */ 0, 16774 /*256:out */ -1 }, 16775 { { /* src r32 */ { FP32_INT(INT32_MAX), FP32_RAND_x7_V4 } }, 16776 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16777 { /* => xmm */ { FP32_V(0,0,0x9e), FP32_RAND_x7_V3 } }, 16778 /*2147483648.0*/ 16779 /*mxcsr:in */ 0, 16780 /*128:out */ X86_MXCSR_PE, 16781 /*256:out */ -1 }, 16782 { { /* src r32 */ { FP32_INT(-INT32_MAX), FP32_RAND_x7_V4 } }, 16783 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16784 { /* => xmm */ { FP32_V(1,0,0x9e), FP32_RAND_x7_V3 } }, 16785 /*-2147483648.0*/ 16786 /*mxcsr:in */ 0, 16787 /*128:out */ X86_MXCSR_PE, 16788 /*256:out */ -1 }, 16789 { { /* src r32 */ { FP32_INT_C(123456789), FP32_RAND_x7_V4 } }, 16790 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16791 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_RAND_x7_V3 } }, 16792 /*123456792.0*/ 16793 /*mxcsr:in */ X86_MXCSR_FZ | X86_MXCSR_DAZ, 16794 /*128:out */ X86_MXCSR_FZ | X86_MXCSR_DAZ | X86_MXCSR_PE, 16795 /*256:out */ -1 }, 16796 { { /* src r32 */ { FP32_INT_C(123456789), FP32_RAND_x7_V4 } }, 16797 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16798 { /* => xmm */ { FP32_V(0,0x6b79a2,0x99), FP32_RAND_x7_V3 } }, 16799 /*123456784.0*/ 16800 /*mxcsr:in */ X86_MXCSR_RC_DOWN, 16801 /*128:out */ X86_MXCSR_RC_DOWN | X86_MXCSR_PE, 16802 /*256:out */ -1 }, 16803 { { /* src r32 */ { FP32_INT_C(-123456789), FP32_RAND_x7_V4 } }, 16804 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16805 { /* => xmm */ { FP32_V(1,0x6b79a3,0x99), FP32_RAND_x7_V3 } }, 16806 /*-123456792.0*/ 16807 /*mxcsr:in */ X86_MXCSR_RC_DOWN, 16808 /*128:out */ X86_MXCSR_RC_DOWN | X86_MXCSR_PE, 16809 /*256:out */ -1 }, 16810 { { /* src r32 */ { FP32_INT_C(123456789), FP32_RAND_x7_V4 } }, 16811 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16812 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_RAND_x7_V3 } }, 16813 /*123456792.0*/ 16814 /*mxcsr:in */ X86_MXCSR_RC_UP, 16815 /*128:out */ X86_MXCSR_RC_UP | X86_MXCSR_PE, 16816 /*256:out */ -1 }, 16817 { { /* src r32 */ { FP32_INT_C(-123456789), FP32_RAND_x7_V4 } }, 16818 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16819 { /* => xmm */ { FP32_V(1,0x6b79a2,0x99), FP32_RAND_x7_V3 } }, 16820 /*-123456784.0*/ 16821 /*mxcsr:in */ X86_MXCSR_RC_UP, 16822 /*128:out */ X86_MXCSR_RC_UP | X86_MXCSR_PE, 16823 /*256:out */ -1 }, 16824 { { /* src r32 */ { FP32_INT_C(123456789), FP32_RAND_x7_V4 } }, 16825 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16826 { /* => xmm */ { FP32_V(0,0x6b79a2,0x99), FP32_RAND_x7_V3 } }, 16827 /*123456784.0*/ 16828 /*mxcsr:in */ X86_MXCSR_RC_ZERO, 16829 /*128:out */ X86_MXCSR_RC_ZERO | X86_MXCSR_PE, 16830 /*256:out */ -1 }, 16831 { { /* src r32 */ { FP32_INT_C(-123456789), FP32_RAND_x7_V4 } }, 16832 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16833 { /* => xmm */ { FP32_V(1,0x6b79a2,0x99), FP32_RAND_x7_V3 } }, 16834 /*-123456784.0*/ 16835 /*mxcsr:in */ X86_MXCSR_RC_ZERO, 16836 /*128:out */ X86_MXCSR_RC_ZERO | X86_MXCSR_PE, 16837 /*256:out */ -1 }, 16838 }; 16839 16840 static BS3CPUINSTR4_TEST1_VALUES_PS_T const s_aValues64[] = 16841 { 16842 /* 16843 * Zero. 16844 */ 16845 /* 0*/{ { /* src r64 */ { FP32_INT64_C(0), FP32_RAND_x6_V0 } }, 16846 { /* src xmm */ { FP32_RAND_V1(0), FP32_RAND_x7_V2 } }, 16847 { /* => xmm */ { FP32_0(0), FP32_RAND_x7_V2 } }, 16848 /*mxcsr:in */ 0, 16849 /*128:out */ 0, 16850 /*256:out */ -1 }, 16851 /* 16852 * Normals & Precision. 16853 */ 16854 /* 1*/{ { /* src r64 */ { FP32_INT64_C(123456789), FP32_RAND_x6_V4 } }, 16855 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16856 { /* => xmm */ { FP32_V(0,0x6b79a3,0x99), FP32_RAND_x7_V3 } }, 16857 /*123456792.0*/ 16858 /*mxcsr:in */ 0, 16859 /*128:out */ X86_MXCSR_PE, 16860 /*256:out */ -1 }, 16861 { { /* src r64 */ { FP32_INT64_C(8526495043095935640), FP32_RAND_x6_V4 } }, 16862 /*0x76543210FEDCBA98*/ 16863 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16864 { /* => xmm */ { FP32_V(0,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16865 /* 8526494970100580352.0 = 0x7654320000000000 */ 16866 /*mxcsr:in */ 0, 16867 /*128:out */ X86_MXCSR_PE, 16868 /*256:out */ -1 }, 16869 { { /* src r64 */ { FP32_INT64_C(-8526495043095935640), FP32_RAND_x6_V4 } }, 16870 /*-0x76543210FEDCBA98*/ 16871 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16872 { /* => xmm */ { FP32_V(1,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16873 /* -8526494970100580352.0 = -0x7654320000000000 */ 16874 /*mxcsr:in */ 0, 16875 /*128:out */ X86_MXCSR_PE, 16876 /*256:out */ -1 }, 16877 { { /* src r64 */ { FP32_INT64_C(-2), FP32_RAND_x6_V4 } }, 16878 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16879 { /* => xmm */ { FP32_2(1), FP32_RAND_x7_V3 } }, 16880 /*mxcsr:in */ 0, 16881 /*128:out */ 0, 16882 /*256:out */ -1 }, 16883 { { /* src r64 */ { FP32_INT64(INT64_MAX), FP32_RAND_x6_V4 } }, 16884 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16885 { /* => xmm */ { FP32_V(0,0x0,0xbe), FP32_RAND_x7_V3 } }, 16886 /* 9223372036854775808.0; exactly INT64_MAX, so why PE (i7-10700)?? */ 16887 /*mxcsr:in */ X86_MXCSR_XCPT_MASK, 16888 /*128:out */ X86_MXCSR_XCPT_MASK | X86_MXCSR_PE, 16889 /*256:out */ -1 }, 16890 { { /* src r64 */ { FP32_INT64(-INT64_MAX), FP32_RAND_x6_V4 } }, 16891 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16892 { /* => xmm */ { FP32_V(1,0x0,0xbe), FP32_RAND_x7_V3 } }, 16893 /* -9223372036854775808.0; exactly -INT64_MAX, so why PE (i7-10700)?? */ 16894 /*mxcsr:in */ X86_MXCSR_XCPT_MASK, 16895 /*128:out */ X86_MXCSR_XCPT_MASK | X86_MXCSR_PE, 16896 /*256:out */ -1 }, 16897 16898 { { /* src r64 */ { FP32_INT64_C(8526495043095935640), FP32_RAND_x6_V4 } }, 16899 /*0x76543210FEDCBA98*/ 16900 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16901 { /* => xmm */ { FP32_V(0,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16902 /* 8526494970100580352.0 = 0x7654320000000000 */ 16903 /*mxcsr:in */ X86_MXCSR_FZ | X86_MXCSR_DAZ, 16904 /*128:out */ X86_MXCSR_FZ | X86_MXCSR_DAZ | X86_MXCSR_PE, 16905 /*256:out */ -1 }, 16906 { { /* src r64 */ { FP32_INT64_C(8526495043095935640), FP32_RAND_x6_V4 } }, 16907 /*0x76543210FEDCBA98*/ 16908 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16909 { /* => xmm */ { FP32_V(0,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16910 /* 8526494970100580352.0 = 0x7654320000000000 */ 16911 /*mxcsr:in */ X86_MXCSR_RC_DOWN, 16912 /*128:out */ X86_MXCSR_RC_DOWN | X86_MXCSR_PE, 16913 /*256:out */ -1 }, 16914 { { /* src r64 */ { FP32_INT64_C(-8526495043095935640), FP32_RAND_x6_V4 } }, 16915 /*-0x76543210FEDCBA98*/ 16916 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16917 { /* => xmm */ { FP32_V(1,0x6ca865,0xbd), FP32_RAND_x7_V3 } }, 16918 /* -8526495519856394240.0 = -0x7654328000000000 */ 16919 /*mxcsr:in */ X86_MXCSR_RC_DOWN, 16920 /*128:out */ X86_MXCSR_RC_DOWN | X86_MXCSR_PE, 16921 /*256:out */ -1 }, 16922 { { /* src r64 */ { FP32_INT64_C(8526495043095935640), FP32_RAND_x6_V4 } }, 16923 /*0x76543210FEDCBA98*/ 16924 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16925 { /* => xmm */ { FP32_V(0,0x6ca865,0xbd), FP32_RAND_x7_V3 } }, 16926 /* 8526495519856394240.0 = 0x7654328000000000 */ 16927 /*mxcsr:in */ X86_MXCSR_RC_UP, 16928 /*128:out */ X86_MXCSR_RC_UP | X86_MXCSR_PE, 16929 /*256:out */ -1 }, 16930 { { /* src r64 */ { FP32_INT64_C(-8526495043095935640), FP32_RAND_x6_V4 } }, 16931 /*-0x76543210FEDCBA98*/ 16932 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16933 { /* => xmm */ { FP32_V(1,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16934 /* -8526494970100580352.0 = -0x7654320000000000 */ 16935 /*mxcsr:in */ X86_MXCSR_RC_UP, 16936 /*128:out */ X86_MXCSR_RC_UP | X86_MXCSR_PE, 16937 /*256:out */ -1 }, 16938 { { /* src r64 */ { FP32_INT64_C(8526495043095935640), FP32_RAND_x6_V4 } }, 16939 /*0x76543210FEDCBA98*/ 16940 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16941 { /* => xmm */ { FP32_V(0,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16942 /* 8526494970100580352.0 = 0x7654320000000000 */ 16943 /*mxcsr:in */ X86_MXCSR_RC_ZERO, 16944 /*128:out */ X86_MXCSR_RC_ZERO | X86_MXCSR_PE, 16945 /*256:out */ -1 }, 16946 { { /* src r64 */ { FP32_INT64_C(-8526495043095935640), FP32_RAND_x6_V4 } }, 16947 /*-0x76543210FEDCBA98*/ 16948 { /* src xmm */ { FP32_NORM_V0(0), FP32_RAND_x7_V3 } }, 16949 { /* => xmm */ { FP32_V(1,0x6ca864,0xbd), FP32_RAND_x7_V3 } }, 16950 /* -8526494970100580352.0 = -0x7654320000000000 */ 16951 /*mxcsr:in */ X86_MXCSR_RC_ZERO, 16952 /*128:out */ X86_MXCSR_RC_ZERO | X86_MXCSR_PE, 16953 /*256:out */ -1 }, 16954 }; 16955 /* 16956 * Infinity, Overflow, Underflow, Denormal, Invalid not possible. 16957 */ 16958 16959 static BS3CPUINSTR4_TEST1_T const s_aTests16[] = 16960 { 16961 { bs3CpuInstr4_cvtsi2ss_XMM1_EAX_icebp_c16, 255, RM_REG, T_SSE, XMM1, XMM1, EAX, PASS_s_aValues32 }, 16962 { bs3CpuInstr4_cvtsi2ss_XMM1_FSxBX_D_icebp_c16, 255, RM_MEM, T_SSE, XMM1, XMM1, FSxBX, PASS_s_aValues32 }, 16963 16964 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_EAX_icebp_c16, 255, RM_REG, T_AVX_128, XMM1, XMM2, EAX, PASS_s_aValues32 }, 16965 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_FSxBX_D_icebp_c16, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM2, FSxBX, PASS_s_aValues32 }, 16966 16967 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_RAX_icebp_c16, BS3_XCPT_UD, RM_REG, T_AVX_128, XMM1, XMM2, RAX, PASS_s_aValues64 }, 16968 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_FSxBX_Q_icebp_c16, BS3_XCPT_UD, RM_MEM, T_AVX_128, XMM1, XMM2, FSxBX, PASS_s_aValues64 }, 16969 16970 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_EAX_icebp_c16, 255, RM_REG, T_AVX_128, XMM1, XMM1, EAX, PASS_s_aValues32 }, 16971 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_FSxBX_D_icebp_c16, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM1, FSxBX, PASS_s_aValues32 }, 16972 16973 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_RAX_icebp_c16, BS3_XCPT_UD, RM_REG, T_AVX_128, XMM1, XMM1, RAX, PASS_s_aValues64 }, 16974 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_FSxBX_Q_icebp_c16, BS3_XCPT_UD, RM_MEM, T_AVX_128, XMM1, XMM1, FSxBX, PASS_s_aValues64 }, 16975 }; 16976 static BS3CPUINSTR4_TEST1_T const s_aTests32[] = 16977 { 16978 { bs3CpuInstr4_cvtsi2ss_XMM1_EAX_icebp_c32, 255, RM_REG, T_SSE, XMM1, XMM1, EAX, PASS_s_aValues32 }, 16979 { bs3CpuInstr4_cvtsi2ss_XMM1_FSxBX_D_icebp_c32, 255, RM_MEM, T_SSE, XMM1, XMM1, FSxBX, PASS_s_aValues32 }, 16980 16981 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_EAX_icebp_c32, 255, RM_REG, T_AVX_128, XMM1, XMM2, EAX, PASS_s_aValues32 }, 16982 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_FSxBX_D_icebp_c32, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM2, FSxBX, PASS_s_aValues32 }, 16983 16984 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_RAX_icebp_c32, BS3_XCPT_UD, RM_REG, T_AVX_128, XMM1, XMM2, RAX, PASS_s_aValues64 }, 16985 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_FSxBX_Q_icebp_c32, BS3_XCPT_UD, RM_MEM, T_AVX_128, XMM1, XMM2, FSxBX, PASS_s_aValues64 }, 16986 16987 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_EAX_icebp_c32, 255, RM_REG, T_AVX_128, XMM1, XMM1, EAX, PASS_s_aValues32 }, 16988 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_FSxBX_D_icebp_c32, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM1, FSxBX, PASS_s_aValues32 }, 16989 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_RAX_icebp_c32, BS3_XCPT_UD, RM_REG, T_AVX_128, XMM1, XMM1, RAX, PASS_s_aValues64 }, 16990 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_FSxBX_Q_icebp_c32, BS3_XCPT_UD, RM_MEM, T_AVX_128, XMM1, XMM1, FSxBX, PASS_s_aValues64 }, 16991 }; 16992 static BS3CPUINSTR4_TEST1_T const s_aTests64[] = 16993 { 16994 { bs3CpuInstr4_cvtsi2ss_XMM1_EAX_icebp_c64, 255, RM_REG, T_SSE, XMM1, XMM1, EAX, PASS_s_aValues32 }, 16995 { bs3CpuInstr4_cvtsi2ss_XMM1_FSxBX_D_icebp_c64, 255, RM_MEM, T_SSE, XMM1, XMM1, FSxBX, PASS_s_aValues32 }, 16996 { bs3CpuInstr4_cvtsi2ss_XMM8_R8D_icebp_c64, 255, RM_REG, T_SSE, XMM8, XMM8, R8D, PASS_s_aValues32 }, 16997 { bs3CpuInstr4_cvtsi2ss_XMM8_FSxBX_D_icebp_c64, 255, RM_MEM, T_SSE, XMM8, XMM8, FSxBX, PASS_s_aValues32 }, 16998 16999 { bs3CpuInstr4_cvtsi2ss_XMM1_RAX_icebp_c64, 255, RM_REG, T_SSE, XMM1, XMM1, RAX, PASS_s_aValues64 }, 17000 { bs3CpuInstr4_cvtsi2ss_XMM1_FSxBX_Q_icebp_c64, 255, RM_MEM, T_SSE, XMM1, XMM1, FSxBX, PASS_s_aValues64 }, 17001 { bs3CpuInstr4_cvtsi2ss_XMM8_R8_icebp_c64, 255, RM_REG, T_SSE, XMM8, XMM8, R8, PASS_s_aValues64 }, 17002 { bs3CpuInstr4_cvtsi2ss_XMM8_FSxBX_Q_icebp_c64, 255, RM_MEM, T_SSE, XMM8, XMM8, FSxBX, PASS_s_aValues64 }, 17003 17004 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_EAX_icebp_c64, 255, RM_REG, T_AVX_128, XMM1, XMM2, EAX, PASS_s_aValues32 }, 17005 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_FSxBX_D_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM2, FSxBX, PASS_s_aValues32 }, 17006 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM9_R8D_icebp_c64, 255, RM_REG, T_AVX_128, XMM8, XMM9, R8D, PASS_s_aValues32 }, 17007 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM9_FSxBX_D_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM8, XMM9, FSxBX, PASS_s_aValues32 }, 17008 17009 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_RAX_icebp_c64, 255, RM_REG, T_AVX_128, XMM1, XMM2, RAX, PASS_s_aValues64 }, 17010 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM2_FSxBX_Q_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM2, FSxBX, PASS_s_aValues64 }, 17011 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM9_R8_icebp_c64, 255, RM_REG, T_AVX_128, XMM8, XMM9, R8, PASS_s_aValues64 }, 17012 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM9_FSxBX_Q_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM8, XMM9, FSxBX, PASS_s_aValues64 }, 17013 17014 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_EAX_icebp_c64, 255, RM_REG, T_AVX_128, XMM1, XMM1, EAX, PASS_s_aValues32 }, 17015 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_FSxBX_D_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM1, FSxBX, PASS_s_aValues32 }, 17016 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM8_R8D_icebp_c64, 255, RM_REG, T_AVX_128, XMM8, XMM8, R8D, PASS_s_aValues32 }, 17017 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM8_FSxBX_D_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM8, XMM8, FSxBX, PASS_s_aValues32 }, 17018 17019 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_RAX_icebp_c64, 255, RM_REG, T_AVX_128, XMM1, XMM1, RAX, PASS_s_aValues64 }, 17020 { bs3CpuInstr4_vcvtsi2ss_XMM1_XMM1_FSxBX_Q_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM1, XMM1, FSxBX, PASS_s_aValues64 }, 17021 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM8_R8_icebp_c64, 255, RM_REG, T_AVX_128, XMM8, XMM8, R8, PASS_s_aValues64 }, 17022 { bs3CpuInstr4_vcvtsi2ss_XMM8_XMM8_FSxBX_Q_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, XMM8, XMM8, FSxBX, PASS_s_aValues64 }, 16696 17023 }; 16697 17024 … … 16763 17090 { "cvtps2pi", bs3CpuInstr4_cvtps2pi, 0 }, 16764 17091 { "cvttps2pi", bs3CpuInstr4_cvttps2pi, 0 }, 17092 { "cvtsi2ss", bs3CpuInstr4_cvtsi2ss, 0 }, 16765 17093 #endif 16766 17094 }; -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-x-regs.c32
r106721 r106733 70 70 /** These values are used in uint8_t fields; the TODO values are *intended* to break compilation. */ 71 71 72 #define BS3_REGISTER_FAMILY_AVX512_TODO 73 #define BS3_REGISTER_FAMILY_APX_TODO 74 #define BS3_REGISTER_FAMILY_OTHER_TODO 72 #define BS3_REGISTER_FAMILY_AVX512_TODO 0x1000 73 #define BS3_REGISTER_FAMILY_APX_TODO 0x2000 74 #define BS3_REGISTER_FAMILY_OTHER_TODO 0x3000 75 75 76 76 #define BS3_REGISTER_FAMILY_MASK 0xE0 77 77 #define BS3_REGISTER_REGISTER_MASK 0x1F 78 #define BS3_REGISTER_MASK (BS3_REGISTER_FAMILY_MASK | BS3_REGISTER_REGISTER_MASK) 78 79 79 80 #define BS3_REGISTER_FAMILY_8BIT_L 0x00 … … 381 382 #define BS3_FSxREG(reg) (((reg) == FSxBX || (reg) == FSxDI) ? reg : ((reg) & BS3_REGISTER_REGISTER_MASK) | BS3_REGISTER_FLAG_MEMREF) 382 383 383 #define BS3_REGISTER_NAME_MAXSIZE sizeof(" (avail)")384 #define BS3_REGISTER_NAME_MAXSIZE sizeof("FSx(avail)") 384 385 385 386 /** … … 391 392 * @param uReg The register identity value. 392 393 */ 393 static size_t bs3CpuInstrXGetRegisterName(char BS3_FAR *pszBuf, size_t cchBuf, uint 8_t uReg)394 static size_t bs3CpuInstrXGetRegisterName(char BS3_FAR *pszBuf, size_t cchBuf, uint16_t uReg) 394 395 { 395 396 const uint8_t uRegNum = uReg & BS3_REGISTER_REGISTER_MASK; … … 404 405 "NOREG", "(avail)", "FSxDI", "FSxBX" }; 405 406 BS3_ASSERT(cchBuf >= BS3_REGISTER_NAME_MAXSIZE); 407 408 if (uReg & BS3_REGISTER_FLAG_MEMREF) 409 { 410 char pszRegName[BS3_REGISTER_NAME_MAXSIZE]; 411 412 bs3CpuInstrXGetRegisterName(pszRegName, BS3_REGISTER_NAME_MAXSIZE, uReg & BS3_REGISTER_MASK); 413 return Bs3StrPrintf(pszBuf, cchBuf, "FSx%s", pszRegName); 414 } 406 415 407 416 switch (uRegSet) { … … 440 449 /** 441 450 * Set a register within a testing context. Intended to support a broad 442 * range of register types; this prototype so far only supports MMX, XMM, 443 * YMM, and hypothetically-but-not-yet-linked, general purpose registers 444 * other than their 8-bit sub-aliases. 445 * 446 * @returns Nothing much of any interest (so far). 447 * @param pExtCtx The testing context to modify. 451 * range of register types; currently supports MMX, XMM, YMM, and general 452 * purpose registers (except 8-bit sub-registers); and setting up FS:xGPR 453 * for memory reference operations. 454 * 455 * Other regs known to this subsystem are either so far unused by 456 * VirtualBox (ZMM, k[0-7], GPRs >15); or not used by tests which call 457 * this (8-bit sub-registers, segment registers, xIP, xFL). 458 * 459 * @param pSetRegCtx Arguments to this function (see below). 448 460 * @param uReg The register identity value to modify within that context. 449 * @param pValue Pointer to the data to store there. 450 * @param pExtra For BS3_REGISTER_FAMILY_XMM: flag whether to zero YMM-hi. 451 * For GPR references: pointer to general purpose register context. 461 * @param pu256Val Pointer to the data to store there. 462 * @returns bool Whether the store succeeded (currently ignored by callers). 452 463 */ 453 #define CLR_YmmHi (void *)true 454 #define SET_YmmHi (void *)false 455 456 static bool Bs3ExtCtxSetReg(PBS3EXTCTX pExtCtx, uint16_t uReg, void * pValue, void * pExtra) 464 465 typedef struct BS3SETREGCTX 457 466 { 458 uint8_t uRegNum = uReg & BS3_REGISTER_REGISTER_MASK; 459 uint8_t uRegSet = uReg & BS3_REGISTER_FAMILY_MASK; 460 char pszRegName[BS3_REGISTER_NAME_MAXSIZE]; 461 PBS3REGCTX pCtx = (PBS3REGCTX)pExtra; /* for BS3_REGISTER_FAMILY_MEMREF, all GPR families */ 462 bool fZeroYMMHi = (bool)pExtra; /* for BS3_REGISTER_FAMILY_XMM */ 467 /** Pointer to test context. */ 468 PBS3EXTCTX pExtCtx; 469 /** Pointer to register context; for BS3_REGISTER_FAMILY_MEMREF, all GPR families */ 470 PBS3REGCTX pCtx; 471 /** Whether to zero YMM-high bits when setting XMM; for BS3_REGISTER_FAMILY_XMM */ 472 bool fZeroYMMHi; 473 /** Current execution mode; for BS3_REGISTER_FAMILY_64BIT */ 474 uint8_t bMode; 475 } BS3SETREGCTX; 476 typedef BS3SETREGCTX BS3_FAR *PBS3SETREGCTX; 477 478 static bool Bs3ExtCtxSetReg_int(PBS3SETREGCTX pSetRegCtx, uint16_t uReg, PCRTUINT256U pu256Val) 479 { 480 uint8_t uRegNum = uReg & BS3_REGISTER_REGISTER_MASK; 481 uint8_t uRegSet = uReg & BS3_REGISTER_FAMILY_MASK; 482 char pszRegName[BS3_REGISTER_NAME_MAXSIZE]; 463 483 464 484 if (uReg & BS3_REGISTER_FLAG_MEMREF || uReg == FSxBX || uReg == FSxDI) 465 485 { 486 if (uRegSet <= BS3_REGISTER_FAMILY_64BIT) 487 uRegNum &= BS3_REGISTER_REGISTER_MASK; 488 else if (uReg == FSxBX) 489 uRegNum = BX; 490 else if (uReg == FSxDI) 491 uRegNum = DI; 492 else 493 uRegNum = 255; /* Fall through to error handling below to complain about 'FSxZMM31' or whatever */ 466 494 uRegSet = BS3_REGISTER_FAMILY_MEMREF; 467 if (uReg == FSxBX) uRegNum = BX;468 if (uReg == FSxDI) uRegNum = DI;469 uRegNum &= BS3_REGISTER_REGISTER_MASK;470 495 } 471 496 … … 475 500 { 476 501 case BS3_REGISTER_FAMILY_16BIT: 477 return Bs3RegCtxSetGpr(p Ctx, uRegNum, *((uint16_t *)pValue), 2);502 return Bs3RegCtxSetGpr(pSetRegCtx->pCtx, uRegNum, pu256Val->au16[0], 2); 478 503 case BS3_REGISTER_FAMILY_32BIT: 479 return Bs3RegCtxSetGpr(p Ctx, uRegNum, *((uint32_t *)pValue), 4);504 return Bs3RegCtxSetGpr(pSetRegCtx->pCtx, uRegNum, pu256Val->au32[0], 4); 480 505 case BS3_REGISTER_FAMILY_64BIT: 481 return Bs3RegCtxSetGpr(p Ctx, uRegNum, *((uint64_t *)pValue), 8);506 return Bs3RegCtxSetGpr(pSetRegCtx->pCtx, uRegNum, pu256Val->au64[0], BS3_MODE_IS_64BIT_CODE(pSetRegCtx->bMode) ? 8 : 4); 482 507 case BS3_REGISTER_FAMILY_XMM: 483 if ( fZeroYMMHi)484 return Bs3ExtCtxSetXmm(p ExtCtx, uRegNum, pValue);508 if (pSetRegCtx->fZeroYMMHi) 509 return Bs3ExtCtxSetXmm(pSetRegCtx->pExtCtx, uRegNum, &pu256Val->au128[0]); 485 510 else 486 return Bs3ExtCtxSetYmm(p ExtCtx, uRegNum, pValue, 16);511 return Bs3ExtCtxSetYmm(pSetRegCtx->pExtCtx, uRegNum, pu256Val, 16); 487 512 case BS3_REGISTER_FAMILY_YMM: 488 return Bs3ExtCtxSetYmm(p ExtCtx, uRegNum, pValue, 32);513 return Bs3ExtCtxSetYmm(pSetRegCtx->pExtCtx, uRegNum, pu256Val, 32); 489 514 case BS3_REGISTER_FAMILY_MEMREF: 490 Bs3RegCtxSetGrpSegFromCurPtr(p Ctx, (&pCtx->rax) + uRegNum, &pCtx->fs, pValue);515 Bs3RegCtxSetGrpSegFromCurPtr(pSetRegCtx->pCtx, (&pSetRegCtx->pCtx->rax) + uRegNum, &pSetRegCtx->pCtx->fs, (void *)pu256Val); 491 516 return true; 492 517 case BS3_REGISTER_FAMILY_OTHER: 493 518 if (BS3_REGISTER_IS_MMX(uReg)) 494 return Bs3ExtCtxSetMm(p ExtCtx, uRegNum, *((uint64_t *)pValue), BS3EXTCTXTOPMM_SET);519 return Bs3ExtCtxSetMm(pSetRegCtx->pExtCtx, uRegNum, pu256Val->au64[0], BS3EXTCTXTOPMM_SET); 495 520 break; 496 521 case BS3_REGISTER_FAMILY_8BIT_L: … … 503 528 if (uReg == NOREG) 504 529 return true; 505 /* FSxDI, FSxBX presumed handled by the callers, though that may change */506 530 507 531 bs3CpuInstrXGetRegisterName(pszRegName, BS3_REGISTER_NAME_MAXSIZE, uReg); 508 532 return Bs3TestFailedF("Bs3ExtCtxSetReg() todo: handle register '%s' (%02X)", pszRegName, uReg); 509 533 } 534 535 static bool g_fSetRegVerbose = false; 536 537 static bool Bs3ExtCtxSetReg(PBS3SETREGCTX pSetRegCtx, uint16_t uReg, PCRTUINT256U pu256Val) 538 { 539 bool fRet = Bs3ExtCtxSetReg_int(pSetRegCtx, uReg, pu256Val); 540 541 if (g_fSetRegVerbose) 542 { 543 char pszRegName[BS3_REGISTER_NAME_MAXSIZE]; 544 char pszValBuf[80] = "(not decoded)"; 545 546 switch (uReg & BS3_REGISTER_FAMILY_MASK) 547 { 548 case BS3_REGISTER_FAMILY_16BIT: 549 Bs3StrPrintf(pszValBuf, 80, "%#06RX16", pu256Val->au16[0]); 550 break; 551 case BS3_REGISTER_FAMILY_32BIT: 552 Bs3StrPrintf(pszValBuf, 80, "%#10RX32", pu256Val->au32[0]); 553 break; 554 case BS3_REGISTER_FAMILY_64BIT: 555 Bs3StrPrintf(pszValBuf, 80, "%#18RX64", pu256Val->au64[0]); 556 break; 557 case BS3_REGISTER_FAMILY_XMM: 558 Bs3StrPrintf(pszValBuf, 80, "%#18RX64:%#18RX64", pu256Val->au64[1], pu256Val->au64[0]); 559 break; 560 case BS3_REGISTER_FAMILY_YMM: 561 Bs3StrPrintf(pszValBuf, 80, "%#18RX64:%#18RX64:%#18RX64:%#18RX64", pu256Val->au64[3], pu256Val->au64[2], pu256Val->au64[1], pu256Val->au64[0]); 562 break; 563 case BS3_REGISTER_FAMILY_OTHER: 564 if (BS3_REGISTER_IS_MMX(uReg)) 565 Bs3StrPrintf(pszValBuf, 80, "%#18RX64", pu256Val->au64[0]); 566 break; 567 default: 568 break; 569 } 570 bs3CpuInstrXGetRegisterName(pszRegName, BS3_REGISTER_NAME_MAXSIZE, uReg); 571 Bs3TestPrintf("Bs3ExtCtxSetReg '%s' to '%s'; %s\n", pszRegName, pszValBuf, fRet ? "worked" : "failed"); 572 } 573 return fRet; 574 }
Note:
See TracChangeset
for help on using the changeset viewer.