Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/golang/src/runtime/cgo
File: abi_ppc64x.h
// Copyright 2023 The Go Authors. All rights reserved.
[0] Fix | Delete
// Use of this source code is governed by a BSD-style
[1] Fix | Delete
// license that can be found in the LICENSE file.
[2] Fix | Delete
[3] Fix | Delete
// Macros for transitioning from the host ABI to Go ABI
[4] Fix | Delete
//
[5] Fix | Delete
// On PPC64/ELFv2 targets, the following registers are callee
[6] Fix | Delete
// saved when called from C. They must be preserved before
[7] Fix | Delete
// calling into Go which does not preserve any of them.
[8] Fix | Delete
//
[9] Fix | Delete
// R14-R31
[10] Fix | Delete
// CR2-4
[11] Fix | Delete
// VR20-31
[12] Fix | Delete
// F14-F31
[13] Fix | Delete
//
[14] Fix | Delete
// xcoff(aix) and ELFv1 are similar, but may only require a
[15] Fix | Delete
// subset of these.
[16] Fix | Delete
//
[17] Fix | Delete
// These macros assume a 16 byte aligned stack pointer. This
[18] Fix | Delete
// is required by ELFv1, ELFv2, and AIX PPC64.
[19] Fix | Delete
[20] Fix | Delete
#define SAVE_GPR_SIZE (18*8)
[21] Fix | Delete
#define SAVE_GPR(offset) \
[22] Fix | Delete
MOVD R14, (offset+8*0)(R1) \
[23] Fix | Delete
MOVD R15, (offset+8*1)(R1) \
[24] Fix | Delete
MOVD R16, (offset+8*2)(R1) \
[25] Fix | Delete
MOVD R17, (offset+8*3)(R1) \
[26] Fix | Delete
MOVD R18, (offset+8*4)(R1) \
[27] Fix | Delete
MOVD R19, (offset+8*5)(R1) \
[28] Fix | Delete
MOVD R20, (offset+8*6)(R1) \
[29] Fix | Delete
MOVD R21, (offset+8*7)(R1) \
[30] Fix | Delete
MOVD R22, (offset+8*8)(R1) \
[31] Fix | Delete
MOVD R23, (offset+8*9)(R1) \
[32] Fix | Delete
MOVD R24, (offset+8*10)(R1) \
[33] Fix | Delete
MOVD R25, (offset+8*11)(R1) \
[34] Fix | Delete
MOVD R26, (offset+8*12)(R1) \
[35] Fix | Delete
MOVD R27, (offset+8*13)(R1) \
[36] Fix | Delete
MOVD R28, (offset+8*14)(R1) \
[37] Fix | Delete
MOVD R29, (offset+8*15)(R1) \
[38] Fix | Delete
MOVD g, (offset+8*16)(R1) \
[39] Fix | Delete
MOVD R31, (offset+8*17)(R1)
[40] Fix | Delete
[41] Fix | Delete
#define RESTORE_GPR(offset) \
[42] Fix | Delete
MOVD (offset+8*0)(R1), R14 \
[43] Fix | Delete
MOVD (offset+8*1)(R1), R15 \
[44] Fix | Delete
MOVD (offset+8*2)(R1), R16 \
[45] Fix | Delete
MOVD (offset+8*3)(R1), R17 \
[46] Fix | Delete
MOVD (offset+8*4)(R1), R18 \
[47] Fix | Delete
MOVD (offset+8*5)(R1), R19 \
[48] Fix | Delete
MOVD (offset+8*6)(R1), R20 \
[49] Fix | Delete
MOVD (offset+8*7)(R1), R21 \
[50] Fix | Delete
MOVD (offset+8*8)(R1), R22 \
[51] Fix | Delete
MOVD (offset+8*9)(R1), R23 \
[52] Fix | Delete
MOVD (offset+8*10)(R1), R24 \
[53] Fix | Delete
MOVD (offset+8*11)(R1), R25 \
[54] Fix | Delete
MOVD (offset+8*12)(R1), R26 \
[55] Fix | Delete
MOVD (offset+8*13)(R1), R27 \
[56] Fix | Delete
MOVD (offset+8*14)(R1), R28 \
[57] Fix | Delete
MOVD (offset+8*15)(R1), R29 \
[58] Fix | Delete
MOVD (offset+8*16)(R1), g \
[59] Fix | Delete
MOVD (offset+8*17)(R1), R31
[60] Fix | Delete
[61] Fix | Delete
#define SAVE_FPR_SIZE (18*8)
[62] Fix | Delete
#define SAVE_FPR(offset) \
[63] Fix | Delete
FMOVD F14, (offset+8*0)(R1) \
[64] Fix | Delete
FMOVD F15, (offset+8*1)(R1) \
[65] Fix | Delete
FMOVD F16, (offset+8*2)(R1) \
[66] Fix | Delete
FMOVD F17, (offset+8*3)(R1) \
[67] Fix | Delete
FMOVD F18, (offset+8*4)(R1) \
[68] Fix | Delete
FMOVD F19, (offset+8*5)(R1) \
[69] Fix | Delete
FMOVD F20, (offset+8*6)(R1) \
[70] Fix | Delete
FMOVD F21, (offset+8*7)(R1) \
[71] Fix | Delete
FMOVD F22, (offset+8*8)(R1) \
[72] Fix | Delete
FMOVD F23, (offset+8*9)(R1) \
[73] Fix | Delete
FMOVD F24, (offset+8*10)(R1) \
[74] Fix | Delete
FMOVD F25, (offset+8*11)(R1) \
[75] Fix | Delete
FMOVD F26, (offset+8*12)(R1) \
[76] Fix | Delete
FMOVD F27, (offset+8*13)(R1) \
[77] Fix | Delete
FMOVD F28, (offset+8*14)(R1) \
[78] Fix | Delete
FMOVD F29, (offset+8*15)(R1) \
[79] Fix | Delete
FMOVD F30, (offset+8*16)(R1) \
[80] Fix | Delete
FMOVD F31, (offset+8*17)(R1)
[81] Fix | Delete
[82] Fix | Delete
#define RESTORE_FPR(offset) \
[83] Fix | Delete
FMOVD (offset+8*0)(R1), F14 \
[84] Fix | Delete
FMOVD (offset+8*1)(R1), F15 \
[85] Fix | Delete
FMOVD (offset+8*2)(R1), F16 \
[86] Fix | Delete
FMOVD (offset+8*3)(R1), F17 \
[87] Fix | Delete
FMOVD (offset+8*4)(R1), F18 \
[88] Fix | Delete
FMOVD (offset+8*5)(R1), F19 \
[89] Fix | Delete
FMOVD (offset+8*6)(R1), F20 \
[90] Fix | Delete
FMOVD (offset+8*7)(R1), F21 \
[91] Fix | Delete
FMOVD (offset+8*8)(R1), F22 \
[92] Fix | Delete
FMOVD (offset+8*9)(R1), F23 \
[93] Fix | Delete
FMOVD (offset+8*10)(R1), F24 \
[94] Fix | Delete
FMOVD (offset+8*11)(R1), F25 \
[95] Fix | Delete
FMOVD (offset+8*12)(R1), F26 \
[96] Fix | Delete
FMOVD (offset+8*13)(R1), F27 \
[97] Fix | Delete
FMOVD (offset+8*14)(R1), F28 \
[98] Fix | Delete
FMOVD (offset+8*15)(R1), F29 \
[99] Fix | Delete
FMOVD (offset+8*16)(R1), F30 \
[100] Fix | Delete
FMOVD (offset+8*17)(R1), F31
[101] Fix | Delete
[102] Fix | Delete
// Save and restore VR20-31 (aka VSR56-63). These
[103] Fix | Delete
// macros must point to a 16B aligned offset.
[104] Fix | Delete
#define SAVE_VR_SIZE (12*16)
[105] Fix | Delete
#define SAVE_VR(offset, rtmp) \
[106] Fix | Delete
MOVD $(offset+16*0), rtmp \
[107] Fix | Delete
STVX V20, (rtmp)(R1) \
[108] Fix | Delete
MOVD $(offset+16*1), rtmp \
[109] Fix | Delete
STVX V21, (rtmp)(R1) \
[110] Fix | Delete
MOVD $(offset+16*2), rtmp \
[111] Fix | Delete
STVX V22, (rtmp)(R1) \
[112] Fix | Delete
MOVD $(offset+16*3), rtmp \
[113] Fix | Delete
STVX V23, (rtmp)(R1) \
[114] Fix | Delete
MOVD $(offset+16*4), rtmp \
[115] Fix | Delete
STVX V24, (rtmp)(R1) \
[116] Fix | Delete
MOVD $(offset+16*5), rtmp \
[117] Fix | Delete
STVX V25, (rtmp)(R1) \
[118] Fix | Delete
MOVD $(offset+16*6), rtmp \
[119] Fix | Delete
STVX V26, (rtmp)(R1) \
[120] Fix | Delete
MOVD $(offset+16*7), rtmp \
[121] Fix | Delete
STVX V27, (rtmp)(R1) \
[122] Fix | Delete
MOVD $(offset+16*8), rtmp \
[123] Fix | Delete
STVX V28, (rtmp)(R1) \
[124] Fix | Delete
MOVD $(offset+16*9), rtmp \
[125] Fix | Delete
STVX V29, (rtmp)(R1) \
[126] Fix | Delete
MOVD $(offset+16*10), rtmp \
[127] Fix | Delete
STVX V30, (rtmp)(R1) \
[128] Fix | Delete
MOVD $(offset+16*11), rtmp \
[129] Fix | Delete
STVX V31, (rtmp)(R1)
[130] Fix | Delete
[131] Fix | Delete
#define RESTORE_VR(offset, rtmp) \
[132] Fix | Delete
MOVD $(offset+16*0), rtmp \
[133] Fix | Delete
LVX (rtmp)(R1), V20 \
[134] Fix | Delete
MOVD $(offset+16*1), rtmp \
[135] Fix | Delete
LVX (rtmp)(R1), V21 \
[136] Fix | Delete
MOVD $(offset+16*2), rtmp \
[137] Fix | Delete
LVX (rtmp)(R1), V22 \
[138] Fix | Delete
MOVD $(offset+16*3), rtmp \
[139] Fix | Delete
LVX (rtmp)(R1), V23 \
[140] Fix | Delete
MOVD $(offset+16*4), rtmp \
[141] Fix | Delete
LVX (rtmp)(R1), V24 \
[142] Fix | Delete
MOVD $(offset+16*5), rtmp \
[143] Fix | Delete
LVX (rtmp)(R1), V25 \
[144] Fix | Delete
MOVD $(offset+16*6), rtmp \
[145] Fix | Delete
LVX (rtmp)(R1), V26 \
[146] Fix | Delete
MOVD $(offset+16*7), rtmp \
[147] Fix | Delete
LVX (rtmp)(R1), V27 \
[148] Fix | Delete
MOVD $(offset+16*8), rtmp \
[149] Fix | Delete
LVX (rtmp)(R1), V28 \
[150] Fix | Delete
MOVD $(offset+16*9), rtmp \
[151] Fix | Delete
LVX (rtmp)(R1), V29 \
[152] Fix | Delete
MOVD $(offset+16*10), rtmp \
[153] Fix | Delete
LVX (rtmp)(R1), V30 \
[154] Fix | Delete
MOVD $(offset+16*11), rtmp \
[155] Fix | Delete
LVX (rtmp)(R1), V31
[156] Fix | Delete
[157] Fix | Delete
// LR and CR are saved in the caller's frame. The callee must
[158] Fix | Delete
// make space for all other callee-save registers.
[159] Fix | Delete
#define SAVE_ALL_REG_SIZE (SAVE_GPR_SIZE+SAVE_FPR_SIZE+SAVE_VR_SIZE)
[160] Fix | Delete
[161] Fix | Delete
// Stack a frame and save all callee-save registers following the
[162] Fix | Delete
// host OS's ABI. Fortunately, this is identical for AIX, ELFv1, and
[163] Fix | Delete
// ELFv2. All host ABIs require the stack pointer to maintain 16 byte
[164] Fix | Delete
// alignment, and save the callee-save registers in the same places.
[165] Fix | Delete
//
[166] Fix | Delete
// To restate, R1 is assumed to be aligned when this macro is used.
[167] Fix | Delete
// This assumes the caller's frame is compliant with the host ABI.
[168] Fix | Delete
// CR and LR are saved into the caller's frame per the host ABI.
[169] Fix | Delete
// R0 is initialized to $0 as expected by Go.
[170] Fix | Delete
#define STACK_AND_SAVE_HOST_TO_GO_ABI(extra) \
[171] Fix | Delete
MOVD LR, R0 \
[172] Fix | Delete
MOVD R0, 16(R1) \
[173] Fix | Delete
MOVW CR, R0 \
[174] Fix | Delete
MOVD R0, 8(R1) \
[175] Fix | Delete
MOVDU R1, -(extra)-FIXED_FRAME-SAVE_ALL_REG_SIZE(R1) \
[176] Fix | Delete
SAVE_GPR(extra+FIXED_FRAME) \
[177] Fix | Delete
SAVE_FPR(extra+FIXED_FRAME+SAVE_GPR_SIZE) \
[178] Fix | Delete
SAVE_VR(extra+FIXED_FRAME+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R0) \
[179] Fix | Delete
MOVD $0, R0
[180] Fix | Delete
[181] Fix | Delete
// This unstacks the frame, restoring all callee-save registers
[182] Fix | Delete
// as saved by STACK_AND_SAVE_HOST_TO_GO_ABI.
[183] Fix | Delete
//
[184] Fix | Delete
// R0 is not guaranteed to contain $0 after this macro.
[185] Fix | Delete
#define UNSTACK_AND_RESTORE_GO_TO_HOST_ABI(extra) \
[186] Fix | Delete
RESTORE_GPR(extra+FIXED_FRAME) \
[187] Fix | Delete
RESTORE_FPR(extra+FIXED_FRAME+SAVE_GPR_SIZE) \
[188] Fix | Delete
RESTORE_VR(extra+FIXED_FRAME+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R0) \
[189] Fix | Delete
ADD $(extra+FIXED_FRAME+SAVE_ALL_REG_SIZE), R1 \
[190] Fix | Delete
MOVD 16(R1), R0 \
[191] Fix | Delete
MOVD R0, LR \
[192] Fix | Delete
MOVD 8(R1), R0 \
[193] Fix | Delete
MOVW R0, CR
[194] Fix | Delete
[195] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function