This patch gives GCC to use the accumulator VGPR registers on CDNA1 and later architectures. The backend does not yet attempt to make use of the matrix acceleration instructions, but the new registers are still useful as fast space for register spills. And they can now be used in inline assembly statements. I haven't written a dedicated testcase for this - just building libgcc and libgfortran seems to have thoroughly exercised the code paths involved. I have a test run in progress - assuming that this doesn't find any breakage, OK to commit? gcc/ChangeLog: * config/gcn/constraints.md: Add AVGPR constraints. * config/gcn/gcn-valu.md (*mov, mov_sgprbase) (reload_in, reload_out): Add AVGPR alternatives. (gather_insn_1offset, gather_insn_1offset_ds) (gather_insn_2offsets) (scatter_store_insn_1offset_insn_1offset_ds) (scatter_insn_2offsets): Allow use of AVGPRs. * config/gcn/gcn.cc (MAX_NORMAL_AVGPR_COUNT): Define. (gcn_class_max_nregs): Handle AVGPR_REGS. (gcn_hard_regno_mode_ok): Likewise. (gcn_spill_class): Allow spilling to AVGPRs on TARGET_CDNA2_PLUS. (gcn_sgpr_move_p): Handle AVGPRs. (gcn_secondary_reload): Reload AVGPRs via VGPRs. (gcn_conditional_register_usage): Handle AVGPRs. (gcn_vgpr_equivalent_register_operand): New function. (gcn_valid_move_p): Check for validity of AVGPR moves. (gcn_memory_move_cost): Handle AVGPRs. (gcn_register_move_cost): Liekwise. (gcn_vmem_insn_p): Handle TYPE_VOP3P_MAI. (gcn_hsa_declare_function_name): Handle AVGPRs. (print_reg): Likewise. (gcn_dwarf_register_numbe): Likewise. * config/gcn/gcn.h (FIRST_AVGPR_REG, AVGPR_REGNO, LAST_AVGPR_REG): Define. (SOFT_ARG_REG, FRAME_POINTER_REGNUM, DWARF_LINK_REGISTER) (FIRST_PSEUDO_REGISTER): Update. (AVGPR_REGNO_P): Define. (FIXED_REGISTERS, CALL_USED_REGISTERS): Add AVGPRs. (enum reg_class, REG_CLASS_NAMES): Add AVGPR_REGS and ALL_VGPR_REGS. (REG_CLASS_CONTENTS): Add new register classes and add entries for AVGPRs to all classes. (REGISTER_NAMES): Add AVGPRs. * config/gcn/gcn.md (FIRST_AVGPR_REG, LAST_AVGPR_REG): Define. (AP_REGNUM, FP_REGNUM): Update. (define_attr "type"): Add vop3p_mai. (*mov_insn, *movti_insn): Add AVGPR alternatives. * gcc/config/gcn/predicates.md (gcn_avgpr_register_operand) (gcn_avgpr_hard_register_operand): New predicates.