const InstrList& dependend_instr() { return m_dependend_instr; }
virtual AluInstr *as_alu() { return nullptr; }
- virtual uint8_t allowed_dest_chan_mask() const { return 0; }
+ virtual uint8_t allowed_src_chan_mask() const { return 0; }
protected:
const InstrList& required_instr() const { return m_required_instr; }
}
}
+uint8_t AluInstr::allowed_src_chan_mask() const
+{
+ return 0xf;
+}
+
uint8_t
AluInstr::allowed_dest_chan_mask() const
{
- if (alu_slots() != 1) {
- if (has_alu_flag(alu_is_cayman_trans)) {
+ if (alu_slots() != 1 && has_alu_flag(alu_is_cayman_trans)) {
return (1 << alu_slots()) - 1;
- } else {
- return 0;
- }
}
return 0xf;
}
AluInstr *as_alu() override { return this; }
- uint8_t allowed_dest_chan_mask() const override;
+ uint8_t allowed_src_chan_mask() const override;
+ uint8_t allowed_dest_chan_mask() const;
private:
friend class AluGroup;
if (dest && (dest->pin() == pin_free || dest->pin() == pin_group)) {
int free_mask = 0xf;
+ for (auto p : dest->parents()) {
+ auto alu = p->as_alu();
+ if (alu)
+ free_mask &= alu->allowed_dest_chan_mask();
+ }
+
for (auto u : dest->uses()) {
- free_mask &= u->allowed_dest_chan_mask();
+ free_mask &= u->allowed_src_chan_mask();
if (!free_mask)
return false;
}
}
uint8_t
-ExportInstr::allowed_dest_chan_mask() const
+ExportInstr::allowed_src_chan_mask() const
{
return value().free_chan_mask();
}
static Instr::Pointer from_string(std::istream& is, ValueFactory& vf);
static Instr::Pointer last_from_string(std::istream& is, ValueFactory& vf);
- uint8_t allowed_dest_chan_mask() const override;
+ uint8_t allowed_src_chan_mask() const override;
private:
static ExportInstr::Pointer from_string_impl(std::istream& is, ValueFactory& vf);
}
uint8_t
-TexInstr::allowed_dest_chan_mask() const
+TexInstr::allowed_src_chan_mask() const
{
return m_src.free_chan_mask();
}
bool replace_source(PRegister old_src, PVirtualValue new_src) override;
- uint8_t allowed_dest_chan_mask() const override;
+ uint8_t allowed_src_chan_mask() const override;
private:
bool do_ready() const override;