Memory semantics Relaxed is a synonym for None

The disassembler should prefer to print Relaxed,
I think. (Untested.)
This commit is contained in:
David Neto 2015-09-25 10:30:27 -04:00
parent 212bafe4da
commit bfa3d86f7b
2 changed files with 10 additions and 0 deletions

View File

@ -1046,6 +1046,14 @@ static const spv_operand_desc_t functionControlEntries[] = {
}; };
static const spv_operand_desc_t memorySemanticsEntries[] = { static const spv_operand_desc_t memorySemanticsEntries[] = {
// "Relaxed" should be a synonym for "None".
// Put the Relaxed entry first so that the disassembler
// will prefer to emit "Relaxed".
{"Relaxed",
MemorySemanticsMaskNone,
SPV_OPCODE_FLAGS_NONE,
0,
{SPV_OPERAND_TYPE_NONE}},
{"None", {"None",
MemorySemanticsMaskNone, MemorySemanticsMaskNone,
SPV_OPCODE_FLAGS_NONE, SPV_OPCODE_FLAGS_NONE,

View File

@ -58,6 +58,8 @@ INSTANTIATE_TEST_CASE_P(
TextToBinaryMemorySemanticsTest, MemorySemanticsTest, TextToBinaryMemorySemanticsTest, MemorySemanticsTest,
::testing::ValuesIn(std::vector<EnumCase<spv::MemorySemanticsMask>>{ ::testing::ValuesIn(std::vector<EnumCase<spv::MemorySemanticsMask>>{
{spv::MemorySemanticsMaskNone, "None", {}}, {spv::MemorySemanticsMaskNone, "None", {}},
// Relaxed is a synonym for None.
{spv::MemorySemanticsMaskNone, "Relaxed", {}},
CASE(Acquire), CASE(Acquire),
CASE(Release), CASE(Release),
CASE(SequentiallyConsistent), CASE(SequentiallyConsistent),