@@ -5,7 +5,6 @@ use crate::binemit::CodeOffset;
55use crate :: ir:: types:: * ;
66use crate :: ir:: Inst as IRInst ;
77use crate :: ir:: { InstructionData , Opcode } ;
8- use crate :: isa:: aarch64:: abi:: * ;
98use crate :: isa:: aarch64:: inst:: * ;
109use crate :: isa:: aarch64:: settings as aarch64_settings;
1110use crate :: machinst:: lower:: * ;
@@ -469,29 +468,7 @@ pub(crate) fn lower_insn_to_regs(
469468 }
470469 }
471470
472- Opcode :: Return => {
473- for ( i, input) in inputs. iter ( ) . enumerate ( ) {
474- // N.B.: according to the AArch64 ABI, the top bits of a register
475- // (above the bits for the value's type) are undefined, so we
476- // need not extend the return values.
477- let src_regs = put_input_in_regs ( ctx, * input) ;
478- let retval_regs = ctx. retval ( i) ;
479-
480- assert_eq ! ( src_regs. len( ) , retval_regs. len( ) ) ;
481- let ty = ctx. input_ty ( insn, i) ;
482- let ( _, tys) = Inst :: rc_for_type ( ty) ?;
483-
484- src_regs
485- . regs ( )
486- . iter ( )
487- . zip ( retval_regs. regs ( ) . iter ( ) )
488- . zip ( tys. iter ( ) )
489- . for_each ( |( ( & src, & dst) , & ty) | {
490- ctx. emit ( Inst :: gen_move ( dst, src, ty) ) ;
491- } ) ;
492- }
493- // N.B.: the Ret itself is generated by the ABI.
494- }
471+ Opcode :: Return => implemented_in_isle ( ctx) ,
495472
496473 Opcode :: Ifcmp | Opcode :: Ffcmp => {
497474 // An Ifcmp/Ffcmp must always be seen as a use of a brif/brff or trueif/trueff
@@ -577,52 +554,7 @@ pub(crate) fn lower_insn_to_regs(
577554
578555 Opcode :: SymbolValue => implemented_in_isle ( ctx) ,
579556
580- Opcode :: Call | Opcode :: CallIndirect => {
581- let caller_conv = ctx. abi ( ) . call_conv ( ) ;
582- let ( mut abi, inputs) = match op {
583- Opcode :: Call => {
584- let ( extname, dist) = ctx. call_target ( insn) . unwrap ( ) ;
585- let extname = extname. clone ( ) ;
586- let sig = ctx. call_sig ( insn) . unwrap ( ) ;
587- assert ! ( inputs. len( ) == sig. params. len( ) ) ;
588- assert ! ( outputs. len( ) == sig. returns. len( ) ) ;
589- (
590- AArch64Caller :: from_func ( sig, & extname, dist, caller_conv, flags) ?,
591- & inputs[ ..] ,
592- )
593- }
594- Opcode :: CallIndirect => {
595- let ptr = put_input_in_reg ( ctx, inputs[ 0 ] , NarrowValueMode :: ZeroExtend64 ) ;
596- let sig = ctx. call_sig ( insn) . unwrap ( ) ;
597- assert ! ( inputs. len( ) - 1 == sig. params. len( ) ) ;
598- assert ! ( outputs. len( ) == sig. returns. len( ) ) ;
599- (
600- AArch64Caller :: from_ptr ( sig, ptr, op, caller_conv, flags) ?,
601- & inputs[ 1 ..] ,
602- )
603- }
604- _ => unreachable ! ( ) ,
605- } ;
606-
607- abi. emit_stack_pre_adjust ( ctx) ;
608- assert ! ( inputs. len( ) == abi. num_args( ) ) ;
609- let mut arg_regs = vec ! [ ] ;
610- for input in inputs {
611- arg_regs. push ( put_input_in_regs ( ctx, * input) )
612- }
613- for ( i, arg_regs) in arg_regs. iter ( ) . enumerate ( ) {
614- abi. emit_copy_regs_to_buffer ( ctx, i, * arg_regs) ;
615- }
616- for ( i, arg_regs) in arg_regs. iter ( ) . enumerate ( ) {
617- abi. emit_copy_regs_to_arg ( ctx, i, * arg_regs) ;
618- }
619- abi. emit_call ( ctx) ;
620- for ( i, output) in outputs. iter ( ) . enumerate ( ) {
621- let retval_regs = get_output_reg ( ctx, * output) ;
622- abi. emit_copy_retval_to_regs ( ctx, i, retval_regs) ;
623- }
624- abi. emit_stack_post_adjust ( ctx) ;
625- }
557+ Opcode :: Call | Opcode :: CallIndirect => implemented_in_isle ( ctx) ,
626558
627559 Opcode :: GetPinnedReg => {
628560 let rd = get_output_reg ( ctx, outputs[ 0 ] ) . only_reg ( ) . unwrap ( ) ;
0 commit comments