mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj/loong64: add support for instructions FCOPYSIGN.{S/D} and FCLASS.{S/D}
Go asm syntax:
FCOPYSG{F/D} FK, FJ, FD
FCLASSF{F/D} FJ, FD
Equivalent platform assembler syntax:
fcopysign.{s/d} fd, fj, fk
fclass.{s/d} fd, fj
Ref: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
Change-Id: Ied34b71c9d0b34456ac5782a59d29d2d0229e326
Reviewed-on: https://go-review.googlesource.com/c/go/+/590675
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
2ffcfcef55
commit
b874005a84
4 changed files with 29 additions and 0 deletions
|
|
@ -1028,6 +1028,8 @@ func buildop(ctxt *obj.Link) {
|
|||
opset(ATRUNCFW, r0)
|
||||
opset(ASQRTF, r0)
|
||||
opset(ASQRTD, r0)
|
||||
opset(AFCLASSF, r0)
|
||||
opset(AFCLASSD, r0)
|
||||
|
||||
case AMOVVF:
|
||||
opset(AMOVVD, r0)
|
||||
|
|
@ -1056,6 +1058,8 @@ func buildop(ctxt *obj.Link) {
|
|||
opset(AFMIND, r0)
|
||||
opset(AFMAXF, r0)
|
||||
opset(AFMAXD, r0)
|
||||
opset(AFCOPYSGF, r0)
|
||||
opset(AFCOPYSGD, r0)
|
||||
|
||||
case AAND:
|
||||
opset(AOR, r0)
|
||||
|
|
@ -1884,6 +1888,10 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
|
|||
return 0x211 << 15 // fmax.s
|
||||
case AFMAXD:
|
||||
return 0x212 << 15 // fmax.d
|
||||
case AFCOPYSGF:
|
||||
return 0x225 << 15 // fcopysign.s
|
||||
case AFCOPYSGD:
|
||||
return 0x226 << 15 // fcopysign.d
|
||||
}
|
||||
|
||||
if a < 0 {
|
||||
|
|
@ -1952,6 +1960,10 @@ func (c *ctxt0) oprr(a obj.As) uint32 {
|
|||
return 0x4511 << 10
|
||||
case ASQRTD:
|
||||
return 0x4512 << 10
|
||||
case AFCLASSF:
|
||||
return 0x450d << 10 // fclass.s
|
||||
case AFCLASSD:
|
||||
return 0x450e << 10 // fclass.d
|
||||
}
|
||||
|
||||
c.ctxt.Diag("bad rr opcode %v", a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue