xref: /aosp_15_r20/external/llvm/lib/Target/Sparc/README.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerTo-do
2*9880d681SAndroid Build Coastguard Worker-----
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker* Keep the address of the constant pool in a register instead of forming its
5*9880d681SAndroid Build Coastguard Worker  address all of the time.
6*9880d681SAndroid Build Coastguard Worker* We can fold small constant offsets into the %hi/%lo references to constant
7*9880d681SAndroid Build Coastguard Worker  pool addresses as well.
8*9880d681SAndroid Build Coastguard Worker* When in V9 mode, register allocate %icc[0-3].
9*9880d681SAndroid Build Coastguard Worker* Add support for isel'ing UMUL_LOHI instead of marking it as Expand.
10*9880d681SAndroid Build Coastguard Worker* Emit the 'Branch on Integer Register with Prediction' instructions.  It's
11*9880d681SAndroid Build Coastguard Worker  not clear how to write a pattern for this though:
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerfloat %t1(int %a, int* %p) {
14*9880d681SAndroid Build Coastguard Worker        %C = seteq int %a, 0
15*9880d681SAndroid Build Coastguard Worker        br bool %C, label %T, label %F
16*9880d681SAndroid Build Coastguard WorkerT:
17*9880d681SAndroid Build Coastguard Worker        store int 123, int* %p
18*9880d681SAndroid Build Coastguard Worker        br label %F
19*9880d681SAndroid Build Coastguard WorkerF:
20*9880d681SAndroid Build Coastguard Worker        ret float undef
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workercodegens to this:
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workert1:
26*9880d681SAndroid Build Coastguard Worker        save -96, %o6, %o6
27*9880d681SAndroid Build Coastguard Worker1)      subcc %i0, 0, %l0
28*9880d681SAndroid Build Coastguard Worker1)      bne .LBBt1_2    ! F
29*9880d681SAndroid Build Coastguard Worker        nop
30*9880d681SAndroid Build Coastguard Worker.LBBt1_1:       ! T
31*9880d681SAndroid Build Coastguard Worker        or %g0, 123, %l0
32*9880d681SAndroid Build Coastguard Worker        st %l0, [%i1]
33*9880d681SAndroid Build Coastguard Worker.LBBt1_2:       ! F
34*9880d681SAndroid Build Coastguard Worker        restore %g0, %g0, %g0
35*9880d681SAndroid Build Coastguard Worker        retl
36*9880d681SAndroid Build Coastguard Worker        nop
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker1) should be replaced with a brz in V9 mode.
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Worker* Same as above, but emit conditional move on register zero (p192) in V9
41*9880d681SAndroid Build Coastguard Worker  mode.  Testcase:
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Workerint %t1(int %a, int %b) {
44*9880d681SAndroid Build Coastguard Worker        %C = seteq int %a, 0
45*9880d681SAndroid Build Coastguard Worker        %D = select bool %C, int %a, int %b
46*9880d681SAndroid Build Coastguard Worker        ret int %D
47*9880d681SAndroid Build Coastguard Worker}
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker* Emit MULX/[SU]DIVX instructions in V9 mode instead of fiddling
50*9880d681SAndroid Build Coastguard Worker  with the Y register, if they are faster.
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Worker* Codegen bswap(load)/store(bswap) -> load/store ASI
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker* Implement frame pointer elimination, e.g. eliminate save/restore for
55*9880d681SAndroid Build Coastguard Worker  leaf fns.
56*9880d681SAndroid Build Coastguard Worker* Fill delay slots
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker* Use %g0 directly to materialize 0. No instruction is required.
59