Changeset 962


Ignore:
Timestamp:
Jun 15, 2011, 4:15:54 PM (8 years ago)
Author:
campbell
Message:

Casts should use source type's signedness, not the target's.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Clight/toCminor.ma

    r961 r962  
    346346[ Tint sz1 sg1 ⇒ λe.
    347347    match ty2 return λx.res (CMexpr (typ_of_type x)) with
    348     [ Tint sz2 sg2 ⇒ OK ? (Op1 ?? (Ocastint sz2 sg2) e)
     348    [ Tint sz2 sg2 ⇒ OK ? (Op1 ?? (Ocastint sg1 sz2) e)
    349349    | Tfloat sz2 ⇒ OK ? (Op1 ?? (match sg1 with [ Unsigned ⇒ Ofloatofintu | _ ⇒ Ofloatofint]) e)
    350350    | Tpointer r _ ⇒ OK ? (Op1 ?? (Optrofint r) e)
  • src/common/FrontEndOps.ma

    r961 r962  
    2727
    2828inductive unary_operation : Type[0] ≝
    29   | Ocastint: intsize → signedness → unary_operation (**r 8-bit zero extension *)
     29  | Ocastint: signedness → intsize → unary_operation (**r integer casts *)
    3030  | Onegint: unary_operation               (**r integer opposite *)
    3131  | Onotbool: unary_operation              (**r boolean negation  *)
     
    9191λop,arg.
    9292  match op with
    93   [ Ocastint sz sg
     93  [ Ocastint sg sz
    9494      match sg with
    9595      [ Unsigned ⇒ Some ? (zero_ext sz arg)
Note: See TracChangeset for help on using the changeset viewer.