blob: 4227245c572a366164014bd3cffe48a503441745 [file] [log] [blame]
sewardjf0c12502014-01-12 12:54:00 +00001
sewardj383d5d32014-01-13 11:50:17 +00002Status
3~~~~~~
sewardjf0c12502014-01-12 12:54:00 +00004
sewardj383d5d32014-01-13 11:50:17 +00005As of Jan 2014 the trunk contains a port to AArch64 ARMv8 -- loosely,
6the 64-bit ARM architecture. Currently it supports integer and FP
sewardjfc073c32014-01-15 14:30:24 +00007instructions and can run almost anything generated by gcc-4.8.2 -O2.
sewardj383d5d32014-01-13 11:50:17 +00008The port is under active development.
sewardjf0c12502014-01-12 12:54:00 +00009
sewardj383d5d32014-01-13 11:50:17 +000010Current limitations, as of mid-Jan 2014.
sewardjf0c12502014-01-12 12:54:00 +000011
sewardj383d5d32014-01-13 11:50:17 +000012* threaded apps won't work, due to inadequate sys_clone() support.
13
14* almost no support of vector (SIMD) instructions
15
philippe3ef45eb2014-02-12 00:02:05 +000016* Integration with the built in GDB server:
17 - basically works but breakpoints are causing crashes due to missing
18 unchainXDirect_ARM64 needed by LibVEX_UnChain.
19 - still to do:
20 arm64 xml register description files (allowing shadow registers to be looked at).
21 ptrace invoker : currently disabled for both arm and arm64
22 cpsr transfer to/from gdb to be looked at (see also arm equivalent code)
sewardj383d5d32014-01-13 11:50:17 +000023
24There has been extensive testing of the baseline simulation of integer
25and FP instructions. Memcheck is also believed to work, at least for
26small examples. Other tools appear to at least not crash when running
27/bin/date.
28
29
30Building
31~~~~~~~~
32
33You could probably build it directly on a target OS, using the normal
34non-cross scheme
35
36 ./autogen.sh ; ./configure --prefix=.. ; make ; make install
37
38Development so far was however done by cross compiling, viz:
39
40 export CC=aarch64-linux-gnu-gcc
41 export LD=aarch64-linux-gnu-ld
42 export AR=aarch64-linux-gnu-ar
43
44 ./autogen.sh
45 ./configure --prefix=`pwd`/Inst --host=aarch64-unknown-linux \
46 --enable-only64bit
47 make -j4
48 make -j4 install
49
50Doing this assumes that the install path (`pwd`/Inst) is valid on
51both host and target, which isn't normally the case. To avoid
52this limitation, do instead:
53
54 ./configure --prefix=/install/path/on/target \
55 --host=aarch64-unknown-linux \
56 --enable-only64bit
57 make -j4
58 make -j4 install DESTDIR=/a/temp/dir/on/host
59 # and then copy the contents of DESTDIR to the target.
60
61See README.android for more examples of cross-compile building.
62
63
64Implementation tidying-up/TODO notes
65~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardjf0c12502014-01-12 12:54:00 +000066
67UnwindStartRegs -- what should that contain?
68
69
sewardjf0c12502014-01-12 12:54:00 +000070vki-arm64-linux.h: vki_sigaction_base
sewardjf0c12502014-01-12 12:54:00 +000071I really don't think that __vki_sigrestore_t sa_restorer
72should be present. Adding it surely puts sa_mask at a wrong
73offset compared to (kernel) reality. But not having it causes
74compilation of m_signals.c to fail in hard to understand ways,
75so adding it temporarily.
76
77
78m_trampoline.S: what's the unexecutable-insn value? 0xFFFFFFFF
79is there at the moment, but 0x00000000 is probably what it should be.
80Also, fix indentation/tab-vs-space stuff
81
82
83./include/vki/vki-arm64-linux.h: uses __uint128_t. Should change
84it to __vki_uint128_t, but what's the defn of that?
85
86
sewardjf0c12502014-01-12 12:54:00 +000087m_debuginfo/priv_storage.h: need proper defn of DiCfSI
88
89
90readdwarf.c: is this correct?
91#elif defined(VGP_arm64_linux)
92# define FP_REG 29 //???
93# define SP_REG 31 //???
94# define RA_REG_DEFAULT 30 //???
95
96
97vki-arm64-linux.h:
98re linux-3.10.5/include/uapi/asm-generic/sembuf.h
99I'd say the amd64 version has padding it shouldn't have. Check?
100
101
sewardjf0c12502014-01-12 12:54:00 +0000102syswrap-linux.c run_a_thread_NORETURN assembly sections
103seems like tst->os_state.exitcode has word type
104in which case the ppc64_linux use of lwz to read it, is wrong
105
106
sewardjf0c12502014-01-12 12:54:00 +0000107syswrap-linux.c ML_(do_fork_clone)
108assuming that VGP_arm64_linux is the same as VGP_arm_linux here
109
110
sewardjf0c12502014-01-12 12:54:00 +0000111dispatch-arm64-linux.S: FIXME: set up FP control state before
112entering generated code. Also fix screwy indentation.
113
sewardj383d5d32014-01-13 11:50:17 +0000114
sewardjf0c12502014-01-12 12:54:00 +0000115dispatcher-ery general: what's a good (predictor-friendly) way to
116branch to a register?
117
118
sewardjf0c12502014-01-12 12:54:00 +0000119in vki-arm64-scnums.h
120//#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
121Probably want to reenable that and clean up accordingly
122
123
sewardjf0c12502014-01-12 12:54:00 +0000124putIRegXXorZR: figure out a way that the computed value is actually
125used, so as to keep any memory reads that might generate it, alive.
126(else the simulation can lose exceptions). At least, for writes to
127the zero register generated by loads .. or .. can anything other
128integer instructions, that write to a register, cause exceptions?
129
130
sewardjf0c12502014-01-12 12:54:00 +0000131loads/stores: generate stack alignment checks as necessary
132
133
sewardjf0c12502014-01-12 12:54:00 +0000134fix barrier insns: ISB, DMB
135
136
sewardjf0c12502014-01-12 12:54:00 +0000137fix atomic loads/stores
138
139
sewardjf0c12502014-01-12 12:54:00 +0000140FMADD/FMSUB/FNMADD/FNMSUB: generate and use the relevant fused
141IROps so as to avoid double rounding
142
143
sewardjf0c12502014-01-12 12:54:00 +0000144ARM64Instr_Call getRegUsage: re-check relative to what
145getAllocableRegs_ARM64 makes available
146
147
sewardjf0c12502014-01-12 12:54:00 +0000148Make dispatch-arm64-linux.S save any callee-saved Q regs
149I think what is required is to save D8-D15 and nothing more than that.
150
151
sewardjf0c12502014-01-12 12:54:00 +0000152wrapper for __NR3264_fstat -- correct?
153
154
sewardj383d5d32014-01-13 11:50:17 +0000155PRE(sys_clone): get rid of references to vki_modify_ldt_t and the
156definition of it in vki-arm64-linux.h. Ditto for 32 bit arm.
sewardjf0c12502014-01-12 12:54:00 +0000157
158
159sigframe-arm64-linux.c: build_sigframe: references to nonexistent
160siguc->uc_mcontext.trap_no, siguc->uc_mcontext.error_code have been
161replaced by zero. Also in synth_ucontext.
162
163
sewardjf0c12502014-01-12 12:54:00 +0000164m_debugger.c:
165uregs.pstate = LibVEX_GuestARM64_get_nzcv(vex); /* is this correct? */
166Is that remotely correct?
167
168
sewardjf0c12502014-01-12 12:54:00 +0000169host_arm64_defs.c: emit_ARM64INstr:
170ARM64in_VDfromX and ARM64in_VQfromXX: use simple top-half zeroing
171MOVs to vector registers instead of INS Vd.D[0], Xreg, to avoid false
172dependencies on the top half of the register. (Or at least check
sewardj383d5d32014-01-13 11:50:17 +0000173the semantics of INS Vd.D[0] to see if it zeroes out the top.)
sewardjf0c12502014-01-12 12:54:00 +0000174
175
176preferredVectorSubTypeFromSize: review perf effects and decide
177on a types-for-subparts policy
178
179
sewardjf0c12502014-01-12 12:54:00 +0000180fold_IRExpr_Unop: add a reduction rule for this
1811Sto64(CmpNEZ64( Or64(GET:I64(1192),GET:I64(1184)) ))
182vis 1Sto64(CmpNEZ64(x)) --> CmpwNEZ64(x)
183
184
sewardjf0c12502014-01-12 12:54:00 +0000185check insn selection for memcheck-only primops:
186Left64 CmpwNEZ64 V128to64 V128HIto64 1Sto64 CmpNEZ64 CmpNEZ32
187widen_z_8_to_64 1Sto32 Left32 32HLto64 CmpwNEZ32 CmpNEZ8
188
189
sewardjf0c12502014-01-12 12:54:00 +0000190isel: get rid of various cases where zero is put into a register
191and just use xzr instead. Especially for CmpNEZ64/32. And for
192writing zeroes into the CC thunk fields.
193
194
sewardjf0c12502014-01-12 12:54:00 +0000195/* Keep this list in sync with that in iselNext below */
196/* Keep this list in sync with that for Ist_Exit above */
197uh .. they are not in sync
198
199
sewardjf0c12502014-01-12 12:54:00 +0000200very stupid:
201imm64 x23, 0xFFFFFFFFFFFFFFA0
20217 F4 9F D2 F7 FF BF F2 F7 FF DF F2 F7 FF FF F2
203
204
sewardjf0c12502014-01-12 12:54:00 +0000205valgrind.h: fix VALGRIND_ALIGN_STACK/VALGRIND_RESTORE_STACK,
206also add CFI annotations
sewardjfdaf9e42014-01-13 00:18:51 +0000207
208
sewardjfdaf9e42014-01-13 00:18:51 +0000209could possibly bring r29 into use, which be useful as it is
210callee saved
sewardj383d5d32014-01-13 11:50:17 +0000211
212
213ubfm/sbfm etc: special case cases that are simple shifts, as iropt
214can't always simplify the general-case IR to a shift in such cases.
sewardj1cd6c902014-02-05 11:02:34 +0000215
216
217LDP,STP (immediate, simm7) (FP&VEC)
218should zero out hi parts of dst registers in the LDP case
219
220
221DUP insns: use Iop_Dup8x16, Iop_Dup16x8, Iop_Dup32x4
222rather than doing it "by hand"
223
224
225Any place where ZeroHI64ofV128 is used in conjunction with
226FP vector IROps: find a way to make sure that arithmetic on
227the upper half of the values is "harmless."
228
229
230math_MINMAXV: use real Iop_Cat{Odd,Even}Lanes ops rather than
231inline scalar code