From 39dd3a1bf29eb0c7346086828c9902ef74c9748f Mon Sep 17 00:00:00 2001 From: natgavrilenko Date: Mon, 25 Nov 2024 13:19:29 +0100 Subject: [PATCH] Cleanup vulkan parser (#787) --- dartagnan/src/main/antlr4/LitmusVulkan.g4 | 165 ++++----- .../exception/AbortErrorListener.java | 2 +- .../dartagnan/exception/ParsingException.java | 6 +- .../dartagnan/parsers/cat/VisitorCat.java | 4 +- .../program/visitors/VisitorLitmusVulkan.java | 333 +++++++----------- .../visitors/spirv/VisitorOpsBarrier.java | 7 +- .../visitors/spirv/helpers/HelperTags.java | 10 +- .../dartagnan/program/event/EventFactory.java | 17 +- .../dat3m/dartagnan/program/event/Tag.java | 4 +- .../compilation/VisitorSpirvVulkan.java | 217 ++++++------ .../processing/compilation/VisitorVulkan.java | 130 +++---- .../visitors/spirv/VisitorOpsMemoryTest.java | 4 +- .../spirv/helpers/HelperTagsTest.java | 14 +- .../compilation/VisitorSpirvVulkanTest.java | 200 ++++------- .../spirv/basic/SpirvChecksTest.java | 151 ++++++++ .../spirv/benchmarks/SpirvAssertionsTest.java | 22 -- .../spirv/benchmarks/SpirvChecksTest.java | 11 - .../spirv/benchmarks/SpirvRacesTest.java | 10 - .../spirv/gpuverify/SpirvChecksTest.java | 11 +- .../src/test/resources/VULKAN-CK-expected.csv | 11 +- .../spirv/basic/builtin-all-123.spv.dis | 36 +- .../spirv/basic/builtin-all-321.spv.dis | 36 +- .../spirv/basic/builtin-constant.spv.dis | 8 +- .../basic/builtin-default-config.spv.dis | 8 +- .../spirv/basic/builtin-variable.spv.dis | 8 +- .../spirv/basic/memory-scopes.spv.dis | 2 +- .../spirv/basic/rmw-extremum-false.spv.dis | 6 +- .../spirv/basic/rmw-extremum-true.spv.dis | 6 +- .../benchmarks/xf-barrier-zero-1.1.2.spv.dis | 201 ----------- .../benchmarks/xf-barrier-zero-2.1.1.spv.dis | 201 ----------- .../benchmarks/xf-barrier-zero-2.1.2.spv.dis | 201 ----------- .../benchmarks/xf-barrier-zero-3.1.3.spv.dis | 203 ----------- .../benchmarks/xf-barrier-zero-fail1.spv.dis | 201 ----------- .../benchmarks/xf-barrier-zero-fail2.spv.dis | 201 ----------- .../benchmarks/xf-barrier-zero-fail3.spv.dis | 201 ----------- .../benchmarks/xf-barrier-zero-fail4.spv.dis | 201 ----------- .../xf-barrier-zero-weakest.spv.dis | 199 ----------- .../atomics/atomic_read_race.spv.dis | 4 +- .../spirv/gpuverify/atomics/counter.spv.dis | 4 +- .../gpuverify/atomics/equality_fail.spv.dis | 4 +- .../spirv/gpuverify/atomics/forloop.spv.dis | 4 +- .../spirv/gpuverify/atomics/histo.spv.dis | 4 +- .../bad_local_counters.spv.dis | 4 +- .../intra_local_counters.spv.dis | 4 +- .../fail/no_barrier_flags.spv.dis | 4 +- .../spirv/gpuverify/mem_fence.spv.dis | 11 +- .../VULKAN/Data-Race/mp3acqrel-filter.litmus | 6 +- .../Data-Race/noncohandatom-filter.litmus | 2 +- .../Data-Race/releaseseq3-filter.litmus | 2 +- .../Data-Race/releaseseq4-filter.litmus | 2 +- litmus/VULKAN/Kronos-Group/mp3acqrel.litmus | 6 +- .../VULKAN/Kronos-Group/noncohandatom.litmus | 2 +- litmus/VULKAN/Kronos-Group/releaseseq3.litmus | 2 +- litmus/VULKAN/Kronos-Group/releaseseq4.litmus | 2 +- .../VULKAN/Manual/MP-mesa-fence-loop.litmus | 2 +- litmus/VULKAN/Manual/MP-mesa-load-acq.litmus | 2 +- litmus/VULKAN/Manual/MP-mesa-optimized.litmus | 2 +- litmus/VULKAN/Manual/MP-mesa.litmus | 2 +- .../Manual/xf-barrier-cbar-rlx-1.litmus | 2 +- .../Manual/xf-barrier-cbar-rlx-2.litmus | 2 +- .../Manual/xf-barrier-cbar-rlx-3.litmus | 4 +- .../Manual/xf-barrier-load-rlx-1.litmus | 2 +- .../Manual/xf-barrier-load-rlx-2.litmus | 2 +- .../Manual/xf-barrier-store-rlx-1.litmus | 2 +- .../Manual/xf-barrier-store-rlx-2.litmus | 2 +- 65 files changed, 740 insertions(+), 2599 deletions(-) create mode 100644 dartagnan/src/test/java/com/dat3m/dartagnan/spirv/basic/SpirvChecksTest.java delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-1.1.2.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.1.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.2.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-3.1.3.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail1.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail2.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail3.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail4.spv.dis delete mode 100644 dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-weakest.spv.dis diff --git a/dartagnan/src/main/antlr4/LitmusVulkan.g4 b/dartagnan/src/main/antlr4/LitmusVulkan.g4 index 483a3cd86e..228fdc47f7 100644 --- a/dartagnan/src/main/antlr4/LitmusVulkan.g4 +++ b/dartagnan/src/main/antlr4/LitmusVulkan.g4 @@ -83,8 +83,12 @@ queuefamilyScope : Queuefamily scopeID ; +scopeID returns [int id] + : t = DigitSequence {$id = Integer.parseInt($t.text);} + ; + instructionList - : (instructionRow) + + : instructionRow+ ; instructionRow @@ -95,75 +99,60 @@ instruction : | storeInstruction | loadInstruction - | rmwInstruction - | fenceInstruction + | atomicStoreInstruction + | atomicLoadInstruction + | atomicRmwInstruction + | memoryBarrierInstruction + | controlBarrierInstruction + | localInstruction + | labelInstruction + | jumpInstruction + | condJumpInstruction | deviceOperation - | label - | branchCond - | jump ; storeInstruction - : Store atomic mo? avvis? scope? storageClass storageClassSemanticList avvisSemanticList location Comma value + : Store (nonpriv | (av scope))? sc location Comma value ; loadInstruction - : localValue - | localAdd - | localSub - | localMul - | localDiv - | loadLocation - ; - -localValue - : Load atomic mo? avvis? scope? storageClass storageClassSemanticList avvisSemanticList register Comma value + : Load (nonpriv | (vis scope))? sc register Comma location ; -localAdd - : Add register Comma value Comma value +atomicStoreInstruction + : Store Period Atom (scope sc | moRel scope sc semSc+ semAv?) location Comma value ; -localSub - : Sub register Comma value Comma value +atomicLoadInstruction + : Load Period Atom (scope sc | moAcq scope sc semSc+ semVis?) register Comma location ; -localMul - : Mul register Comma value Comma value +atomicRmwInstruction + : RMW Period Atom (scope sc | moAcq scope sc semSc+ semVis? | moRel scope sc semSc+ semAv? | moAcqRel scope sc semSc+ semAv? semVis?) (Period operation)? register Comma location Comma value ; -localDiv - : Div register Comma value Comma value +memoryBarrierInstruction + : MemoryBarrier (moAcq scope semSc+ semVis? | moRel scope semSc+ semAv? | moAcqRel scope semSc+ semAv? semVis?) ; -loadLocation - : Load atomic mo? avvis? scope? storageClass storageClassSemanticList avvisSemanticList register Comma location +controlBarrierInstruction + : ControlBarrier (scope | moAcq scope semSc+ semVis? | moRel scope semSc+ semAv? | moAcqRel scope semSc+ semAv? semVis?) value ; -rmwInstruction - : rmwValue - | rmwOp +localInstruction + : operation register Comma value Comma value ; -rmwValue - : RMW atomic mo? avvis? scope? storageClass storageClassSemanticList avvisSemanticList register Comma location Comma value - ; - -rmwOp - : RMW atomic mo? avvis? scope? storageClass storageClassSemanticList avvisSemanticList operation register Comma location Comma value - ; - -fenceInstruction - : memoryBarrier - | controlBarrier +labelInstruction + : Label Colon ; -memoryBarrier - : MemoryBarrier mo? avvis? scope? storageClassSemanticList avvisSemanticList +jumpInstruction + : Goto Label ; -controlBarrier - : ControlBarrier mo? avvis? scope? storageClassSemanticList avvisSemanticList value +condJumpInstruction + : cond value Comma value Comma Label ; deviceOperation @@ -171,18 +160,6 @@ deviceOperation | VISDEVICE ; -label - : Label Colon - ; - -branchCond - : cond value Comma value Comma Label - ; - -jump - : Goto Label - ; - value : constant | register @@ -202,65 +179,63 @@ assertionValue | constant ; -atomic returns [Boolean isAtomic] - : Period Atom {$isAtomic = true;} - | {$isAtomic = false;} +moAcq + : Period Acquire ; -scope returns [String content] - : Period Subgroup {$content = "SG";} - | Period Workgroup {$content = "WG";} - | Period Queuefamily {$content = "QF";} - | Period Device {$content = "DV";} - | Period Nonprivate {$content = "NONPRIV";} +moRel + : Period Release ; -scopeID returns [int id] - : t = DigitSequence {$id = Integer.parseInt($t.text);} +moAcqRel + : Period Acq_rel ; -mo returns [String content] - : Period Acquire {$content = "ACQ";} - | Period Release {$content = "REL";} - | Period Acq_rel {$content = "ACQ_REL";} +nonpriv + : Period Nonprivate ; -avvis returns [String content] - : Period Visible {$content = "VIS";} - | Period Available {$content = "AV";} +av + : Period Available ; -storageClass returns [String content] - : Period Sc0 {$content = "SC0";} - | Period Sc1 {$content = "SC1";} +vis + : Period Visible ; -storageClassSemantic returns [String content] - : Period Semsc0 {$content = "SEMSC0";} - | Period Semsc1 {$content = "SEMSC1";} +semAv + : Period SemAv ; -storageClassSemanticList - : (storageClassSemantic)* +semVis + : Period SemVis ; -avvisSemantic returns [String content] - : Period SemVis {$content = "SEMVIS";} - | Period SemAv {$content = "SEMAV";} +scope returns [String content] + : Period Subgroup {$content = "SG";} + | Period Workgroup {$content = "WG";} + | Period Queuefamily {$content = "QF";} + | Period Device {$content = "DV";} ; -avvisSemanticList - : (avvisSemantic)* +sc returns [String content] + : Period Sc0 {$content = "SC0";} + | Period Sc1 {$content = "SC1";} + ; + +semSc returns [String content] + : Period Semsc0 {$content = "SEMSC0";} + | Period Semsc1 {$content = "SEMSC1";} ; operation locals [IntBinaryOp op] - : Period Add {$op = IntBinaryOp.ADD;} - | Period Sub {$op = IntBinaryOp.SUB;} - | Period Mul {$op = IntBinaryOp.MUL;} - | Period Div {$op = IntBinaryOp.DIV;} - | Period And {$op = IntBinaryOp.AND;} - | Period Or {$op = IntBinaryOp.OR;} - | Period Xor {$op = IntBinaryOp.XOR;} + : Add {$op = IntBinaryOp.ADD;} + | Sub {$op = IntBinaryOp.SUB;} + | Mul {$op = IntBinaryOp.MUL;} + | Div {$op = IntBinaryOp.DIV;} + | And {$op = IntBinaryOp.AND;} + | Or {$op = IntBinaryOp.OR;} + | Xor {$op = IntBinaryOp.XOR;} ; cond returns [IntCmpOp op] diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/exception/AbortErrorListener.java b/dartagnan/src/main/java/com/dat3m/dartagnan/exception/AbortErrorListener.java index 96fe5d686e..669e1bc2b2 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/exception/AbortErrorListener.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/exception/AbortErrorListener.java @@ -15,6 +15,6 @@ public void syntaxError( String msg, RecognitionException e ) throws ParsingException { - throw new ParsingException("Line " + line + ":" + charPositionInLine + " " + msg); + throw new ParsingException(e, "Line " + line + ":" + charPositionInLine + " " + msg); } } \ No newline at end of file diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/exception/ParsingException.java b/dartagnan/src/main/java/com/dat3m/dartagnan/exception/ParsingException.java index f80d5ed119..8c30fce8b9 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/exception/ParsingException.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/exception/ParsingException.java @@ -7,6 +7,10 @@ public ParsingException(String msg){ } public ParsingException(String format, Object... args){ - this(String.format(format, args)); + super(String.format(format, args)); + } + + public ParsingException(Throwable cause, String format, Object... args){ + super(String.format(format, args), cause); } } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/cat/VisitorCat.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/cat/VisitorCat.java index 6e2e803d5a..0c1468565a 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/cat/VisitorCat.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/cat/VisitorCat.java @@ -72,7 +72,7 @@ private void includeStdlib() { final CatParser parser = getParser(CharStreams.fromPath(Path.of(GlobalSettings.getCatDirectory() + "/stdlib.cat"))); parser.mcm().accept(this); } catch (IOException e) { - throw new ParsingException("Error parsing stdlib.cat file", e); + throw new ParsingException(e, "Error parsing stdlib.cat file"); } } @@ -107,7 +107,7 @@ public Object visitInclude(IncludeContext ctx) { final CatParser parser = getParser(CharStreams.fromPath(filePath)); return parser.mcm().accept(this); } catch (IOException e) { - throw new ParsingException(String.format("Error parsing file '%s'", filePath), e); + throw new ParsingException(e, String.format("Error parsing file '%s'", filePath)); } } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusVulkan.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusVulkan.java index 70cf15ed62..8255f76f2c 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusVulkan.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusVulkan.java @@ -4,7 +4,6 @@ import com.dat3m.dartagnan.exception.ParsingException; import com.dat3m.dartagnan.expression.Expression; import com.dat3m.dartagnan.expression.ExpressionFactory; -import com.dat3m.dartagnan.expression.integers.IntBinaryOp; import com.dat3m.dartagnan.expression.integers.IntLiteral; import com.dat3m.dartagnan.expression.type.IntegerType; import com.dat3m.dartagnan.expression.type.TypeFactory; @@ -15,17 +14,14 @@ import com.dat3m.dartagnan.program.Register; import com.dat3m.dartagnan.program.event.Event; import com.dat3m.dartagnan.program.event.EventFactory; -import com.dat3m.dartagnan.program.event.MemoryEvent; import com.dat3m.dartagnan.program.event.Tag; -import com.dat3m.dartagnan.program.event.arch.vulkan.VulkanRMW; -import com.dat3m.dartagnan.program.event.arch.vulkan.VulkanRMWOp; +import com.dat3m.dartagnan.program.event.common.SingleAccessMemoryEvent; import com.dat3m.dartagnan.program.event.core.Label; import com.dat3m.dartagnan.program.event.core.Load; import com.dat3m.dartagnan.program.event.core.Store; import com.dat3m.dartagnan.program.memory.MemoryObject; +import org.antlr.v4.runtime.ParserRuleContext; -import java.util.ArrayList; -import java.util.List; public class VisitorLitmusVulkan extends LitmusVulkanBaseVisitor { private final ProgramBuilder programBuilder = ProgramBuilder.forArch(Program.SourceLanguage.LITMUS, Arch.VULKAN); @@ -35,9 +31,6 @@ public class VisitorLitmusVulkan extends LitmusVulkanBaseVisitor { private int mainThread; private int threadCount = 0; - public VisitorLitmusVulkan() { - } - // ---------------------------------------------------------------------------------------------------------------- // Entry point @@ -136,24 +129,6 @@ public Object visitRegister(LitmusVulkanParser.RegisterContext ctx) { return programBuilder.getOrNewRegister(mainThread, ctx.getText(), archType); } - @Override - public Object visitStorageClassSemanticList(LitmusVulkanParser.StorageClassSemanticListContext ctx) { - List storageClassSemantics = new ArrayList<>(); - for (LitmusVulkanParser.StorageClassSemanticContext scSemantic : ctx.storageClassSemantic()) { - storageClassSemantics.add(scSemantic.content); - } - return storageClassSemantics; - } - - @Override - public Object visitAvvisSemanticList(LitmusVulkanParser.AvvisSemanticListContext ctx) { - List avvisSemantics = new ArrayList<>(); - for (LitmusVulkanParser.AvvisSemanticContext avvisSemantic : ctx.avvisSemantic()) { - avvisSemantics.add(avvisSemantic.content); - } - return avvisSemantics; - } - @Override public Object visitInstructionRow(LitmusVulkanParser.InstructionRowContext ctx) { for (int i = 0; i < threadCount; i++) { @@ -167,216 +142,163 @@ public Object visitInstructionRow(LitmusVulkanParser.InstructionRowContext ctx) public Object visitStoreInstruction(LitmusVulkanParser.StoreInstructionContext ctx) { MemoryObject object = programBuilder.getOrNewMemoryObject(ctx.location().getText()); Expression value = (Expression) ctx.value().accept(this); - Boolean atomic = ctx.atomic().isAtomic; - Store store; - if (ctx.mo() != null) { - store = EventFactory.newStoreWithMo(object, value, ctx.mo().content); - } else { - store = EventFactory.newStore(object, value); - } - if (ctx.avvis() != null) { - store.addTags(ctx.avvis().content); + Store store = EventFactory.newStore(object, value); + store.addTags(ctx.sc().content); + if (ctx.nonpriv() != null) { + store.addTags(Tag.Vulkan.NON_PRIVATE); } - if (ctx.scope() != null) { + if (ctx.av() != null) { + store.addTags(Tag.Vulkan.NON_PRIVATE); + store.addTags(Tag.Vulkan.AVAILABLE); store.addTags(ctx.scope().content); } - String mo = (ctx.mo() != null) ? ctx.mo().content : ""; - String avvis = (ctx.avvis() != null) ? ctx.avvis().content : ""; - String scope = (ctx.scope() != null) ? ctx.scope().content : ""; - String storageClass = ctx.storageClass().content; - List storageClassSemantics = (List) ctx.storageClassSemanticList().accept(this); - List avvisSemantics = (List) ctx.avvisSemanticList().accept(this); - if (!mo.isEmpty() && !mo.equals(Tag.Vulkan.RELEASE) && !avvis.isEmpty() && !avvis.equals(Tag.Vulkan.AVAILABLE)) { - throw new ParsingException("Stores must be release or available"); - } - tagControl(store, atomic, mo, avvis, scope, storageClass, storageClassSemantics, avvisSemantics); return programBuilder.addChild(mainThread, store); } @Override - public Object visitLocalValue(LitmusVulkanParser.LocalValueContext ctx) { - Register register = (Register) ctx.register().accept(this); - Expression value = (Expression) ctx.value().accept(this); - return programBuilder.addChild(mainThread, EventFactory.newLocal(register, value)); - } - - @Override - public Object visitLocalAdd(LitmusVulkanParser.LocalAddContext ctx) { - Register rd = (Register) ctx.register().accept(this); - Expression lhs = (Expression) ctx.value(0).accept(this); - Expression rhs = (Expression) ctx.value(1).accept(this); - Expression exp = expressions.makeAdd(lhs, rhs); - return programBuilder.addChild(mainThread, EventFactory.newLocal(rd, exp)); - } - - @Override - public Object visitLocalSub(LitmusVulkanParser.LocalSubContext ctx) { - Register rd = (Register) ctx.register().accept(this); - Expression lhs = (Expression) ctx.value(0).accept(this); - Expression rhs = (Expression) ctx.value(1).accept(this); - Expression exp = expressions.makeSub(lhs, rhs); - return programBuilder.addChild(mainThread, EventFactory.newLocal(rd, exp)); - } - - @Override - public Object visitLocalMul(LitmusVulkanParser.LocalMulContext ctx) { - Register rd = (Register) ctx.register().accept(this); - Expression lhs = (Expression) ctx.value(0).accept(this); - Expression rhs = (Expression) ctx.value(1).accept(this); - Expression exp = expressions.makeMul(lhs, rhs); - return programBuilder.addChild(mainThread, EventFactory.newLocal(rd, exp)); - } - - @Override - public Object visitLocalDiv(LitmusVulkanParser.LocalDivContext ctx) { - Register rd = (Register) ctx.register().accept(this); - Expression lhs = (Expression) ctx.value(0).accept(this); - Expression rhs = (Expression) ctx.value(1).accept(this); - Expression exp = expressions.makeDiv(lhs, rhs, true); - return programBuilder.addChild(mainThread, EventFactory.newLocal(rd, exp)); - } - - @Override - public Object visitLoadLocation(LitmusVulkanParser.LoadLocationContext ctx) { + public Object visitLoadInstruction(LitmusVulkanParser.LoadInstructionContext ctx) { Register register = (Register) ctx.register().accept(this); MemoryObject location = programBuilder.getOrNewMemoryObject(ctx.location().getText()); - Boolean atomic = ctx.atomic().isAtomic; - Load load; - if (ctx.mo() != null) { - load = EventFactory.newLoadWithMo(register, location, ctx.mo().content); - } else { - load = EventFactory.newLoad(register, location); - } - if (ctx.avvis() != null) { - load.addTags(ctx.avvis().content); + Load load = EventFactory.newLoad(register, location); + load.addTags(ctx.sc().content); + if (ctx.nonpriv() != null) { + load.addTags(Tag.Vulkan.NON_PRIVATE); } - if (ctx.scope() != null) { + if (ctx.vis() != null) { + load.addTags(Tag.Vulkan.NON_PRIVATE); + load.addTags(Tag.Vulkan.VISIBLE); load.addTags(ctx.scope().content); } - String mo = (ctx.mo() != null) ? ctx.mo().content : ""; - String avvis = (ctx.avvis() != null) ? ctx.avvis().content : ""; - String scope = (ctx.scope() != null) ? ctx.scope().content : ""; - String storageClass = ctx.storageClass().content; - List storageClassSemantics = (List) ctx.storageClassSemanticList().accept(this); - List avvisSemantics = (List) ctx.avvisSemanticList().accept(this); - if (!mo.isEmpty() && !mo.equals(Tag.Vulkan.ACQUIRE) && !avvis.isEmpty() && !avvis.equals(Tag.Vulkan.VISIBLE)) { - throw new ParsingException("Loads must be acquire or visible"); - } - tagControl(load, atomic, mo, avvis, scope, storageClass, storageClassSemantics, avvisSemantics); return programBuilder.addChild(mainThread, load); } @Override - public Object visitRmwValue(LitmusVulkanParser.RmwValueContext ctx) { + public Object visitAtomicStoreInstruction(LitmusVulkanParser.AtomicStoreInstructionContext ctx) { + MemoryObject object = programBuilder.getOrNewMemoryObject(ctx.location().getText()); + Expression value = (Expression) ctx.value().accept(this); + String mo = ctx.moRel() != null ? Tag.Vulkan.RELEASE : Tag.Vulkan.ATOM; + Store store = EventFactory.newStoreWithMo(object, value, mo); + store.addTags( + Tag.Vulkan.ATOM, + Tag.Vulkan.NON_PRIVATE, + Tag.Vulkan.AVAILABLE, + ctx.scope().content, + ctx.sc().content + ); + if (ctx.semAv() != null) { + store.addTags(Tag.Vulkan.SEM_AVAILABLE); + } + store.addTags(ctx.semSc().stream().map(c -> c.content).toList()); + return programBuilder.addChild(mainThread, store); + } + + @Override + public Object visitAtomicLoadInstruction(LitmusVulkanParser.AtomicLoadInstructionContext ctx) { Register register = (Register) ctx.register().accept(this); MemoryObject location = programBuilder.getOrNewMemoryObject(ctx.location().getText()); - Expression value = (Expression) ctx.value().accept(this); - String mo = (ctx.mo() != null) ? ctx.mo().content : ""; - String avvis = (ctx.avvis() != null) ? ctx.avvis().content : ""; - String scope = (ctx.scope() != null) ? ctx.scope().content : ""; - String storageClass = ctx.storageClass().content; - List storageClassSemantics = (List) ctx.storageClassSemanticList().accept(this); - List avvisSemantics = (List) ctx.avvisSemanticList().accept(this); - VulkanRMW rmw = EventFactory.Vulkan.newRMW(location, register, value, mo, scope); - if (!avvis.isEmpty()) { - rmw.addTags(avvis); + String mo = ctx.moAcq() != null ? Tag.Vulkan.ACQUIRE : Tag.Vulkan.ATOM; + Load load = EventFactory.newLoadWithMo(register, location, mo); + load.addTags( + Tag.Vulkan.ATOM, + Tag.Vulkan.NON_PRIVATE, + Tag.Vulkan.VISIBLE, + ctx.scope().content, + ctx.sc().content + ); + if (ctx.semVis() != null) { + load.addTags(Tag.Vulkan.SEM_VISIBLE); } - tagControl(rmw, true, mo, avvis, scope, storageClass, storageClassSemantics, avvisSemantics); - return programBuilder.addChild(mainThread, rmw); + load.addTags(ctx.semSc().stream().map(c -> c.content).toList()); + return programBuilder.addChild(mainThread, load); } @Override - public Object visitRmwOp(LitmusVulkanParser.RmwOpContext ctx) { + public Object visitAtomicRmwInstruction(LitmusVulkanParser.AtomicRmwInstructionContext ctx) { Register register = (Register) ctx.register().accept(this); MemoryObject location = programBuilder.getOrNewMemoryObject(ctx.location().getText()); Expression value = (Expression) ctx.value().accept(this); - String mo = (ctx.mo() != null) ? ctx.mo().content : ""; - String avvis = (ctx.avvis() != null) ? ctx.avvis().content : ""; - String scope = (ctx.scope() != null) ? ctx.scope().content : ""; - String storageClass = ctx.storageClass().content; - IntBinaryOp op = ctx.operation().op; - List storageClassSemantics = (List) ctx.storageClassSemanticList().accept(this); - List avvisSemantics = (List) ctx.avvisSemanticList().accept(this); - VulkanRMWOp rmw = EventFactory.Vulkan.newRMWOp(location, register, value, op, mo, scope); - if (!avvis.isEmpty()) { - rmw.addTags(avvis); + String mo = getMemoryOrderOrDefault(ctx, Tag.Vulkan.ATOM); + SingleAccessMemoryEvent rmw = ctx.operation() != null + ? EventFactory.Vulkan.newRMWOp(location, register, value, ctx.operation().op, mo, ctx.scope().content) + : EventFactory.Vulkan.newRMW(location, register, value, mo, ctx.scope().content); + rmw.addTags( + Tag.Vulkan.NON_PRIVATE, + Tag.Vulkan.AVAILABLE, + Tag.Vulkan.VISIBLE, + ctx.sc().content + ); + if (ctx.semAv() != null) { + rmw.addTags(Tag.Vulkan.SEM_AVAILABLE); } - tagControl(rmw, true, mo, avvis, scope, storageClass, storageClassSemantics, avvisSemantics); + if (ctx.semVis() != null) { + rmw.addTags(Tag.Vulkan.SEM_VISIBLE); + } + rmw.addTags(ctx.semSc().stream().map(c -> c.content).toList()); return programBuilder.addChild(mainThread, rmw); } @Override - public Object visitMemoryBarrier(LitmusVulkanParser.MemoryBarrierContext ctx) { - String mo = (ctx.mo() != null) ? ctx.mo().content : ""; - String avvis = (ctx.avvis() != null) ? ctx.avvis().content : ""; - String scope = (ctx.scope() != null) ? ctx.scope().content : ""; - List storageClassSemantics = (List) ctx.storageClassSemanticList().accept(this); - List avvisSemantics = (List) ctx.avvisSemanticList().accept(this); - if (!mo.equals(Tag.Vulkan.ACQUIRE) && !mo.equals(Tag.Vulkan.RELEASE) && !mo.equals(Tag.Vulkan.ACQ_REL) - && !avvis.equals(Tag.Vulkan.AVAILABLE) && !avvis.equals(Tag.Vulkan.VISIBLE)) { - throw new ParsingException("Fences must be acquire, release, acq_rel, available or visible"); - } - Event fence = EventFactory.newFence(ctx.getText().toLowerCase()); - if (!mo.isEmpty()) { + public Object visitMemoryBarrierInstruction(LitmusVulkanParser.MemoryBarrierInstructionContext ctx) { + Event fence = EventFactory.newFence(Tag.FENCE); + String mo = getMemoryOrderOrDefault(ctx, null); + if (mo != null) { fence.addTags(mo); } - if (!avvis.isEmpty()) { - fence.addTags(avvis); + fence.addTags(ctx.scope().content); + if (ctx.semAv() != null) { + fence.addTags(Tag.Vulkan.SEM_AVAILABLE); } - if (!scope.isEmpty()) { - fence.addTags(scope); + if (ctx.semVis() != null) { + fence.addTags(Tag.Vulkan.SEM_VISIBLE); } - tagControl(fence, false, mo, avvis, scope, "", storageClassSemantics, avvisSemantics); + fence.addTags(ctx.semSc().stream().map(c -> c.content).toList()); return programBuilder.addChild(mainThread, fence); } @Override - public Object visitControlBarrier(LitmusVulkanParser.ControlBarrierContext ctx) { - String mo = (ctx.mo() != null) ? ctx.mo().content : ""; - String avvis = (ctx.avvis() != null) ? ctx.avvis().content : ""; - String scope = (ctx.scope() != null) ? ctx.scope().content : ""; - List storageClassSemantics = (List) ctx.storageClassSemanticList().accept(this); - List avvisSemantics = (List) ctx.avvisSemanticList().accept(this); + public Object visitControlBarrierInstruction(LitmusVulkanParser.ControlBarrierInstructionContext ctx) { Expression barrierId = (Expression) ctx.value().accept(this); String barrierIdString = ctx.getText().replace(barrierId.toString(), ""); Event barrier = EventFactory.newControlBarrier(barrierIdString.toLowerCase(), barrierId); - barrier.addTags(Tag.Vulkan.CBAR); - if (!mo.equals(Tag.Vulkan.ACQUIRE) && !mo.equals(Tag.Vulkan.RELEASE) && !mo.equals(Tag.Vulkan.ACQ_REL)) { - barrier.removeTags(Tag.FENCE); - } - if (!mo.isEmpty()) { + barrier.addTags(Tag.Vulkan.CBAR, ctx.scope().content); + String mo = getMemoryOrderOrDefault(ctx, null); + if (mo != null) { barrier.addTags(mo); + } else { + barrier.removeTags(Tag.FENCE); } - if (!avvis.isEmpty()) { - barrier.addTags(avvis); + if (ctx.semAv() != null) { + barrier.addTags(Tag.Vulkan.SEM_AVAILABLE); } - if (!scope.isEmpty()) { - barrier.addTags(scope); + if (ctx.semVis() != null) { + barrier.addTags(Tag.Vulkan.SEM_VISIBLE); } - tagControl(barrier, false, mo, avvis, scope, "", storageClassSemantics, avvisSemantics); + barrier.addTags(ctx.semSc().stream().map(c -> c.content).toList()); return programBuilder.addChild(mainThread, barrier); } @Override - public Object visitDeviceOperation(LitmusVulkanParser.DeviceOperationContext ctx) { - Event e; - if (ctx.getText().equalsIgnoreCase(Tag.Vulkan.AVDEVICE)) { - e = EventFactory.PTX.newAvDevice(); - } else if (ctx.getText().equalsIgnoreCase(Tag.Vulkan.VISDEVICE)) { - e = EventFactory.PTX.newVisDevice(); - } else { - throw new ParsingException("Unknown device operation"); - } - return programBuilder.addChild(mainThread, e); + public Object visitLocalInstruction(LitmusVulkanParser.LocalInstructionContext ctx) { + Register rd = (Register) ctx.register().accept(this); + Expression lhs = (Expression) ctx.value(0).accept(this); + Expression rhs = (Expression) ctx.value(1).accept(this); + Expression exp = expressions.makeIntBinary(lhs, ctx.operation().op, rhs); + return programBuilder.addChild(mainThread, EventFactory.newLocal(rd, exp)); } @Override - public Object visitLabel(LitmusVulkanParser.LabelContext ctx) { + public Object visitLabelInstruction(LitmusVulkanParser.LabelInstructionContext ctx) { return programBuilder.addChild(mainThread, programBuilder.getOrCreateLabel(mainThread, ctx.Label().getText())); } @Override - public Object visitBranchCond(LitmusVulkanParser.BranchCondContext ctx) { + public Object visitJumpInstruction(LitmusVulkanParser.JumpInstructionContext ctx) { + Label label = programBuilder.getOrCreateLabel(mainThread, ctx.Label().getText()); + return programBuilder.addChild(mainThread, EventFactory.newGoto(label)); + } + + @Override + public Object visitCondJumpInstruction(LitmusVulkanParser.CondJumpInstructionContext ctx) { Label label = programBuilder.getOrCreateLabel(mainThread, ctx.Label().getText()); Expression lhs = (Expression) ctx.value(0).accept(this); Expression rhs = (Expression) ctx.value(1).accept(this); @@ -385,41 +307,28 @@ public Object visitBranchCond(LitmusVulkanParser.BranchCondContext ctx) { } @Override - public Object visitJump(LitmusVulkanParser.JumpContext ctx) { - Label label = programBuilder.getOrCreateLabel(mainThread, ctx.Label().getText()); - return programBuilder.addChild(mainThread, EventFactory.newGoto(label)); - } - - private void tagControl(Event e, Boolean atomic, String mo, String avvis, String scope, String storageClass, - List storageClassSemantics, List avvisSemantics) { - if (!storageClass.isEmpty()) { - e.addTags(storageClass); - } - e.addTags(storageClassSemantics); - e.addTags(avvisSemantics); - if (atomic) { - e.addTags(Tag.Vulkan.ATOM); - } - - // ACQ_REL is both ACQ and REL - if (mo.equals(Tag.Vulkan.ACQ_REL)) { - e.addTags(Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE); + public Object visitDeviceOperation(LitmusVulkanParser.DeviceOperationContext ctx) { + Event e; + if (ctx.getText().equalsIgnoreCase(Tag.Vulkan.AVDEVICE)) { + e = EventFactory.Vulkan.newAvDevice(); + } else if (ctx.getText().equalsIgnoreCase(Tag.Vulkan.VISDEVICE)) { + e = EventFactory.Vulkan.newVisDevice(); + } else { + throw new ParsingException("Unknown device operation"); } + return programBuilder.addChild(mainThread, e); + } - // AV, VIS, and atomics M are all implicitly nonpriv - if ((avvis.equals(Tag.Vulkan.AVAILABLE) || avvis.equals(Tag.Vulkan.VISIBLE) || atomic) - && (e instanceof MemoryEvent)) { - e.addTags(Tag.Vulkan.NON_PRIVATE); + private String getMemoryOrderOrDefault(ParserRuleContext ctx, String defaultMo) { + if (ctx.getRuleContext(LitmusVulkanParser.MoAcqContext.class, 0) != null) { + return Tag.Vulkan.ACQUIRE; } - - // Atomics implicitly have AV/VIS ops, hence they are implicitly nonpriv - if (atomic && e instanceof Store) { - e.addTags(Tag.Vulkan.AVAILABLE); - e.addTags(Tag.Vulkan.NON_PRIVATE); + if(ctx.getRuleContext(LitmusVulkanParser.MoRelContext.class, 0) != null) { + return Tag.Vulkan.RELEASE; } - if (atomic && e instanceof Load) { - e.addTags(Tag.Vulkan.VISIBLE); - e.addTags(Tag.Vulkan.NON_PRIVATE); + if (ctx.getRuleContext(LitmusVulkanParser.MoAcqRelContext.class, 0) != null) { + return Tag.Vulkan.ACQ_REL; } + return defaultMo; } } \ No newline at end of file diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsBarrier.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsBarrier.java index 56a7d0bca5..5bca8490cc 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsBarrier.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsBarrier.java @@ -28,13 +28,14 @@ public VisitorOpsBarrier(ProgramBuilder builder) { @Override public Event visitOpControlBarrier(SpirvParser.OpControlBarrierContext ctx) { - if (!ctx.execution().getText().equals(ctx.memory().getText())) { - throw new ParsingException("Unequal scopes in OpControlBarrier are not supported"); + String execScope = getScopeTag(ctx.execution().getText()); + if (!Tag.Spirv.WORKGROUP.equals(execScope)) { + throw new ParsingException("Control barrier with execution scope other than workgroup is not supported"); } Expression barrierId = expressions.makeValue(nextBarrierId++, archType); Event barrier = EventFactory.newControlBarrier("cbar", barrierId); barrier.addTags(Tag.Spirv.CONTROL); - barrier.addTags(getScopeTag(ctx.execution().getText())); + barrier.addTags(getScopeTag(ctx.memory().getText())); Set tags = getMemorySemanticsTags(ctx.semantics().getText()); if (Set.of(Tag.Spirv.RELAXED).equals(tags)) { barrier.removeTags(Tag.FENCE); diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTags.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTags.java index e8819c6789..46fbf837f0 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTags.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTags.java @@ -23,14 +23,14 @@ public static Set parseMemorySemanticsTags(String id, Expression expr) { for (int i = 1; i <= value; i <<= 1) { if ((i & value) > 0) { if (!semantics.containsKey(i)) { - throw new ParsingException("Unexpected memory semantics bits"); + throw new ParsingException("Illegal memory semantics '%s': unexpected bits", value); } tags.add(semantics.get(i)); } } int moSize = Sets.intersection(moTags, tags).size(); if (moSize > 1) { - throw new ParsingException("Selected multiple non-relaxed memory order bits"); + throw new ParsingException("Illegal memory semantics '%s': multiple non-relaxed memory order bits", value); } if (moSize == 0) { tags.add(RELAXED); @@ -59,8 +59,12 @@ public static Set parseMemoryOperandsTags(List operands, Integer if (i != paramsValues.size()) { throwIllegalParametersException(operands); } + if (!tagSet.contains(MEM_NON_PRIVATE) && (tagSet.contains(Tag.Spirv.MEM_AVAILABLE) || tagSet.contains(MEM_VISIBLE))) { + throw new ParsingException("Missing NonPrivatePointer bit in memory operands '%s'", + String.join("|", operands)); + } // TODO: Implementation: this is a legal combination for OpCopyMemory and OpCopyMemorySized - if (tagSet.contains(Tag.Spirv.MEM_VISIBLE) && tagSet.contains(Tag.Spirv.MEM_AVAILABLE)) { + if (tagSet.contains(MEM_AVAILABLE) && tagSet.contains(MEM_VISIBLE)) { throw new ParsingException("Unsupported combination of memory operands '%s'", String.join("|", operands)); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java index 3620948a03..b8185aa230 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java @@ -742,15 +742,6 @@ public static PTXRedOp newRedOp(Expression address, Expression value, red.addTags(scope); return red; } - - public static GenericVisibleEvent newAvDevice() { - return new GenericVisibleEvent("avdevice", Tag.Vulkan.AVDEVICE); - } - - public static GenericVisibleEvent newVisDevice() { - return new GenericVisibleEvent("visdevice", Tag.Vulkan.VISDEVICE); - } - } // ============================================================================================= @@ -778,6 +769,14 @@ public static VulkanCmpXchg newVulkanCmpXchg(Expression address, Register regist Expression value, String mo, String scope) { return new VulkanCmpXchg(register, address, expected, value, mo, scope); } + + public static GenericVisibleEvent newAvDevice() { + return new GenericVisibleEvent("avdevice", Tag.Vulkan.AVDEVICE); + } + + public static GenericVisibleEvent newVisDevice() { + return new GenericVisibleEvent("visdevice", Tag.Vulkan.VISDEVICE); + } } // ============================================================================================= diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/Tag.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/Tag.java index 843083fe63..9227ebc33f 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/Tag.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/Tag.java @@ -357,14 +357,14 @@ public static List getScopeTags() { public static String loadMO(String mo) { return switch (mo) { case ACQ_REL, ACQUIRE -> ACQUIRE; - default -> ""; + default -> ATOM; }; } public static String storeMO(String mo) { return switch (mo) { case ACQ_REL, RELEASE -> RELEASE; - default -> ""; + default -> ATOM; }; } } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkan.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkan.java index 62b4010b85..928f5215e5 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkan.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkan.java @@ -1,5 +1,6 @@ package com.dat3m.dartagnan.program.processing.compilation; +import com.dat3m.dartagnan.exception.ParsingException; import com.dat3m.dartagnan.program.event.Event; import com.dat3m.dartagnan.program.event.EventFactory; import com.dat3m.dartagnan.program.event.Tag; @@ -24,67 +25,80 @@ public class VisitorSpirvVulkan extends VisitorVulkan { @Override public List visitLoad(Load e) { Event load = EventFactory.newLoad(e.getResultRegister(), e.getAddress()); - load.removeTags(load.getTags()); - load.addTags(toVulkanTags(e.getTags())); - return eventSequence(load); + return eventSequence(addVulkanTags(e, load)); } @Override public List visitStore(Store e) { Event store = EventFactory.newStore(e.getAddress(), e.getMemValue()); - store.removeTags(store.getTags()); - store.addTags(toVulkanTags(e.getTags())); - return eventSequence(store); + return eventSequence(addVulkanTags(e, store)); } @Override public List visitSpirvLoad(SpirvLoad e) { - e.addTags(Tag.Spirv.MEM_VISIBLE, Tag.Spirv.MEM_NON_PRIVATE); String mo = moToVulkanTag(Tag.Spirv.getMoTag(e.getTags())); Load load = newLoadWithMo(e.getResultRegister(), e.getAddress(), mo); - load.setFunction(e.getFunction()); - load.addTags(Tag.Vulkan.ATOM); - load.addTags(toVulkanTags(e.getTags())); - replaceAcqRelTag(load, Tag.Vulkan.ACQUIRE); - return eventSequence(load); + load.addTags(Tag.Vulkan.ATOM, Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.VISIBLE); + return eventSequence(addVulkanTags(e, load)); } @Override public List visitSpirvStore(SpirvStore e) { - e.addTags(Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.MEM_NON_PRIVATE); String mo = moToVulkanTag(Tag.Spirv.getMoTag(e.getTags())); Store store = newStoreWithMo(e.getAddress(), e.getMemValue(), mo); - store.setFunction(e.getFunction()); - store.addTags(Tag.Vulkan.ATOM); - store.addTags(toVulkanTags(e.getTags())); - replaceAcqRelTag(store, Tag.Vulkan.RELEASE); - return eventSequence(store); + store.addTags(Tag.Vulkan.ATOM, Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.AVAILABLE); + return eventSequence(addVulkanTags(e, store)); + } + + @Override + public List visitGenericVisibleEvent(GenericVisibleEvent e) { + GenericVisibleEvent fence = new GenericVisibleEvent(e.getName(), Tag.FENCE); + addVulkanTags(e, fence); + return super.visitGenericVisibleEvent(fence); + } + + @Override + public List visitControlBarrier(ControlBarrier e) { + ControlBarrier barrier = EventFactory.newControlBarrier(e.getName(), e.getId()); + addVulkanTags(e, barrier); + if (!e.hasTag(Tag.FENCE)) { + barrier.removeTags(Tag.FENCE); + } + return super.visitControlBarrier(barrier); } @Override public List visitSpirvXchg(SpirvXchg e) { - e.addTags(Tag.Spirv.MEM_VISIBLE, Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.MEM_NON_PRIVATE); String mo = moToVulkanTag(Tag.Spirv.getMoTag(e.getTags())); String scope = toVulkanTag(Tag.Spirv.getScopeTag(e.getTags())); - VulkanRMW rmw = EventFactory.Vulkan.newRMW(e.getAddress(), e.getResultRegister(), - e.getValue(), mo, scope); - rmw.addTags(toVulkanTags(e.getTags())); - rmw.setFunction(e.getFunction()); + VulkanRMW rmw = EventFactory.Vulkan.newRMW(e.getAddress(), e.getResultRegister(), e.getValue(), mo, scope); + rmw.addTags(Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.AVAILABLE, Tag.Vulkan.VISIBLE); + addVulkanTags(e, rmw); return visitVulkanRMW(rmw); } @Override public List visitSpirvRMW(SpirvRmw e) { - e.addTags(Tag.Spirv.MEM_VISIBLE, Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.MEM_NON_PRIVATE); String mo = moToVulkanTag(Tag.Spirv.getMoTag(e.getTags())); String scope = toVulkanTag(Tag.Spirv.getScopeTag(e.getTags())); - VulkanRMWOp rmwOp = EventFactory.Vulkan.newRMWOp(e.getAddress(), e.getResultRegister(), - e.getOperand(), e.getOperator(), mo, scope); - rmwOp.setFunction(e.getFunction()); - rmwOp.addTags(toVulkanTags(e.getTags())); + VulkanRMWOp rmwOp = EventFactory.Vulkan.newRMWOp(e.getAddress(), e.getResultRegister(), e.getOperand(), + e.getOperator(), mo, scope); + rmwOp.addTags(Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.AVAILABLE, Tag.Vulkan.VISIBLE); + addVulkanTags(e, rmwOp); return visitVulkanRMWOp(rmwOp); } + @Override + public List visitSpirvRmwExtremum(SpirvRmwExtremum e) { + String mo = moToVulkanTag(Tag.Spirv.getMoTag(e.getTags())); + String scope = toVulkanTag(Tag.Spirv.getScopeTag(e.getTags())); + VulkanRMWExtremum rmw = EventFactory.Vulkan.newRMWExtremum(e.getAddress(), e.getResultRegister(), + e.getOperator(), e.getValue(), mo, scope); + addVulkanTags(e, rmw); + rmw.addTags(Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.AVAILABLE, Tag.Vulkan.VISIBLE); + return visitVulkanRMWExtremum(rmw); + } + @Override public List visitSpirvCmpXchg(SpirvCmpXchg e) { Set eqTags = new HashSet<>(e.getEqTags()); @@ -100,64 +114,43 @@ public List visitSpirvCmpXchg(SpirvCmpXchg e) { "Spir-V CmpXchg with unequal tag sets is not supported"); } String scope = toVulkanTag(Tag.Spirv.getScopeTag(e.getTags())); - eqTags.addAll(Set.of(Tag.Spirv.MEM_VISIBLE, Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.MEM_NON_PRIVATE)); VulkanCmpXchg cmpXchg = EventFactory.Vulkan.newVulkanCmpXchg(e.getAddress(), e.getResultRegister(), e.getExpectedValue(), e.getStoreValue(), moToVulkanTag(spvMoEq), scope); - cmpXchg.setFunction(e.getFunction()); - cmpXchg.addTags(toVulkanTags(eqTags)); - + addVulkanTags(e, cmpXchg); + cmpXchg.addTags(Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.AVAILABLE, Tag.Vulkan.VISIBLE); return visitVulkanCmpXchg(cmpXchg); } - @Override - public List visitSpirvRmwExtremum(SpirvRmwExtremum e) { - e.addTags(Tag.Spirv.MEM_VISIBLE, Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.MEM_NON_PRIVATE); - String mo = moToVulkanTag(Tag.Spirv.getMoTag(e.getTags())); - String scope = toVulkanTag(Tag.Spirv.getScopeTag(e.getTags())); - VulkanRMWExtremum rmw = EventFactory.Vulkan.newRMWExtremum(e.getAddress(), e.getResultRegister(), - e.getOperator(), e.getValue(), mo, scope); - rmw.setFunction(e.getFunction()); - rmw.addTags(toVulkanTags(e.getTags())); - return visitVulkanRMWExtremum(rmw); - } - - @Override - public List visitGenericVisibleEvent(GenericVisibleEvent e) { - Event fence = new GenericVisibleEvent(e.getName(), Tag.FENCE); - fence.removeTags(fence.getTags()); - fence.addTags(toVulkanTags(e.getTags())); - replaceAcqRelTag(fence, Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE); - return eventSequence(fence); - } - - @Override - public List visitControlBarrier(ControlBarrier e) { - Event barrier = EventFactory.newControlBarrier(e.getName(), e.getId()); - barrier.removeTags(barrier.getTags()); - barrier.addTags(toVulkanTags(e.getTags())); - replaceAcqRelTag(barrier, Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE); - return eventSequence(barrier); - } - - private Set toVulkanTags(Set tags) { - Set vTags = new HashSet<>(); - tags.forEach(tag -> { + private Event addVulkanTags(Event source, Event target) { + source.getTags().forEach(tag -> { if (Tag.Spirv.isSpirvTag(tag)) { String vTag = toVulkanTag(tag); if (vTag != null) { - vTags.add(vTag); + target.addTags(vTag); } } else { - vTags.add(tag); + target.addTags(tag); } }); - return vTags; + target.setFunction(source.getFunction()); + validateSemanticsTags(target.getTags()); + return target; } - private void replaceAcqRelTag(Event e, String... tags) { - if (e.getTags().contains(Tag.Vulkan.ACQ_REL)) { - e.addTags(tags); - e.removeTags(Tag.Vulkan.ACQ_REL); + private void validateSemanticsTags(Set tags) { + boolean hasMoTags = tags.contains(Tag.Vulkan.ACQUIRE) || tags.contains(Tag.Vulkan.RELEASE) || tags.contains(Tag.Vulkan.ACQ_REL); + boolean hasSemScTags = tags.contains(Tag.Vulkan.SEMSC0) || tags.contains(Tag.Vulkan.SEMSC1); + if (hasMoTags && !hasSemScTags) { + throw new ParsingException("Non-relaxed semantics must have storage class semantics tags"); + } + if (hasSemScTags && !hasMoTags) { + throw new ParsingException("Storage class semantics requires memory order tags"); + } + if (tags.contains(Tag.Vulkan.SEM_AVAILABLE) && !tags.contains(Tag.Vulkan.RELEASE) && !tags.contains(Tag.Vulkan.ACQ_REL)) { + throw new ParsingException("Available semantics must have release tag"); + } + if (tags.contains(Tag.Vulkan.SEM_VISIBLE) && !tags.contains(Tag.Vulkan.ACQUIRE) && !tags.contains(Tag.Vulkan.ACQ_REL)) { + throw new ParsingException("Visible semantics must have acquire tag"); } } @@ -170,68 +163,58 @@ private String moToVulkanTag(String moSpv) { private String toVulkanTag(String tag) { return switch (tag) { - // Barriers + // Control barrier case Tag.Spirv.CONTROL -> Tag.Vulkan.CBAR; - // Memory order - case Tag.Spirv.RELAXED -> null; - case Tag.Spirv.ACQUIRE -> Tag.Vulkan.ACQUIRE; - case Tag.Spirv.RELEASE -> Tag.Vulkan.RELEASE; - case Tag.Spirv.ACQ_REL, - Tag.Spirv.SEQ_CST -> Tag.Vulkan.ACQ_REL; + // Storage class + case Tag.Spirv.SC_UNIFORM_CONSTANT, Tag.Spirv.SC_PUSH_CONSTANT + -> null; // read-only + case Tag.Spirv.SC_INPUT, Tag.Spirv.SC_PRIVATE, Tag.Spirv.SC_FUNCTION + -> null; // private + case Tag.Spirv.SC_UNIFORM, Tag.Spirv.SC_OUTPUT, Tag.Spirv.SC_STORAGE_BUFFER, Tag.Spirv.SC_PHYS_STORAGE_BUFFER + -> Tag.Vulkan.SC0; + case Tag.Spirv.SC_WORKGROUP + -> Tag.Vulkan.SC1; + case Tag.Spirv.SC_CROSS_WORKGROUP, Tag.Spirv.SC_GENERIC + -> throw new UnsupportedOperationException( + String.format("Spir-V storage class '%s' is not supported by Vulkan memory model", tag)); // Scope case Tag.Spirv.SUBGROUP -> Tag.Vulkan.SUB_GROUP; case Tag.Spirv.WORKGROUP -> Tag.Vulkan.WORK_GROUP; case Tag.Spirv.QUEUE_FAMILY -> Tag.Vulkan.QUEUE_FAMILY; - // TODO: Refactoring of the cat model - // In the cat file AV/VISSHADER uses device domain, - // and device domain is mapped to AV/VISDEVICE - case Tag.Spirv.INVOCATION, - Tag.Spirv.SHADER_CALL, - Tag.Spirv.DEVICE, - Tag.Spirv.CROSS_DEVICE -> Tag.Vulkan.DEVICE; - - // Memory access (non-atomic) - case Tag.Spirv.MEM_VOLATILE, - Tag.Spirv.MEM_NONTEMPORAL -> null; + // TODO: The model does not distinguish between these scopes + case Tag.Spirv.INVOCATION, Tag.Spirv.SHADER_CALL, Tag.Spirv.DEVICE, Tag.Spirv.CROSS_DEVICE -> Tag.Vulkan.DEVICE; + + // Memory operands (non-atomic) + case Tag.Spirv.MEM_VOLATILE, Tag.Spirv.MEM_NONTEMPORAL -> null; case Tag.Spirv.MEM_NON_PRIVATE -> Tag.Vulkan.NON_PRIVATE; case Tag.Spirv.MEM_AVAILABLE -> Tag.Vulkan.AVAILABLE; case Tag.Spirv.MEM_VISIBLE -> Tag.Vulkan.VISIBLE; - // Memory semantics + // Memory semantics (misc) case Tag.Spirv.SEM_VOLATILE -> null; - case Tag.Spirv.SEM_AVAILABLE -> Tag.Vulkan.SEM_AVAILABLE; - case Tag.Spirv.SEM_VISIBLE -> Tag.Vulkan.SEM_VISIBLE; + + // Memory semantics (memory order) + case Tag.Spirv.RELAXED -> null; + case Tag.Spirv.ACQUIRE -> Tag.Vulkan.ACQUIRE; + case Tag.Spirv.RELEASE -> Tag.Vulkan.RELEASE; + case Tag.Spirv.ACQ_REL -> Tag.Vulkan.ACQ_REL; + case Tag.Spirv.SEQ_CST -> throw new UnsupportedOperationException( + String.format("Spir-V memory order '%s' is not supported by Vulkan memory model", tag)); // Memory semantics (storage class) case Tag.Spirv.SEM_UNIFORM, Tag.Spirv.SEM_OUTPUT -> Tag.Vulkan.SEMSC0; case Tag.Spirv.SEM_WORKGROUP -> Tag.Vulkan.SEMSC1; - case Tag.Spirv.SEM_SUBGROUP, - Tag.Spirv.SEM_CROSS_WORKGROUP, - Tag.Spirv.SEM_ATOMIC_COUNTER, - Tag.Spirv.SEM_IMAGE -> throw new UnsupportedOperationException( - String.format("Spir-V memory semantics '%s' " + - "is not supported by Vulkan memory model", tag)); + case Tag.Spirv.SEM_SUBGROUP, Tag.Spirv.SEM_CROSS_WORKGROUP, Tag.Spirv.SEM_ATOMIC_COUNTER, Tag.Spirv.SEM_IMAGE + -> throw new UnsupportedOperationException( + String.format("Spir-V memory semantics '%s' is not supported by Vulkan memory model", tag)); - // Storage class - case Tag.Spirv.SC_UNIFORM_CONSTANT, - Tag.Spirv.SC_PUSH_CONSTANT -> null; // read-only - case Tag.Spirv.SC_INPUT, - Tag.Spirv.SC_PRIVATE, - Tag.Spirv.SC_FUNCTION -> null; // private - case Tag.Spirv.SC_UNIFORM, - Tag.Spirv.SC_OUTPUT, - Tag.Spirv.SC_STORAGE_BUFFER, - Tag.Spirv.SC_PHYS_STORAGE_BUFFER -> Tag.Vulkan.SC0; - case Tag.Spirv.SC_WORKGROUP -> Tag.Vulkan.SC1; - case Tag.Spirv.SC_CROSS_WORKGROUP, - Tag.Spirv.SC_GENERIC -> throw new UnsupportedOperationException( - String.format("Spir-V storage class '%s' " + - "is not supported by Vulkan memory model", tag)); - - default -> throw new IllegalArgumentException( - String.format("Unexpected non Spir-V tag '%s'", tag)); + // Memory semantics (av-vis) + case Tag.Spirv.SEM_AVAILABLE -> Tag.Vulkan.SEM_AVAILABLE; + case Tag.Spirv.SEM_VISIBLE -> Tag.Vulkan.SEM_VISIBLE; + + default -> throw new IllegalArgumentException(String.format("Unexpected non Spir-V tag '%s'", tag)); }; } } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorVulkan.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorVulkan.java index 50cc44479a..ce03b7463f 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorVulkan.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/compilation/VisitorVulkan.java @@ -11,21 +11,49 @@ import com.dat3m.dartagnan.program.event.core.*; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import static com.dat3m.dartagnan.program.event.EventFactory.*; public class VisitorVulkan extends VisitorBase { + private static final Set commonTags = Set.of( + Tag.Vulkan.SUB_GROUP, Tag.Vulkan.WORK_GROUP, + Tag.Vulkan.QUEUE_FAMILY, Tag.Vulkan.DEVICE, + Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.ATOM, + Tag.Vulkan.SC0, Tag.Vulkan.SC1); + + private static final Set semScTags = Set.of(Tag.Vulkan.SEMSC0, Tag.Vulkan.SEMSC1); + + private static final Set loadTags = Set.of( + Tag.Vulkan.ACQUIRE, Tag.Vulkan.VISIBLE, Tag.Vulkan.SEM_VISIBLE); + + private static final Set storeTags = Set.of( + Tag.Vulkan.RELEASE, Tag.Vulkan.AVAILABLE, Tag.Vulkan.SEM_AVAILABLE); + + private int labelIdx = 0; + + @Override + public List visitGenericVisibleEvent(GenericVisibleEvent e) { + return eventSequence(replaceAcqRelMemoryOrder(e)); + } + + @Override + public List visitControlBarrier(ControlBarrier e) { + return eventSequence(replaceAcqRelMemoryOrder(e)); + } + @Override public List visitVulkanRMW(VulkanRMW e) { + replaceAcqRelMemoryOrder(e); Register resultRegister = e.getResultRegister(); - String mo = e.getMo(); Expression address = e.getAddress(); Register dummy = e.getFunction().newRegister(resultRegister.getType()); - Load load = newRMWLoadWithMo(dummy, address, Tag.Vulkan.loadMO(mo)); - RMWStore store = newRMWStoreWithMo(load, address, e.getValue(), Tag.Vulkan.storeMO(mo)); - this.propagateTags(e, load); - this.propagateTags(e, store); + Load load = newRMWLoadWithMo(dummy, address, Tag.Vulkan.loadMO(e.getMo())); + RMWStore store = newRMWStoreWithMo(load, address, e.getValue(), Tag.Vulkan.storeMO(e.getMo())); + propagateLoadTags(e, load); + propagateStoreTags(e, store); return eventSequence( load, store, @@ -35,15 +63,15 @@ public List visitVulkanRMW(VulkanRMW e) { @Override public List visitVulkanRMWOp(VulkanRMWOp e) { + replaceAcqRelMemoryOrder(e); Register resultRegister = e.getResultRegister(); - String mo = e.getMo(); Expression address = e.getAddress(); Register dummy = e.getFunction().newRegister(resultRegister.getType()); - Load load = newRMWLoadWithMo(dummy, address, Tag.Vulkan.loadMO(mo)); + Load load = newRMWLoadWithMo(dummy, address, Tag.Vulkan.loadMO(e.getMo())); RMWStore store = newRMWStoreWithMo(load, address, - expressions.makeIntBinary(dummy, e.getOperator(), e.getOperand()), Tag.Vulkan.storeMO(mo)); - this.propagateTags(e, load); - this.propagateTags(e, store); + expressions.makeIntBinary(dummy, e.getOperator(), e.getOperand()), Tag.Vulkan.storeMO(e.getMo())); + propagateLoadTags(e, load); + propagateStoreTags(e, store); return eventSequence( load, store, @@ -53,16 +81,16 @@ public List visitVulkanRMWOp(VulkanRMWOp e) { @Override public List visitVulkanRMWExtremum(VulkanRMWExtremum e) { + replaceAcqRelMemoryOrder(e); Register resultRegister = e.getResultRegister(); - String mo = e.getMo(); Expression address = e.getAddress(); Register dummy = e.getFunction().newRegister(resultRegister.getType()); - Load load = newRMWLoadWithMo(dummy, address, Tag.Vulkan.loadMO(mo)); + Load load = newRMWLoadWithMo(dummy, address, Tag.Vulkan.loadMO(e.getMo())); Expression cmpExpr = expressions.makeIntCmp(dummy, e.getOperator(), e.getValue()); Expression ite = expressions.makeITE(cmpExpr, dummy, e.getValue()); - RMWStore store = newRMWStoreWithMo(load, address, ite, Tag.Vulkan.storeMO(mo)); - this.propagateTags(e, load); - this.propagateTags(e, store); + RMWStore store = newRMWStoreWithMo(load, address, ite, Tag.Vulkan.storeMO(e.getMo())); + propagateLoadTags(e, load); + propagateStoreTags(e, store); return eventSequence( load, store, @@ -72,19 +100,19 @@ public List visitVulkanRMWExtremum(VulkanRMWExtremum e) { @Override public List visitVulkanCmpXchg(VulkanCmpXchg e) { + replaceAcqRelMemoryOrder(e); Register resultRegister = e.getResultRegister(); - String mo = e.getMo(); Expression address = e.getAddress(); Expression expected = e.getExpectedValue(); Expression value = e.getStoreValue(); Register cmpResultRegister = e.getFunction().newRegister(types.getBooleanType()); - Label casEnd = newLabel("CAS_end"); - Load load = newRMWLoadWithMo(resultRegister, address, Tag.Vulkan.loadMO(mo)); - RMWStore store = newRMWStoreWithMo(load, address, value, Tag.Vulkan.storeMO(mo)); + Label casEnd = newLabel("CAS_end_" + labelIdx++); + Load load = newRMWLoadWithMo(resultRegister, address, Tag.Vulkan.loadMO(e.getMo())); + RMWStore store = newRMWStoreWithMo(load, address, value, Tag.Vulkan.storeMO(e.getMo())); Local local = newLocal(cmpResultRegister, expressions.makeEQ(resultRegister, expected)); CondJump condJump = newJumpUnless(cmpResultRegister, casEnd); - this.propagateTags(e, load); - this.propagateTags(e, store); + propagateLoadTags(e, load); + propagateStoreTags(e, store); return eventSequence( load, local, @@ -94,45 +122,27 @@ public List visitVulkanCmpXchg(VulkanCmpXchg e) { ); } - private void propagateTags(Event source, Event target) { - for (String tag : List.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.QUEUE_FAMILY, Tag.Vulkan.DEVICE, - Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.ATOM, Tag.Vulkan.SC0, Tag.Vulkan.SC1, Tag.Vulkan.SEMSC0, Tag.Vulkan.SEMSC1)) { - if (source.hasTag(tag)) { - target.addTags(tag); - } - } - if (target instanceof Load) { - // Atomic loads are always visible - if (source.hasTag(Tag.Vulkan.ATOM)) { - target.addTags(Tag.Vulkan.VISIBLE); - } - if (source.hasTag(Tag.Vulkan.SEM_VISIBLE)) { - target.addTags(Tag.Vulkan.SEM_VISIBLE); - } - // Remove tag if it refers to the release write - if (!source.hasTag(Tag.Vulkan.ACQUIRE) && source.hasTag(Tag.Vulkan.RELEASE)) { - target.removeTags(Tag.Vulkan.SEMSC0); - target.removeTags(Tag.Vulkan.SEMSC1); - } - if (source.hasTag(Tag.Vulkan.VISDEVICE)) { - target.addTags(Tag.Vulkan.VISDEVICE); - } - } else if (target instanceof Store) { - // Atomic stores are always available - if (source.hasTag(Tag.Vulkan.ATOM)) { - target.addTags(Tag.Vulkan.AVAILABLE); - } - if (source.hasTag(Tag.Vulkan.SEM_AVAILABLE)) { - target.addTags(Tag.Vulkan.SEM_AVAILABLE); - } - // Remove tag if it refers to the acquire read - if (!source.hasTag(Tag.Vulkan.RELEASE) && source.hasTag(Tag.Vulkan.ACQUIRE)) { - target.removeTags(Tag.Vulkan.SEMSC0); - target.removeTags(Tag.Vulkan.SEMSC1); - } - if (source.hasTag(Tag.Vulkan.AVDEVICE)) { - target.addTags(Tag.Vulkan.AVDEVICE); - } + private Event replaceAcqRelMemoryOrder(Event event) { + if (event.hasTag(Tag.Vulkan.ACQ_REL)) { + event.removeTags(Tag.Vulkan.ACQ_REL); + event.addTags(Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE); } + return event; + } + + private void propagateLoadTags(Event source, Event target) { + boolean isAcq = source.hasTag(Tag.Vulkan.ACQUIRE); + Set tags = source.getTags().stream() + .filter(t -> commonTags.contains(t) || loadTags.contains(t) || isAcq && semScTags.contains(t)) + .collect(Collectors.toSet()); + target.addTags(tags); + } + + private void propagateStoreTags(Event source, Event target) { + boolean isRel = source.hasTag(Tag.Vulkan.RELEASE); + Set tags = source.getTags().stream() + .filter(t -> commonTags.contains(t) || storeTags.contains(t) || isRel && semScTags.contains(t)) + .collect(Collectors.toSet()); + target.addTags(tags); } } diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsMemoryTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsMemoryTest.java index 0863b0baf0..94936f7d10 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsMemoryTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsMemoryTest.java @@ -83,7 +83,7 @@ public void testLoadWithTags() { @Test public void testLoadWithIllegalTags() { // given - String input = "%result = OpLoad %int %ptr MakePointerAvailable %scope"; + String input = "%result = OpLoad %int %ptr NonPrivatePointer|MakePointerAvailable %scope"; builder.mockIntType("%int", 32); builder.mockPtrType("%int_ptr", "%int", "Uniform"); builder.mockVariable("%ptr", "%int_ptr"); @@ -148,7 +148,7 @@ public void testStoreWithTags() { @Test public void testStoreWithIllegalTags() { // given - String input = "OpStore %ptr %value MakePointerVisible %scope"; + String input = "OpStore %ptr %value NonPrivatePointer|MakePointerVisible %scope"; builder.mockIntType("%int", 32); builder.mockPtrType("%int_ptr", "%int", "Uniform"); builder.mockVariable("%ptr", "%int_ptr"); diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTagsTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTagsTest.java index e749ee1096..894f0a9497 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTagsTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/helpers/HelperTagsTest.java @@ -103,11 +103,11 @@ public void doTestValidSemantics(int input, Set expected) { @Test public void testInvalidSemantics() { - doTestInvalidSemantics(0x1, "Unexpected memory semantics bits"); - doTestInvalidSemantics(0x3, "Unexpected memory semantics bits"); - doTestInvalidSemantics(0xffff, "Unexpected memory semantics bits"); - doTestInvalidSemantics(0x6, "Selected multiple non-relaxed memory order bits"); - doTestInvalidSemantics(0x18, "Selected multiple non-relaxed memory order bits"); + doTestInvalidSemantics(0x1, "Illegal memory semantics '1': unexpected bits"); + doTestInvalidSemantics(0x3, "Illegal memory semantics '3': unexpected bits"); + doTestInvalidSemantics(0xffff, "Illegal memory semantics '65535': unexpected bits"); + doTestInvalidSemantics(0x6, "Illegal memory semantics '6': multiple non-relaxed memory order bits"); + doTestInvalidSemantics(0x18, "Illegal memory semantics '24': multiple non-relaxed memory order bits"); } private void doTestInvalidSemantics(int input, String error) { @@ -143,8 +143,8 @@ public void testValidMemoryOperands() { doTestValidMemoryOperands(Set.of(), "Aligned", 4, List.of()); doTestValidMemoryOperands(Set.of(), "Aligned", 8, List.of()); doTestValidMemoryOperands(Set.of(MEM_NON_PRIVATE), "NonPrivatePointer|Aligned", 4, List.of()); - doTestValidMemoryOperands(Set.of(MEM_NONTEMPORAL, MEM_VISIBLE, DEVICE), - "Nontemporal|Aligned|MakePointerVisible", 4, List.of(1)); + doTestValidMemoryOperands(Set.of(MEM_NONTEMPORAL, MEM_NON_PRIVATE, MEM_VISIBLE, DEVICE), + "Nontemporal|Aligned|NonPrivatePointer|MakePointerVisible", 4, List.of(1)); // Availability-Visibility doTestValidMemoryOperands(Set.of(MEM_NON_PRIVATE, MEM_VISIBLE, DEVICE), diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkanTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkanTest.java index c40d6bbefc..8859a50b1c 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkanTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/program/processing/compilation/VisitorSpirvVulkanTest.java @@ -43,8 +43,8 @@ public void testLoad() { Set.of(Tag.Vulkan.SC1) ); doTestLoad( - Set.of(Tag.Spirv.MEM_VISIBLE, Tag.Spirv.DEVICE, Tag.Spirv.SC_UNIFORM), - Set.of(Tag.Vulkan.VISIBLE, Tag.Vulkan.DEVICE, Tag.Vulkan.SC0) + Set.of(Tag.Spirv.MEM_NON_PRIVATE, Tag.Spirv.DEVICE), + Set.of(Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.DEVICE) ); doTestLoad( Set.of(Tag.Spirv.MEM_NON_PRIVATE, Tag.Spirv.MEM_VISIBLE, Tag.Spirv.DEVICE, Tag.Spirv.SC_UNIFORM), @@ -57,6 +57,7 @@ private void doTestLoad(Set spvTags, Set vulTags) { Register register = mock(Register.class); MemoryObject address = mock(MemoryObject.class); Load e = EventFactory.newLoad(register, address); + e.setFunction(mock(Function.class)); e.addTags(spvTags); // when @@ -80,8 +81,8 @@ public void testStore() { Set.of(Tag.Vulkan.SC1) ); doTestStore( - Set.of(Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.DEVICE, Tag.Spirv.SC_UNIFORM), - Set.of(Tag.Vulkan.AVAILABLE, Tag.Vulkan.DEVICE, Tag.Vulkan.SC0) + Set.of(Tag.Spirv.MEM_NON_PRIVATE, Tag.Spirv.DEVICE), + Set.of(Tag.Vulkan.NON_PRIVATE, Tag.Vulkan.DEVICE) ); doTestStore( Set.of(Tag.Spirv.MEM_NON_PRIVATE, Tag.Spirv.MEM_AVAILABLE, Tag.Spirv.DEVICE, Tag.Spirv.SC_UNIFORM), @@ -94,6 +95,7 @@ private void doTestStore(Set spvTags, Set vulTags) { Expression value = mock(Expression.class); MemoryObject address = mock(MemoryObject.class); Store e = EventFactory.newStore(address, value); + e.setFunction(mock(Function.class)); e.addTags(spvTags); // when @@ -109,24 +111,16 @@ private void doTestStore(Set spvTags, Set vulTags) { @Test public void testSpirvLoad() { doTestSpirvLoad( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.SUBGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) - ); - doTestSpirvLoad( - Set.of(Tag.Spirv.SEQ_CST, Tag.Spirv.SUBGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.SUB_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.SUBGROUP, Tag.Spirv.RELAXED), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.SUB_GROUP) ); doTestSpirvLoad( - Set.of(Tag.Spirv.ACQUIRE, Tag.Spirv.WORKGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.WORKGROUP, Tag.Spirv.ACQUIRE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SEMSC1) ); doTestSpirvLoad( - Set.of(Tag.Spirv.ACQUIRE, Tag.Spirv.WORKGROUP, Tag.Spirv.SEM_UNIFORM, Tag.Spirv.SEM_VISIBLE, Tag.Spirv.SC_UNIFORM), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SEMSC0, Tag.Vulkan.SEM_VISIBLE, Tag.Vulkan.SC0, Tag.Vulkan.NON_PRIVATE) - ); - doTestSpirvLoad( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.DEVICE, Tag.Spirv.SC_UNIFORM), - Set.of(Tag.Vulkan.DEVICE, Tag.Vulkan.SC0, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_UNIFORM, Tag.Spirv.WORKGROUP, Tag.Spirv.ACQUIRE, Tag.Spirv.SEM_UNIFORM, Tag.Spirv.SEM_VISIBLE), + Set.of(Tag.Vulkan.SC0, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SEMSC0, Tag.Vulkan.SEM_VISIBLE) ); } @@ -152,24 +146,16 @@ private void doTestSpirvLoad(Set spvTags, Set vulTags) { @Test public void testSpirvStore() { doTestSpirvStore( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.SUBGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) - ); - doTestSpirvStore( - Set.of(Tag.Spirv.SEQ_CST, Tag.Spirv.SUBGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.SUBGROUP, Tag.Spirv.RELAXED), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.SUB_GROUP) ); doTestSpirvStore( - Set.of(Tag.Spirv.RELEASE, Tag.Spirv.WORKGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.WORKGROUP, Tag.Spirv.RELEASE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); doTestSpirvStore( - Set.of(Tag.Spirv.RELEASE, Tag.Spirv.WORKGROUP, Tag.Spirv.SEM_UNIFORM, Tag.Spirv.SEM_AVAILABLE, Tag.Spirv.SC_UNIFORM), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SEMSC0, Tag.Vulkan.SEM_AVAILABLE, Tag.Vulkan.SC0, Tag.Vulkan.NON_PRIVATE) - ); - doTestSpirvStore( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.DEVICE, Tag.Spirv.SC_UNIFORM), - Set.of(Tag.Vulkan.DEVICE, Tag.Vulkan.SC0, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_UNIFORM, Tag.Spirv.WORKGROUP, Tag.Spirv.RELEASE, Tag.Spirv.SEM_UNIFORM, Tag.Spirv.SEM_AVAILABLE), + Set.of(Tag.Vulkan.SC0, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC0, Tag.Vulkan.SEM_AVAILABLE) ); } @@ -195,34 +181,24 @@ private void doTestSpirvStore(Set spvTags, Set vulTags) { @Test public void testSpirvXchg() { doTestSpirvXchg( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.SUBGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE), - Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) - ); - doTestSpirvXchg( - Set.of(Tag.Spirv.ACQUIRE, Tag.Spirv.WORKGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE), - Set.of(Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.SUBGROUP, Tag.Spirv.RELAXED), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.SUB_GROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.SUB_GROUP) ); doTestSpirvXchg( - Set.of(Tag.Spirv.RELEASE, Tag.Spirv.WORKGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.WORKGROUP, Tag.Spirv.ACQUIRE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SEMSC1), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP) ); doTestSpirvXchg( - Set.of(Tag.Spirv.ACQ_REL, Tag.Spirv.WORKGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.WORKGROUP, Tag.Spirv.RELEASE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); doTestSpirvXchg( - Set.of(Tag.Spirv.SEQ_CST, Tag.Spirv.WORKGROUP, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) - ); - doTestSpirvXchg( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.DEVICE, Tag.Spirv.SC_WORKGROUP), - Set.of(Tag.Vulkan.DEVICE, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE), - Set.of(Tag.Vulkan.DEVICE, Tag.Vulkan.SC1, Tag.Vulkan.NON_PRIVATE) + Set.of(Tag.Spirv.SC_WORKGROUP, Tag.Spirv.WORKGROUP, Tag.Spirv.ACQ_REL, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SEMSC1), + Set.of(Tag.Vulkan.SC1, Tag.Vulkan.WORK_GROUP, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); } @@ -256,34 +232,24 @@ private void doTestSpirvXchg(Set spvTags, Set loadTags, Set spvTags, Set loadTags, Set eqTags, Set neqTags, Set loadTags, Set storeTags) { @@ -423,30 +377,27 @@ private void doTestSpirvCmpXchgIllegal(Set eqTags, Set neqTags, @Test public void testSpirvMemoryBarrier() { doTestSpirvMemoryBarrier( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.SUBGROUP), + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.RELAXED), Set.of(Tag.Vulkan.SUB_GROUP) ); doTestSpirvMemoryBarrier( - Set.of(Tag.Spirv.ACQUIRE, Tag.Spirv.SUBGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.SUB_GROUP) - ); - doTestSpirvMemoryBarrier( - Set.of(Tag.Spirv.RELEASE, Tag.Spirv.SUBGROUP), - Set.of(Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP) + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.ACQUIRE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SEMSC1) ); doTestSpirvMemoryBarrier( - Set.of(Tag.Spirv.ACQ_REL, Tag.Spirv.SUBGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP) + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.RELEASE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); doTestSpirvMemoryBarrier( - Set.of(Tag.Spirv.SEQ_CST, Tag.Spirv.SUBGROUP), - Set.of(Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP) + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.ACQ_REL, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.Vulkan.SUB_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); } private void doTestSpirvMemoryBarrier(Set spvTags, Set expected) { // given GenericVisibleEvent e = new GenericVisibleEvent("membar", Tag.FENCE); + e.setFunction(mock(Function.class)); e.addTags(spvTags); // when @@ -466,30 +417,27 @@ public void testSpirvControlBarrier() { Set.of() ); doTestSpirvControlBarrier( - Set.of(Tag.Spirv.RELAXED, Tag.Spirv.SUBGROUP), + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.RELAXED), Set.of(Tag.FENCE, Tag.Vulkan.SUB_GROUP) ); doTestSpirvControlBarrier( - Set.of(Tag.Spirv.ACQUIRE, Tag.Spirv.SUBGROUP), - Set.of(Tag.FENCE, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SUB_GROUP) + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.ACQUIRE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.FENCE, Tag.Vulkan.SUB_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.SEMSC1) ); doTestSpirvControlBarrier( - Set.of(Tag.Spirv.RELEASE, Tag.Spirv.SUBGROUP), - Set.of(Tag.FENCE, Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP) + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.RELEASE, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.FENCE, Tag.Vulkan.SUB_GROUP, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); doTestSpirvControlBarrier( - Set.of(Tag.Spirv.ACQ_REL, Tag.Spirv.SUBGROUP), - Set.of(Tag.FENCE, Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP) - ); - doTestSpirvControlBarrier( - Set.of(Tag.Spirv.SEQ_CST, Tag.Spirv.SUBGROUP), - Set.of(Tag.FENCE, Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE, Tag.Vulkan.SUB_GROUP) + Set.of(Tag.Spirv.SUBGROUP, Tag.Spirv.ACQ_REL, Tag.Spirv.SEM_WORKGROUP), + Set.of(Tag.FENCE, Tag.Vulkan.SUB_GROUP, Tag.Vulkan.ACQUIRE, Tag.Vulkan.RELEASE, Tag.Vulkan.SEMSC1) ); } private void doTestSpirvControlBarrier(Set spvTags, Set expected) { // given ControlBarrier e = EventFactory.newControlBarrier("cbar", mock(Expression.class)); + e.setFunction(mock(Function.class)); e.addTags(Tag.Spirv.CONTROL); if (!spvTags.isEmpty()) { e.addTags(spvTags); diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/basic/SpirvChecksTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/basic/SpirvChecksTest.java new file mode 100644 index 0000000000..5ff198b1ab --- /dev/null +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/basic/SpirvChecksTest.java @@ -0,0 +1,151 @@ +package com.dat3m.dartagnan.spirv.basic; + +import com.dat3m.dartagnan.configuration.Arch; +import com.dat3m.dartagnan.encoding.ProverWithTracker; +import com.dat3m.dartagnan.parsers.cat.ParserCat; +import com.dat3m.dartagnan.parsers.program.ProgramParser; +import com.dat3m.dartagnan.program.Program; +import com.dat3m.dartagnan.utils.Result; +import com.dat3m.dartagnan.verification.VerificationTask; +import com.dat3m.dartagnan.verification.solving.AssumeSolver; +import com.dat3m.dartagnan.verification.solving.RefinementSolver; +import com.dat3m.dartagnan.wmm.Wmm; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.sosy_lab.common.ShutdownManager; +import org.sosy_lab.common.configuration.Configuration; +import org.sosy_lab.common.configuration.InvalidConfigurationException; +import org.sosy_lab.common.log.BasicLogManager; +import org.sosy_lab.java_smt.SolverContextFactory; +import org.sosy_lab.java_smt.api.SolverContext; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.EnumSet; + +import static com.dat3m.dartagnan.configuration.Property.CAT_SPEC; +import static com.dat3m.dartagnan.configuration.Property.PROGRAM_SPEC; +import static com.dat3m.dartagnan.utils.ResourceHelper.getRootPath; +import static com.dat3m.dartagnan.utils.ResourceHelper.getTestResourcePath; +import static com.dat3m.dartagnan.utils.Result.*; +import static org.junit.Assert.assertEquals; + +@RunWith(Parameterized.class) +public class SpirvChecksTest { + + private final String modelPath = getRootPath("cat/spirv-check.cat"); + private final String programPath; + private final int bound; + private final Result expected; + + public SpirvChecksTest(String file, int bound, Result expected) { + this.programPath = getTestResourcePath("spirv/basic/" + file); + this.bound = bound; + this.expected = expected; + } + + @Parameterized.Parameters(name = "{index}: {0}, {1}, {2}") + public static Iterable data() throws IOException { + return Arrays.asList(new Object[][]{ + {"empty-exists-false.spv.dis", 1, PASS}, + {"empty-exists-true.spv.dis", 1, PASS}, + {"empty-forall-false.spv.dis", 1, PASS}, + {"empty-forall-true.spv.dis", 1, PASS}, + {"empty-not-exists-false.spv.dis", 1, PASS}, + {"empty-not-exists-true.spv.dis", 1, PASS}, + {"init-forall.spv.dis", 1, PASS}, + {"init-forall-split.spv.dis", 1, PASS}, + {"init-forall-not-exists.spv.dis", 1, PASS}, + {"init-forall-not-exists-fail.spv.dis", 1, PASS}, + {"uninitialized-exists.spv.dis", 1, PASS}, + {"uninitialized-forall.spv.dis", 1, PASS}, + {"uninitialized-private-exists.spv.dis", 1, PASS}, + {"uninitialized-private-forall.spv.dis", 1, PASS}, + {"undef-exists.spv.dis", 1, PASS}, + {"undef-forall.spv.dis", 1, PASS}, + {"read-write.spv.dis", 1, PASS}, + {"vector-init.spv.dis", 1, PASS}, + {"vector.spv.dis", 1, PASS}, + {"array.spv.dis", 1, PASS}, + {"array-of-vector.spv.dis", 1, PASS}, + {"array-of-vector1.spv.dis", 1, PASS}, + {"vector-read-write.spv.dis", 1, PASS}, + {"spec-id-integer.spv.dis", 1, PASS}, + {"spec-id-boolean.spv.dis", 1, PASS}, + {"mixed-size.spv.dis", 1, PASS}, + {"ids.spv.dis", 1, PASS}, + {"builtin-constant.spv.dis", 1, PASS}, + {"builtin-variable.spv.dis", 1, PASS}, + {"builtin-default-config.spv.dis", 1, PASS}, + {"builtin-all-123.spv.dis", 1, PASS}, + {"builtin-all-321.spv.dis", 1, PASS}, + {"branch-cond-ff.spv.dis", 1, PASS}, + {"branch-cond-ff-inverted.spv.dis", 1, PASS}, + {"branch-cond-bf.spv.dis", 1, UNKNOWN}, + {"branch-cond-bf.spv.dis", 2, PASS}, + {"branch-cond-fb.spv.dis", 1, UNKNOWN}, + {"branch-cond-fb.spv.dis", 2, PASS}, + {"branch-cond-struct.spv.dis", 1, PASS}, + {"branch-cond-struct-read-write.spv.dis", 1, PASS}, + {"branch-race.spv.dis", 1, PASS}, + {"branch-loop.spv.dis", 2, UNKNOWN}, + {"branch-loop.spv.dis", 3, PASS}, + {"loop-struct-cond.spv.dis", 1, UNKNOWN}, + {"loop-struct-cond.spv.dis", 2, PASS}, + {"loop-struct-cond-suffix.spv.dis", 1, UNKNOWN}, + {"loop-struct-cond-suffix.spv.dis", 2, PASS}, + {"loop-struct-cond-sequence.spv.dis", 2, UNKNOWN}, + {"loop-struct-cond-sequence.spv.dis", 3, PASS}, + {"loop-struct-cond-nested.spv.dis", 2, UNKNOWN}, + {"loop-struct-cond-nested.spv.dis", 3, PASS}, + {"phi.spv.dis", 1, PASS}, + {"phi-unstruct-true.spv.dis", 1, PASS}, + {"phi-unstruct-false.spv.dis", 1, PASS}, + {"cmpxchg-const-const.spv.dis", 1, PASS}, + {"cmpxchg-const-reg.spv.dis", 1, PASS}, + {"cmpxchg-reg-const.spv.dis", 1, PASS}, + {"cmpxchg-reg-reg.spv.dis", 1, PASS}, + {"memory-scopes.spv.dis", 1, PASS}, + {"rmw-extremum-true.spv.dis", 1, PASS}, + {"rmw-extremum-false.spv.dis", 1, PASS}, + {"push-constants.spv.dis", 1, PASS}, + {"push-constants-pod.spv.dis", 1, PASS}, + {"push-constant-mixed.spv.dis", 1, PASS} + }); + } + + @Test + public void testAllSolvers() throws Exception { + try (SolverContext ctx = mkCtx(); ProverWithTracker prover = mkProver(ctx)) { + assertEquals(expected, RefinementSolver.run(ctx, prover, mkTask()).getResult()); + } + try (SolverContext ctx = mkCtx(); ProverWithTracker prover = mkProver(ctx)) { + assertEquals(expected, AssumeSolver.run(ctx, prover, mkTask()).getResult()); + } + } + + private SolverContext mkCtx() throws InvalidConfigurationException { + Configuration cfg = Configuration.builder().build(); + return SolverContextFactory.createSolverContext( + cfg, + BasicLogManager.create(cfg), + ShutdownManager.create().getNotifier(), + SolverContextFactory.Solvers.Z3); + } + + private ProverWithTracker mkProver(SolverContext ctx) { + return new ProverWithTracker(ctx, "", SolverContext.ProverOptions.GENERATE_MODELS); + } + + private VerificationTask mkTask() throws Exception { + VerificationTask.VerificationTaskBuilder builder = VerificationTask.builder() + .withConfig(Configuration.builder().build()) + .withBound(bound) + .withTarget(Arch.VULKAN); + Program program = new ProgramParser().parse(new File(programPath)); + Wmm mcm = new ParserCat().parse(new File(modelPath)); + return builder.build(program, mcm, EnumSet.of(CAT_SPEC)); + } +} diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvAssertionsTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvAssertionsTest.java index f9bb418ac7..de0e9e57b1 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvAssertionsTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvAssertionsTest.java @@ -84,28 +84,6 @@ public static Iterable data() throws IOException { {"xf-barrier-fail3.spv.dis", 4, FAIL}, {"xf-barrier-fail4.spv.dis", 4, FAIL}, {"xf-barrier-weakest.spv.dis", 4, FAIL}, - - {"xf-barrier-local-2.1.2.spv.dis", 4, FAIL}, - {"xf-barrier-local-3.1.3.spv.dis", 9, FAIL}, - // TODO: ?? - // {"xf-barrier-local-1.1.2.spv.dis", 2, FAIL}, - {"xf-barrier-local-2.1.1.spv.dis", 2, FAIL}, - {"xf-barrier-local-fail1.spv.dis", 4, FAIL}, - {"xf-barrier-local-fail2.spv.dis", 4, FAIL}, - {"xf-barrier-local-fail3.spv.dis", 4, FAIL}, - {"xf-barrier-local-fail4.spv.dis", 4, FAIL}, - {"xf-barrier-local-weakest.spv.dis", 4, FAIL}, - - {"xf-barrier-zero-2.1.2.spv.dis", 4, FAIL}, - {"xf-barrier-zero-3.1.3.spv.dis", 9, FAIL}, - // TODO: ?? - // {"xf-barrier-zero-1.1.2.spv.dis", 2, FAIL}, - {"xf-barrier-zero-2.1.1.spv.dis", 2, FAIL}, - {"xf-barrier-zero-fail1.spv.dis", 4, FAIL}, - {"xf-barrier-zero-fail2.spv.dis", 4, FAIL}, - {"xf-barrier-zero-fail3.spv.dis", 4, FAIL}, - {"xf-barrier-zero-fail4.spv.dis", 4, FAIL}, - {"xf-barrier-zero-weakest.spv.dis", 4, FAIL}, }); } diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvChecksTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvChecksTest.java index 4b6b052568..0a41382cd2 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvChecksTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvChecksTest.java @@ -100,17 +100,6 @@ public static Iterable data() throws IOException { {"xf-barrier-local-fail3.spv.dis", 4, PASS}, {"xf-barrier-local-fail4.spv.dis", 4, PASS}, {"xf-barrier-local-weakest.spv.dis", 4, PASS}, - - // Fails check checkRelIsSem for a barrier with semantics 0x8 (rel_acq, no storage class semantics) - // {"xf-barrier-zero-2.1.2.spv.dis", 4, PASS}, - // {"xf-barrier-zero-3.1.3.spv.dis", 9, PASS}, - // {"xf-barrier-zero-2.1.1.spv.dis", 2, PASS}, - // {"xf-barrier-zero-1.1.2.spv.dis", 2, PASS}, - // {"xf-barrier-zero-fail1.spv.dis", 4, PASS}, - // {"xf-barrier-zero-fail2.spv.dis", 4, PASS}, - // {"xf-barrier-zero-fail3.spv.dis", 4, PASS}, - // {"xf-barrier-zero-fail4.spv.dis", 4, PASS}, - // {"xf-barrier-zero-weakest.spv.dis", 4, PASS}, }); } diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvRacesTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvRacesTest.java index f74cc504d7..bebd25903c 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvRacesTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/benchmarks/SpirvRacesTest.java @@ -99,16 +99,6 @@ public static Iterable data() throws IOException { {"xf-barrier-local-fail3.spv.dis", 4, FAIL}, {"xf-barrier-local-fail4.spv.dis", 4, FAIL}, {"xf-barrier-local-weakest.spv.dis", 4, FAIL}, - - {"xf-barrier-zero-2.1.2.spv.dis", 4, FAIL}, - {"xf-barrier-zero-3.1.3.spv.dis", 9, FAIL}, - {"xf-barrier-zero-2.1.1.spv.dis", 2, FAIL}, - {"xf-barrier-zero-1.1.2.spv.dis", 2, PASS}, - {"xf-barrier-zero-fail1.spv.dis", 4, FAIL}, - {"xf-barrier-zero-fail2.spv.dis", 4, FAIL}, - {"xf-barrier-zero-fail3.spv.dis", 4, FAIL}, - {"xf-barrier-zero-fail4.spv.dis", 4, FAIL}, - {"xf-barrier-zero-weakest.spv.dis", 4, FAIL}, }); } diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/gpuverify/SpirvChecksTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/gpuverify/SpirvChecksTest.java index 7a3742f03b..bace4477a4 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/gpuverify/SpirvChecksTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/spirv/gpuverify/SpirvChecksTest.java @@ -64,16 +64,19 @@ public static Iterable data() throws IOException { {"divergence/race_no_divergence.spv.dis", 1, PASS}, {"inter_group_and_barrier_flag_tests/fail/local_id.spv.dis", 1, PASS}, - // Fails check checkRelIsSem for a barrier with semantics 0x8 (rel_acq, no storage class semantics) - // {"inter_group_and_barrier_flag_tests/fail/no_barrier_flags.spv.dis", 1, PASS}, + // Changed illegal barrier semantics 0x8 (acqrel) to 0x108 (acqrel+semWg) + {"inter_group_and_barrier_flag_tests/fail/no_barrier_flags.spv.dis", 1, PASS}, {"inter_group_and_barrier_flag_tests/fail/sync.spv.dis", 1, PASS}, {"inter_group_and_barrier_flag_tests/pass/local_id_benign_write_write.spv.dis", 1, PASS}, {"inter_group_and_barrier_flag_tests/pass/pass_due_to_intra_group_flag.spv.dis", 1, PASS}, {"localarrayaccess.spv.dis", 1, PASS}, - // Fails check checkRelIsSem for a barrier with semantics 0x8 (rel_acq, no storage class semantics) - // {"mem_fence.spv.dis", 1, PASS}, + // Changed illegal fence semantics: + // 0x2 (acq) -> 0x102 (acq+semWg) + // 0x4 (rel) -> 0x104 (rel+semWg) + // 0x8 (acqrel) -> 0x108 (acqrel+semWg) + {"mem_fence.spv.dis", 1, PASS}, {"misc/fail/miscfail1.spv.dis", 1, PASS}, {"misc/fail/miscfail3.spv.dis", 1, PASS}, diff --git a/dartagnan/src/test/resources/VULKAN-CK-expected.csv b/dartagnan/src/test/resources/VULKAN-CK-expected.csv index fa84a018c8..3797d7bb50 100644 --- a/dartagnan/src/test/resources/VULKAN-CK-expected.csv +++ b/dartagnan/src/test/resources/VULKAN-CK-expected.csv @@ -158,9 +158,14 @@ litmus/VULKAN/Manual/ticketlock-acq2rlx-2.litmus,1 litmus/VULKAN/Manual/ticketlock-diff-wg.litmus,1 litmus/VULKAN/Manual/ticketlock-rel2rlx.litmus,1 litmus/VULKAN/Manual/ticketlock-same-wg.litmus,1 -litmus/VULKAN/Manual/XF-Barrier-relacq.litmus,1 -litmus/VULKAN/Manual/XF-Barrier-rlx.litmus,1 -litmus/VULKAN/Manual/XF-Barrier-weak.litmus,1 +litmus/VULKAN/Manual/xf-barrier.litmus,1 +litmus/VULKAN/Manual/xf-barrier-cbar-rlx-1.litmus,1 +litmus/VULKAN/Manual/xf-barrier-cbar-rlx-2.litmus,1 +litmus/VULKAN/Manual/xf-barrier-cbar-rlx-3.litmus,1 +litmus/VULKAN/Manual/xf-barrier-load-rlx-1.litmus,1 +litmus/VULKAN/Manual/xf-barrier-load-rlx-2.litmus,1 +litmus/VULKAN/Manual/xf-barrier-store-rlx-1.litmus,1 +litmus/VULKAN/Manual/xf-barrier-store-rlx-2.litmus,1 litmus/VULKAN/CADP/2_threads_2_instructions/4_simple.litmus,1 litmus/VULKAN/CADP/2_threads_2_instructions/5_simple.litmus,1 litmus/VULKAN/CADP/2_threads_3_instructions/4_simple.litmus,1 diff --git a/dartagnan/src/test/resources/spirv/basic/builtin-all-123.spv.dis b/dartagnan/src/test/resources/spirv/basic/builtin-all-123.spv.dis index fc3e0a6504..b1dbfebc40 100644 --- a/dartagnan/src/test/resources/spirv/basic/builtin-all-123.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/builtin-all-123.spv.dis @@ -55,7 +55,7 @@ %c0 = OpConstant %uint 0 %c1 = OpConstant %uint 1 %c2 = OpConstant %uint 2 - %c64 = OpConstant %uint 64 + %c68 = OpConstant %uint 68 %init = OpConstant %uint 999 %v3init = OpConstantComposite %v3uint %init %init %init @@ -83,7 +83,7 @@ %label = OpLabel %in_SubgroupLocalInvocationId = OpLoad %uint %gl_SubgroupLocalInvocationId - OpAtomicStore %out_SubgroupLocalInvocationId %c1 %c64 %in_SubgroupLocalInvocationId + OpAtomicStore %out_SubgroupLocalInvocationId %c1 %c68 %in_SubgroupLocalInvocationId %in0_ptr_LocalInvocationId = OpAccessChain %ptr_uint %gl_LocalInvocationId %c0 %in1_ptr_LocalInvocationId = OpAccessChain %ptr_uint %gl_LocalInvocationId %c1 @@ -94,12 +94,12 @@ %out0_ptr_LocalInvocationId = OpAccessChain %ptr_uint %out_LocalInvocationId %c0 %out1_ptr_LocalInvocationId = OpAccessChain %ptr_uint %out_LocalInvocationId %c1 %out2_ptr_LocalInvocationId = OpAccessChain %ptr_uint %out_LocalInvocationId %c2 - OpAtomicStore %out0_ptr_LocalInvocationId %c1 %c64 %v0_LocalInvocationId - OpAtomicStore %out1_ptr_LocalInvocationId %c1 %c64 %v1_LocalInvocationId - OpAtomicStore %out2_ptr_LocalInvocationId %c1 %c64 %v2_LocalInvocationId + OpAtomicStore %out0_ptr_LocalInvocationId %c1 %c68 %v0_LocalInvocationId + OpAtomicStore %out1_ptr_LocalInvocationId %c1 %c68 %v1_LocalInvocationId + OpAtomicStore %out2_ptr_LocalInvocationId %c1 %c68 %v2_LocalInvocationId %in_LocalInvocationIndex = OpLoad %uint %gl_LocalInvocationIndex - OpAtomicStore %out_LocalInvocationIndex %c1 %c64 %in_LocalInvocationIndex + OpAtomicStore %out_LocalInvocationIndex %c1 %c68 %in_LocalInvocationIndex %in0_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %gl_GlobalInvocationId %c0 %in1_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %gl_GlobalInvocationId %c1 @@ -110,15 +110,15 @@ %out0_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %out_GlobalInvocationId %c0 %out1_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %out_GlobalInvocationId %c1 %out2_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %out_GlobalInvocationId %c2 - OpAtomicStore %out0_ptr_GlobalInvocationId %c1 %c64 %v0_GlobalInvocationId - OpAtomicStore %out1_ptr_GlobalInvocationId %c1 %c64 %v1_GlobalInvocationId - OpAtomicStore %out2_ptr_GlobalInvocationId %c1 %c64 %v2_GlobalInvocationId + OpAtomicStore %out0_ptr_GlobalInvocationId %c1 %c68 %v0_GlobalInvocationId + OpAtomicStore %out1_ptr_GlobalInvocationId %c1 %c68 %v1_GlobalInvocationId + OpAtomicStore %out2_ptr_GlobalInvocationId %c1 %c68 %v2_GlobalInvocationId %in_DeviceIndex = OpLoad %uint %gl_DeviceIndex - OpAtomicStore %out_DeviceIndex %c1 %c64 %in_DeviceIndex + OpAtomicStore %out_DeviceIndex %c1 %c68 %in_DeviceIndex %in_SubgroupId = OpLoad %uint %gl_SubgroupId - OpAtomicStore %out_SubgroupId %c1 %c64 %in_SubgroupId + OpAtomicStore %out_SubgroupId %c1 %c68 %in_SubgroupId %in0_ptr_WorkgroupId = OpAccessChain %ptr_uint %gl_WorkgroupId %c0 %in1_ptr_WorkgroupId = OpAccessChain %ptr_uint %gl_WorkgroupId %c1 @@ -129,12 +129,12 @@ %out0_ptr_WorkgroupId = OpAccessChain %ptr_uint %out_WorkgroupId %c0 %out1_ptr_WorkgroupId = OpAccessChain %ptr_uint %out_WorkgroupId %c1 %out2_ptr_WorkgroupId = OpAccessChain %ptr_uint %out_WorkgroupId %c2 - OpAtomicStore %out0_ptr_WorkgroupId %c1 %c64 %v0_WorkgroupId - OpAtomicStore %out1_ptr_WorkgroupId %c1 %c64 %v1_WorkgroupId - OpAtomicStore %out2_ptr_WorkgroupId %c1 %c64 %v2_WorkgroupId + OpAtomicStore %out0_ptr_WorkgroupId %c1 %c68 %v0_WorkgroupId + OpAtomicStore %out1_ptr_WorkgroupId %c1 %c68 %v1_WorkgroupId + OpAtomicStore %out2_ptr_WorkgroupId %c1 %c68 %v2_WorkgroupId %in_SubgroupSize = OpLoad %uint %gl_SubgroupSize - OpAtomicStore %out_SubgroupSize %c1 %c64 %in_SubgroupSize + OpAtomicStore %out_SubgroupSize %c1 %c68 %in_SubgroupSize %in0_ptr_WorkgroupSize = OpAccessChain %ptr_uint %gl_WorkgroupSize %c0 %in1_ptr_WorkgroupSize = OpAccessChain %ptr_uint %gl_WorkgroupSize %c1 @@ -145,9 +145,9 @@ %out0_ptr_WorkgroupSize = OpAccessChain %ptr_uint %out_WorkgroupSize %c0 %out1_ptr_WorkgroupSize = OpAccessChain %ptr_uint %out_WorkgroupSize %c1 %out2_ptr_WorkgroupSize = OpAccessChain %ptr_uint %out_WorkgroupSize %c2 - OpAtomicStore %out0_ptr_WorkgroupSize %c1 %c64 %v0_WorkgroupSize - OpAtomicStore %out1_ptr_WorkgroupSize %c1 %c64 %v1_WorkgroupSize - OpAtomicStore %out2_ptr_WorkgroupSize %c1 %c64 %v2_WorkgroupSize + OpAtomicStore %out0_ptr_WorkgroupSize %c1 %c68 %v0_WorkgroupSize + OpAtomicStore %out1_ptr_WorkgroupSize %c1 %c68 %v1_WorkgroupSize + OpAtomicStore %out2_ptr_WorkgroupSize %c1 %c68 %v2_WorkgroupSize OpReturn OpFunctionEnd diff --git a/dartagnan/src/test/resources/spirv/basic/builtin-all-321.spv.dis b/dartagnan/src/test/resources/spirv/basic/builtin-all-321.spv.dis index d8c037e0dd..a50cc0b495 100644 --- a/dartagnan/src/test/resources/spirv/basic/builtin-all-321.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/builtin-all-321.spv.dis @@ -55,7 +55,7 @@ %c0 = OpConstant %uint 0 %c1 = OpConstant %uint 1 %c2 = OpConstant %uint 2 - %c64 = OpConstant %uint 64 + %c68 = OpConstant %uint 68 %init = OpConstant %uint 999 %v3init = OpConstantComposite %v3uint %init %init %init @@ -83,7 +83,7 @@ %label = OpLabel %in_SubgroupLocalInvocationId = OpLoad %uint %gl_SubgroupLocalInvocationId - OpAtomicStore %out_SubgroupLocalInvocationId %c1 %c64 %in_SubgroupLocalInvocationId + OpAtomicStore %out_SubgroupLocalInvocationId %c1 %c68 %in_SubgroupLocalInvocationId %in0_ptr_LocalInvocationId = OpAccessChain %ptr_uint %gl_LocalInvocationId %c0 %in1_ptr_LocalInvocationId = OpAccessChain %ptr_uint %gl_LocalInvocationId %c1 @@ -94,12 +94,12 @@ %out0_ptr_LocalInvocationId = OpAccessChain %ptr_uint %out_LocalInvocationId %c0 %out1_ptr_LocalInvocationId = OpAccessChain %ptr_uint %out_LocalInvocationId %c1 %out2_ptr_LocalInvocationId = OpAccessChain %ptr_uint %out_LocalInvocationId %c2 - OpAtomicStore %out0_ptr_LocalInvocationId %c1 %c64 %v0_LocalInvocationId - OpAtomicStore %out1_ptr_LocalInvocationId %c1 %c64 %v1_LocalInvocationId - OpAtomicStore %out2_ptr_LocalInvocationId %c1 %c64 %v2_LocalInvocationId + OpAtomicStore %out0_ptr_LocalInvocationId %c1 %c68 %v0_LocalInvocationId + OpAtomicStore %out1_ptr_LocalInvocationId %c1 %c68 %v1_LocalInvocationId + OpAtomicStore %out2_ptr_LocalInvocationId %c1 %c68 %v2_LocalInvocationId %in_LocalInvocationIndex = OpLoad %uint %gl_LocalInvocationIndex - OpAtomicStore %out_LocalInvocationIndex %c1 %c64 %in_LocalInvocationIndex + OpAtomicStore %out_LocalInvocationIndex %c1 %c68 %in_LocalInvocationIndex %in0_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %gl_GlobalInvocationId %c0 %in1_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %gl_GlobalInvocationId %c1 @@ -110,15 +110,15 @@ %out0_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %out_GlobalInvocationId %c0 %out1_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %out_GlobalInvocationId %c1 %out2_ptr_GlobalInvocationId = OpAccessChain %ptr_uint %out_GlobalInvocationId %c2 - OpAtomicStore %out0_ptr_GlobalInvocationId %c1 %c64 %v0_GlobalInvocationId - OpAtomicStore %out1_ptr_GlobalInvocationId %c1 %c64 %v1_GlobalInvocationId - OpAtomicStore %out2_ptr_GlobalInvocationId %c1 %c64 %v2_GlobalInvocationId + OpAtomicStore %out0_ptr_GlobalInvocationId %c1 %c68 %v0_GlobalInvocationId + OpAtomicStore %out1_ptr_GlobalInvocationId %c1 %c68 %v1_GlobalInvocationId + OpAtomicStore %out2_ptr_GlobalInvocationId %c1 %c68 %v2_GlobalInvocationId %in_DeviceIndex = OpLoad %uint %gl_DeviceIndex - OpAtomicStore %out_DeviceIndex %c1 %c64 %in_DeviceIndex + OpAtomicStore %out_DeviceIndex %c1 %c68 %in_DeviceIndex %in_SubgroupId = OpLoad %uint %gl_SubgroupId - OpAtomicStore %out_SubgroupId %c1 %c64 %in_SubgroupId + OpAtomicStore %out_SubgroupId %c1 %c68 %in_SubgroupId %in0_ptr_WorkgroupId = OpAccessChain %ptr_uint %gl_WorkgroupId %c0 %in1_ptr_WorkgroupId = OpAccessChain %ptr_uint %gl_WorkgroupId %c1 @@ -129,12 +129,12 @@ %out0_ptr_WorkgroupId = OpAccessChain %ptr_uint %out_WorkgroupId %c0 %out1_ptr_WorkgroupId = OpAccessChain %ptr_uint %out_WorkgroupId %c1 %out2_ptr_WorkgroupId = OpAccessChain %ptr_uint %out_WorkgroupId %c2 - OpAtomicStore %out0_ptr_WorkgroupId %c1 %c64 %v0_WorkgroupId - OpAtomicStore %out1_ptr_WorkgroupId %c1 %c64 %v1_WorkgroupId - OpAtomicStore %out2_ptr_WorkgroupId %c1 %c64 %v2_WorkgroupId + OpAtomicStore %out0_ptr_WorkgroupId %c1 %c68 %v0_WorkgroupId + OpAtomicStore %out1_ptr_WorkgroupId %c1 %c68 %v1_WorkgroupId + OpAtomicStore %out2_ptr_WorkgroupId %c1 %c68 %v2_WorkgroupId %in_SubgroupSize = OpLoad %uint %gl_SubgroupSize - OpAtomicStore %out_SubgroupSize %c1 %c64 %in_SubgroupSize + OpAtomicStore %out_SubgroupSize %c1 %c68 %in_SubgroupSize %in0_ptr_WorkgroupSize = OpAccessChain %ptr_uint %gl_WorkgroupSize %c0 %in1_ptr_WorkgroupSize = OpAccessChain %ptr_uint %gl_WorkgroupSize %c1 @@ -145,9 +145,9 @@ %out0_ptr_WorkgroupSize = OpAccessChain %ptr_uint %out_WorkgroupSize %c0 %out1_ptr_WorkgroupSize = OpAccessChain %ptr_uint %out_WorkgroupSize %c1 %out2_ptr_WorkgroupSize = OpAccessChain %ptr_uint %out_WorkgroupSize %c2 - OpAtomicStore %out0_ptr_WorkgroupSize %c1 %c64 %v0_WorkgroupSize - OpAtomicStore %out1_ptr_WorkgroupSize %c1 %c64 %v1_WorkgroupSize - OpAtomicStore %out2_ptr_WorkgroupSize %c1 %c64 %v2_WorkgroupSize + OpAtomicStore %out0_ptr_WorkgroupSize %c1 %c68 %v0_WorkgroupSize + OpAtomicStore %out1_ptr_WorkgroupSize %c1 %c68 %v1_WorkgroupSize + OpAtomicStore %out2_ptr_WorkgroupSize %c1 %c68 %v2_WorkgroupSize OpReturn OpFunctionEnd diff --git a/dartagnan/src/test/resources/spirv/basic/builtin-constant.spv.dis b/dartagnan/src/test/resources/spirv/basic/builtin-constant.spv.dis index d11c108918..bb4192b410 100644 --- a/dartagnan/src/test/resources/spirv/basic/builtin-constant.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/builtin-constant.spv.dis @@ -19,7 +19,7 @@ %c0 = OpConstant %uint 0 %c1 = OpConstant %uint 1 %c2 = OpConstant %uint 2 - %c64 = OpConstant %uint 64 + %c68 = OpConstant %uint 68 %sc0 = OpSpecConstant %uint 0 %gl_WorkGroupSize = OpSpecConstantComposite %v3uint %sc0 %sc0 %sc0 %_ptr_Input_v3uint = OpTypePointer Input %v3uint @@ -37,8 +37,8 @@ %out0_ptr = OpAccessChain %ptr_uint %out %c0 %out1_ptr = OpAccessChain %ptr_uint %out %c1 %out2_ptr = OpAccessChain %ptr_uint %out %c2 - OpAtomicStore %out0_ptr %c1 %c64 %v0 - OpAtomicStore %out1_ptr %c1 %c64 %v1 - OpAtomicStore %out2_ptr %c1 %c64 %v2 + OpAtomicStore %out0_ptr %c1 %c68 %v0 + OpAtomicStore %out1_ptr %c1 %c68 %v1 + OpAtomicStore %out2_ptr %c1 %c68 %v2 OpReturn OpFunctionEnd diff --git a/dartagnan/src/test/resources/spirv/basic/builtin-default-config.spv.dis b/dartagnan/src/test/resources/spirv/basic/builtin-default-config.spv.dis index fbfb100f8d..71325b8813 100644 --- a/dartagnan/src/test/resources/spirv/basic/builtin-default-config.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/builtin-default-config.spv.dis @@ -18,7 +18,7 @@ %c0 = OpConstant %uint 0 %c1 = OpConstant %uint 1 %c2 = OpConstant %uint 2 - %c64 = OpConstant %uint 64 + %c68 = OpConstant %uint 68 %sc0 = OpSpecConstant %uint 0 %gl_WorkGroupSize = OpSpecConstantComposite %v3uint %sc0 %sc0 %sc0 %_ptr_Input_v3uint = OpTypePointer Input %v3uint @@ -36,8 +36,8 @@ %out0_ptr = OpAccessChain %ptr_uint %out %c0 %out1_ptr = OpAccessChain %ptr_uint %out %c1 %out2_ptr = OpAccessChain %ptr_uint %out %c2 - OpAtomicStore %out0_ptr %c1 %c64 %v0 - OpAtomicStore %out1_ptr %c1 %c64 %v1 - OpAtomicStore %out2_ptr %c1 %c64 %v2 + OpAtomicStore %out0_ptr %c1 %c68 %v0 + OpAtomicStore %out1_ptr %c1 %c68 %v1 + OpAtomicStore %out2_ptr %c1 %c68 %v2 OpReturn OpFunctionEnd diff --git a/dartagnan/src/test/resources/spirv/basic/builtin-variable.spv.dis b/dartagnan/src/test/resources/spirv/basic/builtin-variable.spv.dis index 6eb9124731..47fb9e86ed 100644 --- a/dartagnan/src/test/resources/spirv/basic/builtin-variable.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/builtin-variable.spv.dis @@ -19,7 +19,7 @@ %c0 = OpConstant %uint 0 %c1 = OpConstant %uint 1 %c2 = OpConstant %uint 2 - %c64 = OpConstant %uint 64 + %c68 = OpConstant %uint 68 %_ptr_Input_v3uint = OpTypePointer Input %v3uint %_ptr_Output_v3uint = OpTypePointer Output %v3uint %gl_WorkGroupSize = OpVariable %_ptr_Input_v3uint Input @@ -38,8 +38,8 @@ ; TODO: What is the storage class here? Should be mapped from Output - OpAtomicStore %out0_ptr %c1 %c64 %v0 - OpAtomicStore %out1_ptr %c1 %c64 %v1 - OpAtomicStore %out2_ptr %c1 %c64 %v2 + OpAtomicStore %out0_ptr %c1 %c68 %v0 + OpAtomicStore %out1_ptr %c1 %c68 %v1 + OpAtomicStore %out2_ptr %c1 %c68 %v2 OpReturn OpFunctionEnd diff --git a/dartagnan/src/test/resources/spirv/basic/memory-scopes.spv.dis b/dartagnan/src/test/resources/spirv/basic/memory-scopes.spv.dis index f1e1d63fc0..453a6e0f8a 100644 --- a/dartagnan/src/test/resources/spirv/basic/memory-scopes.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/memory-scopes.spv.dis @@ -52,7 +52,7 @@ %var_wg_orig = OpAtomicIIncrement %uint %var_wg %c2 %c72 %var_dv_orig = OpAtomicIIncrement %uint %var_dv %c1 %c72 - OpControlBarrier %c1 %c1 %c72 + OpControlBarrier %c2 %c1 %c72 %th = OpAtomicLoad %uint %var_th %c4 %c66 %wg = OpAtomicLoad %uint %var_wg %c2 %c66 diff --git a/dartagnan/src/test/resources/spirv/basic/rmw-extremum-false.spv.dis b/dartagnan/src/test/resources/spirv/basic/rmw-extremum-false.spv.dis index 29e6bf0e4e..f9844217b6 100644 --- a/dartagnan/src/test/resources/spirv/basic/rmw-extremum-false.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/rmw-extremum-false.spv.dis @@ -22,15 +22,15 @@ %c1 = OpConstant %int 1 %c2 = OpConstant %int 2 %c3 = OpConstant %int 3 - %c64 = OpConstant %int 64 + %c72 = OpConstant %int 72 %var0 = OpVariable %ptr_int Uniform %c2 %var1 = OpVariable %ptr_int Uniform %c2 %out_result = OpVariable %ptr_v2int Output %out_final = OpVariable %ptr_v2int Output %main = OpFunction %void None %func %label = OpLabel - %result0 = OpAtomicSMin %int %var0 %c1 %c64 %c3_neg - %result1 = OpAtomicSMax %int %var1 %c1 %c64 %c3_neg + %result0 = OpAtomicSMin %int %var0 %c1 %c72 %c3_neg + %result1 = OpAtomicSMax %int %var1 %c1 %c72 %c3_neg %final0 = OpLoad %int %var0 %final1 = OpLoad %int %var1 %ptr_res_0 = OpAccessChain %ptr_int %out_result %c0 diff --git a/dartagnan/src/test/resources/spirv/basic/rmw-extremum-true.spv.dis b/dartagnan/src/test/resources/spirv/basic/rmw-extremum-true.spv.dis index 69492c108e..ceb4d407f1 100644 --- a/dartagnan/src/test/resources/spirv/basic/rmw-extremum-true.spv.dis +++ b/dartagnan/src/test/resources/spirv/basic/rmw-extremum-true.spv.dis @@ -22,15 +22,15 @@ %c1 = OpConstant %int 1 %c2 = OpConstant %int 2 %c3 = OpConstant %int 3 - %c64 = OpConstant %int 64 + %c72 = OpConstant %int 72 %var0 = OpVariable %ptr_int Uniform %c2 %var1 = OpVariable %ptr_int Uniform %c2 %out_result = OpVariable %ptr_v2int Output %out_final = OpVariable %ptr_v2int Output %main = OpFunction %void None %func %label = OpLabel - %result0 = OpAtomicSMin %int %var0 %c1 %c64 %c3_neg - %result1 = OpAtomicSMax %int %var1 %c1 %c64 %c3_neg + %result0 = OpAtomicSMin %int %var0 %c1 %c72 %c3_neg + %result1 = OpAtomicSMax %int %var1 %c1 %c72 %c3_neg %final0 = OpLoad %int %var0 %final1 = OpLoad %int %var1 %ptr_res_0 = OpAccessChain %ptr_int %out_result %c0 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-1.1.2.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-1.1.2.spv.dis deleted file mode 100644 index b2ae1d76d0..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-1.1.2.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 2 and %21[0][1] == 2) -; @Config: 1, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 155 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %133 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %134 = OpString "xf_barrier" - %135 = OpString " __kernel" - %137 = OpString "flag" - %140 = OpString "in" - %143 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %106 None - OpBranchConditional %76 %79 %106 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %95 None - OpBranchConditional %81 %84 %95 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %89 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %90 = OpINotEqual %bool %89 %uint_0 - OpLoopMerge %93 %88 None - OpBranchConditional %90 %93 %88 - %93 = OpLabel - OpBranch %95 - %95 = OpLabel - OpBranch %97 - %97 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %104 None - OpBranchConditional %81 %100 %104 - %100 = OpLabel - %101 = OpIAdd %uint %36 %uint_1 - %102 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %101 - OpAtomicStore %102 %uint_1 %uint_68 %uint_0 - OpBranch %104 - %104 = OpLabel - OpBranch %106 - %106 = OpLabel - OpBranch %108 - %108 = OpLabel - %109 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %128 None - OpBranchConditional %109 %112 %128 - %112 = OpLabel - %113 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %114 = OpLoad %uint %113 - OpBranch %116 - %116 = OpLabel - %117 = OpPhi %uint %121 %116 %114 %112 - %118 = OpPhi %uint %122 %116 %uint_0 %112 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %118 - %120 = OpLoad %uint %119 MakePointerVisible|NonPrivatePointer %uint_1 - %121 = OpIAdd %uint %117 %120 - OpStore %113 %121 - %122 = OpIAdd %uint %118 %uint_1 - %123 = OpUGreaterThanEqual %bool %122 %47 - OpLoopMerge %126 %116 None - OpBranchConditional %123 %126 %116 - %126 = OpLabel - OpBranch %128 - %128 = OpLabel - OpBranch %130 - %130 = OpLabel - OpReturn - OpFunctionEnd - %147 = OpExtInst %void %133 PushConstantGlobalSize %uint_0 %uint_12 - %149 = OpExtInst %void %133 PushConstantRegionOffset %uint_16 %uint_12 - %151 = OpExtInst %void %133 PushConstantNumWorkgroups %uint_32 %uint_12 - %153 = OpExtInst %void %133 PushConstantRegionGroupOffset %uint_48 %uint_12 - %136 = OpExtInst %void %133 Kernel %24 %134 %uint_3 %uint_0 %135 - %138 = OpExtInst %void %133 ArgumentInfo %137 - %139 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_0 %uint_0 %uint_0 %138 - %141 = OpExtInst %void %133 ArgumentInfo %140 - %142 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_1 %uint_0 %uint_1 %141 - %144 = OpExtInst %void %133 ArgumentInfo %143 - %145 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_2 %uint_0 %uint_2 %144 - %154 = OpExtInst %void %133 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.1.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.1.spv.dis deleted file mode 100644 index e83390b1dc..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.1.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 2 and %21[0][1] == 2) -; @Config: 2, 1, 1 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 155 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %133 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %134 = OpString "xf_barrier" - %135 = OpString " __kernel" - %137 = OpString "flag" - %140 = OpString "in" - %143 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %106 None - OpBranchConditional %76 %79 %106 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %95 None - OpBranchConditional %81 %84 %95 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %89 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %90 = OpINotEqual %bool %89 %uint_0 - OpLoopMerge %93 %88 None - OpBranchConditional %90 %93 %88 - %93 = OpLabel - OpBranch %95 - %95 = OpLabel - OpBranch %97 - %97 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %104 None - OpBranchConditional %81 %100 %104 - %100 = OpLabel - %101 = OpIAdd %uint %36 %uint_1 - %102 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %101 - OpAtomicStore %102 %uint_1 %uint_68 %uint_0 - OpBranch %104 - %104 = OpLabel - OpBranch %106 - %106 = OpLabel - OpBranch %108 - %108 = OpLabel - %109 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %128 None - OpBranchConditional %109 %112 %128 - %112 = OpLabel - %113 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %114 = OpLoad %uint %113 - OpBranch %116 - %116 = OpLabel - %117 = OpPhi %uint %121 %116 %114 %112 - %118 = OpPhi %uint %122 %116 %uint_0 %112 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %118 - %120 = OpLoad %uint %119 MakePointerVisible|NonPrivatePointer %uint_1 - %121 = OpIAdd %uint %117 %120 - OpStore %113 %121 - %122 = OpIAdd %uint %118 %uint_1 - %123 = OpUGreaterThanEqual %bool %122 %47 - OpLoopMerge %126 %116 None - OpBranchConditional %123 %126 %116 - %126 = OpLabel - OpBranch %128 - %128 = OpLabel - OpBranch %130 - %130 = OpLabel - OpReturn - OpFunctionEnd - %147 = OpExtInst %void %133 PushConstantGlobalSize %uint_0 %uint_12 - %149 = OpExtInst %void %133 PushConstantRegionOffset %uint_16 %uint_12 - %151 = OpExtInst %void %133 PushConstantNumWorkgroups %uint_32 %uint_12 - %153 = OpExtInst %void %133 PushConstantRegionGroupOffset %uint_48 %uint_12 - %136 = OpExtInst %void %133 Kernel %24 %134 %uint_3 %uint_0 %135 - %138 = OpExtInst %void %133 ArgumentInfo %137 - %139 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_0 %uint_0 %uint_0 %138 - %141 = OpExtInst %void %133 ArgumentInfo %140 - %142 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_1 %uint_0 %uint_1 %141 - %144 = OpExtInst %void %133 ArgumentInfo %143 - %145 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_2 %uint_0 %uint_2 %144 - %154 = OpExtInst %void %133 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.2.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.2.spv.dis deleted file mode 100644 index 3bf12ac7e8..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-2.1.2.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 4 and %21[0][1] == 4 and %21[0][2] == 4 and %21[0][3] == 4) -; @Config: 2, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 155 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %133 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %134 = OpString "xf_barrier" - %135 = OpString " __kernel" - %137 = OpString "flag" - %140 = OpString "in" - %143 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %106 None - OpBranchConditional %76 %79 %106 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %95 None - OpBranchConditional %81 %84 %95 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %89 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %90 = OpINotEqual %bool %89 %uint_0 - OpLoopMerge %93 %88 None - OpBranchConditional %90 %93 %88 - %93 = OpLabel - OpBranch %95 - %95 = OpLabel - OpBranch %97 - %97 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %104 None - OpBranchConditional %81 %100 %104 - %100 = OpLabel - %101 = OpIAdd %uint %36 %uint_1 - %102 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %101 - OpAtomicStore %102 %uint_1 %uint_68 %uint_0 - OpBranch %104 - %104 = OpLabel - OpBranch %106 - %106 = OpLabel - OpBranch %108 - %108 = OpLabel - %109 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %128 None - OpBranchConditional %109 %112 %128 - %112 = OpLabel - %113 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %114 = OpLoad %uint %113 - OpBranch %116 - %116 = OpLabel - %117 = OpPhi %uint %121 %116 %114 %112 - %118 = OpPhi %uint %122 %116 %uint_0 %112 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %118 - %120 = OpLoad %uint %119 MakePointerVisible|NonPrivatePointer %uint_1 - %121 = OpIAdd %uint %117 %120 - OpStore %113 %121 - %122 = OpIAdd %uint %118 %uint_1 - %123 = OpUGreaterThanEqual %bool %122 %47 - OpLoopMerge %126 %116 None - OpBranchConditional %123 %126 %116 - %126 = OpLabel - OpBranch %128 - %128 = OpLabel - OpBranch %130 - %130 = OpLabel - OpReturn - OpFunctionEnd - %147 = OpExtInst %void %133 PushConstantGlobalSize %uint_0 %uint_12 - %149 = OpExtInst %void %133 PushConstantRegionOffset %uint_16 %uint_12 - %151 = OpExtInst %void %133 PushConstantNumWorkgroups %uint_32 %uint_12 - %153 = OpExtInst %void %133 PushConstantRegionGroupOffset %uint_48 %uint_12 - %136 = OpExtInst %void %133 Kernel %24 %134 %uint_3 %uint_0 %135 - %138 = OpExtInst %void %133 ArgumentInfo %137 - %139 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_0 %uint_0 %uint_0 %138 - %141 = OpExtInst %void %133 ArgumentInfo %140 - %142 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_1 %uint_0 %uint_1 %141 - %144 = OpExtInst %void %133 ArgumentInfo %143 - %145 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_2 %uint_0 %uint_2 %144 - %154 = OpExtInst %void %133 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-3.1.3.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-3.1.3.spv.dis deleted file mode 100644 index a608862e5e..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-3.1.3.spv.dis +++ /dev/null @@ -1,203 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 9 and %21[0][1] == 9 and %21[0][2] == 9) -; @Output: forall (%21[0][3] == 9 and %21[0][4] == 9 and %21[0][5] == 9) -; @Output: forall (%21[0][6] == 9 and %21[0][7] == 9 and %21[0][8] == 9) -; @Config: 3, 1, 3 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 155 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %133 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %134 = OpString "xf_barrier" - %135 = OpString " __kernel" - %137 = OpString "flag" - %140 = OpString "in" - %143 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %106 None - OpBranchConditional %76 %79 %106 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %95 None - OpBranchConditional %81 %84 %95 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %89 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %90 = OpINotEqual %bool %89 %uint_0 - OpLoopMerge %93 %88 None - OpBranchConditional %90 %93 %88 - %93 = OpLabel - OpBranch %95 - %95 = OpLabel - OpBranch %97 - %97 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %104 None - OpBranchConditional %81 %100 %104 - %100 = OpLabel - %101 = OpIAdd %uint %36 %uint_1 - %102 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %101 - OpAtomicStore %102 %uint_1 %uint_68 %uint_0 - OpBranch %104 - %104 = OpLabel - OpBranch %106 - %106 = OpLabel - OpBranch %108 - %108 = OpLabel - %109 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %128 None - OpBranchConditional %109 %112 %128 - %112 = OpLabel - %113 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %114 = OpLoad %uint %113 - OpBranch %116 - %116 = OpLabel - %117 = OpPhi %uint %121 %116 %114 %112 - %118 = OpPhi %uint %122 %116 %uint_0 %112 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %118 - %120 = OpLoad %uint %119 MakePointerVisible|NonPrivatePointer %uint_1 - %121 = OpIAdd %uint %117 %120 - OpStore %113 %121 - %122 = OpIAdd %uint %118 %uint_1 - %123 = OpUGreaterThanEqual %bool %122 %47 - OpLoopMerge %126 %116 None - OpBranchConditional %123 %126 %116 - %126 = OpLabel - OpBranch %128 - %128 = OpLabel - OpBranch %130 - %130 = OpLabel - OpReturn - OpFunctionEnd - %147 = OpExtInst %void %133 PushConstantGlobalSize %uint_0 %uint_12 - %149 = OpExtInst %void %133 PushConstantRegionOffset %uint_16 %uint_12 - %151 = OpExtInst %void %133 PushConstantNumWorkgroups %uint_32 %uint_12 - %153 = OpExtInst %void %133 PushConstantRegionGroupOffset %uint_48 %uint_12 - %136 = OpExtInst %void %133 Kernel %24 %134 %uint_3 %uint_0 %135 - %138 = OpExtInst %void %133 ArgumentInfo %137 - %139 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_0 %uint_0 %uint_0 %138 - %141 = OpExtInst %void %133 ArgumentInfo %140 - %142 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_1 %uint_0 %uint_1 %141 - %144 = OpExtInst %void %133 ArgumentInfo %143 - %145 = OpExtInst %void %133 ArgumentStorageBuffer %136 %uint_2 %uint_0 %uint_2 %144 - %154 = OpExtInst %void %133 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail1.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail1.spv.dis deleted file mode 100644 index 5a7c831159..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail1.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 4 and %21[0][1] == 4 and %21[0][2] == 4 and %21[0][3] == 4) -; @Config: 2, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 156 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %134 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %135 = OpString "xf_barrier" - %136 = OpString " __kernel" - %138 = OpString "flag" - %141 = OpString "in" - %144 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %107 None - OpBranchConditional %76 %79 %107 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %96 None - OpBranchConditional %81 %84 %96 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %90 = OpAtomicLoad %uint %86 %uint_1 %uint_0 - %91 = OpINotEqual %bool %90 %uint_0 - OpLoopMerge %94 %88 None - OpBranchConditional %91 %94 %88 - %94 = OpLabel - OpBranch %96 - %96 = OpLabel - OpBranch %98 - %98 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %105 None - OpBranchConditional %81 %101 %105 - %101 = OpLabel - %102 = OpIAdd %uint %36 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %102 - OpAtomicStore %103 %uint_1 %uint_68 %uint_0 - OpBranch %105 - %105 = OpLabel - OpBranch %107 - %107 = OpLabel - OpBranch %109 - %109 = OpLabel - %110 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %129 None - OpBranchConditional %110 %113 %129 - %113 = OpLabel - %114 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %115 = OpLoad %uint %114 - OpBranch %117 - %117 = OpLabel - %118 = OpPhi %uint %122 %117 %115 %113 - %119 = OpPhi %uint %123 %117 %uint_0 %113 - %120 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %119 - %121 = OpLoad %uint %120 MakePointerVisible|NonPrivatePointer %uint_1 - %122 = OpIAdd %uint %118 %121 - OpStore %114 %122 - %123 = OpIAdd %uint %119 %uint_1 - %124 = OpUGreaterThanEqual %bool %123 %47 - OpLoopMerge %127 %117 None - OpBranchConditional %124 %127 %117 - %127 = OpLabel - OpBranch %129 - %129 = OpLabel - OpBranch %131 - %131 = OpLabel - OpReturn - OpFunctionEnd - %148 = OpExtInst %void %134 PushConstantGlobalSize %uint_0 %uint_12 - %150 = OpExtInst %void %134 PushConstantRegionOffset %uint_16 %uint_12 - %152 = OpExtInst %void %134 PushConstantNumWorkgroups %uint_32 %uint_12 - %154 = OpExtInst %void %134 PushConstantRegionGroupOffset %uint_48 %uint_12 - %137 = OpExtInst %void %134 Kernel %24 %135 %uint_3 %uint_0 %136 - %139 = OpExtInst %void %134 ArgumentInfo %138 - %140 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_0 %uint_0 %uint_0 %139 - %142 = OpExtInst %void %134 ArgumentInfo %141 - %143 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_1 %uint_0 %uint_1 %142 - %145 = OpExtInst %void %134 ArgumentInfo %144 - %146 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_2 %uint_0 %uint_2 %145 - %155 = OpExtInst %void %134 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail2.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail2.spv.dis deleted file mode 100644 index 7c6a7ad8f1..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail2.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 4 and %21[0][1] == 4 and %21[0][2] == 4 and %21[0][3] == 4) -; @Config: 2, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 156 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %134 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %135 = OpString "xf_barrier" - %136 = OpString " __kernel" - %138 = OpString "flag" - %141 = OpString "in" - %144 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %107 None - OpBranchConditional %76 %79 %107 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %95 None - OpBranchConditional %81 %84 %95 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %89 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %90 = OpINotEqual %bool %89 %uint_0 - OpLoopMerge %93 %88 None - OpBranchConditional %90 %93 %88 - %93 = OpLabel - OpBranch %95 - %95 = OpLabel - OpBranch %97 - %97 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %105 None - OpBranchConditional %81 %100 %105 - %100 = OpLabel - %101 = OpIAdd %uint %36 %uint_1 - %102 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %101 - OpAtomicStore %102 %uint_1 %uint_0 %uint_0 - OpBranch %105 - %105 = OpLabel - OpBranch %107 - %107 = OpLabel - OpBranch %109 - %109 = OpLabel - %110 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %129 None - OpBranchConditional %110 %113 %129 - %113 = OpLabel - %114 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %115 = OpLoad %uint %114 - OpBranch %117 - %117 = OpLabel - %118 = OpPhi %uint %122 %117 %115 %113 - %119 = OpPhi %uint %123 %117 %uint_0 %113 - %120 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %119 - %121 = OpLoad %uint %120 MakePointerVisible|NonPrivatePointer %uint_1 - %122 = OpIAdd %uint %118 %121 - OpStore %114 %122 - %123 = OpIAdd %uint %119 %uint_1 - %124 = OpUGreaterThanEqual %bool %123 %47 - OpLoopMerge %127 %117 None - OpBranchConditional %124 %127 %117 - %127 = OpLabel - OpBranch %129 - %129 = OpLabel - OpBranch %131 - %131 = OpLabel - OpReturn - OpFunctionEnd - %148 = OpExtInst %void %134 PushConstantGlobalSize %uint_0 %uint_12 - %150 = OpExtInst %void %134 PushConstantRegionOffset %uint_16 %uint_12 - %152 = OpExtInst %void %134 PushConstantNumWorkgroups %uint_32 %uint_12 - %154 = OpExtInst %void %134 PushConstantRegionGroupOffset %uint_48 %uint_12 - %137 = OpExtInst %void %134 Kernel %24 %135 %uint_3 %uint_0 %136 - %139 = OpExtInst %void %134 ArgumentInfo %138 - %140 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_0 %uint_0 %uint_0 %139 - %142 = OpExtInst %void %134 ArgumentInfo %141 - %143 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_1 %uint_0 %uint_1 %142 - %145 = OpExtInst %void %134 ArgumentInfo %144 - %146 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_2 %uint_0 %uint_2 %145 - %155 = OpExtInst %void %134 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail3.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail3.spv.dis deleted file mode 100644 index a6e755e317..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail3.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 4 and %21[0][1] == 4 and %21[0][2] == 4 and %21[0][3] == 4) -; @Config: 2, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 156 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %134 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %135 = OpString "xf_barrier" - %136 = OpString " __kernel" - %138 = OpString "flag" - %141 = OpString "in" - %144 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_66 = OpConstant %uint 66 - %uint_68 = OpConstant %uint 68 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_0 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_66 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %107 None - OpBranchConditional %76 %79 %107 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %95 None - OpBranchConditional %81 %84 %95 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %89 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %90 = OpINotEqual %bool %89 %uint_0 - OpLoopMerge %93 %88 None - OpBranchConditional %90 %93 %88 - %93 = OpLabel - OpBranch %95 - %95 = OpLabel - OpBranch %97 - %97 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %105 None - OpBranchConditional %81 %100 %105 - %100 = OpLabel - %101 = OpIAdd %uint %36 %uint_1 - %102 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %101 - OpAtomicStore %102 %uint_1 %uint_68 %uint_0 - OpBranch %105 - %105 = OpLabel - OpBranch %107 - %107 = OpLabel - OpBranch %109 - %109 = OpLabel - %110 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %129 None - OpBranchConditional %110 %113 %129 - %113 = OpLabel - %114 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %115 = OpLoad %uint %114 - OpBranch %117 - %117 = OpLabel - %118 = OpPhi %uint %122 %117 %115 %113 - %119 = OpPhi %uint %123 %117 %uint_0 %113 - %120 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %119 - %121 = OpLoad %uint %120 MakePointerVisible|NonPrivatePointer %uint_1 - %122 = OpIAdd %uint %118 %121 - OpStore %114 %122 - %123 = OpIAdd %uint %119 %uint_1 - %124 = OpUGreaterThanEqual %bool %123 %47 - OpLoopMerge %127 %117 None - OpBranchConditional %124 %127 %117 - %127 = OpLabel - OpBranch %129 - %129 = OpLabel - OpBranch %131 - %131 = OpLabel - OpReturn - OpFunctionEnd - %148 = OpExtInst %void %134 PushConstantGlobalSize %uint_0 %uint_12 - %150 = OpExtInst %void %134 PushConstantRegionOffset %uint_16 %uint_12 - %152 = OpExtInst %void %134 PushConstantNumWorkgroups %uint_32 %uint_12 - %154 = OpExtInst %void %134 PushConstantRegionGroupOffset %uint_48 %uint_12 - %137 = OpExtInst %void %134 Kernel %24 %135 %uint_3 %uint_0 %136 - %139 = OpExtInst %void %134 ArgumentInfo %138 - %140 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_0 %uint_0 %uint_0 %139 - %142 = OpExtInst %void %134 ArgumentInfo %141 - %143 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_1 %uint_0 %uint_1 %142 - %145 = OpExtInst %void %134 ArgumentInfo %144 - %146 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_2 %uint_0 %uint_2 %145 - %155 = OpExtInst %void %134 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail4.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail4.spv.dis deleted file mode 100644 index 0a9744602d..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-fail4.spv.dis +++ /dev/null @@ -1,201 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 4 and %21[0][1] == 4 and %21[0][2] == 4 and %21[0][3] == 4) -; @Config: 2, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 156 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %134 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %135 = OpString "xf_barrier" - %136 = OpString " __kernel" - %138 = OpString "flag" - %141 = OpString "in" - %144 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %uint_68 = OpConstant %uint 68 - %uint_66 = OpConstant %uint 66 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %75 None - OpBranchConditional %51 %54 %75 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %71 None - OpBranchConditional %56 %59 %71 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_68 %uint_1 - OpBranch %63 - %63 = OpLabel - %65 = OpAtomicLoad %uint %60 %uint_1 %uint_0 - %66 = OpINotEqual %bool %65 %uint_1 - OpLoopMerge %69 %63 None - OpBranchConditional %66 %69 %63 - %69 = OpLabel - OpBranch %71 - %71 = OpLabel - OpBranch %73 - %73 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %75 - %75 = OpLabel - %76 = OpPhi %bool %false %73 %true %25 - OpSelectionMerge %107 None - OpBranchConditional %76 %79 %107 - %79 = OpLabel - %80 = OpIAdd %uint %36 %uint_1 - %81 = OpULessThan %bool %80 %39 - OpSelectionMerge %96 None - OpBranchConditional %81 %84 %96 - %84 = OpLabel - %85 = OpIAdd %uint %36 %uint_1 - %86 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %85 - OpBranch %88 - %88 = OpLabel - %90 = OpAtomicLoad %uint %86 %uint_1 %uint_66 - %91 = OpINotEqual %bool %90 %uint_0 - OpLoopMerge %94 %88 None - OpBranchConditional %91 %94 %88 - %94 = OpLabel - OpBranch %96 - %96 = OpLabel - OpBranch %98 - %98 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %105 None - OpBranchConditional %81 %101 %105 - %101 = OpLabel - %102 = OpIAdd %uint %36 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %102 - OpAtomicStore %103 %uint_1 %uint_68 %uint_0 - OpBranch %105 - %105 = OpLabel - OpBranch %107 - %107 = OpLabel - OpBranch %109 - %109 = OpLabel - %110 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %129 None - OpBranchConditional %110 %113 %129 - %113 = OpLabel - %114 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %115 = OpLoad %uint %114 - OpBranch %117 - %117 = OpLabel - %118 = OpPhi %uint %122 %117 %115 %113 - %119 = OpPhi %uint %123 %117 %uint_0 %113 - %120 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %119 - %121 = OpLoad %uint %120 MakePointerVisible|NonPrivatePointer %uint_1 - %122 = OpIAdd %uint %118 %121 - OpStore %114 %122 - %123 = OpIAdd %uint %119 %uint_1 - %124 = OpUGreaterThanEqual %bool %123 %47 - OpLoopMerge %127 %117 None - OpBranchConditional %124 %127 %117 - %127 = OpLabel - OpBranch %129 - %129 = OpLabel - OpBranch %131 - %131 = OpLabel - OpReturn - OpFunctionEnd - %148 = OpExtInst %void %134 PushConstantGlobalSize %uint_0 %uint_12 - %150 = OpExtInst %void %134 PushConstantRegionOffset %uint_16 %uint_12 - %152 = OpExtInst %void %134 PushConstantNumWorkgroups %uint_32 %uint_12 - %154 = OpExtInst %void %134 PushConstantRegionGroupOffset %uint_48 %uint_12 - %137 = OpExtInst %void %134 Kernel %24 %135 %uint_3 %uint_0 %136 - %139 = OpExtInst %void %134 ArgumentInfo %138 - %140 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_0 %uint_0 %uint_0 %139 - %142 = OpExtInst %void %134 ArgumentInfo %141 - %143 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_1 %uint_0 %uint_1 %142 - %145 = OpExtInst %void %134 ArgumentInfo %144 - %146 = OpExtInst %void %134 ArgumentStorageBuffer %137 %uint_2 %uint_0 %uint_2 %145 - %155 = OpExtInst %void %134 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-weakest.spv.dis b/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-weakest.spv.dis deleted file mode 100644 index 63ec714560..0000000000 --- a/dartagnan/src/test/resources/spirv/benchmarks/xf-barrier-zero-weakest.spv.dis +++ /dev/null @@ -1,199 +0,0 @@ -; flag -; @Input: %19 = {{0, 0, 0, 0, 0, 0, 0, 0}} -; data -; @Input: %20 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Input: %21 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} -; @Output: forall (%21[0][0] == 4 and %21[0][1] == 4 and %21[0][2] == 4 and %21[0][3] == 4) -; @Config: 2, 1, 2 -; SPIR-V -; Version: 1.6 -; Generator: Google Clspv; 0 -; Bound: 154 -; Schema: 0 - OpCapability Shader - OpCapability VulkanMemoryModel - OpMemoryModel Logical Vulkan - %132 = OpExtInstImport "NonSemantic.ClspvReflection.5" - OpEntryPoint GLCompute %24 "xf_barrier" %gl_GlobalInvocationID %gl_LocalInvocationID %gl_WorkGroupID %15 %19 %20 %21 %5 - OpSource OpenCL_C 200 - %133 = OpString "xf_barrier" - %134 = OpString " __kernel" - %136 = OpString "flag" - %139 = OpString "in" - %142 = OpString "out" - OpMemberDecorate %_struct_3 0 Offset 0 - OpMemberDecorate %_struct_3 1 Offset 16 - OpMemberDecorate %_struct_3 2 Offset 32 - OpMemberDecorate %_struct_3 3 Offset 48 - OpDecorate %_struct_3 Block - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %_struct_17 0 Offset 0 - OpDecorate %_struct_17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 0 - OpDecorate %20 DescriptorSet 0 - OpDecorate %20 Binding 1 - OpDecorate %21 DescriptorSet 0 - OpDecorate %21 Binding 2 - OpDecorate %10 SpecId 0 - OpDecorate %11 SpecId 1 - OpDecorate %12 SpecId 2 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 - %_struct_3 = OpTypeStruct %v3uint %v3uint %v3uint %v3uint -%_ptr_PushConstant__struct_3 = OpTypePointer PushConstant %_struct_3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint - %10 = OpSpecConstant %uint 1 - %11 = OpSpecConstant %uint 1 - %12 = OpSpecConstant %uint 1 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %10 %11 %12 -%_ptr_Private_v3uint = OpTypePointer Private %v3uint -%_runtimearr_uint = OpTypeRuntimeArray %uint - %_struct_17 = OpTypeStruct %_runtimearr_uint -%_ptr_StorageBuffer__struct_17 = OpTypePointer StorageBuffer %_struct_17 - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_0 = OpConstant %uint 0 -%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint - %uint_3 = OpConstant %uint 3 - %uint_2 = OpConstant %uint 2 - %uint_1 = OpConstant %uint 1 -%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %bool = OpTypeBool - %uint_8 = OpConstant %uint 8 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %uint_12 = OpConstant %uint 12 - %uint_16 = OpConstant %uint 16 - %uint_32 = OpConstant %uint 32 - %uint_48 = OpConstant %uint 48 - %5 = OpVariable %_ptr_PushConstant__struct_3 PushConstant -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input -%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input - %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize - %19 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %20 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %21 = OpVariable %_ptr_StorageBuffer__struct_17 StorageBuffer - %24 = OpFunction %void None %23 - %25 = OpLabel - %28 = OpAccessChain %_ptr_Input_uint %gl_WorkGroupID %uint_0 - %29 = OpLoad %uint %28 - %32 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_3 %uint_0 - %33 = OpLoad %uint %32 - %34 = OpIAdd %uint %33 %29 - %35 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %36 = OpLoad %uint %35 - %38 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_2 %uint_0 - %39 = OpLoad %uint %38 - %40 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %41 = OpLoad %uint %40 - %43 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_1 %uint_0 - %44 = OpLoad %uint %43 - %45 = OpIAdd %uint %44 %41 - %46 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 - %47 = OpLoad %uint %46 - %49 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %45 - OpStore %49 %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1 - %51 = OpINotEqual %bool %34 %uint_0 - OpSelectionMerge %74 None - OpBranchConditional %51 %54 %74 - %54 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - %56 = OpIEqual %bool %36 %uint_0 - OpSelectionMerge %70 None - OpBranchConditional %56 %59 %70 - %59 = OpLabel - %60 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %34 - OpAtomicStore %60 %uint_1 %uint_0 %uint_1 - OpBranch %63 - %63 = OpLabel - %64 = OpAtomicLoad %uint %60 %uint_1 %uint_0 - %65 = OpINotEqual %bool %64 %uint_1 - OpLoopMerge %68 %63 None - OpBranchConditional %65 %68 %63 - %68 = OpLabel - OpBranch %70 - %70 = OpLabel - OpBranch %72 - %72 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpBranch %74 - %74 = OpLabel - %75 = OpPhi %bool %false %72 %true %25 - OpSelectionMerge %105 None - OpBranchConditional %75 %78 %105 - %78 = OpLabel - %79 = OpIAdd %uint %36 %uint_1 - %80 = OpULessThan %bool %79 %39 - OpSelectionMerge %94 None - OpBranchConditional %80 %83 %94 - %83 = OpLabel - %84 = OpIAdd %uint %36 %uint_1 - %85 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %84 - OpBranch %87 - %87 = OpLabel - %88 = OpAtomicLoad %uint %85 %uint_1 %uint_0 - %89 = OpINotEqual %bool %88 %uint_0 - OpLoopMerge %92 %87 None - OpBranchConditional %89 %92 %87 - %92 = OpLabel - OpBranch %94 - %94 = OpLabel - OpBranch %96 - %96 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_8 - OpSelectionMerge %103 None - OpBranchConditional %80 %99 %103 - %99 = OpLabel - %100 = OpIAdd %uint %36 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %19 %uint_0 %100 - OpAtomicStore %101 %uint_1 %uint_0 %uint_0 - OpBranch %103 - %103 = OpLabel - OpBranch %105 - %105 = OpLabel - OpBranch %107 - %107 = OpLabel - %108 = OpINotEqual %bool %47 %uint_0 - OpSelectionMerge %127 None - OpBranchConditional %108 %111 %127 - %111 = OpLabel - %112 = OpAccessChain %_ptr_StorageBuffer_uint %21 %uint_0 %45 - %113 = OpLoad %uint %112 - OpBranch %115 - %115 = OpLabel - %116 = OpPhi %uint %120 %115 %113 %111 - %117 = OpPhi %uint %121 %115 %uint_0 %111 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %20 %uint_0 %117 - %119 = OpLoad %uint %118 MakePointerVisible|NonPrivatePointer %uint_1 - %120 = OpIAdd %uint %116 %119 - OpStore %112 %120 - %121 = OpIAdd %uint %117 %uint_1 - %122 = OpUGreaterThanEqual %bool %121 %47 - OpLoopMerge %125 %115 None - OpBranchConditional %122 %125 %115 - %125 = OpLabel - OpBranch %127 - %127 = OpLabel - OpBranch %129 - %129 = OpLabel - OpReturn - OpFunctionEnd - %146 = OpExtInst %void %132 PushConstantGlobalSize %uint_0 %uint_12 - %148 = OpExtInst %void %132 PushConstantRegionOffset %uint_16 %uint_12 - %150 = OpExtInst %void %132 PushConstantNumWorkgroups %uint_32 %uint_12 - %152 = OpExtInst %void %132 PushConstantRegionGroupOffset %uint_48 %uint_12 - %135 = OpExtInst %void %132 Kernel %24 %133 %uint_3 %uint_0 %134 - %137 = OpExtInst %void %132 ArgumentInfo %136 - %138 = OpExtInst %void %132 ArgumentStorageBuffer %135 %uint_0 %uint_0 %uint_0 %137 - %140 = OpExtInst %void %132 ArgumentInfo %139 - %141 = OpExtInst %void %132 ArgumentStorageBuffer %135 %uint_1 %uint_0 %uint_1 %140 - %143 = OpExtInst %void %132 ArgumentInfo %142 - %144 = OpExtInst %void %132 ArgumentStorageBuffer %135 %uint_2 %uint_0 %uint_2 %143 - %153 = OpExtInst %void %132 SpecConstantWorkgroupSize %uint_0 %uint_1 %uint_2 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/atomic_read_race.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/atomic_read_race.spv.dis index 8938cc1f33..cc1dd2e5da 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/atomic_read_race.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/atomic_read_race.spv.dis @@ -37,7 +37,7 @@ %uint_0 = OpConstant %uint 0 %_ptr_Input_uint = OpTypePointer Input %uint %uint_1 = OpConstant %uint 1 - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %uint_3 = OpConstant %uint 3 %uint_4 = OpConstant %uint 4 %uint_2 = OpConstant %uint 2 @@ -53,7 +53,7 @@ %27 = OpAccessChain %_ptr_Workgroup_uint %14 %26 %28 = OpLoad %uint %27 OpStore %20 %28 - %31 = OpAtomicIIncrement %uint %23 %uint_1 %uint_80 + %31 = OpAtomicIIncrement %uint %23 %uint_1 %uint_72 OpReturn OpFunctionEnd %35 = OpExtInst %void %32 Kernel %17 %33 %uint_1 %uint_0 %34 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/counter.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/counter.spv.dis index 104c0fc326..452406ddd0 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/counter.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/counter.spv.dis @@ -39,7 +39,7 @@ %uint_2 = OpConstant %uint 2 %uint_264 = OpConstant %uint 264 %uint_1 = OpConstant %uint 1 - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %uint_3 = OpConstant %uint 3 %uint_4 = OpConstant %uint 4 %3 = OpVariable %_ptr_Workgroup_uint Workgroup @@ -60,7 +60,7 @@ OpControlBarrier %uint_2 %uint_2 %uint_264 %34 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 %35 = OpLoad %uint %34 - %38 = OpAtomicIIncrement %uint %3 %uint_1 %uint_80 + %38 = OpAtomicIIncrement %uint %3 %uint_1 %uint_72 %39 = OpAccessChain %_ptr_Workgroup_uint %16 %38 OpStore %39 %35 OpReturn diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/equality_fail.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/equality_fail.spv.dis index 2484f1e099..22e84b163e 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/equality_fail.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/equality_fail.spv.dis @@ -33,7 +33,7 @@ %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint %uint_0 = OpConstant %uint 0 %uint_1 = OpConstant %uint 1 - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %uint_3 = OpConstant %uint 3 %uint_4 = OpConstant %uint 4 %uint_2 = OpConstant %uint 2 @@ -42,7 +42,7 @@ %15 = OpFunction %void None %14 %16 = OpLabel %19 = OpAccessChain %_ptr_Workgroup_uint %12 %uint_0 - %22 = OpAtomicIIncrement %uint %19 %uint_1 %uint_80 + %22 = OpAtomicIIncrement %uint %19 %uint_1 %uint_72 OpReturn OpFunctionEnd %26 = OpExtInst %void %23 Kernel %15 %24 %uint_1 %uint_0 %25 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/forloop.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/forloop.spv.dis index 0e88f926ae..eba4b31cc0 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/forloop.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/forloop.spv.dis @@ -51,7 +51,7 @@ %_ptr_Input_uint = OpTypePointer Input %uint %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %uint_4 = OpConstant %uint 4 %uint_3 = OpConstant %uint 3 %uint_16 = OpConstant %uint 16 @@ -76,7 +76,7 @@ %38 = OpPhi %uint %44 %37 %uint_0 %22 %39 = OpPhi %uint %43 %37 %uint_0 %22 %41 = OpAccessChain %_ptr_StorageBuffer_uint %18 %uint_0 %38 - %43 = OpAtomicIAdd %uint %41 %uint_1 %uint_80 %39 + %43 = OpAtomicIAdd %uint %41 %uint_1 %uint_72 %39 %44 = OpIAdd %uint %38 %uint_1 %45 = OpSGreaterThanEqual %bool %44 %27 OpLoopMerge %48 %37 None diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/histo.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/histo.spv.dis index 9b77650385..1e2e35396e 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/histo.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/histo.spv.dis @@ -41,7 +41,7 @@ %uint_0 = OpConstant %uint 0 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint %uint_1 = OpConstant %uint 1 - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %uint_2 = OpConstant %uint 2 %uint_3 = OpConstant %uint 3 %uint_4 = OpConstant %uint 4 @@ -56,7 +56,7 @@ %28 = OpAccessChain %_ptr_Workgroup_uint %14 %26 %29 = OpLoad %uint %28 %30 = OpAccessChain %_ptr_Workgroup_uint %18 %29 - %33 = OpAtomicIIncrement %uint %30 %uint_1 %uint_80 + %33 = OpAtomicIIncrement %uint %30 %uint_1 %uint_72 OpReturn OpFunctionEnd %38 = OpExtInst %void %34 Kernel %21 %35 %uint_2 %uint_0 %36 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/bad_local_counters.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/bad_local_counters.spv.dis index 653b8e63bc..02ac070fc6 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/bad_local_counters.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/bad_local_counters.spv.dis @@ -49,7 +49,7 @@ %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint %uint_0 = OpConstant %uint 0 %uint_1 = OpConstant %uint 1 - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %_ptr_Input_uint = OpTypePointer Input %uint %_ptr_PushConstant_uint = OpTypePointer PushConstant %uint %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint @@ -65,7 +65,7 @@ %24 = OpFunction %void None %23 %25 = OpLabel %28 = OpAccessChain %_ptr_Workgroup_uint %21 %uint_0 - %31 = OpAtomicIIncrement %uint %28 %uint_1 %uint_80 + %31 = OpAtomicIIncrement %uint %28 %uint_1 %uint_72 %33 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 %34 = OpLoad %uint %33 %36 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/intra_local_counters.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/intra_local_counters.spv.dis index 653b8e63bc..02ac070fc6 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/intra_local_counters.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/atomics/refined_atomic_abstraction/intra_local_counters.spv.dis @@ -49,7 +49,7 @@ %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint %uint_0 = OpConstant %uint 0 %uint_1 = OpConstant %uint 1 - %uint_80 = OpConstant %uint 80 + %uint_72 = OpConstant %uint 72 %_ptr_Input_uint = OpTypePointer Input %uint %_ptr_PushConstant_uint = OpTypePointer PushConstant %uint %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint @@ -65,7 +65,7 @@ %24 = OpFunction %void None %23 %25 = OpLabel %28 = OpAccessChain %_ptr_Workgroup_uint %21 %uint_0 - %31 = OpAtomicIIncrement %uint %28 %uint_1 %uint_80 + %31 = OpAtomicIIncrement %uint %28 %uint_1 %uint_72 %33 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 %34 = OpLoad %uint %33 %36 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/inter_group_and_barrier_flag_tests/fail/no_barrier_flags.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/inter_group_and_barrier_flag_tests/fail/no_barrier_flags.spv.dis index 820394c5d8..b479dbc6a1 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/inter_group_and_barrier_flag_tests/fail/no_barrier_flags.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/inter_group_and_barrier_flag_tests/fail/no_barrier_flags.spv.dis @@ -42,7 +42,7 @@ %_ptr_PushConstant_uint = OpTypePointer PushConstant %uint %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint %uint_2 = OpConstant %uint 2 - %uint_8 = OpConstant %uint 8 + %uint_264 = OpConstant %uint 264 %uint_1 = OpConstant %uint 1 %uint_3 = OpConstant %uint 3 %uint_4 = OpConstant %uint 4 @@ -63,7 +63,7 @@ %32 = OpLoad %uint %31 %34 = OpAccessChain %_ptr_Workgroup_uint %18 %32 OpStore %34 %30 - OpControlBarrier %uint_2 %uint_2 %uint_8 + OpControlBarrier %uint_2 %uint_2 %uint_264 %37 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 %38 = OpLoad %uint %37 %39 = OpAccessChain %_ptr_PushConstant_uint %5 %uint_0 %uint_0 diff --git a/dartagnan/src/test/resources/spirv/gpuverify/mem_fence.spv.dis b/dartagnan/src/test/resources/spirv/gpuverify/mem_fence.spv.dis index 45ab5c04c2..80507691bd 100644 --- a/dartagnan/src/test/resources/spirv/gpuverify/mem_fence.spv.dis +++ b/dartagnan/src/test/resources/spirv/gpuverify/mem_fence.spv.dis @@ -26,16 +26,17 @@ %void = OpTypeVoid %10 = OpTypeFunction %void %uint_2 = OpConstant %uint 2 - %uint_8 = OpConstant %uint 8 - %uint_4 = OpConstant %uint 4 + %uint_264 = OpConstant %uint 264 + %uint_260 = OpConstant %uint 260 + %uint_258 = OpConstant %uint 258 %uint_0 = OpConstant %uint 0 %uint_1 = OpConstant %uint 1 %8 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize %11 = OpFunction %void None %10 %12 = OpLabel - OpMemoryBarrier %uint_2 %uint_8 - OpMemoryBarrier %uint_2 %uint_2 - OpMemoryBarrier %uint_2 %uint_4 + OpMemoryBarrier %uint_2 %uint_264 + OpMemoryBarrier %uint_2 %uint_258 + OpMemoryBarrier %uint_2 %uint_260 OpReturn OpFunctionEnd %20 = OpExtInst %void %16 Kernel %11 %17 %uint_0 %uint_0 %18 diff --git a/litmus/VULKAN/Data-Race/mp3acqrel-filter.litmus b/litmus/VULKAN/Data-Race/mp3acqrel-filter.litmus index ea469a5746..a69dda0df4 100644 --- a/litmus/VULKAN/Data-Race/mp3acqrel-filter.litmus +++ b/litmus/VULKAN/Data-Race/mp3acqrel-filter.litmus @@ -8,8 +8,8 @@ P2:r2=0; x=0; y=0; } - P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; - st.av.dv.sc0 x, 1 | rmw.acq_rel.dv.sc0.semsc0 r0, y, 2 | ld.atom.acq.dv.sc1.semsc0 r1, y ; - st.atom.rel.dv.sc1.semsc0 y, 1 | | ld.vis.dv.sc0 r2, x ; + P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; + st.av.dv.sc0 x, 1 | rmw.atom.acq_rel.dv.sc0.semsc0 r0, y, 2 | ld.atom.acq.dv.sc1.semsc0 r1, y ; + st.atom.rel.dv.sc1.semsc0 y, 1 | | ld.vis.dv.sc0 r2, x ; filter (P1:r0 == 1 /\ P2:r1 == 2) \ No newline at end of file diff --git a/litmus/VULKAN/Data-Race/noncohandatom-filter.litmus b/litmus/VULKAN/Data-Race/noncohandatom-filter.litmus index 0895e45168..581b98ed7e 100644 --- a/litmus/VULKAN/Data-Race/noncohandatom-filter.litmus +++ b/litmus/VULKAN/Data-Race/noncohandatom-filter.litmus @@ -8,7 +8,7 @@ y=0; } P0@sg 0, wg 0, qf 0 ; st.nonpriv.sc0 y, 1 ; - rmw.wg.sc0 r0, y, 2 ; + rmw.atom.wg.sc0 r0, y, 2 ; ld.sc0 r1, y ; filter (P0:r0 == 1 /\ P0:r1 == 2) \ No newline at end of file diff --git a/litmus/VULKAN/Data-Race/releaseseq3-filter.litmus b/litmus/VULKAN/Data-Race/releaseseq3-filter.litmus index 74e59303f4..46102ab3d4 100644 --- a/litmus/VULKAN/Data-Race/releaseseq3-filter.litmus +++ b/litmus/VULKAN/Data-Race/releaseseq3-filter.litmus @@ -9,7 +9,7 @@ x=0; y=0; } P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; - st.av.dv.sc0 x, 1 | rmw.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; + st.av.dv.sc0 x, 1 | rmw.atom.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; st.atom.rel.dv.sc0.semsc0 y, 1 | | ld.vis.dv.sc0 r2, x ; filter (P1:r0 == 1 /\ P2:r1 == 1) \ No newline at end of file diff --git a/litmus/VULKAN/Data-Race/releaseseq4-filter.litmus b/litmus/VULKAN/Data-Race/releaseseq4-filter.litmus index 59c37b763b..b6b335689f 100644 --- a/litmus/VULKAN/Data-Race/releaseseq4-filter.litmus +++ b/litmus/VULKAN/Data-Race/releaseseq4-filter.litmus @@ -9,7 +9,7 @@ x=0; y=0; } P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; - st.av.dv.sc0 x, 1 | rmw.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; + st.av.dv.sc0 x, 1 | rmw.atom.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; membar.rel.dv.semsc0 | | ld.vis.dv.sc0 r2, x ; st.atom.dv.sc0 y, 1 | | ; filter diff --git a/litmus/VULKAN/Kronos-Group/mp3acqrel.litmus b/litmus/VULKAN/Kronos-Group/mp3acqrel.litmus index 2d714f99bf..9c7ee8e1f2 100644 --- a/litmus/VULKAN/Kronos-Group/mp3acqrel.litmus +++ b/litmus/VULKAN/Kronos-Group/mp3acqrel.litmus @@ -8,8 +8,8 @@ P2:r2=0; x=0; y=0; } - P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; - st.av.dv.sc0 x, 1 | rmw.acq_rel.dv.sc0.semsc0 r0, y, 2 | ld.atom.acq.dv.sc1.semsc0 r1, y ; - st.atom.rel.dv.sc1.semsc0 y, 1 | | ld.vis.dv.sc0 r2, x ; + P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; + st.av.dv.sc0 x, 1 | rmw.atom.acq_rel.dv.sc0.semsc0 r0, y, 2 | ld.atom.acq.dv.sc1.semsc0 r1, y ; + st.atom.rel.dv.sc1.semsc0 y, 1 | | ld.vis.dv.sc0 r2, x ; exists (P1:r0 == 1 /\ P2:r1 == 2) \ No newline at end of file diff --git a/litmus/VULKAN/Kronos-Group/noncohandatom.litmus b/litmus/VULKAN/Kronos-Group/noncohandatom.litmus index 488c33ba56..d1bb2078d4 100644 --- a/litmus/VULKAN/Kronos-Group/noncohandatom.litmus +++ b/litmus/VULKAN/Kronos-Group/noncohandatom.litmus @@ -8,7 +8,7 @@ y=0; } P0@sg 0, wg 0, qf 0 ; st.nonpriv.sc0 y, 1 ; - rmw.wg.sc0 r0, y, 2 ; + rmw.atom.wg.sc0 r0, y, 2 ; ld.sc0 r1, y ; exists (P0:r0 == 1 /\ P0:r1 == 2) \ No newline at end of file diff --git a/litmus/VULKAN/Kronos-Group/releaseseq3.litmus b/litmus/VULKAN/Kronos-Group/releaseseq3.litmus index 300ccf79a2..0fd4be4a18 100644 --- a/litmus/VULKAN/Kronos-Group/releaseseq3.litmus +++ b/litmus/VULKAN/Kronos-Group/releaseseq3.litmus @@ -9,7 +9,7 @@ x=0; y=0; } P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; - st.av.dv.sc0 x, 1 | rmw.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; + st.av.dv.sc0 x, 1 | rmw.atom.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; st.atom.rel.dv.sc0.semsc0 y, 1 | | ld.vis.dv.sc0 r2, x ; exists (P1:r0 == 1 /\ P2:r1 == 1) \ No newline at end of file diff --git a/litmus/VULKAN/Kronos-Group/releaseseq4.litmus b/litmus/VULKAN/Kronos-Group/releaseseq4.litmus index b35494a424..aa07f835de 100644 --- a/litmus/VULKAN/Kronos-Group/releaseseq4.litmus +++ b/litmus/VULKAN/Kronos-Group/releaseseq4.litmus @@ -9,7 +9,7 @@ x=0; y=0; } P0@sg 0, wg 0, qf 0 | P1@sg 0,wg 1, qf 0 | P2@sg 0,wg 2, qf 0 ; - st.av.dv.sc0 x, 1 | rmw.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; + st.av.dv.sc0 x, 1 | rmw.atom.dv.sc0 r0, y, 2 | ld.atom.acq.dv.sc0.semsc0 r1, y ; membar.rel.dv.semsc0 | | ld.vis.dv.sc0 r2, x ; st.atom.dv.sc0 y, 1 | | ; exists diff --git a/litmus/VULKAN/Manual/MP-mesa-fence-loop.litmus b/litmus/VULKAN/Manual/MP-mesa-fence-loop.litmus index baca414a21..0e486768c2 100644 --- a/litmus/VULKAN/Manual/MP-mesa-fence-loop.litmus +++ b/litmus/VULKAN/Manual/MP-mesa-fence-loop.litmus @@ -13,6 +13,6 @@ flag=0; goto LC00 | ; LC01: | ; ld.atom.dv.sc0 r2, data | ; - ld.sc0 r3, 1 | ; + add r3, 1, 0 | ; exists (P0:r3 == 1 /\ P0:r2 != 1) \ No newline at end of file diff --git a/litmus/VULKAN/Manual/MP-mesa-load-acq.litmus b/litmus/VULKAN/Manual/MP-mesa-load-acq.litmus index 77dc5e748e..6fdc81160c 100644 --- a/litmus/VULKAN/Manual/MP-mesa-load-acq.litmus +++ b/litmus/VULKAN/Manual/MP-mesa-load-acq.litmus @@ -12,6 +12,6 @@ flag=0; goto LC00 | ; LC01: | ; ld.atom.dv.sc0 r2, data | ; - ld.sc0 r3, 1 | ; + add r3, 1, 0 | ; exists (P0:r3 == 1 /\ P0:r2 != 1) \ No newline at end of file diff --git a/litmus/VULKAN/Manual/MP-mesa-optimized.litmus b/litmus/VULKAN/Manual/MP-mesa-optimized.litmus index 8a8ddd8e35..a3b22c51ea 100644 --- a/litmus/VULKAN/Manual/MP-mesa-optimized.litmus +++ b/litmus/VULKAN/Manual/MP-mesa-optimized.litmus @@ -8,6 +8,6 @@ flag=0; P0@sg 0,wg 0, qf 0 | P1@sg 0,wg 1, qf 0 ; membar.acq.dv.semsc0 | st.atom.dv.sc0 data, 1 ; ld.atom.dv.sc0 r2, data | membar.rel.dv.semsc0 ; - ld.sc0 r3, 1 | st.atom.dv.sc0 flag, 1 ; + add r3, 1, 0 | st.atom.dv.sc0 flag, 1 ; exists (P0:r3 == 1 /\ P0:r2 != 1) \ No newline at end of file diff --git a/litmus/VULKAN/Manual/MP-mesa.litmus b/litmus/VULKAN/Manual/MP-mesa.litmus index 3b303b8b3d..99b97a3349 100644 --- a/litmus/VULKAN/Manual/MP-mesa.litmus +++ b/litmus/VULKAN/Manual/MP-mesa.litmus @@ -13,6 +13,6 @@ flag=0; LC01: | ; membar.acq.dv.semsc0 | ; ld.atom.dv.sc0 r2, data | ; - ld.sc0 r3, 1 | ; + add r3, 1, 0 | ; exists (P0:r3 == 1 /\ P0:r2 != 1) \ No newline at end of file diff --git a/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-1.litmus b/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-1.litmus index 2a9d244f38..4af8a56a3b 100644 --- a/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-1.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-1.litmus @@ -13,7 +13,7 @@ f1=0; f2=0; bne r9, 0, LC01 | bne r9, 0, LC11 | LC20: | ld.vis.dv.sc0 r0, x0 | LC40: | ld.vis.dv.sc0 r0, x0 ; goto LC00 | goto LC10 | ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; LC01: | LC11: | bne r9, 1, LC21 | ld.vis.dv.sc0 r2, x2 | bne r9, 1, LC41 | ld.vis.dv.sc0 r2, x2 ; - cbar.wg.semsc0 00 | cbar.wg.semsc0 00 | goto LC20 | ld.vis.dv.sc0 r3, x3 | goto LC40 | ld.vis.dv.sc0 r3, x3 ; + cbar.wg 00 | cbar.wg 00 | goto LC20 | ld.vis.dv.sc0 r3, x3 | goto LC40 | ld.vis.dv.sc0 r3, x3 ; st.atom.rel.dv.sc0.semsc0 f1, 0 | st.atom.rel.dv.sc0.semsc0 f2, 0 | LC21: | ld.vis.dv.sc0 r4, x4 | LC41: | ld.vis.dv.sc0 r4, x4 ; ld.vis.dv.sc0 r0, x0 | ld.vis.dv.sc0 r0, x0 | cbar.acq_rel.wg.semsc0 11 | ld.vis.dv.sc0 r5, x5 | cbar.acq_rel.wg.semsc0 21 | ld.vis.dv.sc0 r5, x5 ; ld.vis.dv.sc0 r1, x1 | ld.vis.dv.sc0 r1, x1 | ld.vis.dv.sc0 r0, x0 | | ld.vis.dv.sc0 r0, x0 | ; diff --git a/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-2.litmus b/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-2.litmus index b3a583687b..14c714c24a 100644 --- a/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-2.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-2.litmus @@ -8,7 +8,7 @@ f1=0; f2=0; } P0@sg 0, wg 0, qf 0 | P1@sg 0, wg 0, qf 0 | P2@sg 0, wg 1, qf 0 | P3@sg 0, wg 1, qf 0 | P4@sg 0, wg 2, qf 0 | P5@sg 0, wg 2, qf 0 ; st.av.dv.sc0 x0, 1 | st.av.dv.sc0 x1, 1 | st.av.dv.sc0 x2, 1 | st.av.dv.sc0 x3, 1 | st.av.dv.sc0 x4, 1 | st.av.dv.sc0 x5, 1 ; - LC00: | LC10: | cbar.wg.semsc0 10 | cbar.wg.semsc0 10 | cbar.wg.semsc0 20 | cbar.wg.semsc0 20 ; + LC00: | LC10: | cbar.wg 10 | cbar.wg 10 | cbar.wg 20 | cbar.wg 20 ; ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | st.atom.rel.dv.sc0.semsc0 f1, 1 | cbar.acq_rel.wg.semsc0 11 | st.atom.rel.dv.sc0.semsc0 f2, 1 | cbar.acq_rel.wg.semsc0 21 ; bne r9, 0, LC01 | bne r9, 0, LC11 | LC20: | ld.vis.dv.sc0 r0, x0 | LC40: | ld.vis.dv.sc0 r0, x0 ; goto LC00 | goto LC10 | ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; diff --git a/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-3.litmus b/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-3.litmus index 5ff25aef34..2075a630a3 100644 --- a/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-3.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-cbar-rlx-3.litmus @@ -9,13 +9,13 @@ f1=0; f2=0; P0@sg 0, wg 0, qf 0 | P1@sg 0, wg 0, qf 0 | P2@sg 0, wg 1, qf 0 | P3@sg 0, wg 1, qf 0 | P4@sg 0, wg 2, qf 0 | P5@sg 0, wg 2, qf 0 ; st.av.dv.sc0 x0, 1 | st.av.dv.sc0 x1, 1 | st.av.dv.sc0 x2, 1 | st.av.dv.sc0 x3, 1 | st.av.dv.sc0 x4, 1 | st.av.dv.sc0 x5, 1 ; LC00: | LC10: | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 20 | cbar.acq_rel.wg.semsc0 20 ; - ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | st.atom.rel.dv.sc0.semsc0 f1, 1 | cbar.wg.semsc0 11 | st.atom.rel.dv.sc0.semsc0 f2, 1 | cbar.wg.semsc0 21 ; + ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | st.atom.rel.dv.sc0.semsc0 f1, 1 | cbar.wg 11 | st.atom.rel.dv.sc0.semsc0 f2, 1 | cbar.wg 21 ; bne r9, 0, LC01 | bne r9, 0, LC11 | LC20: | ld.vis.dv.sc0 r0, x0 | LC40: | ld.vis.dv.sc0 r0, x0 ; goto LC00 | goto LC10 | ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; LC01: | LC11: | bne r9, 1, LC21 | ld.vis.dv.sc0 r2, x2 | bne r9, 1, LC41 | ld.vis.dv.sc0 r2, x2 ; cbar.acq_rel.wg.semsc0 00 | cbar.acq_rel.wg.semsc0 00 | goto LC20 | ld.vis.dv.sc0 r3, x3 | goto LC40 | ld.vis.dv.sc0 r3, x3 ; st.atom.rel.dv.sc0.semsc0 f1, 0 | st.atom.rel.dv.sc0.semsc0 f2, 0 | LC21: | ld.vis.dv.sc0 r4, x4 | LC41: | ld.vis.dv.sc0 r4, x4 ; - ld.vis.dv.sc0 r0, x0 | ld.vis.dv.sc0 r0, x0 | cbar.wg.semsc0 11 | ld.vis.dv.sc0 r5, x5 | cbar.wg.semsc0 21 | ld.vis.dv.sc0 r5, x5 ; + ld.vis.dv.sc0 r0, x0 | ld.vis.dv.sc0 r0, x0 | cbar.wg 11 | ld.vis.dv.sc0 r5, x5 | cbar.wg 21 | ld.vis.dv.sc0 r5, x5 ; ld.vis.dv.sc0 r1, x1 | ld.vis.dv.sc0 r1, x1 | ld.vis.dv.sc0 r0, x0 | | ld.vis.dv.sc0 r0, x0 | ; ld.vis.dv.sc0 r2, x2 | ld.vis.dv.sc0 r2, x2 | ld.vis.dv.sc0 r1, x1 | | ld.vis.dv.sc0 r1, x1 | ; ld.vis.dv.sc0 r3, x3 | ld.vis.dv.sc0 r3, x3 | ld.vis.dv.sc0 r2, x2 | | ld.vis.dv.sc0 r2, x2 | ; diff --git a/litmus/VULKAN/Manual/xf-barrier-load-rlx-1.litmus b/litmus/VULKAN/Manual/xf-barrier-load-rlx-1.litmus index 9a5a00b887..dc3dac78fe 100644 --- a/litmus/VULKAN/Manual/xf-barrier-load-rlx-1.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-load-rlx-1.litmus @@ -9,7 +9,7 @@ f1=0; f2=0; P0@sg 0, wg 0, qf 0 | P1@sg 0, wg 0, qf 0 | P2@sg 0, wg 1, qf 0 | P3@sg 0, wg 1, qf 0 | P4@sg 0, wg 2, qf 0 | P5@sg 0, wg 2, qf 0 ; st.av.dv.sc0 x0, 1 | st.av.dv.sc0 x1, 1 | st.av.dv.sc0 x2, 1 | st.av.dv.sc0 x3, 1 | st.av.dv.sc0 x4, 1 | st.av.dv.sc0 x5, 1 ; LC00: | LC10: | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 20 | cbar.acq_rel.wg.semsc0 20 ; - ld.atom.dv.sc0.semsc0 r9, f1 | ld.atom.dv.sc0.semsc0 r9, f2 | st.atom.rel.dv.sc0.semsc0 f1, 1 | cbar.acq_rel.wg.semsc0 11 | st.atom.rel.dv.sc0.semsc0 f2, 1 | cbar.acq_rel.wg.semsc0 21 ; + ld.atom.dv.sc0 r9, f1 | ld.atom.dv.sc0 r9, f2 | st.atom.rel.dv.sc0.semsc0 f1, 1 | cbar.acq_rel.wg.semsc0 11 | st.atom.rel.dv.sc0.semsc0 f2, 1 | cbar.acq_rel.wg.semsc0 21 ; bne r9, 0, LC01 | bne r9, 0, LC11 | LC20: | ld.vis.dv.sc0 r0, x0 | LC40: | ld.vis.dv.sc0 r0, x0 ; goto LC00 | goto LC10 | ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; LC01: | LC11: | bne r9, 1, LC21 | ld.vis.dv.sc0 r2, x2 | bne r9, 1, LC41 | ld.vis.dv.sc0 r2, x2 ; diff --git a/litmus/VULKAN/Manual/xf-barrier-load-rlx-2.litmus b/litmus/VULKAN/Manual/xf-barrier-load-rlx-2.litmus index c75f2bc904..d95cfca8e9 100644 --- a/litmus/VULKAN/Manual/xf-barrier-load-rlx-2.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-load-rlx-2.litmus @@ -11,7 +11,7 @@ f1=0; f2=0; LC00: | LC10: | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 20 | cbar.acq_rel.wg.semsc0 20 ; ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | st.atom.rel.dv.sc0.semsc0 f1, 1 | cbar.acq_rel.wg.semsc0 11 | st.atom.rel.dv.sc0.semsc0 f2, 1 | cbar.acq_rel.wg.semsc0 21 ; bne r9, 0, LC01 | bne r9, 0, LC11 | LC20: | ld.vis.dv.sc0 r0, x0 | LC40: | ld.vis.dv.sc0 r0, x0 ; - goto LC00 | goto LC10 | ld.atom.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; + goto LC00 | goto LC10 | ld.atom.dv.sc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.dv.sc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; LC01: | LC11: | bne r9, 1, LC21 | ld.vis.dv.sc0 r2, x2 | bne r9, 1, LC41 | ld.vis.dv.sc0 r2, x2 ; cbar.acq_rel.wg.semsc0 00 | cbar.acq_rel.wg.semsc0 00 | goto LC20 | ld.vis.dv.sc0 r3, x3 | goto LC40 | ld.vis.dv.sc0 r3, x3 ; st.atom.rel.dv.sc0.semsc0 f1, 0 | st.atom.rel.dv.sc0.semsc0 f2, 0 | LC21: | ld.vis.dv.sc0 r4, x4 | LC41: | ld.vis.dv.sc0 r4, x4 ; diff --git a/litmus/VULKAN/Manual/xf-barrier-store-rlx-1.litmus b/litmus/VULKAN/Manual/xf-barrier-store-rlx-1.litmus index 7a46094930..9ad60cea94 100644 --- a/litmus/VULKAN/Manual/xf-barrier-store-rlx-1.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-store-rlx-1.litmus @@ -14,7 +14,7 @@ f1=0; f2=0; goto LC00 | goto LC10 | ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; LC01: | LC11: | bne r9, 1, LC21 | ld.vis.dv.sc0 r2, x2 | bne r9, 1, LC41 | ld.vis.dv.sc0 r2, x2 ; cbar.acq_rel.wg.semsc0 00 | cbar.acq_rel.wg.semsc0 00 | goto LC20 | ld.vis.dv.sc0 r3, x3 | goto LC40 | ld.vis.dv.sc0 r3, x3 ; - st.atom.dv.sc0.semsc0 f1, 0 | st.atom.dv.sc0.semsc0 f2, 0 | LC21: | ld.vis.dv.sc0 r4, x4 | LC41: | ld.vis.dv.sc0 r4, x4 ; + st.atom.dv.sc0 f1, 0 | st.atom.dv.sc0 f2, 0 | LC21: | ld.vis.dv.sc0 r4, x4 | LC41: | ld.vis.dv.sc0 r4, x4 ; ld.vis.dv.sc0 r0, x0 | ld.vis.dv.sc0 r0, x0 | cbar.acq_rel.wg.semsc0 11 | ld.vis.dv.sc0 r5, x5 | cbar.acq_rel.wg.semsc0 21 | ld.vis.dv.sc0 r5, x5 ; ld.vis.dv.sc0 r1, x1 | ld.vis.dv.sc0 r1, x1 | ld.vis.dv.sc0 r0, x0 | | ld.vis.dv.sc0 r0, x0 | ; ld.vis.dv.sc0 r2, x2 | ld.vis.dv.sc0 r2, x2 | ld.vis.dv.sc0 r1, x1 | | ld.vis.dv.sc0 r1, x1 | ; diff --git a/litmus/VULKAN/Manual/xf-barrier-store-rlx-2.litmus b/litmus/VULKAN/Manual/xf-barrier-store-rlx-2.litmus index f81cc46ce0..a0729362ca 100644 --- a/litmus/VULKAN/Manual/xf-barrier-store-rlx-2.litmus +++ b/litmus/VULKAN/Manual/xf-barrier-store-rlx-2.litmus @@ -9,7 +9,7 @@ f1=0; f2=0; P0@sg 0, wg 0, qf 0 | P1@sg 0, wg 0, qf 0 | P2@sg 0, wg 1, qf 0 | P3@sg 0, wg 1, qf 0 | P4@sg 0, wg 2, qf 0 | P5@sg 0, wg 2, qf 0 ; st.av.dv.sc0 x0, 1 | st.av.dv.sc0 x1, 1 | st.av.dv.sc0 x2, 1 | st.av.dv.sc0 x3, 1 | st.av.dv.sc0 x4, 1 | st.av.dv.sc0 x5, 1 ; LC00: | LC10: | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 10 | cbar.acq_rel.wg.semsc0 20 | cbar.acq_rel.wg.semsc0 20 ; - ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | st.atom.dv.sc0.semsc0 f1, 1 | cbar.acq_rel.wg.semsc0 11 | st.atom.dv.sc0.semsc0 f2, 1 | cbar.acq_rel.wg.semsc0 21 ; + ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | st.atom.dv.sc0 f1, 1 | cbar.acq_rel.wg.semsc0 11 | st.atom.dv.sc0 f2, 1 | cbar.acq_rel.wg.semsc0 21 ; bne r9, 0, LC01 | bne r9, 0, LC11 | LC20: | ld.vis.dv.sc0 r0, x0 | LC40: | ld.vis.dv.sc0 r0, x0 ; goto LC00 | goto LC10 | ld.atom.acq.dv.sc0.semsc0 r9, f1 | ld.vis.dv.sc0 r1, x1 | ld.atom.acq.dv.sc0.semsc0 r9, f2 | ld.vis.dv.sc0 r1, x1 ; LC01: | LC11: | bne r9, 1, LC21 | ld.vis.dv.sc0 r2, x2 | bne r9, 1, LC41 | ld.vis.dv.sc0 r2, x2 ;