SM3TT2B (vector)

Data processing (scalar floating-point and Advanced SIMD)

fixed bit field field the encoding fixes should be

Vector crypto sm3 sm3tt2b

313029282726252423222120191817161514131211109876543210
11001110010Rm10imm211RnRd

11001110010xxxxx10xx11xxxxxxxxxx

Decode Sail

if not_bool(HaveSM3Ext()) then {
    throw(Error_Undefined())
};
let 'd = UInt(Rd);
let 'n = UInt(Rn);
let 'm = UInt(Rm);
let 'i = UInt(imm2);
execute_aarch64_instrs_vector_crypto_sm3_sm3tt2b(d, i, m, n)

Operation Sail

AArch64_CheckFPAdvSIMDEnabled();
let Vm : bits(128) = V_read(m, 128);
let Vn : bits(128) = V_read(n, 128);
let Vd : bits(128) = V_read(d, 128);
result : bits(128) = undefined;
let Wj : bits(32) = Elem_read(Vm, i, 32);
TT2 : bits(32) = Vd[127 .. 96] & Vd[95 .. 64] | not_vec(Vd[127 .. 96]) & Vd[63 .. 32];
let TT2 : bits(32) = (TT2 + Vd[31 .. 0] + Vn[127 .. 96] + Wj)[31 .. 0];
result[31 .. 0] = Vd[63 .. 32];
result[63 .. 32] = ROL(Vd[95 .. 64], 19);
result[95 .. 64] = Vd[127 .. 96];
result[127 .. 96] = EOR(EOR(TT2, ROL(TT2, 9)), ROL(TT2, 17));
V_set(d, 128) = result

Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.