This is an archive of the discontinued LLVM Phabricator instance.

Use .set instead of = when printing assignment in assembly output
ClosedPublic

Authored by kparzysz on Mar 8 2018, 9:40 AM.

Details

Summary

The function EmitAssignment would simply print "x = y" for an assignment of y to x. On Hexagon "x = y" is a syntax used in most instructions, and is not treated as a directive.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz created this revision.Mar 8 2018, 9:40 AM
espindola edited reviewers, added: espindola; removed: rafael.Mar 15 2018, 8:33 AM

set works in all targets, no?

set works in all targets, no?

Probably. Are you suggesting changing to set for everybody? Should it still be hardcoded as ".set" (as it was for '=')?

set works in all targets, no?

Probably. Are you suggesting changing to set for everybody? Should it still be hardcoded as ".set" (as it was for '=')?

Yes. If there is a solution that works everywhere that is better than having a config option.

kparzysz updated this revision to Diff 139941.Mar 27 2018, 8:45 AM
kparzysz retitled this revision from Allow targets to specify syntax of assignment in assembler output to Use .set instead of = when printing assignment in assembly output.

Changed EmitAssignment to print .set instead of =, updated tests.

espindola accepted this revision.Mar 27 2018, 9:22 AM
espindola added a reviewer: rnk.

LGTM, but please wait for a second opinion. rnk?

For what it is worth, gcc printed assembly uses .set too.

This revision is now accepted and ready to land.Mar 27 2018, 9:23 AM
rnk accepted this revision.Mar 27 2018, 9:31 AM

lgtm

I always preferred the = spelling, but if this matches what GCC emits and works around Hexagon assembler issues, I'm OK with it.

This revision was automatically updated to reflect the committed changes.