1// Copyright (c) 2006 The Regents of The University of Michigan 2// All rights reserved. 3// 4// Redistribution and use in source and binary forms, with or without 5// modification, are permitted provided that the following conditions are 6// met: redistributions of source code must retain the above copyright 7// notice, this list of conditions and the following disclaimer; 8// redistributions in binary form must reproduce the above copyright --- 221 unchanged lines hidden (view full) --- 230 else Rd = resTemp; 231 } }}, 232 {{0}}, 233 {{overflow}}, 234 {{0}}, 235 {{0}} 236 ); 237 0x1F: sdivcc({{ |
238 int64_t val2 = Rs2_or_imm13.sdw<31:0>; 239 bool overflow = false, underflow = false; |
240 if(val2 == 0) fault = new DivisionByZero; 241 else 242 { |
243 Rd = (int64_t)((Y << 32) | Rs1.sdw<31:0>) / val2; 244 overflow = (Rd<63:31> != 0); 245 underflow = (Rd<63:> && Rd<62:31> != 0xFFFFFFFF); 246 if(overflow) Rd = 0x7FFFFFFF; 247 else if(underflow) Rd = 0xFFFFFFFF80000000ULL; |
248 } }}, 249 {{0}}, 250 {{overflow || underflow}}, 251 {{0}}, 252 {{0}} 253 ); 254 0x20: taddcc({{ 255 int64_t resTemp, val2 = Rs2_or_imm13; --- 9 unchanged lines hidden (view full) --- 265 Rd = resTemp = Rs1 + val2; 266 int32_t overflow = Rs1<1:0> || val2<1:0> || (Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>);}}, 267 {{(Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31}}, 268 {{overflow}}, 269 {{((Rs1 >> 1) + (val2 >> 1) + (Rs1 & val2 & 0x1))<63:>}}, 270 {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}} 271 ); 272 0x22: taddcctv({{ |
273 int64_t val2 = Rs2_or_imm13; 274 Rd = Rs1 + val2; |
275 int32_t overflow = Rs1<1:0> || val2<1:0> || 276 (Rs1<31:> == val2<31:> && val2<31:> != Rd<31:>); 277 if(overflow) fault = new TagOverflow;}}, 278 {{((Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31)}}, 279 {{overflow}}, 280 {{((Rs1 >> 1) + (val2 >> 1) + (Rs1 & val2 & 0x1))<63:>}}, |
281 {{Rs1<63:> == val2<63:> && val2<63:> != Rd<63:>}} |
282 ); 283 0x23: tsubcctv({{ 284 int64_t resTemp, val2 = Rs2_or_imm13; 285 Rd = resTemp = Rs1 + val2; 286 int32_t overflow = Rs1<1:0> || val2<1:0> || (Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>); 287 if(overflow) fault = new TagOverflow;}}, 288 {{((Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31)}}, 289 {{overflow}}, --- 602 unchanged lines hidden --- |