Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(42)

Issue 1733046: code review 1733046: 6l: implement MOVLQZX as "mov", not "movsxd" (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years ago by rsc
Modified:
15 years ago
Reviewers:
ken3
CC:
ken2, golang-dev
Visibility:
Public.

Description

6l: implement MOVLQZX as "mov", not "movsxd" (Here, quoted strings are the official AMD names.) The amd64 "movsxd" instruction, when invoked with a 64-bit REX prefix, moves and sign extends a 32-bit value from register or memory into a 64-bit register. 6.out.h spells this MOVLQSX. 6.out.h also includes MOVLQZX, the zero extending version, which it implements as "movsxd" without the REX prefix. Without the REX prefix it's only sign extending 32 bits to 32 bits (i.e., not doing anything to the bits) and then storing in a 32-bit register. Any write to a 32-bit register zeros the top half of the corresponding 64-bit register, giving the advertised effect. This particular implementation of the functionality is non-standard, because an ordinary 32-bit "mov" would do the same thing. Because it is non-standard, it is often mishandled or not handled by binary translation tools like valgrind. Switching to the standard "mov" makes the binaries work better with those tools. It's probably useful in 6c and 6g to have an explicit instruction, though, so that the intent of the size change is clear. Thus we leave the concept of MOVLQZX and just implement it by the standard "mov" instead of the non-standard 32-bit "movsxd". Fixes issue 896.

Patch Set 1 #

Patch Set 2 : code review 1733046: 6l: implement MOVLQZX as "mov", not "movsxd" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M src/cmd/6l/optab.c View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
rsc
Hello ken2 (cc: golang-dev@googlegroups.com), I'd like you to review this change.
15 years ago (2010-07-01 19:18:34 UTC) #1
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=060260a3f89b *** 6l: implement MOVLQZX as "mov", not "movsxd" (Here, quoted strings ...
15 years ago (2010-07-01 19:18:37 UTC) #2
ken3
15 years ago (2010-07-01 19:50:44 UTC) #3
LGTM
drop the comment?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b