Commit Graph

96765 Commits

Author SHA1 Message Date
Denis Drakhnia 8f4de9d485 e2k: Implement basic v5 support.
Add gdb xml files for e2k.
Tags are partially disabled for better performance.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 6fb98e718e e2k: Move TCG translation parts into single file.
The TCG translation was splitted into multiple files and
it was painful because it has a lot of cross references.

Reorg FX helpers.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 17be44b21b e2k: Use one large array for registers.
Previously was used two separate arrays for low and
high halves of a register. Now we can pass direct
pointer to a register into helpers instead of copying
the halves into a temporary buffer and pass pointer to
that buffer.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia bed634d944 e2k: Use %pfpfr for f32 and f64 operations.
%fpcr and %fpsr have been used for the operations but
%pfpfr must be used instead.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia cd6c5f262f e2k: Fix fxcmp{s,d}b tcg fatal errors.
Was used destroyed value of converted src2 after a branch.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia a8514e0e08 e2k: Update qemu-binfmt-conf.sh script.
Add e2k_old, e2k32 and e2k32_old user targets.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia b0a1af39c6 e2k: Add a fake atomic execution.
QEMU has cpu_exec_step_atomic function to run
one instruction in an exclusive mode but we need
to execute multiple instructions in that mode.
I don't want to modify the function.

The solution provides a correct execution of
atomic operations like on real CPU but needs
more testing to prove that it works correctly
in all cases.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 88fed7c276 e2k: Fix signed integer division.
Do not raise an x86 exception when the minimum signed
integer is divisible by minus one.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 374e658eb1 e2k: Add access_hw_stacks and backtrace syscalls.
Special system calls for managing hardware stacks.
Required for C++ exceptions.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia f49a9d8df0 e2k: Fix incorrect initialization of mlock.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Alibek Omarov 5220638091 e2k: remove unnecessary e2k32 directory
It can be avoided with TARGET_ABI_DIR=e2k in e2k32-linux-user.mak

Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia d3e84e57e5 e2k: Add e2k32 linux user files.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia e440ebc3db e2k: Basic impl of e2k32-linux-user.
Fix target_stat64 field types in 32-bit mode.
Basic impl of getpl.
Basic impl of ldgd{b,h,w,d}.
Basic impl of stgd{b,h,w,d}.
Add e2k exceptions.
Add Dynamic hw stacks expansion.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 7198f44549 e2k: Always SPILL/FILL in FX window mode.
It will fix 'finish' command in gdb.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 9e87995802 e2k: Panic if it was not possible to copy CR to a new thread.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 47c93f9dec e2k: Skip breakpoints into fake kernel address space.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 5bcc8d7383 e2k: Add reading of %lsr in rr{s,d}.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 0475c820f8 e2k: Fix args sizes for some int vec ops.
objdump prints incorrect argument sizes of some
integer vector operations from the first version
of ISA.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 3628f0569b e2k: Delete redundant unimplemented messages.
From e2k_cpu_set_pc and e2k_cpu_synchronize_from_tb.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 3cf004027d e2k: Increase PCS and PS sizes.
Dynamically expanding the stack has not yet been
implemented, but sometimes applications require
larger stacks.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 9146c4c67f e2k: Fix build of other linux-user-targets.
Forgot to wrap constants in if block.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 62637ca653 e2k: Add systrace print for access_hw_stacks.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 774f31dd0e e2k: Fix vector ops with saturation.
An incorrect cast to an unsigned integer was used
instead of a signed integer.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia ab620f7a2b e2k: Delete redundant unimplemented messages.
DAM has not been yet implemented. We always generate
a jump to a fixing code. All these messages are redundant.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia e404c06a2d e2k: Fix syscall restart.
We cannot just change the IP address in E2K to restart
the instruction because the same register can be read
and written in the same instruction (and many more
situations), but we can create a fake syscall instruction
and restart it.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 5e66da5f7d e2k: Delete top CRs from cpu state.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 05304bd1f3 e2k: Fix compiler warnings.
Remove unused static functions.
Replace a misused not operator by bitwise not.
2022-06-10 11:48:19 +03:00
Denis Drakhnia 5cb3b40f2d e2k: Set correct NR macro for pread/pwrite. 2022-06-10 11:48:19 +03:00
Denis Drakhnia 26b9e9a1e4 e2k: Impl basic unix signals support. 2022-06-10 11:48:19 +03:00
Denis Drakhnia 9c1321402e e2k: Fix getf{s,d} ops. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 7237457c44 e2k: Add stub for pref op. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 54c4312744 e2k: Add packed float simple and combined ops. 2022-06-10 11:48:18 +03:00
Denis Drakhnia f73e828f75 e2k: Fix fcomb_check. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 8a56f792b7 e2k: Probe AAU read access once per page. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 00502466f2 e2k: Always ignore lock load. 2022-06-10 11:48:18 +03:00
Denis Drakhnia b692d4c596 e2k: Fix decoding fcomb and pshufb. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 177922ca64 e2k: Split ALC decode/generate stages. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 99280ddade e2k: Fix movxc. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 00a4284abb e2k: Reorg fcomb ops. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 1caf8cf356 e2k: Reorg icomb ops. 2022-06-10 11:48:18 +03:00
Alibek Omarov dd64dfa134 e2k: %pfpfr write stubs 2022-06-10 11:48:18 +03:00
Alibek Omarov 400947bba3 e2k: implement fsqrttd/fxsqrttxx through ignoring what fsqrtid/fxsqrt{i,u}xx does 2022-06-10 11:48:18 +03:00
Denis Drakhnia 65675ac1cf e2k: Check address before MOVA memory read. 2022-06-10 11:48:18 +03:00
Denis Drakhnia cf04412feb e2k: Do not align mova addr. 2022-06-10 11:48:18 +03:00
Denis Drakhnia a37964a9d3 e2k: Fix fcomb operand ordering. 2022-06-10 11:48:18 +03:00
Denis Drakhnia b166b260da e2k: Impl neg src2 in fscale{s,d} and fxscalesx. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 399416a0d7 e2k: Allow to execute frcps, fsqrts, frsqrts. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 861a2b6fb6 e2k: Init CRs, make gcc happy. 2022-06-10 11:48:18 +03:00
Denis Drakhnia f018f02a5b e2k: Add movt{,c}{s,d,q} ops. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 6277820c04 e2k: Add fscale{s,d} and fxscalesx ops. 2022-06-10 11:48:18 +03:00