Source file src/cmd/compile/internal/ssarewrite/rewrite386splitload/rewrite386splitload.go

     1  // Code generated from _gen/386splitload.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package rewrite386splitload
     4  
     5  import "cmd/compile/internal/ssa/ssaop"
     6  import "cmd/compile/internal/ssa"
     7  
     8  func RewriteValue(v *ssa.Value) bool {
     9  	switch v.Op {
    10  	case ssaop.Op386CMPBconstload:
    11  		return rewriteValue_Op386CMPBconstload(v)
    12  	case ssaop.Op386CMPBload:
    13  		return rewriteValue_Op386CMPBload(v)
    14  	case ssaop.Op386CMPLconstload:
    15  		return rewriteValue_Op386CMPLconstload(v)
    16  	case ssaop.Op386CMPLload:
    17  		return rewriteValue_Op386CMPLload(v)
    18  	case ssaop.Op386CMPWconstload:
    19  		return rewriteValue_Op386CMPWconstload(v)
    20  	case ssaop.Op386CMPWload:
    21  		return rewriteValue_Op386CMPWload(v)
    22  	}
    23  	return false
    24  }
    25  func rewriteValue_Op386CMPBconstload(v *ssa.Value) bool {
    26  	v_1 := v.Args[1]
    27  	v_0 := v.Args[0]
    28  	b := v.Block
    29  	typ := &b.Func.Config.Types
    30  	// match: (CMPBconstload {sym} [vo] ptr mem)
    31  	// result: (CMPBconst (MOVBload {sym} [vo.Off()] ptr mem) [vo.Val8()])
    32  	for {
    33  		vo := ssa.AuxIntToValAndOff(v.AuxInt)
    34  		sym := ssa.AuxToSym(v.Aux)
    35  		ptr := v_0
    36  		mem := v_1
    37  		v.Reset(ssaop.Op386CMPBconst)
    38  		v.AuxInt = ssa.Int8ToAuxInt(vo.Val8())
    39  		v0 := b.NewValue0(v.Pos, ssaop.Op386MOVBload, typ.UInt8)
    40  		v0.AuxInt = ssa.Int32ToAuxInt(vo.Off())
    41  		v0.Aux = ssa.SymToAux(sym)
    42  		v0.AddArg2(ptr, mem)
    43  		v.AddArg(v0)
    44  		return true
    45  	}
    46  }
    47  func rewriteValue_Op386CMPBload(v *ssa.Value) bool {
    48  	v_2 := v.Args[2]
    49  	v_1 := v.Args[1]
    50  	v_0 := v.Args[0]
    51  	b := v.Block
    52  	// match: (CMPBload {sym} [off] ptr x mem)
    53  	// result: (CMPB (MOVBload <x.Type> {sym} [off] ptr mem) x)
    54  	for {
    55  		off := ssa.AuxIntToInt32(v.AuxInt)
    56  		sym := ssa.AuxToSym(v.Aux)
    57  		ptr := v_0
    58  		x := v_1
    59  		mem := v_2
    60  		v.Reset(ssaop.Op386CMPB)
    61  		v0 := b.NewValue0(v.Pos, ssaop.Op386MOVBload, x.Type)
    62  		v0.AuxInt = ssa.Int32ToAuxInt(off)
    63  		v0.Aux = ssa.SymToAux(sym)
    64  		v0.AddArg2(ptr, mem)
    65  		v.AddArg2(v0, x)
    66  		return true
    67  	}
    68  }
    69  func rewriteValue_Op386CMPLconstload(v *ssa.Value) bool {
    70  	v_1 := v.Args[1]
    71  	v_0 := v.Args[0]
    72  	b := v.Block
    73  	typ := &b.Func.Config.Types
    74  	// match: (CMPLconstload {sym} [vo] ptr mem)
    75  	// result: (CMPLconst (MOVLload {sym} [vo.Off()] ptr mem) [vo.Val()])
    76  	for {
    77  		vo := ssa.AuxIntToValAndOff(v.AuxInt)
    78  		sym := ssa.AuxToSym(v.Aux)
    79  		ptr := v_0
    80  		mem := v_1
    81  		v.Reset(ssaop.Op386CMPLconst)
    82  		v.AuxInt = ssa.Int32ToAuxInt(vo.Val())
    83  		v0 := b.NewValue0(v.Pos, ssaop.Op386MOVLload, typ.UInt32)
    84  		v0.AuxInt = ssa.Int32ToAuxInt(vo.Off())
    85  		v0.Aux = ssa.SymToAux(sym)
    86  		v0.AddArg2(ptr, mem)
    87  		v.AddArg(v0)
    88  		return true
    89  	}
    90  }
    91  func rewriteValue_Op386CMPLload(v *ssa.Value) bool {
    92  	v_2 := v.Args[2]
    93  	v_1 := v.Args[1]
    94  	v_0 := v.Args[0]
    95  	b := v.Block
    96  	// match: (CMPLload {sym} [off] ptr x mem)
    97  	// result: (CMPL (MOVLload <x.Type> {sym} [off] ptr mem) x)
    98  	for {
    99  		off := ssa.AuxIntToInt32(v.AuxInt)
   100  		sym := ssa.AuxToSym(v.Aux)
   101  		ptr := v_0
   102  		x := v_1
   103  		mem := v_2
   104  		v.Reset(ssaop.Op386CMPL)
   105  		v0 := b.NewValue0(v.Pos, ssaop.Op386MOVLload, x.Type)
   106  		v0.AuxInt = ssa.Int32ToAuxInt(off)
   107  		v0.Aux = ssa.SymToAux(sym)
   108  		v0.AddArg2(ptr, mem)
   109  		v.AddArg2(v0, x)
   110  		return true
   111  	}
   112  }
   113  func rewriteValue_Op386CMPWconstload(v *ssa.Value) bool {
   114  	v_1 := v.Args[1]
   115  	v_0 := v.Args[0]
   116  	b := v.Block
   117  	typ := &b.Func.Config.Types
   118  	// match: (CMPWconstload {sym} [vo] ptr mem)
   119  	// result: (CMPWconst (MOVWload {sym} [vo.Off()] ptr mem) [vo.Val16()])
   120  	for {
   121  		vo := ssa.AuxIntToValAndOff(v.AuxInt)
   122  		sym := ssa.AuxToSym(v.Aux)
   123  		ptr := v_0
   124  		mem := v_1
   125  		v.Reset(ssaop.Op386CMPWconst)
   126  		v.AuxInt = ssa.Int16ToAuxInt(vo.Val16())
   127  		v0 := b.NewValue0(v.Pos, ssaop.Op386MOVWload, typ.UInt16)
   128  		v0.AuxInt = ssa.Int32ToAuxInt(vo.Off())
   129  		v0.Aux = ssa.SymToAux(sym)
   130  		v0.AddArg2(ptr, mem)
   131  		v.AddArg(v0)
   132  		return true
   133  	}
   134  }
   135  func rewriteValue_Op386CMPWload(v *ssa.Value) bool {
   136  	v_2 := v.Args[2]
   137  	v_1 := v.Args[1]
   138  	v_0 := v.Args[0]
   139  	b := v.Block
   140  	// match: (CMPWload {sym} [off] ptr x mem)
   141  	// result: (CMPW (MOVWload <x.Type> {sym} [off] ptr mem) x)
   142  	for {
   143  		off := ssa.AuxIntToInt32(v.AuxInt)
   144  		sym := ssa.AuxToSym(v.Aux)
   145  		ptr := v_0
   146  		x := v_1
   147  		mem := v_2
   148  		v.Reset(ssaop.Op386CMPW)
   149  		v0 := b.NewValue0(v.Pos, ssaop.Op386MOVWload, x.Type)
   150  		v0.AuxInt = ssa.Int32ToAuxInt(off)
   151  		v0.Aux = ssa.SymToAux(sym)
   152  		v0.AddArg2(ptr, mem)
   153  		v.AddArg2(v0, x)
   154  		return true
   155  	}
   156  }
   157  func RewriteBlock(b *ssa.Block) bool {
   158  	return false
   159  }
   160  

View as plain text