tools/clang/lib/SPIRV/SPIRVEmitter.cpp
// Returns true if the given opcode is an accepted binary opcode in
// OpSpecConstantOp.
Returns true if the given opcode is an accepted binary opcode in
OpSpecConstantOp.
Returns true if the given opcode is an accepted binary opcode in OpSpecConstantOp .
bool isAcceptedSpecConstantBinaryOp(spv::Op op) {
  switch (op) {
  case spv::Op::OpIAdd:
  case spv::Op::OpISub:
  case spv::Op::OpIMul:
  case spv::Op::OpUDiv:
  case spv::Op::OpSDiv:
  case spv::Op::OpUMod:
  case spv::Op::OpSRem:
  case spv::Op::OpSMod:
  case spv::Op::OpShiftRightLogical:
  case spv::Op::OpShiftRightArithmetic:
  case spv::Op::OpShiftLeftLogical:
  case spv::Op::OpBitwiseOr:
  case spv::Op::OpBitwiseXor:
  case spv::Op::OpBitwiseAnd:
  case spv::Op::OpVectorShuffle:
  case spv::Op::OpCompositeExtract:
  case spv::Op::OpCompositeInsert:
  case spv::Op::OpLogicalOr:
  case spv::Op::OpLogicalAnd:
  case spv::Op::OpLogicalNot:
  case spv::Op::OpLogicalEqual:
  case spv::Op::OpLogicalNotEqual:
  case spv::Op::OpIEqual:
  case spv::Op::OpINotEqual:
  case spv::Op::OpULessThan:
  case spv::Op::OpSLessThan:
  case spv::Op::OpUGreaterThan:
  case spv::Op::OpSGreaterThan:
  case spv::Op::OpULessThanEqual:
  case spv::Op::OpSLessThanEqual:
  case spv::Op::OpUGreaterThanEqual:
  case spv::Op::OpSGreaterThanEqual:
    return true;
  }
  return false;
}
bool isAcceptedSpecConstantBinaryOp ( spv :: Op op ) { switch ( op ) { case spv :: Op :: OpIAdd : case spv :: Op :: OpISub : case spv :: Op :: OpIMul : case spv :: Op :: OpUDiv : case spv :: Op :: OpSDiv : case spv :: Op :: OpUMod : case spv :: Op :: OpSRem : case spv :: Op :: OpSMod : case spv :: Op :: OpShiftRightLogical : case spv :: Op :: OpShiftRightArithmetic : case spv :: Op :: OpShiftLeftLogical : case spv :: Op :: OpBitwiseOr : case spv :: Op :: OpBitwiseXor : case spv :: Op :: OpBitwiseAnd : case spv :: Op :: OpVectorShuffle : case spv :: Op :: OpCompositeExtract : case spv :: Op :: OpCompositeInsert : case spv :: Op :: OpLogicalOr : case spv :: Op :: OpLogicalAnd : case spv :: Op :: OpLogicalNot : case spv :: Op :: OpLogicalEqual : case spv :: Op :: OpLogicalNotEqual : case spv :: Op :: OpIEqual : case spv :: Op :: OpINotEqual : case spv :: Op :: OpULessThan : case spv :: Op :: OpSLessThan : case spv :: Op :: OpUGreaterThan : case spv :: Op :: OpSGreaterThan : case spv :: Op :: OpULessThanEqual : case spv :: Op :: OpSLessThanEqual : case spv :: Op :: OpUGreaterThanEqual : case spv :: Op :: OpSGreaterThanEqual : return true ; } return false ; }
Returns true if the given opcode is an accepted binary opcode in
OpSpecConstantOp.
Returns true if the given opcode is an accepted binary opcode in OpSpecConstantOp .