From: Takayuki 'January June' Suwa Date: Sun, 24 Aug 2025 21:26:41 +0000 (+0900) Subject: xtensa: Simplify "zero_extend[hq]isi2" insn patterns X-Git-Tag: basepoints/gcc-17~5434 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee8f20d61dfaa5cf2af77e49e3ad78ccd4d98b36;p=thirdparty%2Fgcc.git xtensa: Simplify "zero_extend[hq]isi2" insn patterns gcc/ChangeLog: * config/xtensa/xtensa.md (mode_bits): New mode attribute. (zero_extendsi2): Use the appropriate mode iterator and attribute to unify "zero_extend[hq]isi2" to this description. --- diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index f38fe6da8e4..4a02a6efe51 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -88,6 +88,7 @@ ;; This mode iterator allows the HI and QI patterns to be defined from ;; the same template. (define_mode_iterator HQI [HI QI]) +(define_mode_attr mode_bits [(HI "16") (QI "8")]) ;; This mode iterator allows the SI and HI patterns to be defined from ;; the same template. @@ -944,24 +945,13 @@ ;; Zero-extend instructions. -(define_insn "zero_extendhisi2" +(define_insn "zero_extendsi2" [(set (match_operand:SI 0 "register_operand" "=a,a") - (zero_extend:SI (match_operand:HI 1 "nonimmed_operand" "r,U")))] + (zero_extend:SI (match_operand:HQI 1 "nonimmed_operand" "r,U")))] "" "@ - extui\t%0, %1, 0, 16 - %v1l16ui\t%0, %1" - [(set_attr "type" "arith,load") - (set_attr "mode" "SI") - (set_attr "length" "3,3")]) - -(define_insn "zero_extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=a,a") - (zero_extend:SI (match_operand:QI 1 "nonimmed_operand" "r,U")))] - "" - "@ - extui\t%0, %1, 0, 8 - %v1l8ui\t%0, %1" + extui\t%0, %1, 0, + %v1lui\t%0, %1" [(set_attr "type" "arith,load") (set_attr "mode" "SI") (set_attr "length" "3,3")])