Upstream instruction fixes: 64-bit literals, exact normalized ends, flat offsets, rare forms
Ports of 7d04943 (a signed 64-bit operand sign-extends its literal), 645391b (a normalized buffer format's ends load as exactly 1.0 and -1.0), 40f30be (FLAT offsets ignore bit 11), 3d71ad1, 344704e, 5d6889e, 78c1267, c3a04e2, e3fe5bf and the tests 259ba31, 8610ffb, 41b2472, 45ed8e3, 8d67fa5. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
25f78a079c
commit
a780306f4c
5 files changed
+529
-14
No files matched your search
@@ -352,6 +352,21 @@ mod tests {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn flat_offsets_ignore_bit_eleven() {
|
||||
let offset = |word0: u32| {
|
||||
let code = bytes(&[word0, 0x0000_0001, S_ENDPGM]);
|
||||
match decode(&code).unwrap()[0].fields(false) {
|
||||
Fields::Flat { offset, .. } => offset,
|
||||
fields => panic!("{fields:?}"),
|
||||
}
|
||||
};
|
||||
// flat_load_dword v0, v[1:2]: the FLAT offset is 11-bit and
|
||||
// unsigned, so bit 11 is ignored (0x800 -> 0, 0xfff -> 0x7ff).
|
||||
assert_eq!(offset(0xDC30_0800), 0);
|
||||
assert_eq!(offset(0xDC30_0FFF), 0x7FF);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tables_are_sorted() {
|
||||
for t in [
|
||||
|
||||
Reference in new issue
Block a user