https://gcc.gnu.org/g:b1e8f118e962cbd08ab6037c05a1045df90585c5

commit r16-2427-gb1e8f118e962cbd08ab6037c05a1045df90585c5
Author: Takayuki 'January June' Suwa <jjsuwa_sys3...@yahoo.co.jp>
Date:   Wed Jul 16 17:03:26 2025 +0900

    xtensa: Make relaxed MOVI instructions treated as "load" type
    
    The relaxed MOVI instructions in the Xtensa ISA are assignment ones that
    contain large integer, floating-point or symbolic constants that would not
    normally be allowed as immediate values by instructions in assembly code,
    and will instead be translated by the assembler later rather the compiler,
    into the L32R instructions referencing to literal pool entries containing
    that values (see '-mauto-litpools' Xtensa-specific option).
    
    This means that even though such instructions look like nothing more than
    constant value assignments in their RTL representation, these may perform
    better by treating them as loads from memory (i.e. the actual behavior)
    and also trying to avoid using the value immediately after the load,
    especially from an instruction scheduling perspective.
    
    gcc/ChangeLog:
    
            * config/xtensa/xtensa.md
            (movsi_internal, movhi_internal, movsf_internal):
            Change the value of the "type" attribute from "move" to "load"
            when the source operand constraint is "Y".

Diff:
---
 gcc/config/xtensa/xtensa.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 029be99e3b4e..5d3bc3baaac6 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -1344,7 +1344,7 @@
    %v0s32i\t%1, %0
    rsr\t%0, ACCLO
    wsr\t%1, ACCLO"
-  [(set_attr "type"    
"move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr")
+  [(set_attr "type"    
"move,move,move,load,store,store,move,move,move,load,move,load,load,store,rsr,wsr")
    (set_attr "mode"    "SI")
    (set_attr "length"  "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")])
 
@@ -1410,7 +1410,7 @@
    %v0s16i\t%1, %0
    rsr\t%0, ACCLO
    wsr\t%1, ACCLO"
-  [(set_attr "type"    "move,move,move,move,move,load,load,store,rsr,wsr")
+  [(set_attr "type"    "move,move,move,move,load,load,load,store,rsr,wsr")
    (set_attr "mode"    "HI")
    (set_attr "length"  "2,2,3,3,3,3,3,3,3,3")])
 
@@ -1519,7 +1519,7 @@
    const16\t%0, %t1\;const16\t%0, %b1
    %v1l32i\t%0, %1
    %v0s32i\t%1, %0"
-  [(set_attr "type"    
"farith,fload,fstore,move,load,load,store,move,farith,farith,move,move,load,store")
+  [(set_attr "type"    
"farith,fload,fstore,move,load,load,store,move,farith,farith,load,move,load,store")
    (set_attr "mode"    "SF")
    (set_attr "length"  "3,3,3,2,3,2,2,3,3,3,3,6,3,3")])

Reply via email to