Ticket #7689 (closed feature request: fixed)

Opened 3 months ago

Last modified 3 months ago

Primitive bitwise operations on Int#

Reported by: jstolarek Owned by:
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

During recent work I found a need for primitive bitwise operations that work on Int# type. Currently existing and#, or#, not# and xor# PrimOps work on Word#, which requires writing explicit conversions using int2Word# and word2Int#. It would be most helpful to have equivalent andI#, orI#, notI# and xorI# PrimOps.

Attachments

Test-7689.patch Download (4.6 KB) - added by jstolarek 3 months ago.
Patch for the testsuite
Primitive-bitwise-operations-on-Int-Fixes-7689.patch Download (3.4 KB) - added by jstolarek 3 months ago.
Adds primitive bitwise operatons on Int#

Change History

Changed 3 months ago by jstolarek

Patch for the testsuite

Changed 3 months ago by jstolarek

  • owner set to jstolarek

Changed 3 months ago by jstolarek

  • status changed from new to patch

Changed 3 months ago by simonmar

  • owner jstolarek deleted
  • difficulty set to Unknown
  • status changed from patch to new

Could you please separate out the whitespace changes into a separate patch?

Changed 3 months ago by jstolarek

Adds primitive bitwise operatons on Int#

Changed 3 months ago by jstolarek

  • status changed from new to patch

Whoops. Sorry about that. I've recently set up my Emacs to remove trailing whitespaces upon saving. A good thing to do, but only assuming that everyone else in the team does that. Anyway, I've uploaded the fixed patch.

Changed 3 months ago by jan.stolarek@…

commit 29e86f9b178d3cf436629641ec1f2502c67f0347

Author: Jan Stolarek <jan.stolarek@p.lodz.pl>
Date:   Fri Feb 15 13:10:36 2013 +0100

    Primitive bitwise operations on Int# (Fixes #7689)

 compiler/codeGen/StgCmmPrim.hs  |    4 ++++
 compiler/prelude/PrelRules.lhs  |    9 +++++++++
 compiler/prelude/primops.txt.pp |   11 +++++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

Changed 3 months ago by simonmar

  • status changed from patch to closed
  • resolution set to fixed
  • milestone set to 7.8.1

Pushed, thanks!

Changed 3 months ago by jstolarek

  • status changed from closed to new
  • resolution fixed deleted

It looks that patch for the Testsuite was not merged. Reopening.

Changed 3 months ago by jstolarek

  • status changed from new to patch

Changed 3 months ago by simonmar

  • status changed from patch to closed
  • resolution set to fixed

Sorry about that, done now:

commit de9a5457567313b5890f6aa8caee8f7802464acb
Author: Jan Stolarek <jan.stolarek@p.lodz.pl>
Date:   Thu Feb 14 13:07:26 2013 +0100

    Test #7689
    
    Tests primitive bitwise `andI#`, `orI#`, `notI#`, `xorI#`
    operations on Int#
Note: See TracTickets for help on using tickets.