CMP

Arithmetic

fixed bit field field the encoding fixes should be

Encoding

313029282726252423222120191817161514131211109876543210
10111cmpxcmpyaddrsrc1src2desc

bits 31:0: 1011 1xxx xxxx xxxx xxxx xxxx xxxx xxxx

Its format is @cmp: format 1c: CMP's comparisons of x and y (0 ==, 1 !=, 2 <, 3 <=, 4 >, 5 >=).

Runs execute_CMP with Form() 0.

Fields

FieldBitsThe Sail reads it in
cmpx26:24execute_CMP
[25:21]25:21ArithDest (not a field of the file)
cmpy23:21execute_CMP
addr20:19ArithA, ArithB
src118:12ArithA (18:14), ArithA
[13:7]13:7ArithB (not a field of the file)
src211:7ArithB
desc6:0ArithPattern

Operation Sail

let p = ArithPattern();
let a = ArithA(p, false);
let b = ArithB(p, false);
/* the register the arithmetic format's destination field names (the comparisons' bits): the other arithmetic
   instructions' code makes its variable, which the module keeps */
let unused = ArithDest();
let mx = UInt(Field(24, 3));
let my = UInt(Field(21, 3));
if mx <= 5 & my <= 5 then {
    CondWrite(0, FCompare(CompareCode(mx), V4At(a, 0), V4At(b, 0)));
    CondWrite(1, FCompare(CompareCode(my), V4At(a, 1), V4At(b, 1)))
}

Made from ScarletNX's Sail at 166ad3910f80. The Sail and the encodings' file are ScarletNX's (GPL-3.0-or-later); its encodings are from nihstro's shader_bytecode.h (BSD-3-Clause), as Azahar reads them.