Remove references for sig (#5414)
This commit is contained in:
@@ -123,13 +123,13 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
|
|||||||
builder.take()
|
builder.take()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn defs_init(&mut self, abi: &Sig) -> CallRetList {
|
fn defs_init(&mut self, abi: Sig) -> CallRetList {
|
||||||
// Allocate writable registers for all retval regs, except for StructRet args.
|
// Allocate writable registers for all retval regs, except for StructRet args.
|
||||||
let mut defs = smallvec![];
|
let mut defs = smallvec![];
|
||||||
for i in 0..self.lower_ctx.sigs().num_rets(*abi) {
|
for i in 0..self.lower_ctx.sigs().num_rets(abi) {
|
||||||
if let &ABIArg::Slots {
|
if let &ABIArg::Slots {
|
||||||
ref slots, purpose, ..
|
ref slots, purpose, ..
|
||||||
} = &self.lower_ctx.sigs().get_ret(*abi, i)
|
} = &self.lower_ctx.sigs().get_ret(abi, i)
|
||||||
{
|
{
|
||||||
if purpose == ArgumentPurpose::StructReturn {
|
if purpose == ArgumentPurpose::StructReturn {
|
||||||
continue;
|
continue;
|
||||||
@@ -165,20 +165,20 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
|
|||||||
self.lower_ctx.sigs().abi_sig_for_sig_ref(sig_ref)
|
self.lower_ctx.sigs().abi_sig_for_sig_ref(sig_ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_first_ret(&mut self, sig_ref: SigRef, abi: &Sig) -> usize {
|
fn abi_first_ret(&mut self, sig_ref: SigRef, abi: Sig) -> usize {
|
||||||
// Return the index of the first actual return value, excluding
|
// Return the index of the first actual return value, excluding
|
||||||
// any StructReturn that might have been added to Sig.
|
// any StructReturn that might have been added to Sig.
|
||||||
let sig = &self.lower_ctx.dfg().signatures[sig_ref];
|
let sig = &self.lower_ctx.dfg().signatures[sig_ref];
|
||||||
self.lower_ctx.sigs().num_rets(*abi) - sig.returns.len()
|
self.lower_ctx.sigs().num_rets(abi) - sig.returns.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_lane_order(&mut self, abi: &Sig) -> LaneOrder {
|
fn abi_lane_order(&mut self, abi: Sig) -> LaneOrder {
|
||||||
lane_order_for_call_conv(self.lower_ctx.sigs()[*abi].call_conv())
|
lane_order_for_call_conv(self.lower_ctx.sigs()[abi].call_conv())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_accumulate_outgoing_args_size(&mut self, abi: &Sig) -> Unit {
|
fn abi_accumulate_outgoing_args_size(&mut self, abi: Sig) -> Unit {
|
||||||
let off = self.lower_ctx.sigs()[*abi].sized_stack_arg_space()
|
let off = self.lower_ctx.sigs()[abi].sized_stack_arg_space()
|
||||||
+ self.lower_ctx.sigs()[*abi].sized_stack_ret_space();
|
+ self.lower_ctx.sigs()[abi].sized_stack_ret_space();
|
||||||
self.lower_ctx
|
self.lower_ctx
|
||||||
.abi_mut()
|
.abi_mut()
|
||||||
.accumulate_outgoing_args_size(off as u32);
|
.accumulate_outgoing_args_size(off as u32);
|
||||||
@@ -186,16 +186,13 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
|
|||||||
|
|
||||||
fn abi_call_info(
|
fn abi_call_info(
|
||||||
&mut self,
|
&mut self,
|
||||||
abi: &Sig,
|
abi: Sig,
|
||||||
name: ExternalName,
|
name: ExternalName,
|
||||||
uses: &CallArgList,
|
uses: &CallArgList,
|
||||||
defs: &CallRetList,
|
defs: &CallRetList,
|
||||||
opcode: &Opcode,
|
opcode: &Opcode,
|
||||||
) -> BoxCallInfo {
|
) -> BoxCallInfo {
|
||||||
let clobbers = self
|
let clobbers = self.lower_ctx.sigs().call_clobbers::<S390xMachineDeps>(abi);
|
||||||
.lower_ctx
|
|
||||||
.sigs()
|
|
||||||
.call_clobbers::<S390xMachineDeps>(*abi);
|
|
||||||
Box::new(CallInfo {
|
Box::new(CallInfo {
|
||||||
dest: name.clone(),
|
dest: name.clone(),
|
||||||
uses: uses.clone(),
|
uses: uses.clone(),
|
||||||
@@ -203,23 +200,20 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
|
|||||||
clobbers,
|
clobbers,
|
||||||
opcode: *opcode,
|
opcode: *opcode,
|
||||||
caller_callconv: self.lower_ctx.abi().call_conv(self.lower_ctx.sigs()),
|
caller_callconv: self.lower_ctx.abi().call_conv(self.lower_ctx.sigs()),
|
||||||
callee_callconv: self.lower_ctx.sigs()[*abi].call_conv(),
|
callee_callconv: self.lower_ctx.sigs()[abi].call_conv(),
|
||||||
tls_symbol: None,
|
tls_symbol: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_call_ind_info(
|
fn abi_call_ind_info(
|
||||||
&mut self,
|
&mut self,
|
||||||
abi: &Sig,
|
abi: Sig,
|
||||||
target: Reg,
|
target: Reg,
|
||||||
uses: &CallArgList,
|
uses: &CallArgList,
|
||||||
defs: &CallRetList,
|
defs: &CallRetList,
|
||||||
opcode: &Opcode,
|
opcode: &Opcode,
|
||||||
) -> BoxCallIndInfo {
|
) -> BoxCallIndInfo {
|
||||||
let clobbers = self
|
let clobbers = self.lower_ctx.sigs().call_clobbers::<S390xMachineDeps>(abi);
|
||||||
.lower_ctx
|
|
||||||
.sigs()
|
|
||||||
.call_clobbers::<S390xMachineDeps>(*abi);
|
|
||||||
Box::new(CallIndInfo {
|
Box::new(CallIndInfo {
|
||||||
rn: target,
|
rn: target,
|
||||||
uses: uses.clone(),
|
uses: uses.clone(),
|
||||||
@@ -227,7 +221,7 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
|
|||||||
clobbers,
|
clobbers,
|
||||||
opcode: *opcode,
|
opcode: *opcode,
|
||||||
caller_callconv: self.lower_ctx.abi().call_conv(self.lower_ctx.sigs()),
|
caller_callconv: self.lower_ctx.abi().call_conv(self.lower_ctx.sigs()),
|
||||||
callee_callconv: self.lower_ctx.sigs()[*abi].call_conv(),
|
callee_callconv: self.lower_ctx.sigs()[abi].call_conv(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1018,11 +1018,11 @@ pub struct Callee<M: ABIMachineSpec> {
|
|||||||
fn get_special_purpose_param_register(
|
fn get_special_purpose_param_register(
|
||||||
f: &ir::Function,
|
f: &ir::Function,
|
||||||
sigs: &SigSet,
|
sigs: &SigSet,
|
||||||
sig: &Sig,
|
sig: Sig,
|
||||||
purpose: ir::ArgumentPurpose,
|
purpose: ir::ArgumentPurpose,
|
||||||
) -> Option<Reg> {
|
) -> Option<Reg> {
|
||||||
let idx = f.signature.special_param_index(purpose)?;
|
let idx = f.signature.special_param_index(purpose)?;
|
||||||
match &sigs.args(*sig)[idx] {
|
match &sigs.args(sig)[idx] {
|
||||||
&ABIArg::Slots { ref slots, .. } => match &slots[0] {
|
&ABIArg::Slots { ref slots, .. } => match &slots[0] {
|
||||||
&ABIArgSlot::Reg { reg, .. } => Some(reg.into()),
|
&ABIArgSlot::Reg { reg, .. } => Some(reg.into()),
|
||||||
_ => None,
|
_ => None,
|
||||||
@@ -1100,11 +1100,11 @@ impl<M: ABIMachineSpec> Callee<M> {
|
|||||||
// argument or as a global value which often calculates the stack limit
|
// argument or as a global value which often calculates the stack limit
|
||||||
// from the arguments.
|
// from the arguments.
|
||||||
let stack_limit =
|
let stack_limit =
|
||||||
get_special_purpose_param_register(f, sigs, &sig, ir::ArgumentPurpose::StackLimit)
|
get_special_purpose_param_register(f, sigs, sig, ir::ArgumentPurpose::StackLimit)
|
||||||
.map(|reg| (reg, smallvec![]))
|
.map(|reg| (reg, smallvec![]))
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
f.stack_limit
|
f.stack_limit
|
||||||
.map(|gv| gen_stack_limit::<M>(f, sigs, &sig, gv))
|
.map(|gv| gen_stack_limit::<M>(f, sigs, sig, gv))
|
||||||
});
|
});
|
||||||
|
|
||||||
// Determine whether a probestack call is required for large enough
|
// Determine whether a probestack call is required for large enough
|
||||||
@@ -1225,7 +1225,7 @@ impl<M: ABIMachineSpec> Callee<M> {
|
|||||||
fn gen_stack_limit<M: ABIMachineSpec>(
|
fn gen_stack_limit<M: ABIMachineSpec>(
|
||||||
f: &ir::Function,
|
f: &ir::Function,
|
||||||
sigs: &SigSet,
|
sigs: &SigSet,
|
||||||
sig: &Sig,
|
sig: Sig,
|
||||||
gv: ir::GlobalValue,
|
gv: ir::GlobalValue,
|
||||||
) -> (Reg, SmallInstVec<M::I>) {
|
) -> (Reg, SmallInstVec<M::I>) {
|
||||||
let mut insts = smallvec![];
|
let mut insts = smallvec![];
|
||||||
@@ -1236,7 +1236,7 @@ fn gen_stack_limit<M: ABIMachineSpec>(
|
|||||||
fn generate_gv<M: ABIMachineSpec>(
|
fn generate_gv<M: ABIMachineSpec>(
|
||||||
f: &ir::Function,
|
f: &ir::Function,
|
||||||
sigs: &SigSet,
|
sigs: &SigSet,
|
||||||
sig: &Sig,
|
sig: Sig,
|
||||||
gv: ir::GlobalValue,
|
gv: ir::GlobalValue,
|
||||||
insts: &mut SmallInstVec<M::I>,
|
insts: &mut SmallInstVec<M::I>,
|
||||||
) -> Reg {
|
) -> Reg {
|
||||||
|
|||||||
@@ -400,40 +400,40 @@ macro_rules! isle_lower_prelude_methods {
|
|||||||
regs.regs()[idx]
|
regs.regs()[idx]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_num_args(&mut self, abi: &Sig) -> usize {
|
fn abi_num_args(&mut self, abi: Sig) -> usize {
|
||||||
self.lower_ctx.sigs().num_args(*abi)
|
self.lower_ctx.sigs().num_args(abi)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_get_arg(&mut self, abi: &Sig, idx: usize) -> ABIArg {
|
fn abi_get_arg(&mut self, abi: Sig, idx: usize) -> ABIArg {
|
||||||
self.lower_ctx.sigs().get_arg(*abi, idx)
|
self.lower_ctx.sigs().get_arg(abi, idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_num_rets(&mut self, abi: &Sig) -> usize {
|
fn abi_num_rets(&mut self, abi: Sig) -> usize {
|
||||||
self.lower_ctx.sigs().num_rets(*abi)
|
self.lower_ctx.sigs().num_rets(abi)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_get_ret(&mut self, abi: &Sig, idx: usize) -> ABIArg {
|
fn abi_get_ret(&mut self, abi: Sig, idx: usize) -> ABIArg {
|
||||||
self.lower_ctx.sigs().get_ret(*abi, idx)
|
self.lower_ctx.sigs().get_ret(abi, idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_ret_arg(&mut self, abi: &Sig) -> Option<ABIArg> {
|
fn abi_ret_arg(&mut self, abi: Sig) -> Option<ABIArg> {
|
||||||
self.lower_ctx.sigs().get_ret_arg(*abi)
|
self.lower_ctx.sigs().get_ret_arg(abi)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_no_ret_arg(&mut self, abi: &Sig) -> Option<()> {
|
fn abi_no_ret_arg(&mut self, abi: Sig) -> Option<()> {
|
||||||
if let Some(_) = self.lower_ctx.sigs().get_ret_arg(*abi) {
|
if let Some(_) = self.lower_ctx.sigs().get_ret_arg(abi) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(())
|
Some(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_sized_stack_arg_space(&mut self, abi: &Sig) -> i64 {
|
fn abi_sized_stack_arg_space(&mut self, abi: Sig) -> i64 {
|
||||||
self.lower_ctx.sigs()[*abi].sized_stack_arg_space()
|
self.lower_ctx.sigs()[abi].sized_stack_arg_space()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_sized_stack_ret_space(&mut self, abi: &Sig) -> i64 {
|
fn abi_sized_stack_ret_space(&mut self, abi: Sig) -> i64 {
|
||||||
self.lower_ctx.sigs()[*abi].sized_stack_ret_space()
|
self.lower_ctx.sigs()[abi].sized_stack_ret_space()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abi_arg_only_slot(&mut self, arg: &ABIArg) -> Option<ABIArgSlot> {
|
fn abi_arg_only_slot(&mut self, arg: &ABIArg) -> Option<ABIArgSlot> {
|
||||||
|
|||||||
@@ -597,7 +597,7 @@
|
|||||||
;;;; Helpers for generating calls ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;; Helpers for generating calls ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
;; Type to hold information about a function call signature.
|
;; Type to hold information about a function call signature.
|
||||||
(type Sig extern (enum))
|
(type Sig (primitive Sig))
|
||||||
|
|
||||||
;; Information how to pass one argument or return value.
|
;; Information how to pass one argument or return value.
|
||||||
(type ABIArg extern (enum))
|
(type ABIArg extern (enum))
|
||||||
|
|||||||
Reference in New Issue
Block a user