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 ANDN and ORN
Go asm syntax:
ANDN/ORN RK, RJ, RD
or ANDN/ORN RK, RD
Equivalent platform assembler syntax:
andn/orn rd, rj, rk
or andn/orn rd, rd, rk
Ref: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
Change-Id: I6d240ecae8f9443811ca450aed3574f13f0f4a81
Reviewed-on: https://go-review.googlesource.com/c/go/+/610475
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
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:
parent
501b389efc
commit
db07c8607a
4 changed files with 17 additions and 0 deletions
|
|
@ -132,6 +132,11 @@ lable2:
|
||||||
BREAK // 00002a00
|
BREAK // 00002a00
|
||||||
UNDEF // 00002a00
|
UNDEF // 00002a00
|
||||||
|
|
||||||
|
ANDN R4, R5, R6 // a6901600
|
||||||
|
ANDN R4, R5 // a5901600
|
||||||
|
ORN R4, R5, R6 // a6101600
|
||||||
|
ORN R4, R5 // a5101600
|
||||||
|
|
||||||
// mul
|
// mul
|
||||||
MUL R4, R5 // a5101c00
|
MUL R4, R5 // a5101c00
|
||||||
MUL R4, R5, R6 // a6101c00
|
MUL R4, R5, R6 // a6101c00
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,10 @@ const (
|
||||||
AMOVVF
|
AMOVVF
|
||||||
AMOVVD
|
AMOVVD
|
||||||
|
|
||||||
|
// 2.2.1.8
|
||||||
|
AORN
|
||||||
|
AANDN
|
||||||
|
|
||||||
// 2.2.7. Atomic Memory Access Instructions
|
// 2.2.7. Atomic Memory Access Instructions
|
||||||
AAMSWAPB
|
AAMSWAPB
|
||||||
AAMSWAPH
|
AAMSWAPH
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,8 @@ var Anames = []string{
|
||||||
"MOVDV",
|
"MOVDV",
|
||||||
"MOVVF",
|
"MOVVF",
|
||||||
"MOVVD",
|
"MOVVD",
|
||||||
|
"ORN",
|
||||||
|
"ANDN",
|
||||||
"AMSWAPB",
|
"AMSWAPB",
|
||||||
"AMSWAPH",
|
"AMSWAPH",
|
||||||
"AMSWAPW",
|
"AMSWAPW",
|
||||||
|
|
|
||||||
|
|
@ -1100,6 +1100,8 @@ func buildop(ctxt *obj.Link) {
|
||||||
case AAND:
|
case AAND:
|
||||||
opset(AOR, r0)
|
opset(AOR, r0)
|
||||||
opset(AXOR, r0)
|
opset(AXOR, r0)
|
||||||
|
opset(AORN, r0)
|
||||||
|
opset(AANDN, r0)
|
||||||
|
|
||||||
case ABEQ:
|
case ABEQ:
|
||||||
opset(ABNE, r0)
|
opset(ABNE, r0)
|
||||||
|
|
@ -1858,6 +1860,10 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
|
||||||
return 0x2a << 15
|
return 0x2a << 15
|
||||||
case AXOR:
|
case AXOR:
|
||||||
return 0x2b << 15
|
return 0x2b << 15
|
||||||
|
case AORN:
|
||||||
|
return 0x2c << 15 // orn
|
||||||
|
case AANDN:
|
||||||
|
return 0x2d << 15 // andn
|
||||||
case ASUB:
|
case ASUB:
|
||||||
return 0x22 << 15
|
return 0x22 << 15
|
||||||
case ASUBU, ANEGW:
|
case ASUBU, ANEGW:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue