github.com/mh-cbon/go@v0.0.0-20160603070303-9e112a3fe4c0/src/cmd/compile/internal/ssa/gen/ARM.rules (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  (Add32 x y) -> (ADD x y)
     6  
     7  (Const32 [val]) -> (MOVWconst [val])
     8  
     9  (Less32 x y) -> (LessThan (CMP x y))
    10  
    11  (OffPtr [off] ptr) -> (ADD (MOVWconst <config.Frontend().TypeInt32()> [off]) ptr)
    12  
    13  (Addr {sym} base) -> (ADDconst {sym} base)
    14  
    15  (Load <t> ptr mem) && is32BitInt(t) -> (MOVWload ptr mem)
    16  (Store [4] ptr val mem) -> (MOVWstore ptr val mem)
    17  
    18  (StaticCall [argwid] {target} mem) -> (CALLstatic [argwid] {target} mem)
    19  
    20  // Absorb LessThan into blocks.
    21  (If (LessThan cc) yes no) -> (LT cc yes no)
    22  
    23  
    24  
    25  // Optimizations
    26  
    27  (ADD (MOVWconst [c]) x) -> (ADDconst [c] x)
    28  (ADD x (MOVWconst [c])) -> (ADDconst [c] x)
    29  (MOVWload [off1] {sym1} (ADDconst [off2] {sym2} ptr) mem) && canMergeSym(sym1,sym2) ->
    30    (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
    31  (MOVWstore [off1] {sym1} (ADDconst [off2] {sym2} ptr) val mem) && canMergeSym(sym1,sym2) ->
    32    (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)