This is an archive of the discontinued LLVM Phabricator instance.

[Sparc] Accept %0 through %31 as registers in assembly code.
AbandonedPublic

Authored by dougk on Aug 21 2015, 7:34 PM.

Details

Reviewers
jyknight
Summary

This syntax appears in actual code in the wild, and is valid according to gnu as.

Diff Detail

Event Timeline

dougk updated this revision to Diff 32893.Aug 21 2015, 7:34 PM
dougk retitled this revision from to [Sparc] Accept %0 through %31 as registers in assembly code..
dougk updated this object.
dougk added a reviewer: jyknight.
dougk added a subscriber: llvm-commits.
jyknight edited edge metadata.Aug 21 2015, 8:17 PM
jyknight added a subscriber: jyknight.

I'm not sure this is actually a good idea. The asm file in question seems
to me probably to have just been a typo. (Says %0 in one place, instead of
%g0 or 0.)

Unless there's more widespread usage of this, I think it might be better to
treat that "%0" usage as a bug, and just fix it, rather than adding support
for this confusing register-naming variant in llvm.

Solaris 'as' also doesn't accept that syntax.
$ echo "mov %0, %g1" > /tmp/test.s
$ as -o /tmp/test.o /tmp/test.s
as: "/tmp/test.s", line 1: error: statement syntax

dougk abandoned this revision.Sep 8 2015, 5:57 AM