@@ -903,33 +903,14 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
903903 | Opcode :: Sextend
904904 | Opcode :: Breduce
905905 | Opcode :: Bextend
906- | Opcode :: Ireduce => implemented_in_isle ( ctx) ,
907-
908- Opcode :: Bint => {
909- // Booleans are stored as all-zeroes (0) or all-ones (-1). We AND
910- // out the LSB to give a 0 / 1-valued integer result.
911- let rn = put_input_in_reg ( ctx, inputs[ 0 ] ) ;
912- let rd = get_output_reg ( ctx, outputs[ 0 ] ) ;
913- let ty = ctx. output_ty ( insn, 0 ) ;
914-
915- ctx. emit ( Inst :: gen_move ( rd. regs ( ) [ 0 ] , rn, types:: I64 ) ) ;
916- ctx. emit ( Inst :: alu_rmi_r (
917- OperandSize :: Size64 ,
918- AluRmiROpcode :: And ,
919- RegMemImm :: imm ( 1 ) ,
920- rd. regs ( ) [ 0 ] ,
921- ) ) ;
922-
923- if ty == types:: I128 {
924- let upper = rd. regs ( ) [ 1 ] ;
925- ctx. emit ( Inst :: alu_rmi_r (
926- OperandSize :: Size64 ,
927- AluRmiROpcode :: Xor ,
928- RegMemImm :: reg ( upper. to_reg ( ) ) ,
929- upper,
930- ) ) ;
931- }
932- }
906+ | Opcode :: Ireduce
907+ | Opcode :: Bint
908+ | Opcode :: Debugtrap
909+ | Opcode :: WideningPairwiseDotProductS
910+ | Opcode :: Fadd
911+ | Opcode :: Fsub
912+ | Opcode :: Fmul
913+ | Opcode :: Fdiv => implemented_in_isle ( ctx) ,
933914
934915 Opcode :: Icmp => {
935916 let condcode = ctx. data ( insn) . cond_code ( ) . unwrap ( ) ;
@@ -1240,10 +1221,6 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
12401221 abi. emit_stack_post_adjust ( ctx) ;
12411222 }
12421223
1243- Opcode :: Debugtrap => {
1244- ctx. emit ( Inst :: Hlt ) ;
1245- }
1246-
12471224 Opcode :: Trapif | Opcode :: Trapff => {
12481225 let trap_code = ctx. data ( insn) . trap_code ( ) . unwrap ( ) ;
12491226
@@ -1301,77 +1278,6 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
13011278 } ;
13021279 }
13031280
1304- Opcode :: WideningPairwiseDotProductS => {
1305- let lhs = put_input_in_reg ( ctx, inputs[ 0 ] ) ;
1306- let rhs = input_to_reg_mem ( ctx, inputs[ 1 ] ) ;
1307- let dst = get_output_reg ( ctx, outputs[ 0 ] ) . only_reg ( ) . unwrap ( ) ;
1308- let ty = ty. unwrap ( ) ;
1309-
1310- ctx. emit ( Inst :: gen_move ( dst, lhs, ty) ) ;
1311-
1312- if ty == types:: I32X4 {
1313- ctx. emit ( Inst :: xmm_rm_r ( SseOpcode :: Pmaddwd , rhs, dst) ) ;
1314- } else {
1315- panic ! (
1316- "Opcode::WideningPairwiseDotProductS: unsupported laneage: {:?}" ,
1317- ty
1318- ) ;
1319- }
1320- }
1321-
1322- Opcode :: Fadd | Opcode :: Fsub | Opcode :: Fmul | Opcode :: Fdiv => {
1323- let lhs = put_input_in_reg ( ctx, inputs[ 0 ] ) ;
1324- // We can't guarantee the RHS (if a load) is 128-bit aligned, so we
1325- // must avoid merging a load here.
1326- let rhs = RegMem :: reg ( put_input_in_reg ( ctx, inputs[ 1 ] ) ) ;
1327- let dst = get_output_reg ( ctx, outputs[ 0 ] ) . only_reg ( ) . unwrap ( ) ;
1328- let ty = ty. unwrap ( ) ;
1329-
1330- // Move the `lhs` to the same register as `dst`; this may not emit an actual move
1331- // but ensures that the registers are the same to match x86's read-write operand
1332- // encoding.
1333- ctx. emit ( Inst :: gen_move ( dst, lhs, ty) ) ;
1334-
1335- // Note: min and max can't be handled here, because of the way Cranelift defines them:
1336- // if any operand is a NaN, they must return the NaN operand, while the x86 machine
1337- // instruction will return the second operand if either operand is a NaN.
1338- let sse_op = match ty {
1339- types:: F32 => match op {
1340- Opcode :: Fadd => SseOpcode :: Addss ,
1341- Opcode :: Fsub => SseOpcode :: Subss ,
1342- Opcode :: Fmul => SseOpcode :: Mulss ,
1343- Opcode :: Fdiv => SseOpcode :: Divss ,
1344- _ => unreachable ! ( ) ,
1345- } ,
1346- types:: F64 => match op {
1347- Opcode :: Fadd => SseOpcode :: Addsd ,
1348- Opcode :: Fsub => SseOpcode :: Subsd ,
1349- Opcode :: Fmul => SseOpcode :: Mulsd ,
1350- Opcode :: Fdiv => SseOpcode :: Divsd ,
1351- _ => unreachable ! ( ) ,
1352- } ,
1353- types:: F32X4 => match op {
1354- Opcode :: Fadd => SseOpcode :: Addps ,
1355- Opcode :: Fsub => SseOpcode :: Subps ,
1356- Opcode :: Fmul => SseOpcode :: Mulps ,
1357- Opcode :: Fdiv => SseOpcode :: Divps ,
1358- _ => unreachable ! ( ) ,
1359- } ,
1360- types:: F64X2 => match op {
1361- Opcode :: Fadd => SseOpcode :: Addpd ,
1362- Opcode :: Fsub => SseOpcode :: Subpd ,
1363- Opcode :: Fmul => SseOpcode :: Mulpd ,
1364- Opcode :: Fdiv => SseOpcode :: Divpd ,
1365- _ => unreachable ! ( ) ,
1366- } ,
1367- _ => panic ! (
1368- "invalid type: expected one of [F32, F64, F32X4, F64X2], found {}" ,
1369- ty
1370- ) ,
1371- } ;
1372- ctx. emit ( Inst :: xmm_rm_r ( sse_op, rhs, dst) ) ;
1373- }
1374-
13751281 Opcode :: Fmin | Opcode :: Fmax => {
13761282 let lhs = put_input_in_reg ( ctx, inputs[ 0 ] ) ;
13771283 let rhs = put_input_in_reg ( ctx, inputs[ 1 ] ) ;
0 commit comments