aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authorCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>2018-01-10 15:29:50 -0200
committerLynn Boger <laboger@linux.vnet.ibm.com>2018-03-13 19:46:54 +0000
commite1f8fe8dff31136ec2c3f3ba83fbeee9f2ef4c3b (patch)
treeaa91be8e1cdefd2a29b25a4aebdf4ca552e8769b /src/cmd/asm
parentca9abbb731a6d1f824dd755afde83e5727dab3c6 (diff)
downloadgo-e1f8fe8dff31136ec2c3f3ba83fbeee9f2ef4c3b.tar.xz
cmd/internal/obj/ppc64: implement full operand support for l*arx instructions
The current implementation of l*arx instructions does not accept non-zero offsets in RA nor the EH field. This change adds full functionality to those instructions. Updates #23845 Change-Id: If113f70d11de5f35f8389520b049390dbc40e863 Reviewed-on: https://go-review.googlesource.com/99635 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/ppc64.s20
-rw-r--r--src/cmd/asm/internal/asm/testdata/ppc64enc.s14
2 files changed, 34 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s
index e34671231f..c6150573fc 100644
--- a/src/cmd/asm/internal/asm/testdata/ppc64.s
+++ b/src/cmd/asm/internal/asm/testdata/ppc64.s
@@ -1199,6 +1199,26 @@ label1:
CALL foo(SB)
RET foo(SB)
+// load-and-reserve
+// L*AR (RB)(RA*1),EH,RT produces
+// l*arx RT,RA,RB,EH
+//
+// Extended forms also accepted. Assumes RA=0, EH=0:
+// L*AR (RB),RT
+// L*AR (RB),EH,RT
+ LBAR (R4)(R3*1), $1, R5
+ LBAR (R4), $0, R5
+ LBAR (R3), R5
+ LHAR (R4)(R3*1), $1, R5
+ LHAR (R4), $0, R5
+ LHAR (R3), R5
+ LWAR (R4)(R3*1), $1, R5
+ LWAR (R4), $0, R5
+ LWAR (R3), R5
+ LDAR (R4)(R3*1), $1, R5
+ LDAR (R4), $0, R5
+ LDAR (R3), R5
+
// END
//
// LEND comma // asm doesn't support the trailing comma.
diff --git a/src/cmd/asm/internal/asm/testdata/ppc64enc.s b/src/cmd/asm/internal/asm/testdata/ppc64enc.s
index f39c0728eb..7ab1a578f8 100644
--- a/src/cmd/asm/internal/asm/testdata/ppc64enc.s
+++ b/src/cmd/asm/internal/asm/testdata/ppc64enc.s
@@ -84,4 +84,18 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
XOR $1234567, R5 // 641f001263ffd6877fe52a78
XOR $1234567, R5, R3 // 641f001263ffd6877fe32a78
+ // load-and-reserve
+ LBAR (R4)(R3*1),$1,R5 // 7ca32069
+ LBAR (R4),$0,R5 // 7ca02068
+ LBAR (R3),R5 // 7ca01868
+ LHAR (R4)(R3*1),$1,R5 // 7ca320e9
+ LHAR (R4),$0,R5 // 7ca020e8
+ LHAR (R3),R5 // 7ca018e8
+ LWAR (R4)(R3*1),$1,R5 // 7ca32029
+ LWAR (R4),$0,R5 // 7ca02028
+ LWAR (R3),R5 // 7ca01828
+ LDAR (R4)(R3*1),$1,R5 // 7ca320a9
+ LDAR (R4),$0,R5 // 7ca020a8
+ LDAR (R3),R5 // 7ca018a8
+
RET