-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
|
||
def vt(x: int) -> int: | ||
assert x in range(1<<7) | ||
return x << 16 | ||
|
||
def vs(x: int) -> int: | ||
assert x in range(1<<7) | ||
return x << 8 | ||
|
||
def vd(x: int) -> int: | ||
assert x in range(1<<7) | ||
return x << 0 | ||
|
||
VFPU0 = 0b011000 << 26 | ||
|
||
def vfpu0_fmt_tp(x: int) -> int: | ||
assert x in range(1<<5) | ||
fmt = (x & 0b11100) >> 2 | ||
t = (x & 0b00010) >> 1 | ||
p = (x & 0b00001) >> 0 | ||
return (fmt << 23) | (t << 15) | (p << 7) | ||
|
||
VT = vt(0) | ||
VS = vs(1 << 4) | ||
VD = vd(1 << 6) | ||
|
||
print(" # VFPU0") | ||
|
||
for i in range(1<<5): | ||
print(f" .word 0x{VFPU0:08X} | 0x{vfpu0_fmt_tp(i):08X} | 0x{VT:08X} | 0x{VS:08X} | 0x{VD:08X}") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.