diff options
| author | Xiaolin Zhao <zhaoxiaolin@loongson.cn> | 2024-06-06 16:06:39 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-08-03 02:48:45 +0000 |
| commit | 40876244739f787fd9a4eb06503cc122b6c5ce52 (patch) | |
| tree | 802c6e7c9ba28d192bd1ad52ee2eec3c2e06fe27 /src/cmd/internal | |
| parent | b874005a84253e9c4313eb30889df418d607ed4d (diff) | |
| download | go-40876244739f787fd9a4eb06503cc122b6c5ce52.tar.xz | |
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>
Diffstat (limited to 'src/cmd/internal')
| -rw-r--r-- | src/cmd/internal/obj/loong64/a.out.go | 10 | ||||
| -rw-r--r-- | src/cmd/internal/obj/loong64/anames.go | 8 | ||||
| -rw-r--r-- | src/cmd/internal/obj/loong64/asm.go | 24 |
3 files changed, 42 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/loong64/a.out.go b/src/cmd/internal/obj/loong64/a.out.go index 878f148f15..4dc7a84994 100644 --- a/src/cmd/internal/obj/loong64/a.out.go +++ b/src/cmd/internal/obj/loong64/a.out.go @@ -454,6 +454,16 @@ const ( AFCLASSF AFCLASSD + // 3.2.3.2 + AFFINTFW + AFFINTFV + AFFINTDW + AFFINTDV + AFTINTWF + AFTINTWD + AFTINTVF + AFTINTVD + ALAST // aliases diff --git a/src/cmd/internal/obj/loong64/anames.go b/src/cmd/internal/obj/loong64/anames.go index aac8ac92b8..2d80a8aa10 100644 --- a/src/cmd/internal/obj/loong64/anames.go +++ b/src/cmd/internal/obj/loong64/anames.go @@ -187,5 +187,13 @@ var Anames = []string{ "FCOPYSGD", "FCLASSF", "FCLASSD", + "FFINTFW", + "FFINTFV", + "FFINTDW", + "FFINTDV", + "FTINTWF", + "FTINTWD", + "FTINTVF", + "FTINTVD", "LAST", } diff --git a/src/cmd/internal/obj/loong64/asm.go b/src/cmd/internal/obj/loong64/asm.go index 6ac02df988..02ecbe71f6 100644 --- a/src/cmd/internal/obj/loong64/asm.go +++ b/src/cmd/internal/obj/loong64/asm.go @@ -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) |
