mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
more notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25908 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9acddcd07e
commit
d395d0984f
@ -373,4 +373,56 @@ _test:
|
||||
|
||||
Doing this correctly is tricky though, as the xor clobbers the flags.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
We should generate 'test' instead of 'cmp' in various cases, e.g.:
|
||||
|
||||
bool %test(int %X) {
|
||||
%Y = shl int %X, ubyte 1
|
||||
%C = seteq int %Y, 0
|
||||
ret bool %C
|
||||
}
|
||||
bool %test(int %X) {
|
||||
%Y = and int %X, 8
|
||||
%C = seteq int %Y, 0
|
||||
ret bool %C
|
||||
}
|
||||
|
||||
This may just be a matter of using 'test' to write bigger patterns for X86cmp.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
Evaluate whether using movapd for SSE reg-reg moves is faster than using
|
||||
movsd/movss for them. It may eliminate false partial register dependences by
|
||||
writing the whole result register.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
SSE should implement 'select_cc' using 'emulated conditional moves' that use
|
||||
pcmp/pand/pandn/por to do a selection instead of a conditional branch:
|
||||
|
||||
double %X(double %Y, double %Z, double %A, double %B) {
|
||||
%C = setlt double %A, %B
|
||||
%z = add double %Z, 0.0 ;; select operand is not a load
|
||||
%D = select bool %C, double %Y, double %z
|
||||
ret double %D
|
||||
}
|
||||
|
||||
We currently emit:
|
||||
|
||||
_X:
|
||||
subl $12, %esp
|
||||
xorpd %xmm0, %xmm0
|
||||
addsd 24(%esp), %xmm0
|
||||
movsd 32(%esp), %xmm1
|
||||
movsd 16(%esp), %xmm2
|
||||
ucomisd 40(%esp), %xmm1
|
||||
jb LBB_X_2
|
||||
LBB_X_1:
|
||||
movsd %xmm0, %xmm2
|
||||
LBB_X_2:
|
||||
movsd %xmm2, (%esp)
|
||||
fldl (%esp)
|
||||
addl $12, %esp
|
||||
ret
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user