Skip to content

Commit

Permalink
gas64 : Disabling completely parity checks in case FB_FPMODE_PRECISE …
Browse files Browse the repository at this point in the history
…used (<> FB_FPMODE_FAST)
  • Loading branch information
SARG-FB committed Jun 29, 2023
1 parent ed2cf8b commit ab3c3d5
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions src/compiler/ir-gas64.bas
Expand Up @@ -3211,11 +3211,15 @@ private sub bop_float( _
'' Result = ( a op b )
select case op
case AST_OP_EQ
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
end if
jmpcode=@"je "
case AST_OP_NE
parity = "jp "+lname1
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
parity = "jp "+lname1
end if
jmpcode=@"jne "
case AST_OP_GT
jmpcode=@"ja "
Expand All @@ -3232,11 +3236,15 @@ private sub bop_float( _
'' Result = !( a op b )
select case op
case AST_OP_EQ
parity = "jp "+lname1
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
parity = "jp "+lname1
end if
jmpcode=@"jne "
case AST_OP_NE
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
end if
jmpcode=@"je "
case AST_OP_GT
swapinit = true
Expand All @@ -3259,11 +3267,15 @@ private sub bop_float( _
'' if !( a op b ) then goto exit_label
select case op
case AST_OP_EQ
parity = "jp "+*symbGetMangledName( label )
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
parity = "jp "+*symbGetMangledName( label )
end if
jmpcode=@"jne "
case AST_OP_NE
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
end if
jmpcode=@"je "
case AST_OP_GT
jmpcode=@"jbe "
Expand All @@ -3280,11 +3292,15 @@ private sub bop_float( _
'' if ( a op b ) then goto exit_label
select case op
case AST_OP_EQ
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
lname2 = *symbUniqueLabel( )
parity = "jp "+lname2
end if
jmpcode=@"je "
case AST_OP_NE
parity = "jp "+*symbGetMangledName( label )
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
parity = "jp "+*symbGetMangledName( label )
end if
jmpcode=@"jne "
case AST_OP_GT
jmpcode=@"ja "
Expand Down Expand Up @@ -3323,10 +3339,8 @@ private sub bop_float( _

'' Check for parity flag (if needed),
'' disregard if '-fpmode fast' command line option is used
if( env.clopt.fpmode = FB_FPMODE_PRECISE ) then
if( len( parity ) > 0 ) then
asm_code( parity )
end if
if( env.clopt.fpmode <> FB_FPMODE_FAST ) then
asm_code( parity )
end if

'' conditionally jump to exit label
Expand All @@ -3337,7 +3351,7 @@ private sub bop_float( _
reg_mark(label)
end if

'' label when different
'' even in case of PRECISE lname2 can be empty
if( len(lname2) > 0 ) then
asm_code(lname2+":")
end if
Expand Down

0 comments on commit ab3c3d5

Please sign in to comment.