fixed bit field field the encoding fixes should be
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 | cmpx | cmpy | addr | src1 | src2 | desc | |||||||||||||||||||||
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.
| Field | Bits | The Sail reads it in |
|---|---|---|
| cmpx | 26:24 | execute_CMP |
| [25:21] | 25:21 | ArithDest (not a field of the file) |
| cmpy | 23:21 | execute_CMP |
| addr | 20:19 | ArithA, ArithB |
| src1 | 18:12 | ArithA (18:14), ArithA |
| [13:7] | 13:7 | ArithB (not a field of the file) |
| src2 | 11:7 | ArithB |
| desc | 6:0 | ArithPattern |
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.