File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed 
filetests/filetests/runtests Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -543,10 +543,10 @@ pub(crate) fn emit(
543543
544544                // Here, divisor == -1. 
545545                if  !kind. is_div ( )  { 
546-                     // x % -1 = 0; put the result into the destination, $rdx . 
546+                     // x % -1 = 0; put the result into the destination, $rax . 
547547                    let  done_label = sink. get_label ( ) ; 
548548
549-                     let  inst = Inst :: imm ( OperandSize :: Size64 ,  0 ,  Writable :: from_reg ( regs:: rdx ( ) ) ) ; 
549+                     let  inst = Inst :: imm ( OperandSize :: Size64 ,  0 ,  Writable :: from_reg ( regs:: rax ( ) ) ) ; 
550550                    inst. emit ( & [ ] ,  sink,  info,  state) ; 
551551
552552                    let  inst = Inst :: jmp_known ( done_label) ; 
Original file line number Diff line number Diff line change @@ -142,3 +142,12 @@ block0(v0: i8):
142142; run: %srem_imm_i8(-19) == -1
143143; run: %srem_imm_i8(0xC0) == -1
144144; run: %srem_imm_i8(0x80) == -2
145+ 
146+ function %srem_with_bmask(i64, i8) -> i8 {
147+ block0(v0: i64, v1: i8):
148+     v2 = bmask.i8 v0
149+     v3 = srem v2, v1
150+     return v3
151+ }
152+ ; run: %srem_with_bmask(4352, -1) == 0
153+ ; run: %srem_with_bmask(4352, 1) == 0
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments