Changeset ddc27d8 in git
- Timestamp:
- Nov 20, 1997, 4:25:05 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f8c8b82fe7f133a61ed61cf56a09aea0752694c2
- Parents:
- c2b784d2a361f4e8e390743e963f669b3e9b6b5d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/imm.h
rc2b784 rddc27d8 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: imm.h,v 1. 7 1997-11-19 11:37:29schmidt Exp $ */2 /* $Id: imm.h,v 1.8 1997-11-20 15:25:05 schmidt Exp $ */ 3 3 4 4 #ifndef INCL_IMM_H … … 35 35 #endif 36 36 37 //{{{ predicates38 inline int is_imm ( const InternalCF * const ptr )39 {40 // returns 0 if ptr is not immediate41 return ( (int)ptr & 3 );42 }43 44 inline int imm_iszero ( const InternalCF * const ptr )45 {46 return imm2int( ptr ) == 0;47 }48 49 inline int imm_isone ( const InternalCF * const ptr )50 {51 return imm2int( ptr ) == 1;52 }53 54 inline int imm_iszero_p ( const InternalCF * const ptr )55 {56 return imm2int( ptr ) == 0;57 }58 59 inline int imm_isone_p ( const InternalCF * const ptr )60 {61 return imm2int( ptr ) == 1;62 }63 64 inline int imm_iszero_gf ( const InternalCF * const ptr )65 {66 return gf_iszero( imm2int( ptr ) );67 }68 69 inline int imm_isone_gf ( const InternalCF * const ptr )70 {71 return gf_isone( imm2int( ptr ) );72 }73 //}}}74 75 37 //{{{ conversion functions 76 38 #ifdef HAS_ARITHMETIC_SHIFT … … 116 78 return (InternalCF*)((i << 2) | GFMARK ); 117 79 } 118 80 //}}} 81 82 //{{{ predicates 83 inline int is_imm ( const InternalCF * const ptr ) 84 { 85 // returns 0 if ptr is not immediate 86 return ( (int)ptr & 3 ); 87 } 88 89 inline int imm_iszero ( const InternalCF * const ptr ) 90 { 91 return imm2int( ptr ) == 0; 92 } 93 94 inline int imm_isone ( const InternalCF * const ptr ) 95 { 96 return imm2int( ptr ) == 1; 97 } 98 99 inline int imm_iszero_p ( const InternalCF * const ptr ) 100 { 101 return imm2int( ptr ) == 0; 102 } 103 104 inline int imm_isone_p ( const InternalCF * const ptr ) 105 { 106 return imm2int( ptr ) == 1; 107 } 108 109 inline int imm_iszero_gf ( const InternalCF * const ptr ) 110 { 111 return gf_iszero( imm2int( ptr ) ); 112 } 113 114 inline int imm_isone_gf ( const InternalCF * const ptr ) 115 { 116 return gf_isone( imm2int( ptr ) ); 117 } 118 //}}} 119 120 //{{{ conversion functions 119 121 inline int imm_intval ( const InternalCF* const op ) 120 122 { … … 142 144 // 143 145 // If CO is an immediate integer, the sign is defined as usual. 144 // If CO is an element of a finite field and SW_SYMMETRIC_FF is 145 // on the sign of CO is the sign of the symmetric representation 146 // of CO. If CO is in GF(q) or in a finite field and 147 // SW_SYMMETRIC_FF is off, the sign of CO is zero iff CO is zero, 148 // otherwise the sign is one. 146 // If CO is an element of FF(p) and SW_SYMMETRIC_FF is on the 147 // sign of CO is the sign of the symmetric representation of CO. 148 // If CO is in GF(q) or in FF(p) and SW_SYMMETRIC_FF is off, the 149 // sign of CO is zero iff CO is zero, otherwise the sign is one. 149 150 // 150 151 // See alse: CanonicalForm::sign(), gf_sign()
Note: See TracChangeset
for help on using the changeset viewer.