X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FnativeGen%2FStixInteger.lhs;h=cd642e86151a7729ad628b40830ee3378f259ff1;hb=f8d8ea662828a295e27a2f5f52ce38d68fd3dee2;hp=fbd96cf1a7ca4980ebd6c2a6cda8295bf9ea96d4;hpb=8252a068d95fa49040f6c55ed170f9155416e8ac;p=ghc-hetmet.git diff --git a/ghc/compiler/nativeGen/StixInteger.lhs b/ghc/compiler/nativeGen/StixInteger.lhs index fbd96cf..cd642e8 100644 --- a/ghc/compiler/nativeGen/StixInteger.lhs +++ b/ghc/compiler/nativeGen/StixInteger.lhs @@ -14,18 +14,13 @@ module StixInteger ( #include "HsVersions.h" import {-# SOURCE #-} StixPrim ( amodeToStix ) -import MachMisc -import MachRegs import AbsCSyn hiding (spRel) -- bits and bobs.. -import Const ( Literal(..) ) -import CallConv ( cCallConv ) -import OrdList ( OrdList ) +import ForeignCall ( CCallConv(..) ) import PrimOp ( PrimOp(..) ) import PrimRep ( PrimRep(..) ) -import SMRep ( arrWordsHdrSize ) -import Stix ( sStLitLbl, StixTree(..), StixTreeList, arrWordsHS ) -import UniqSupply ( returnUs, thenUs, UniqSM ) +import Stix ( StixTree(..), StixTreeList, arrWordsHS ) +import UniqSupply ( returnUs, UniqSM ) \end{code} Although gmpCompare doesn't allocate space, it does temporarily use @@ -61,7 +56,7 @@ gmpCompare res args@(csa1,cda1, csa2,cda2) (a1,a2,a3) = toStruct scratch1 (aa1,sa1,da1) (a4,a5,a6) = toStruct scratch2 (aa2,sa2,da2) - mpz_cmp = StCall SLIT("mpz_cmp") cCallConv IntRep [scratch1, scratch2] + mpz_cmp = StCall SLIT("__gmpz_cmp") CCallConv IntRep [scratch1, scratch2] r1 = StAssign IntRep result mpz_cmp in returnUs (\xs -> a1 : a2 : a3 : a4 : a5 : a6 : r1 : xs) @@ -80,7 +75,7 @@ gmpCompareInt res args@(csa1,cda1, cai) da1 = stgArrWords__BYTE_ARR_CTS (amodeToStix cda1) ai = amodeToStix cai (a1,a2,a3) = toStruct scratch1 (aa1,sa1,da1) - mpz_cmp_si = StCall SLIT("mpz_cmp_si") cCallConv IntRep [scratch1, ai] + mpz_cmp_si = StCall SLIT("__gmpz_cmp_si") CCallConv IntRep [scratch1, ai] r1 = StAssign IntRep result mpz_cmp_si in returnUs (\xs -> a1 : a2 : a3 : r1 : xs) @@ -100,7 +95,7 @@ gmpInteger2Int res args@(csa,cda) da = stgArrWords__BYTE_ARR_CTS (amodeToStix cda) (a1,a2,a3) = toStruct scratch1 (aa,sa,da) - mpz_get_si = StCall SLIT("mpz_get_si") cCallConv IntRep [scratch1] + mpz_get_si = StCall SLIT("__gmpz_get_si") CCallConv IntRep [scratch1] r1 = StAssign IntRep result mpz_get_si in returnUs (\xs -> a1 : a2 : a3 : r1 : xs) @@ -118,7 +113,7 @@ gmpInteger2Word res args@(csa,cda) da = stgArrWords__BYTE_ARR_CTS (amodeToStix cda) (a1,a2,a3) = toStruct scratch1 (aa,sa,da) - mpz_get_ui = StCall SLIT("mpz_get_ui") cCallConv IntRep [scratch1] + mpz_get_ui = StCall SLIT("__gmpz_get_ui") CCallConv IntRep [scratch1] r1 = StAssign WordRep result mpz_get_ui in returnUs (\xs -> a1 : a2 : a3 : r1 : xs)