gcc/libgo/go/runtime/os_linux_s390x.go
Ian Lance Taylor a72128258b re PR go/89123 (Too many go test failures on s390x-linux)
PR go/89123
    internal/cpu, runtime: add S/390 CPU capability support
    
    Patch by Robin Dapp.
    
    Updates https://gcc.gnu.org/PR89123
    
    Reviewed-on: https://go-review.googlesource.com/c/162887

From-SVN: r268941
2019-02-15 14:51:10 +00:00

34 lines
958 B
Go

// Copyright 2016 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.
package runtime
import "internal/cpu"
const (
// bit masks taken from bits/hwcap.h
_HWCAP_S390_ZARCH = 2
_HWCAP_S390_STFLE = 4
_HWCAP_S390_MSA = 8
_HWCAP_S390_LDISP = 16
_HWCAP_S390_EIMM = 32
_HWCAP_S390_DFP = 64
_HWCAP_S390_ETF3EH = 256
_HWCAP_S390_VX = 2048 // vector facility
)
func archauxv(tag, val uintptr) {
switch tag {
case _AT_HWCAP: // CPU capability bit flags
cpu.S390X.HasZArch = val&_HWCAP_S390_ZARCH != 0
cpu.S390X.HasSTFLE = val&_HWCAP_S390_STFLE != 0
cpu.S390X.HasMSA = val&_HWCAP_S390_MSA != 0
cpu.S390X.HasLDisp = val&_HWCAP_S390_LDISP != 0
cpu.S390X.HasEImm = val&_HWCAP_S390_EIMM != 0
cpu.S390X.HasDFP = val&_HWCAP_S390_DFP != 0
cpu.S390X.HasETF3Enhanced = val&_HWCAP_S390_ETF3EH != 0
cpu.S390X.HasVX = val&_HWCAP_S390_VX != 0
}
}