github.com/primecitizens/pcz/std@v0.2.1/runtime/panic32.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  //
     4  // Copyright 2019 The Go Authors. All rights reserved.
     5  // Use of this source code is governed by a BSD-style
     6  // license that can be found in the LICENSE file.
     7  
     8  //go:build pcz && (386 || arm || mips || mipsle)
     9  
    10  package runtime
    11  
    12  // Additional index/slice error paths for 32-bit platforms.
    13  // Used when the high word of a 64-bit index is not zero.
    14  
    15  // failures in the comparisons for s[x], 0 <= x < y (y == len(s))
    16  func goPanicExtendIndex(hi int, lo uint, y int) {
    17  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsIndex})
    18  }
    19  
    20  func goPanicExtendIndexU(hi uint, lo uint, y int) {
    21  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsIndex})
    22  }
    23  
    24  // failures in the comparisons for s[:x], 0 <= x <= y (y == len(s) or cap(s))
    25  func goPanicExtendSliceAlen(hi int, lo uint, y int) {
    26  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSliceAlen})
    27  }
    28  
    29  func goPanicExtendSliceAlenU(hi uint, lo uint, y int) {
    30  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSliceAlen})
    31  }
    32  
    33  func goPanicExtendSliceAcap(hi int, lo uint, y int) {
    34  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSliceAcap})
    35  }
    36  
    37  func goPanicExtendSliceAcapU(hi uint, lo uint, y int) {
    38  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSliceAcap})
    39  }
    40  
    41  // failures in the comparisons for s[x:y], 0 <= x <= y
    42  func goPanicExtendSliceB(hi int, lo uint, y int) {
    43  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSliceB})
    44  }
    45  
    46  func goPanicExtendSliceBU(hi uint, lo uint, y int) {
    47  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSliceB})
    48  }
    49  
    50  // failures in the comparisons for s[::x], 0 <= x <= y (y == len(s) or cap(s))
    51  func goPanicExtendSlice3Alen(hi int, lo uint, y int) {
    52  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSlice3Alen})
    53  }
    54  
    55  func goPanicExtendSlice3AlenU(hi uint, lo uint, y int) {
    56  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSlice3Alen})
    57  }
    58  
    59  func goPanicExtendSlice3Acap(hi int, lo uint, y int) {
    60  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSlice3Acap})
    61  }
    62  
    63  func goPanicExtendSlice3AcapU(hi uint, lo uint, y int) {
    64  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSlice3Acap})
    65  }
    66  
    67  // failures in the comparisons for s[:x:y], 0 <= x <= y
    68  func goPanicExtendSlice3B(hi int, lo uint, y int) {
    69  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSlice3B})
    70  }
    71  
    72  func goPanicExtendSlice3BU(hi uint, lo uint, y int) {
    73  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSlice3B})
    74  }
    75  
    76  // failures in the comparisons for s[x:y:], 0 <= x <= y
    77  func goPanicExtendSlice3C(hi int, lo uint, y int) {
    78  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: true, y: y, code: boundsSlice3C})
    79  }
    80  
    81  func goPanicExtendSlice3CU(hi uint, lo uint, y int) {
    82  	panicBoundsError(boundsError{x: int64(hi)<<32 + int64(lo), signed: false, y: y, code: boundsSlice3C})
    83  }
    84  
    85  // Implemented in assembly, as they take arguments in registers.
    86  // Declared here to mark them as ABIInternal.
    87  
    88  func panicExtendIndex(hi int, lo uint, y int)
    89  func panicExtendIndexU(hi uint, lo uint, y int)
    90  func panicExtendSliceAlen(hi int, lo uint, y int)
    91  func panicExtendSliceAlenU(hi uint, lo uint, y int)
    92  func panicExtendSliceAcap(hi int, lo uint, y int)
    93  func panicExtendSliceAcapU(hi uint, lo uint, y int)
    94  func panicExtendSliceB(hi int, lo uint, y int)
    95  func panicExtendSliceBU(hi uint, lo uint, y int)
    96  func panicExtendSlice3Alen(hi int, lo uint, y int)
    97  func panicExtendSlice3AlenU(hi uint, lo uint, y int)
    98  func panicExtendSlice3Acap(hi int, lo uint, y int)
    99  func panicExtendSlice3AcapU(hi uint, lo uint, y int)
   100  func panicExtendSlice3B(hi int, lo uint, y int)
   101  func panicExtendSlice3BU(hi uint, lo uint, y int)
   102  func panicExtendSlice3C(hi int, lo uint, y int)
   103  func panicExtendSlice3CU(hi uint, lo uint, y int)