From a523b9fb302b56ce188a2a291652f7913ee1e5f3 Mon Sep 17 00:00:00 2001 From: sewardj Date: Fri, 7 Dec 2001 11:27:09 +0000 Subject: [PATCH] [project @ 2001-12-07 11:27:09 by sewardj] Comments only. --- ghc/compiler/absCSyn/AbsCUtils.lhs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/absCSyn/AbsCUtils.lhs b/ghc/compiler/absCSyn/AbsCUtils.lhs index ab505df..ab1a649 100644 --- a/ghc/compiler/absCSyn/AbsCUtils.lhs +++ b/ghc/compiler/absCSyn/AbsCUtils.lhs @@ -595,6 +595,15 @@ rrConflictsWithRR s1b s2b rr1 rr2 = rr rr1 rr2 ------------------------------------------------------------------------------ -- Assumes no volatiles +-- Creates +-- res = arg >> (bits-per-word / 2) when little-endian +-- or +-- res = arg & ((1 << (bits-per-word / 2)) - 1) when big-endian +-- +-- In other words, if arg had been stored in memory, makes res the +-- halfword of arg which would have had the higher address. This is +-- why it needs to take into account endianness. +-- mkHalfWord_HIADDR res arg = mkTemp IntRep `thenFlt` \ t_hw_shift -> mkTemp WordRep `thenFlt` \ t_hw_mask1 -> @@ -802,7 +811,7 @@ dscCOpStmt [r] AddrRemOp [a1,a2] vols ] -- not handled by translateOp because they need casts -dscCOpStmt [r] SllOp [a1,a2] vols +dscCOpStmt [r] SllOp [a1,a2] vols = translateOp_dyadic_cast1 MO_Nat_Shl r WordRep a1 a2 vols dscCOpStmt [r] SrlOp [a1,a2] vols = translateOp_dyadic_cast1 MO_Nat_Shr r WordRep a1 a2 vols -- 1.7.10.4