1
0
mirror of https://github.com/golang/go synced 2024-11-22 10:44:41 -07:00

cmd/internal/obj/loong64: add support for instructions FFINT.{S/D}.{W/L} and FTINT.{W/L}.{S/D}

Go asm syntax:
	FFINT{F/D}{W/V}		FJ, FD
	FTINT{W/V}{F/D}		FJ, FD

Equivalent platform assembler syntax:
	ffint.{s/d}.{w/l}	fd, fj
	ftint.{w/l}.{s/d}	fd, fj

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

Change-Id: Ie7646c5d49645c63b274b34b66539f10370f4930
Reviewed-on: https://go-review.googlesource.com/c/go/+/590996
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Auto-Submit: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Qiqi Huang <huangqiqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
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>
This commit is contained in:
Xiaolin Zhao 2024-06-06 16:06:39 +08:00 committed by Gopher Robot
parent b874005a84
commit 4087624473
4 changed files with 51 additions and 0 deletions

View File

@ -283,3 +283,12 @@ lable2:
FCOPYSGD F4, F5, F6 // a6101301
FCLASSF F4, F5 // 85341401
FCLASSD F4, F5 // 85381401
FFINTFW F0, F1 // 01101d01
FFINTFV F0, F1 // 01181d01
FFINTDW F0, F1 // 01201d01
FFINTDV F0, F1 // 01281d01
FTINTWF F0, F1 // 01041b01
FTINTWD F0, F1 // 01081b01
FTINTVF F0, F1 // 01241b01
FTINTVD F0, F1 // 01281b01

View File

@ -454,6 +454,16 @@ const (
AFCLASSF
AFCLASSD
// 3.2.3.2
AFFINTFW
AFFINTFV
AFFINTDW
AFFINTDV
AFTINTWF
AFTINTWD
AFTINTVF
AFTINTVD
ALAST
// aliases

View File

@ -187,5 +187,13 @@ var Anames = []string{
"FCOPYSGD",
"FCLASSF",
"FCLASSD",
"FFINTFW",
"FFINTFV",
"FFINTDW",
"FFINTDV",
"FTINTWF",
"FTINTWD",
"FTINTVF",
"FTINTVD",
"LAST",
}

View File

@ -1037,6 +1037,14 @@ func buildop(ctxt *obj.Link) {
opset(AMOVDV, r0)
opset(ATRUNCDV, r0)
opset(ATRUNCFV, r0)
opset(AFFINTFW, r0)
opset(AFFINTFV, r0)
opset(AFFINTDW, r0)
opset(AFFINTDV, r0)
opset(AFTINTWF, r0)
opset(AFTINTWD, r0)
opset(AFTINTVF, r0)
opset(AFTINTVD, r0)
case AADD:
opset(ASGT, r0)
@ -1964,6 +1972,22 @@ func (c *ctxt0) oprr(a obj.As) uint32 {
return 0x450d << 10 // fclass.s
case AFCLASSD:
return 0x450e << 10 // fclass.d
case AFFINTFW:
return 0x4744 << 10 // ffint.s.w
case AFFINTFV:
return 0x4746 << 10 // ffint.s.l
case AFFINTDW:
return 0x4748 << 10 // ffint.d.w
case AFFINTDV:
return 0x474a << 10 // ffint.d.l
case AFTINTWF:
return 0x46c1 << 10 // ftint.w.s
case AFTINTWD:
return 0x46c2 << 10 // ftint.w.d
case AFTINTVF:
return 0x46c9 << 10 // ftint.l.s
case AFTINTVD:
return 0x46ca << 10 // ftint.l.d
}
c.ctxt.Diag("bad rr opcode %v", a)