SGEI

Arithmetic

fixed bit field field the encoding fixes should be

Encoding

313029282726252423222120191817161514131211109876543210
011010destaddrsrc1src2desc

bits 31:0: 0110 10xx xxxx xxxx xxxx xxxx xxxx xxxx

Its format is @arith_i: format 1: src1 takes the address register. 1i (the I forms): src2 takes it.

Runs execute_SETCMP with Form() 1.

Fields

Its operation is 4 opcodes' (Form() tells them apart), so it may read the fields of their layouts too.

FieldBitsThe Sail reads it in
dest25:21ArithDest
addr20:19ArithA, ArithB
src118:14ArithA
[18:12]18:12ArithA (not a field of the file)
src213:7ArithB, ArithB (11:7)
desc6:0ArithPattern

Operation Sail

SGE, SLT and their I forms: 1.0 in each component where a >= b (a < b), else 0.0

let f = Form(); /* 0 SGE, 1 SGEI, 2 SLT, 3 SLTI */
let inverted = f == 1 | f == 3;
let p = ArithPattern();
let a = ArithA(p, inverted);
let b = ArithB(p, inverted);
let d = ArithDest();
let mask = V4FCompare(if f <= 1 then 6 else 1, a, b);
SetDest(p, d, V4Select(mask, V4Const(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000),
                       V4Const(0x00000000, 0x00000000, 0x00000000, 0x00000000)))

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.