1
0
mirror of https://github.com/golang/go synced 2024-10-04 20:21:22 -06:00
go/usr/r/reflect/gencast.sh

37 lines
680 B
Bash
Raw Normal View History

#!/bin/bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
awk '
BEGIN {
print("// Conversion operators - really just casts")
print("// *** Created by gencast.sh - Do Not Edit ***\n")}
{
print("TEXT reflect·AddrToPtr" $0 "(SB),7,$-8")
print("\tMOVQ 8(SP), AX")
print("\tMOVQ AX, 16(SP)")
print("\tRET")
print("")
print("TEXT reflect·Ptr" $0 "ToAddr(SB),7,$-8")
print("\tMOVQ 8(SP), AX")
print("\tMOVQ AX, 16(SP)")
print("\tRET")
print("")
}
' > cast_$GOARCH.s << '!'
Addr
Int8
Int16
Int32
Int64
Uint8
Uint16
Uint32
Uint64
Float32
Float64
Float80
String
!