Skip to content

Commit

Permalink
FIX: issue red#212 (Red/System cannot compile float for ARM target?).…
Browse files Browse the repository at this point in the history
… Regression fixed, but one unit test is still failing.
  • Loading branch information
dockimbel committed Mar 11, 2012
1 parent 29c6527 commit c73af21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions red-system/targets/ARM.r
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
]
]

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 [
Expand Down
1 change: 1 addition & 0 deletions red-system/targets/target-class.r
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c73af21

Please sign in to comment.