@@ -209,6 +209,8 @@ impl MachineLower for X64Machine {
209209 NodeKind :: Fsub => emit_fpu_rr ( ctx, node, SseFpuBinOp :: Sub ) ,
210210 NodeKind :: Fmul => emit_fpu_rr ( ctx, node, SseFpuBinOp :: Mul ) ,
211211 NodeKind :: Fdiv => emit_fpu_rr ( ctx, node, SseFpuBinOp :: Div ) ,
212+ NodeKind :: Fext => emit_cvtss2sd ( ctx, node) ,
213+ NodeKind :: Ftrunc => emit_cvtsd2ss ( ctx, node) ,
212214 & NodeKind :: Fcmp ( kind) => select_direct_fcmp ( ctx, node, kind) ,
213215 NodeKind :: SintToFloat => emit_cvtsi2s ( ctx, node) ,
214216 NodeKind :: UintToFloat => select_uinttofloat ( ctx, node) ,
@@ -1329,6 +1331,34 @@ fn emit_cvts2si(ctx: &mut IselContext<'_, '_, X64Machine>, node: Node) {
13291331 ) ;
13301332}
13311333
1334+ fn emit_cvtss2sd ( ctx : & mut IselContext < ' _ , ' _ , X64Machine > , node : Node ) {
1335+ let [ output] = ctx. node_outputs_exact ( node) ;
1336+ let [ input] = ctx. node_inputs_exact ( node) ;
1337+
1338+ let input = ctx. get_value_vreg ( input) ;
1339+ let output = ctx. get_value_vreg ( output) ;
1340+
1341+ ctx. emit_instr (
1342+ X64Instr :: Cvtss2sd ,
1343+ & [ DefOperand :: any_reg ( output) ] ,
1344+ & [ UseOperand :: any ( input) ] ,
1345+ ) ;
1346+ }
1347+
1348+ fn emit_cvtsd2ss ( ctx : & mut IselContext < ' _ , ' _ , X64Machine > , node : Node ) {
1349+ let [ output] = ctx. node_outputs_exact ( node) ;
1350+ let [ input] = ctx. node_inputs_exact ( node) ;
1351+
1352+ let input = ctx. get_value_vreg ( input) ;
1353+ let output = ctx. get_value_vreg ( output) ;
1354+
1355+ ctx. emit_instr (
1356+ X64Instr :: Cvtsd2ss ,
1357+ & [ DefOperand :: any_reg ( output) ] ,
1358+ & [ UseOperand :: any ( input) ] ,
1359+ ) ;
1360+ }
1361+
13321362// Matching helpers
13331363
13341364fn match_icmp_imm32 (
0 commit comments