https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126183
Bug ID: 126183
Summary: ix86_register_move_cost should treat 8bit/16bit moves
between gpr and xmm differently
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: liuhongt at gcc dot gnu.org
Target Milestone: ---
Target: x86
Unlike 32bit/64bit moves, 8bit/16bit moves between gpr and xmm can be
expensive or impossible, depending on ISAs. But ix86_register_move_cost
uses
if (SSE_CLASS_P (class1) != SSE_CLASS_P (class2))
return (SSE_CLASS_P (class1)
? ix86_cost->hard_register.sse_to_integer
: ix86_cost->hard_register.integer_to_sse);
It doesn't work well for 8bit nor 16bit. Also it doesn't consider
TARGET_INTER_UNIT_MOVES_FROM_VEC nor TARGET_INTER_UNIT_MOVES_TO_VEC.