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 |
| 0 | Q | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | Rn | Rt | ||||||||
| L | R | opcode | S | size | |||||||||||||||||||||||||||
0x00110100000001100001xxxxxxxxxx
let 't = UInt(Rt);
let 'n = UInt(Rn);
let 'm = __UNKNOWN_integer();
let wback : bool = false;
let nontemporal : bool = false;
let tagchecked : bool = wback | n != 31;
let 'init_scale = UInt(opcode[2 .. 1]);
scale : int = init_scale;
let 'selem = UInt([opcode[0]] @ R) + 1;
replicate : bool = false;
index : int = undefined;
match scale {
3 => {
if L == 0b0 | S == 0b1 then {
throw(Error_Undefined())
};
scale = UInt(size);
replicate = true
},
0 => {
index = UInt((Q @ S) @ size)
},
1 => {
if [size[0]] == 0b1 then {
throw(Error_Undefined())
};
index = UInt((Q @ S) @ [size[1]])
},
2 => {
if [size[1]] == 0b1 then {
throw(Error_Undefined())
};
if [size[0]] == 0b0 then {
index = UInt(Q @ S)
} else {
if S == 0b1 then {
throw(Error_Undefined())
};
index = UInt(Q);
scale = 3
}
},
_ => ()
};
let 'scale = scale;
let 'index = index;
let memop : MemOp = if L == 0b1 then MemOp_LOAD else MemOp_STORE;
let 'datasize = if Q == 0b1 then 128 else 64;
let 'esize = (8 << scale);
assert(constraint('esize in {8, 16, 32, 64}));
execute_aarch64_instrs_memory_vector_single_no_wb_ordered(datasize, esize, index, m, memop, n, replicate, selem, t, tagchecked, wback)
t : int = t__arg;
CheckFPAdvSIMDEnabled64();
address : bits(64) = undefined;
rval : bits(128) = undefined;
element : bits('esize) = undefined;
let 'ebytes = DIV(esize, 8);
let accdesc : AccessDescriptor = CreateAccDescASIMDAcqRel(memop, tagchecked);
if n == 31 then {
CheckSPAlignment();
address = SP_read()
} else {
address = X_read(n, 64)
};
offs : bits(64) = Zeros(64);
if replicate then {
foreach (s from 0 to (selem - 1) by 1 in inc) {
element = Mem_read(address + offs, ebytes, accdesc);
V_set(t, datasize) = Replicate(element, DIV(datasize, esize));
offs = offs + ebytes;
t = MOD(t + 1, 32)
}
} else {
foreach (s from 0 to (selem - 1) by 1 in inc) {
rval = V_read(t, 128);
if memop == MemOp_LOAD then {
rval = Elem_set(rval, index, esize, Mem_read(address + offs, ebytes, accdesc));
V_set(t, 128) = rval
} else {
Mem_set(address + offs, ebytes, accdesc) = Elem_read(rval, index, esize)
};
offs = offs + ebytes;
t = MOD(t + 1, 32)
}
};
if SPESampleInFlight then {
SPESampleSIMDFPLoadStore()
};
if wback then {
if m != 31 then {
offs = X_read(m, 64)
};
if n == 31 then {
SP_set() = address + offs
} else {
X_set(n, 64) = address + offs
}
};
()
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.