cmd/internal/obj/loong64: remove the incorrect unsigned instructions

The loong64 ISA does not support the 32-bit unsigned arithmetic
instructions ADDU, SUBU and MULU.

Change-Id: Ifa67de9c59aa12d08844189ed23e6daad0cc11ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/722760
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Xiaolin Zhao 2025-11-21 17:22:05 +08:00 committed by abner chenc
parent c048a9a11f
commit c6d64f8556
7 changed files with 5 additions and 38 deletions

View file

@ -1431,7 +1431,6 @@ func buildop(ctxt *obj.Link) {
opset(AADDW, r0)
opset(ASGT, r0)
opset(ASGTU, r0)
opset(AADDU, r0)
case AADDV:
opset(AADDVU, r0)
@ -1514,13 +1513,11 @@ func buildop(ctxt *obj.Link) {
case ASUB:
opset(ASUBW, r0)
opset(ASUBU, r0)
opset(ANOR, r0)
opset(ASUBV, r0)
opset(ASUBVU, r0)
opset(AMUL, r0)
opset(AMULW, r0)
opset(AMULU, r0)
opset(AMULH, r0)
opset(AMULHU, r0)
opset(AREM, r0)
@ -2296,8 +2293,7 @@ func (c *ctxt0) asmout(p *obj.Prog, o *Optab, out []uint32) {
o5 := uint32(0)
o6 := uint32(0)
add := AADDU
add = AADDVU
add := AADDVU
switch o.type_ {
default:
@ -2428,7 +2424,7 @@ func (c *ctxt0) asmout(p *obj.Prog, o *Optab, out []uint32) {
v := c.regoff(&p.From)
a := AOR
if v < 0 {
a = AADDU
a = AADD
}
o1 = OP_12IRR(c.opirr(a), uint32(v), uint32(0), uint32(REGTMP))
r := int(p.Reg)
@ -2687,7 +2683,7 @@ func (c *ctxt0) asmout(p *obj.Prog, o *Optab, out []uint32) {
case 34: // mov $con,fr
v := c.regoff(&p.From)
a := AADDU
a := AADD
if v > 0 {
a = AOR
}
@ -3317,8 +3313,6 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
switch a {
case AADD, AADDW:
return 0x20 << 15
case AADDU:
return 0x20 << 15
case ASGT:
return 0x24 << 15 // SLT
case ASGTU:
@ -3337,9 +3331,7 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
return 0x2c << 15 // orn
case AANDN:
return 0x2d << 15 // andn
case ASUB, ASUBW:
return 0x22 << 15
case ASUBU, ANEGW:
case ASUB, ASUBW, ANEGW:
return 0x22 << 15
case ANOR:
return 0x28 << 15
@ -3370,8 +3362,6 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
case AMUL, AMULW:
return 0x38 << 15 // mul.w
case AMULU:
return 0x38 << 15 // mul.w
case AMULH:
return 0x39 << 15 // mulh.w
case AMULHU:
@ -4684,7 +4674,7 @@ func (c *ctxt0) opir(a obj.As) uint32 {
func (c *ctxt0) opirr(a obj.As) uint32 {
switch a {
case AADD, AADDW, AADDU:
case AADD, AADDW:
return 0x00a << 22
case ASGT:
return 0x008 << 22