https://bugs.kde.org/show_bug.cgi?id=468575
--- Comment #75 from Mark Wielaard <m...@klomp.org> ---
Trying to figure out:
integer.c: Assembler messages:
integer.c:132: Error: illegal operands `la zero,0'

integer.c:132 is:
   TESTINST_0_2_Bxx_COND(4, "beq a0, zero, 1f", 0, 0, a0, zero);

TESTINST_0_2_Bxx_COND defined in testinst.h:
#define TESTINST_0_2_Bxx_COND(length, instruction, rs1_val, rs2_val, rs1, rs2)
\
   JMP_COND(length, instruction, #rs1_val, #rs2_val, rs1, rs2)

#define JMP_COND(length, instruction, rs1_val, rs2_val, rs1, rs2)             
\
   {                                                                          
\
      unsigned long w[3 /*out*/ + 2 /*spill*/] = {0, 0, 0, 0, 0};             
\
      /* w[0] = flag that the branch was taken                                
\
         w[1] = flag that rs1 is valid                                        
\
         w[2] = flag that rs2 is valid                                        
\
         w[3] = spill slot for rs1                                            
\
         w[4] = spill slot for rs2                                            
\
       */                                                                     
\
      register unsigned long* t1 asm("t1") = w;                               
\
      __asm__ __volatile__(                                                   
\
         "li t2, 1;"                                                          
\
         "sd t2, 0(%[w]);"             /* Set result to "taken". */           
\
         ".if \"" #rs1 "\" != \"unused\";"                                    
\
         "sd " #rs1 ", 24(%[w]);"      /* Spill rs1. */                       
\
         "la " #rs1 ", " rs1_val ";"   /* Load the first input. */            
\
         ".endif;"                                                            
\
         ".if \"" #rs2 "\" != \"unused\";"                                    
\
         "sd " #rs2 ", 32(%[w]);"      /* Spill rs2. */                       
\
         "la " #rs2 ", " rs2_val ";"   /* Load the second input. */           
\
         ".endif;"                                                            
\
         ASMINST_##length(instruction) ";"                                    
\
         "li t2, 0;"                                                          
\
         "sd t2, 0(%[w]);"             /* Set result to "not taken". */       
\
         "1:;"                                                                
\
         ".if \"" #rs1 "\" != \"unused\";"                                    
\
         "li t2, 1;"                                                          
\
         "sd t2, 8(%[w]);"             /* Flag that rs1 is valid. */          
\
         ".endif;"                                                            
\
         ".if \"" #rs2 "\" != \"unused\";"                                    
\
         "li t2, 1;"                                                          
\
         "sd t2, 16(%[w]);"            /* Flag that rs2 is valid. */          
\
         ".endif;"                                                            
\
         ".if \"" #rs1 "\" != \"unused\";"                                    
\
         "ld " #rs1 ", 24(%[w]);"      /* Reload rs1. */                      
\
         ".endif;"                                                            
\
         ".if \"" #rs2 "\" != \"unused\";"                                    
\
         "ld " #rs2 ", 32(%[w]);"      /* Reload rs2. */                      
\
         ".endif;"                                                            
\
         :                                                                    
\
         : [w] "r"(t1)                                                        
\
         : "t2", "memory");                                                   
\
      printf("%s ::\n", instruction);                                         
\
      if (w[1] != 0) { /* If rs1 is valid. */                                 
\
         printf("  inputs: %s=%s", #rs1, rs1_val);                            
\
         if (w[2] != 0) /* If rs2 is valid. */                                
\
            printf(", %s=%s", #rs2, rs2_val);                                 
\
         printf("\n");                                                        
\
      }                                                                       
\
      printf("  branch: %s\n", w[0] ? "taken" : "not taken");                 
\
   }

So it looks like this line:

         "la " #rs2 ", " rs2_val ";"   /* Load the second input. */           
\

rs2 = zero and rs2_val = 0

Producing

"la zero, 0;"

So that is a write to the zero register of 0.
Which should be legal? The zero register should ignore writes?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to