mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
add a note from PR6194
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95649 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d94998f525
commit
1728472726
@ -954,3 +954,36 @@ define float @bar(float %x) nounwind {
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
This IR (from PR6194):
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-apple-darwin10.0.0"
|
||||
|
||||
%0 = type { double, double }
|
||||
%struct.float3 = type { float, float, float }
|
||||
|
||||
define void @test(%0, %struct.float3* nocapture %res) nounwind noinline ssp {
|
||||
entry:
|
||||
%tmp18 = extractvalue %0 %0, 0 ; <double> [#uses=1]
|
||||
%tmp19 = bitcast double %tmp18 to i64 ; <i64> [#uses=1]
|
||||
%tmp20 = zext i64 %tmp19 to i128 ; <i128> [#uses=1]
|
||||
%tmp10 = lshr i128 %tmp20, 32 ; <i128> [#uses=1]
|
||||
%tmp11 = trunc i128 %tmp10 to i32 ; <i32> [#uses=1]
|
||||
%tmp12 = bitcast i32 %tmp11 to float ; <float> [#uses=1]
|
||||
%tmp5 = getelementptr inbounds %struct.float3* %res, i64 0, i32 1 ; <float*> [#uses=1]
|
||||
store float %tmp12, float* %tmp5
|
||||
ret void
|
||||
}
|
||||
|
||||
Compiles to:
|
||||
|
||||
_test: ## @test
|
||||
movd %xmm0, %rax
|
||||
shrq $32, %rax
|
||||
movl %eax, 4(%rdi)
|
||||
ret
|
||||
|
||||
This would be better kept in the SSE unit by treating XMM0 as a 4xfloat and
|
||||
doing a shuffle from v[1] to v[0] then a float store.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user