@@ -1067,6 +1067,122 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
1067
1067
) ;
1068
1068
}
1069
1069
1070
+ "llvm.x86.sha1rnds4" => {
1071
+ // https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sha1rnds4_epu32&ig_expand=5877
1072
+ intrinsic_args ! ( fx, args => ( a, b, _func) ; intrinsic) ;
1073
+
1074
+ let a = a. load_scalar ( fx) ;
1075
+ let b = b. load_scalar ( fx) ;
1076
+
1077
+ let func = if let Some ( func) =
1078
+ crate :: constant:: mir_operand_get_const_val ( fx, & args[ 2 ] . node )
1079
+ {
1080
+ func
1081
+ } else {
1082
+ fx. tcx
1083
+ . dcx ( )
1084
+ . span_fatal ( span, "Func argument for `_mm_sha1rnds4_epu32` is not a constant" ) ;
1085
+ } ;
1086
+
1087
+ let func = func. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , func) ) ;
1088
+
1089
+ codegen_inline_asm_inner (
1090
+ fx,
1091
+ & [ InlineAsmTemplatePiece :: String ( format ! ( "sha1rnds4 xmm1, xmm2, {func}" ) ) ] ,
1092
+ & [
1093
+ CInlineAsmOperand :: InOut {
1094
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm1) ) ,
1095
+ _late : true ,
1096
+ in_value : a,
1097
+ out_place : Some ( ret) ,
1098
+ } ,
1099
+ CInlineAsmOperand :: In {
1100
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm2) ) ,
1101
+ value : b,
1102
+ } ,
1103
+ ] ,
1104
+ InlineAsmOptions :: NOSTACK | InlineAsmOptions :: PURE | InlineAsmOptions :: NOMEM ,
1105
+ ) ;
1106
+ }
1107
+
1108
+ "llvm.x86.sha1msg1" => {
1109
+ // https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sha1msg1_epu32&ig_expand=5874
1110
+ intrinsic_args ! ( fx, args => ( a, b) ; intrinsic) ;
1111
+
1112
+ let a = a. load_scalar ( fx) ;
1113
+ let b = b. load_scalar ( fx) ;
1114
+
1115
+ codegen_inline_asm_inner (
1116
+ fx,
1117
+ & [ InlineAsmTemplatePiece :: String ( "sha1msg1 xmm1, xmm2" . to_string ( ) ) ] ,
1118
+ & [
1119
+ CInlineAsmOperand :: InOut {
1120
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm1) ) ,
1121
+ _late : true ,
1122
+ in_value : a,
1123
+ out_place : Some ( ret) ,
1124
+ } ,
1125
+ CInlineAsmOperand :: In {
1126
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm2) ) ,
1127
+ value : b,
1128
+ } ,
1129
+ ] ,
1130
+ InlineAsmOptions :: NOSTACK | InlineAsmOptions :: PURE | InlineAsmOptions :: NOMEM ,
1131
+ ) ;
1132
+ }
1133
+
1134
+ "llvm.x86.sha1msg2" => {
1135
+ // https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sha1msg2_epu32&ig_expand=5875
1136
+ intrinsic_args ! ( fx, args => ( a, b) ; intrinsic) ;
1137
+
1138
+ let a = a. load_scalar ( fx) ;
1139
+ let b = b. load_scalar ( fx) ;
1140
+
1141
+ codegen_inline_asm_inner (
1142
+ fx,
1143
+ & [ InlineAsmTemplatePiece :: String ( "sha1msg2 xmm1, xmm2" . to_string ( ) ) ] ,
1144
+ & [
1145
+ CInlineAsmOperand :: InOut {
1146
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm1) ) ,
1147
+ _late : true ,
1148
+ in_value : a,
1149
+ out_place : Some ( ret) ,
1150
+ } ,
1151
+ CInlineAsmOperand :: In {
1152
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm2) ) ,
1153
+ value : b,
1154
+ } ,
1155
+ ] ,
1156
+ InlineAsmOptions :: NOSTACK | InlineAsmOptions :: PURE | InlineAsmOptions :: NOMEM ,
1157
+ ) ;
1158
+ }
1159
+
1160
+ "llvm.x86.sha1nexte" => {
1161
+ // https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sha1nexte_epu32&ig_expand=5876
1162
+ intrinsic_args ! ( fx, args => ( a, b) ; intrinsic) ;
1163
+
1164
+ let a = a. load_scalar ( fx) ;
1165
+ let b = b. load_scalar ( fx) ;
1166
+
1167
+ codegen_inline_asm_inner (
1168
+ fx,
1169
+ & [ InlineAsmTemplatePiece :: String ( "sha1nexte xmm1, xmm2" . to_string ( ) ) ] ,
1170
+ & [
1171
+ CInlineAsmOperand :: InOut {
1172
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm1) ) ,
1173
+ _late : true ,
1174
+ in_value : a,
1175
+ out_place : Some ( ret) ,
1176
+ } ,
1177
+ CInlineAsmOperand :: In {
1178
+ reg : InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: xmm2) ) ,
1179
+ value : b,
1180
+ } ,
1181
+ ] ,
1182
+ InlineAsmOptions :: NOSTACK | InlineAsmOptions :: PURE | InlineAsmOptions :: NOMEM ,
1183
+ ) ;
1184
+ }
1185
+
1070
1186
"llvm.x86.sha256rnds2" => {
1071
1187
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sha256rnds2_epu32&ig_expand=5977
1072
1188
intrinsic_args ! ( fx, args => ( a, b, k) ; intrinsic) ;
0 commit comments