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
Родитель 212bafe4da
Коммит bfa3d86f7b
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -1046,6 +1046,14 @@ static const spv_operand_desc_t functionControlEntries[] = {
};
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",
MemorySemanticsMaskNone,
SPV_OPCODE_FLAGS_NONE,

Просмотреть файл

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