[erlang-patches] Patch for binary pattern matching of floats with HiPE

Mikael Pettersson <>
Sun Sep 4 14:41:15 CEST 2011


Paul Guyot writes:
 > Hello,
 > 
 > HiPE generates bad code for a pattern matching of a float with a variable size length such as :
 > <<F:S/float>>
 > 
 > The following function always fail when compiled natively and behaves as expected with BEAM:
 > 
 > bin_to_float(B,S) ->
 >     <<F:S/float>> = B,
 >     F.
 > 
 > Judging from the almost identical code for integers, this obviously is a typo. I guess both code could be factorized, although I do not know what the policy is for duplicate code in HiPE (it's just about 14x2 lines).
 > 
 > The following commit fixes this bug. Also, a test is obvious to implement and I wish HiPE tests were open source, so we could enrich them.
 > 
 > https://github.com/pguyot/otp/commit/79e0c0345539624ed8bdcea2450dc2252f8375e8

The above patch is

Acked-by: Mikael Pettersson <>

 > git fetch git://github.com/pguyot/otp.git fix-hipe-bs_get_float2
 > 
 > Regards,
 > 
 > Paul
 > -- 
 > Semiocast            http://semiocast.com/
 > +33.183627948 - 20 rue Lacaze, 75014 Paris
 > 
 > _______________________________________________
 > erlang-patches mailing list
 > 
 > http://erlang.org/mailman/listinfo/erlang-patches
 > 


More information about the erlang-patches mailing list