Permalink
Browse files

FIX: issue #212 (Red/System cannot compile float for ARM target?). Re…

…gression fixed, but one unit test is still failing.
  • Loading branch information...
1 parent 29c6527 commit c73af213a05b09242b2bf2c4d83877efb047c340 @dockimbel dockimbel committed Mar 11, 2012
Showing with 11 additions and 6 deletions.
  1. +10 −6 red-system/targets/ARM.r
  2. +1 −0 red-system/targets/target-class.r
@@ -40,7 +40,7 @@ make target-class [
byte-flag: #{00400000} ;-- trigger byte access in opcode
pools: context [ ;-- literals pools management
- active?: yes ;-- yes => store in pools, no => store inlined
+ active?: no ;-- yes => store in pools, no => store inlined
values: make block! 2000 ;-- [value instruction-pos sym-spec ...]
entry-points: make block! 100 ;-- insertion points candidates for pools between functions
ins-points: make block! 100 ;-- insertion points candidates for pools inlined in code
@@ -835,11 +835,11 @@ make target-class [
emit-set-stack: func [value /frame][
if verbose >= 3 [print [">>>emitting SET-STACK" mold value]]
- emit-load value
+ unless tag? value [emit-load value]
either frame [
- emit-i32 #{e1ab0000} ;-- MOV fp, r0
+ emit-i32 #{e1a0b000} ;-- MOV fp, r0
][
- emit-i32 #{e1ad0000} ;-- MOV sp, r0
+ emit-i32 #{e1a0d000} ;-- MOV sp, r0
]
]
@@ -1277,7 +1277,8 @@ make target-class [
switch type?/word value [
tag! [ ;-- == <last>
- do either find [float! float64!] compiler/last-type/1 [
+ type: either cast [cast/type][compiler/last-type]
+ do either find [float! float64!] type/1 [
push-last64
][
push-last
@@ -1339,7 +1340,10 @@ make target-class [
emit-push <last>
]
object! [
- unless compiler/literal? value/data [
+ unless any [
+ path? value/data
+ compiler/any-float? compiler/get-type value/data
+ ][
emit-casting value no
]
either cdecl [
@@ -17,6 +17,7 @@ target-class: context [
on-root-level-entry: none ;-- called after a root level expression or directive is compiled
emit-stack-align-prolog: none ;-- align stack on imported function calls
emit-stack-align-epilog: none ;-- unwind aligned stack
+ emit-float-trash-last: none ;-- FPU clean-up code after use in expression
compiler: none ;-- just a short-cut
width: none ;-- current operand width in bytes

0 comments on commit c73af21

Please sign in to comment.