LGTM with a nit: ... > + "TARGET_XTHEADBA > + && (INTVAL (operands[2]) >= 0) && (INTVAL (operands[2]) <= 3)"
IN_RANGE(INTVAL(operands[2]), 0, 3) and I am little bit suppress it can be zero > + "th.addsl\t%0,%1,%3,%2" > + [(set_attr "type" "bitmanip") > + (set_attr "mode" "<X:MODE>")])