| 1 |
// Copyright 2016 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package runtime |
| 6 |
|
| 7 |
import "internal/cpu" |
| 8 |
|
| 9 |
const ( |
| 10 |
_HWCAP_VX = 1 << 11 // vector facility |
| 11 |
) |
| 12 |
|
| 13 |
func archauxv(tag, val uintptr) { |
| 14 |
switch tag { |
| 15 |
case _AT_HWCAP: |
| 16 |
cpu.HWCap = uint(val) |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
func checkS390xCPU() { |
| 21 |
// Check if the present z-system has the hardware capability to carryout |
| 22 |
// floating point operations. Check if hwcap reflects CPU capability for the |
| 23 |
// necessary floating point hardware (HasVX) availability. |
| 24 |
// Starting with Go1.19, z13 is the minimum machine level for running Go on LoZ |
| 25 |
if cpu.HWCap&_HWCAP_VX == 0 { |
| 26 |
print("runtime: This CPU has no floating point hardware, so this program cannot be run. \n") |
| 27 |
exit(1) |
| 28 |
} |
| 29 |
} |