@@ -89,6 +89,54 @@ macro_rules! isle_common_prelude_methods {
8989 Some ( Imm64 :: new( result) . mask_to_width( type_width) )
9090 }
9191
92+ #[ inline]
93+ fn imm64_add( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
94+ let ty_mask = self . ty_mask( ty) as i64 ;
95+ Imm64 :: new( x. bits( ) . wrapping_add( y. bits( ) ) & ty_mask)
96+ }
97+
98+ #[ inline]
99+ fn imm64_sub( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
100+ let ty_mask = self . ty_mask( ty) as i64 ;
101+ Imm64 :: new( x. bits( ) . wrapping_sub( y. bits( ) ) & ty_mask)
102+ }
103+
104+ #[ inline]
105+ fn imm64_mul( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
106+ let ty_mask = self . ty_mask( ty) as i64 ;
107+ Imm64 :: new( x. bits( ) . wrapping_mul( y. bits( ) ) & ty_mask)
108+ }
109+
110+ #[ inline]
111+ fn imm64_and( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
112+ let ty_mask = self . ty_mask( ty) as i64 ;
113+ Imm64 :: new( ( x. bits( ) & y. bits( ) ) & ty_mask)
114+ }
115+
116+ #[ inline]
117+ fn imm64_or( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
118+ let ty_mask = self . ty_mask( ty) as i64 ;
119+ Imm64 :: new( ( x. bits( ) | y. bits( ) ) & ty_mask)
120+ }
121+
122+ #[ inline]
123+ fn imm64_xor( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
124+ let ty_mask = self . ty_mask( ty) as i64 ;
125+ Imm64 :: new( ( x. bits( ) ^ y. bits( ) ) & ty_mask)
126+ }
127+
128+ #[ inline]
129+ fn imm64_not( & mut self , ty: Type , x: Imm64 ) -> Imm64 {
130+ let ty_mask = self . ty_mask( ty) as i64 ;
131+ Imm64 :: new( ( !x. bits( ) ) & ty_mask)
132+ }
133+
134+ #[ inline]
135+ fn imm64_neg( & mut self , ty: Type , x: Imm64 ) -> Imm64 {
136+ let ty_mask = self . ty_mask( ty) as i64 ;
137+ Imm64 :: new( x. bits( ) . wrapping_neg( ) & ty_mask)
138+ }
139+
92140 #[ inline]
93141 fn imm64_shl( & mut self , ty: Type , x: Imm64 , y: Imm64 ) -> Imm64 {
94142 // Mask off any excess shift bits.
0 commit comments