diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index 7db69b595cb..c544d01794b 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -13331,7 +13331,21 @@ ir.cpp: # 1216| getRightOperand(): [VariableAccess] vi4_shuffle # 1216| Type = [SpecifiedType] __attribute((vector_size(16UL))) int # 1216| ValueCategory = prvalue(load) -# 1219| getStmt(5): [ReturnStmt] return ... +# 1217| getStmt(5): [ExprStmt] ExprStmt +# 1217| getExpr(): [AssignExpr] ... = ... +# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1217| ValueCategory = lvalue +# 1217| getLValue(): [VariableAccess] vi4 +# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1217| ValueCategory = lvalue +# 1218| getStmt(6): [ExprStmt] ExprStmt +# 1218| getExpr(): [AssignExpr] ... = ... +# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1218| ValueCategory = lvalue +# 1218| getLValue(): [VariableAccess] vi4 +# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1218| ValueCategory = lvalue +# 1219| getStmt(7): [ReturnStmt] return ... # 1221| [TopLevelFunction] void* memcpy(void*, void*, int) # 1221| : # 1221| getParameter(0): [Parameter] dst diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index 0ff90fbb5d8..b7f7d598348 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -10486,10 +10486,6 @@ ir.cpp: # 1216| r1216_5(__attribute((vector_size(16UL))) int) = Add : r1216_2, r1216_4 # 1216| r1216_6(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : # 1216| m1216_7(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1216_6, r1216_5 -# 1219| v1219_1(void) = NoOp : -# 1211| v1211_7(void) = ReturnVoid : -# 1211| v1211_8(void) = AliasedUse : m1211_3 -# 1211| v1211_9(void) = ExitFunction : # 1223| int ModeledCallTarget(int) # 1223| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected index f1b75895c3e..3bbce2b470a 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected @@ -6,6 +6,7 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor +| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected index f1b75895c3e..3bbce2b470a 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected @@ -6,6 +6,7 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor +| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/ir.cpp b/cpp/ql/test/library-tests/ir/ir/ir.cpp index 2bc8fcca9a3..99876f7e9a4 100644 --- a/cpp/ql/test/library-tests/ir/ir/ir.cpp +++ b/cpp/ql/test/library-tests/ir/ir/ir.cpp @@ -1214,8 +1214,8 @@ void VectorTypes(int i) { vi4[i] = x; vector(4, int) vi4_shuffle = __builtin_shufflevector(vi4, vi4, 3+0, 2, 1, 0); vi4 = vi4 + vi4_shuffle; - - + vi4 = vi4 && vi4_shuffle; + vi4 = vi4 || vi4_shuffle; } void *memcpy(void *dst, void *src, int size); diff --git a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected index de43ad9631a..b1965792181 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected @@ -1,4 +1,6 @@ missingOperand +| ir.cpp:1217:3:1217:26 | Store: ... = ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | +| ir.cpp:1218:3:1218:26 | Store: ... = ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | unexpectedOperand duplicateOperand missingPhiOperand @@ -6,6 +8,8 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor +| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | +| ir.cpp:1217:3:1217:26 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 4fce667c611..44a97e35cf5 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -9692,10 +9692,18 @@ ir.cpp: # 1216| r1216_5(__attribute((vector_size(16UL))) int) = Add : r1216_2, r1216_4 # 1216| r1216_6(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : # 1216| mu1216_7(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1216_6, r1216_5 -# 1219| v1219_1(void) = NoOp : -# 1211| v1211_6(void) = ReturnVoid : -# 1211| v1211_7(void) = AliasedUse : ~m? -# 1211| v1211_8(void) = ExitFunction : + +# 1217| Block 1 +# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1217| mu1217_2(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_1 + +# 1218| Block 2 +# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1218| mu1218_2(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_1 +# 1219| v1219_1(void) = NoOp : +# 1211| v1211_6(void) = ReturnVoid : +# 1211| v1211_7(void) = AliasedUse : ~m? +# 1211| v1211_8(void) = ExitFunction : # 1223| int ModeledCallTarget(int) # 1223| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected index f1b75895c3e..3bbce2b470a 100644 --- a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected @@ -6,6 +6,7 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor +| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected index f1b75895c3e..3bbce2b470a 100644 --- a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected +++ b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected @@ -6,6 +6,7 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor +| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/vector_types/variables.expected b/cpp/ql/test/library-tests/vector_types/variables.expected index 284df7f4ff1..a4062385baf 100644 --- a/cpp/ql/test/library-tests/vector_types/variables.expected +++ b/cpp/ql/test/library-tests/vector_types/variables.expected @@ -34,4 +34,7 @@ | vector_types.cpp:47:23:47:25 | dst | dst | file://:0:0:0:0 | v16i * | 8 | | vector_types.cpp:47:34:47:36 | src | src | file://:0:0:0:0 | v16i * | 8 | | vector_types.cpp:47:43:47:43 | n | n | file://:0:0:0:0 | int | 4 | +| vector_types.cpp:54:20:54:22 | dst | dst | file://:0:0:0:0 | v16i * | 8 | +| vector_types.cpp:54:31:54:34 | src1 | src1 | file://:0:0:0:0 | v16i * | 8 | +| vector_types.cpp:54:43:54:46 | src2 | src2 | file://:0:0:0:0 | v16i * | 8 | | vector_types.cpp:62:43:62:44 | vf | vf | vector_types.cpp:60:16:60:27 | vector4float | 16 | diff --git a/cpp/ql/test/library-tests/vector_types/vector_types.cpp b/cpp/ql/test/library-tests/vector_types/vector_types.cpp index 79a90fa6fb9..84e263897d2 100644 --- a/cpp/ql/test/library-tests/vector_types/vector_types.cpp +++ b/cpp/ql/test/library-tests/vector_types/vector_types.cpp @@ -51,10 +51,10 @@ void shift_left(v16i *dst, v16i *src, int n) { *dst = *src << n; } - - - - +void logical(v16i *dst, v16i *src1, v16i *src2) { + *dst = *src1 && *src2; + *dst = *src1 || *src2; +} typedef double vector4double __attribute__((__vector_size__(32))); typedef float vector4float __attribute__((__vector_size__(16)));