Add hard float support for arm platform, add tests
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
a458a18f07
commit
a7c4509d3d
55
.drone.yml
55
.drone.yml
|
@ -178,6 +178,61 @@ environment:
|
|||
workspace:
|
||||
path: /drone/src
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.22-alpine3.19
|
||||
commands:
|
||||
- apk update
|
||||
- apk add --no-cache git
|
||||
- go test -tags purego -p 1 -failfast -timeout 20m -cover -gcflags=-d=checkptr -short -v .
|
||||
-
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: go-arm-asm
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
environment:
|
||||
GOPROXY: direct
|
||||
GOARCH: arm
|
||||
GOARM: 7
|
||||
GOOS: linux
|
||||
GOTRACEBACK: 2
|
||||
GOEXPERIMENT: "cgocheck2,newinliner"
|
||||
CGO_ENABLED: "0"
|
||||
|
||||
workspace:
|
||||
path: /drone/src
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.22-alpine3.19
|
||||
commands:
|
||||
- apk update
|
||||
- apk add --no-cache git
|
||||
- go test -p 1 -failfast -timeout 20m -cover -gcflags=-d=checkptr -short -v .
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: go-arm-purego
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
environment:
|
||||
GOPROXY: direct
|
||||
GOARCH: arm
|
||||
GOARM: 7
|
||||
GOOS: linux
|
||||
GOTRACEBACK: 2
|
||||
GOEXPERIMENT: "cgocheck2,newinliner"
|
||||
CGO_ENABLED: "0"
|
||||
|
||||
workspace:
|
||||
path: /drone/src
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.22-alpine3.19
|
||||
|
|
|
@ -22,7 +22,7 @@ For the C++ implementation and design of RandomX, see [github.com/tevador/Random
|
|||
|:---------------------:|:----------:|:--------------:|:------:|:----------:|:------:|:------:|:-------:|:------:|
|
||||
| purego | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| Full Mode | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ |
|
||||
| Float Operations | hw | **hw** | soft | **hw** | soft | soft | soft | soft |
|
||||
| Float Operations | hw | **hw** | **hw** | **hw** | soft | soft | soft | soft |
|
||||
| AES Operations | soft | **hw** | soft | soft | soft | soft | soft | soft |
|
||||
| Superscalar Execution | native | **native+jit** | native | native | native | native | native | native |
|
||||
| VM Execution | **native** | **native+jit** | soft | **native** | soft | soft | soft | soft |
|
||||
|
|
23
internal/asm/round_arm.go
Normal file
23
internal/asm/round_arm.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
//go:build (arm.6 || arm.7) && !purego
|
||||
|
||||
package asm
|
||||
|
||||
// GetFPSCR returns the value of FPSCR register.
|
||||
func getFPSCR() (value uint32)
|
||||
|
||||
// SetFPSCR writes the FPSCR value.
|
||||
func setFPSCR(value uint32)
|
||||
|
||||
func setRoundingMode(mode uint8) {
|
||||
switch mode {
|
||||
// switch plus/minus infinity
|
||||
case 1:
|
||||
mode = 2
|
||||
case 2:
|
||||
mode = 1
|
||||
|
||||
}
|
||||
fpscr := getFPSCR()
|
||||
fpscr = (fpscr & (^uint32(0x0C00000))) | ((uint32(mode) & 3) << 22)
|
||||
setFPSCR(fpscr)
|
||||
}
|
13
internal/asm/round_arm.s
Normal file
13
internal/asm/round_arm.s
Normal file
|
@ -0,0 +1,13 @@
|
|||
//go:build (arm.6 || arm.7) && !purego
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT ·getFPSCR(SB),NOSPLIT,$0-4
|
||||
WORD $0xeef1ba10 // vmrs r11, fpscr
|
||||
MOVW R11, value+0(FP)
|
||||
RET
|
||||
|
||||
TEXT ·setFPSCR(SB),NOSPLIT,$0-4
|
||||
MOVW value+0(FP), R11
|
||||
WORD $0xeee1ba10 // vmsr fpscr, r11
|
||||
RET
|
|
@ -1,4 +1,4 @@
|
|||
//go:build (!arm64 && !amd64 && !386) || purego
|
||||
//go:build (!arm64 && !(arm.6 || arm.7) && !amd64 && !386) || purego
|
||||
|
||||
package asm
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//go:build (arm64 || amd64 || 386) && !purego
|
||||
//go:build (arm64 || arm.6 || arm.7 || amd64 || 386) && !purego
|
||||
|
||||
package randomx
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//go:build (!arm64 && !amd64 && !386) || purego
|
||||
//go:build (!arm64 && !(arm.6 || arm.7) && !amd64 && !386) || purego
|
||||
|
||||
package randomx
|
||||
|
||||
|
|
Loading…
Reference in a new issue