Added 386 platform to round and tests
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
38b0377f45
commit
1b2b3c22cb
27
.drone.yml
27
.drone.yml
|
@ -18,6 +18,33 @@ environment:
|
|||
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 -v .
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: from-source-386
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
environment:
|
||||
GOPROXY: direct
|
||||
GOARCH: 386
|
||||
GO386: sse2
|
||||
GOOS: linux
|
||||
GOTRACEBACK: 2
|
||||
GOEXPERIMENT: "cgocheck2,newinliner"
|
||||
CGO_ENABLED: "0"
|
||||
|
||||
workspace:
|
||||
path: /drone/src
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.22-alpine3.19
|
||||
|
|
20
fpu/round_386.go
Normal file
20
fpu/round_386.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
//go:build 386
|
||||
|
||||
package fpu
|
||||
|
||||
// stmxcsr reads the MXCSR control and status register.
|
||||
//
|
||||
//go:noescape
|
||||
func stmxcsr(addr *uint32)
|
||||
|
||||
// ldmxcsr writes to the MXCSR control and status register.
|
||||
//
|
||||
//go:noescape
|
||||
func ldmxcsr(addr *uint32)
|
||||
|
||||
func setRoundingMode(mode uint8) {
|
||||
var csr uint32
|
||||
stmxcsr(&csr)
|
||||
csr = (csr & (^uint32(0x6000))) | ((uint32(mode) & 3) << 13)
|
||||
ldmxcsr(&csr)
|
||||
}
|
13
fpu/round_386.s
Normal file
13
fpu/round_386.s
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "textflag.h"
|
||||
|
||||
// stmxcsr reads the MXCSR control and status register.
|
||||
TEXT ·stmxcsr(SB),NOSPLIT|NOFRAME,$0-4
|
||||
MOVL addr+0(FP), SI
|
||||
STMXCSR (SI)
|
||||
RET
|
||||
|
||||
// ldmxcsr writes to the MXCSR control and status register.
|
||||
TEXT ·ldmxcsr(SB),NOSPLIT|NOFRAME,$0-4
|
||||
MOVL addr+0(FP), SI
|
||||
LDMXCSR (SI)
|
||||
RET
|
|
@ -1,4 +1,4 @@
|
|||
//go:build !arm64 && !amd64
|
||||
//go:build !arm64 && !amd64 && !386
|
||||
|
||||
package fpu
|
||||
|
||||
|
|
Loading…
Reference in a new issue