cmd/internal/obj/loong64: add support for instructions F{MAX/NIN}.{S/D}

Go asm syntax:
	F{MAX/MIN}{F/D}		FK, FJ, FD

Equivalent platform assembler syntax:
	f{max/min}.{s/d}	fd, fj, fk

Ref: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html

Change-Id: Ib11fed1fe3700be5ebba33b5818661c4071b7b7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/590676
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: abner chenc <chenguoqi@loongson.cn>
This commit is contained in:
Xiaolin Zhao 2024-04-10 11:37:56 +08:00 committed by Gopher Robot
parent 9abd11440c
commit e761921688
4 changed files with 31 additions and 0 deletions

View file

@ -1052,6 +1052,10 @@ func buildop(ctxt *obj.Link) {
opset(ASUBF, r0)
opset(ASUBD, r0)
opset(AADDD, r0)
opset(AFMINF, r0)
opset(AFMIND, r0)
opset(AFMAXF, r0)
opset(AFMAXD, r0)
case AAND:
opset(AOR, r0)
@ -1872,6 +1876,14 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
return 0x0c2<<20 | 0x3<<15 // FCMP.SLT.D
case ACMPGTF:
return 0x0c1<<20 | 0x3<<15 // FCMP.SLT.S
case AFMINF:
return 0x215 << 15 // fmin.s
case AFMIND:
return 0x216 << 15 // fmin.d
case AFMAXF:
return 0x211 << 15 // fmax.s
case AFMAXD:
return 0x212 << 15 // fmax.d
}
if a < 0 {