---
title: "CmpOp: type in IR, TypeShade API reference for developers"
description: "CmpOp, a type in IR. The operator tag on Expr.compare: the six relational operators."
url: https://typeshade.dev/api/cmpop/
language: en
---

# `CmpOp`

Type in IR

The operator tag on Expr.compare: the six relational operators.

`import type { CmpOp } from 'typeshade'`
`import type { CmpOp } from 'typeshade/core/ir'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
type CmpOp = '<' | '>' | '<=' | '>=' | '==' | '!=';
```

## Description

A comparison produces a `bool`, or a `vecN<bool>` when the operands are vectors. The WGSL, GLSL and CPU backends spell or evaluate it identically.

## Source

[`src/core/ir/nodes/operators.ts`, line 21](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/nodes/operators.ts#L21), at commit af54ddad5
