-/* Copyright (C) 1988-2019 Free Software Foundation, Inc.
+/* Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GCC.
return STUB_INDEX_OFFSET + m_stack_align_off_in;
}
- static const struct xlogue_layout &get_instance ();
+ static const class xlogue_layout &get_instance ();
static unsigned count_stub_managed_regs ();
static bool is_stub_managed_reg (unsigned regno, unsigned count);
class scalar_chain
{
public:
- scalar_chain ();
+ scalar_chain (enum machine_mode, enum machine_mode);
virtual ~scalar_chain ();
static unsigned max_id;
+ /* Scalar mode. */
+ enum machine_mode smode;
+ /* Vector mode. */
+ enum machine_mode vmode;
+
/* ID of a chain. */
unsigned int chain_id;
/* A queue of instructions to be included into a chain. */
/* Registers used in both vector and sclar modes. */
bitmap defs_conv;
- void build (bitmap candidates, unsigned insn_uid);
+ /* Limit on chain discovery. */
+ unsigned max_visits;
+
+ bitmap insns_conv;
+ hash_map<rtx, rtx> defs_map;
+ unsigned n_sse_to_integer;
+ unsigned n_integer_to_sse;
+
+ bool build (bitmap candidates, unsigned insn_uid, bitmap disallowed);
virtual int compute_convert_gain () = 0;
int convert ();
protected:
void add_to_queue (unsigned insn_uid);
void emit_conversion_insns (rtx insns, rtx_insn *pos);
+ rtx convert_compare (rtx op1, rtx op2, rtx_insn *insn);
+ void mark_dual_mode_def (df_ref def);
+ void convert_reg (rtx_insn *insn, rtx dst, rtx src);
+ void convert_insn_common (rtx_insn *insn);
+ void make_vector_copies (rtx_insn *, rtx);
+ void convert_registers ();
private:
- void add_insn (bitmap candidates, unsigned insn_uid);
- void analyze_register_chain (bitmap candidates, df_ref ref);
- virtual void mark_dual_mode_def (df_ref def) = 0;
+ bool add_insn (bitmap candidates, unsigned insn_uid, bitmap disallowed);
+ bool analyze_register_chain (bitmap candidates, df_ref ref,
+ bitmap disallowed);
virtual void convert_insn (rtx_insn *insn) = 0;
- virtual void convert_registers () = 0;
+ virtual void convert_op (rtx *op, rtx_insn *insn) = 0;
};
-class dimode_scalar_chain : public scalar_chain
+class general_scalar_chain : public scalar_chain
{
public:
- int compute_convert_gain ();
+ general_scalar_chain (enum machine_mode smode_, enum machine_mode vmode_)
+ : scalar_chain (smode_, vmode_) {}
+ int compute_convert_gain () final override;
+
private:
- void mark_dual_mode_def (df_ref def);
- rtx replace_with_subreg (rtx x, rtx reg, rtx subreg);
- void replace_with_subreg_in_insn (rtx_insn *insn, rtx reg, rtx subreg);
- void convert_insn (rtx_insn *insn);
- void convert_op (rtx *op, rtx_insn *insn);
- void convert_reg (unsigned regno);
- void make_vector_copies (unsigned regno);
- void convert_registers ();
+ void convert_insn (rtx_insn *insn) final override;
+ void convert_op (rtx *op, rtx_insn *insn) final override;
int vector_const_cost (rtx exp);
+ rtx convert_rotate (enum rtx_code, rtx op0, rtx op1, rtx_insn *insn);
};
class timode_scalar_chain : public scalar_chain
{
public:
- /* Convert from TImode to V1TImode is always faster. */
- int compute_convert_gain () { return 1; }
+ timode_scalar_chain () : scalar_chain (TImode, V1TImode) {}
+ int compute_convert_gain () final override;
private:
- void mark_dual_mode_def (df_ref def);
void fix_debug_reg_uses (rtx reg);
- void convert_insn (rtx_insn *insn);
- /* We don't convert registers to difference size. */
- void convert_registers () {}
+ void convert_insn (rtx_insn *insn) final override;
+ void convert_op (rtx *op, rtx_insn *insn) final override;
};
} // anon namespace
-bool ix86_save_reg (unsigned int regno, bool maybe_eh_return, bool ignore_outlined);
+bool ix86_save_reg (unsigned int regno, bool maybe_eh_return,
+ bool ignore_outlined);
int ix86_compare_version_priority (tree decl1, tree decl2);
tree ix86_generate_version_dispatcher_body (void *node_p);
tree ix86_get_function_versions_dispatcher (void *decl);