Source file test/codegen/memops_bigoffset.go

     1  // asmcheck
     2  
     3  // Copyright 2023 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package codegen
     8  
     9  type big1 struct {
    10  	w [1<<30 - 1]uint32
    11  }
    12  type big2 struct {
    13  	d [1<<29 - 1]uint64
    14  }
    15  
    16  func loadLargeOffset(sw *big1, sd *big2) (uint32, uint64) {
    17  
    18  	// ppc64x:`MOVWZ\s+[0-9]+\(R[0-9]+\)`,-`ADD`
    19  	a3 := sw.w[1<<10]
    20  	// ppc64le/power10:`MOVWZ\s+[0-9]+\(R[0-9]+\),\sR[0-9]+`,-`ADD`
    21  	// ppc64x/power9:`ADD`,`MOVWZ\s+\(R[0-9]+\),\sR[0-9]+`
    22  	// ppc64x/power8:`ADD`,`MOVWZ\s+\(R[0-9]+\),\sR[0-9]+`
    23  	b3 := sw.w[1<<16]
    24  	// ppc64le/power10:`MOVWZ\s+[0-9]+\(R[0-9]+\),\sR[0-9]+`,-`ADD`
    25  	// ppc64x/power9:`ADD`,`MOVWZ\s+\(R[0-9]+\),\sR[0-9]+`
    26  	// ppc64x/power8:`ADD`,`MOVWZ\s+\(R[0-9]+\),\sR[0-9]+`
    27  	c3 := sw.w[1<<28]
    28  	// ppc64x:`MOVWZ\s+\(R[0-9]+\)\(R[0-9]+\),\sR[0-9]+`
    29  	d3 := sw.w[1<<29]
    30  	// ppc64x:`MOVD\s+[0-9]+\(R[0-9]+\)`,-`ADD`
    31  	a4 := sd.d[1<<10]
    32  	// ppc64le/power10:`MOVD\s+[0-9]+\(R[0-9]+\)`,-`ADD`
    33  	// ppc64x/power9:`ADD`,`MOVD\s+\(R[0-9]+\),\sR[0-9]+`
    34  	// ppc64x/power8:`ADD`,`MOVD\s+\(R[0-9]+\),\sR[0-9]+`
    35  	b4 := sd.d[1<<16]
    36  	// ppc64le/power10`:`MOVD\s+[0-9]+\(R[0-9]+\)`,-`ADD`
    37  	// ppc64x/power9:`ADD`,`MOVD\s+\(R[0-9]+\),\sR[0-9]+`
    38  	// ppc64x/power8:`ADD`,`MOVD\s+\(R[0-9]+\),\sR[0-9]+`
    39  	c4 := sd.d[1<<27]
    40  	// ppc64x:`MOVD\s+\(R[0-9]+\)\(R[0-9]+\),\sR[0-9]+`
    41  	d4 := sd.d[1<<28]
    42  
    43  	return a3 + b3 + c3 + d3, a4 + b4 + c4 + d4
    44  }
    45  
    46  func storeLargeOffset(sw *big1, sd *big2) {
    47  	// ppc64x:`MOVW\s+R[0-9]+,\s[0-9]+\(R[0-9]+\)`,-`ADD`
    48  	sw.w[1<<10] = uint32(10)
    49  	// ppc64le/power10:`MOVW\s+R[0-9]+,\s[0-9]+\(R[0-9]+\)`,-`ADD`
    50  	// ppc64x/power9:`MOVW\s+R[0-9]+\,\s\(R[0-9]+\)`,`ADD`
    51  	// ppc64x/power8:`MOVW\s+R[0-9]+\,\s\(R[0-9]+\)`,`ADD`
    52  	sw.w[1<<16] = uint32(20)
    53  	// ppc64le/power10:`MOVW\s+R[0-9]+,\s[0-9]+\(R[0-9]+\)`,-`ADD`
    54  	// ppc64x/power9:`MOVW\s+R[0-9]+,\s\(R[0-9]+\)`,`ADD`
    55  	// ppc64x/power8:`MOVW\s+R[0-9]+,\s\(R[0-9]+\)`,`ADD`
    56  	sw.w[1<<28] = uint32(30)
    57  	// ppc64x:`MOVW\s+R[0-9]+,\s\(R[0-9]+\)`
    58  	sw.w[1<<29] = uint32(40)
    59  	// ppc64x:`MOVD\s+R[0-9]+,\s[0-9]+\(R[0-9]+\)`,-`ADD`
    60  	sd.d[1<<10] = uint64(40)
    61  	// ppc64le/power10:`MOVD\s+R[0-9]+,\s[0-9]+\(R[0-9]+\)`,-`ADD`
    62  	// ppc64x/power9:`MOVD\s+R[0-9]+,\s\(R[0-9]+\)`,`ADD`
    63  	// ppc64x/power8:`MOVD\s+R[0-9]+,\s\(R[0-9]+\)`,`ADD`
    64  	sd.d[1<<16] = uint64(50)
    65  	// ppc64le/power10`:`MOVD\s+R[0-9]+,\s[0-9]+\(R[0-9]+\)`,-`ADD`
    66  	// ppc64x/power9:`MOVD\s+R[0-9]+,\s\(R[0-9]+\)`,`ADD`
    67  	// ppc64x/power8:`MOVD\s+R[0-9]+,\s\(R[0-9]+\)`,`ADD`
    68  	sd.d[1<<27] = uint64(60)
    69  	// ppc64x:`MOVD\s+R[0-9]+,\s\(R[0-9]+\)`
    70  	sd.d[1<<28] = uint64(70)
    71  }
    72  

View as plain text