forked from OSchip/llvm-project
				
			Add operators for vabdl and vabal so they can be implemented without builtins.
llvm-svn: 121287
This commit is contained in:
		
							parent
							
								
									bf74755e62
								
							
						
					
					
						commit
						dbe9e7e3dd
					
				| 
						 | 
				
			
			@ -747,9 +747,36 @@ static std::string GenOpString(OpKind op, const std::string &proto,
 | 
			
		|||
    s += ");";
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
  case OpAbdl: {
 | 
			
		||||
    std::string abd = MangleName("vabd", typestr, ClassS) + "(__a, __b)";
 | 
			
		||||
    if (typestr[0] != 'U') {
 | 
			
		||||
      // vabd results are always unsigned and must be zero-extended.
 | 
			
		||||
      std::string utype = "U" + typestr.str();
 | 
			
		||||
      s += "(" + TypeString(proto[0], typestr) + ")";
 | 
			
		||||
      abd = "(" + TypeString('d', utype) + ")" + abd;
 | 
			
		||||
      s += Extend(utype, abd) + ";";
 | 
			
		||||
    } else {
 | 
			
		||||
      s += Extend(typestr, abd) + ";";
 | 
			
		||||
    }
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
  case OpAba:
 | 
			
		||||
    s += "__a + " + MangleName("vabd", typestr, ClassS) + "(__b, __c);";
 | 
			
		||||
    break;
 | 
			
		||||
  case OpAbal: {
 | 
			
		||||
    s += "__a + ";
 | 
			
		||||
    std::string abd = MangleName("vabd", typestr, ClassS) + "(__b, __c)";
 | 
			
		||||
    if (typestr[0] != 'U') {
 | 
			
		||||
      // vabd results are always unsigned and must be zero-extended.
 | 
			
		||||
      std::string utype = "U" + typestr.str();
 | 
			
		||||
      s += "(" + TypeString(proto[0], typestr) + ")";
 | 
			
		||||
      abd = "(" + TypeString('d', utype) + ")" + abd;
 | 
			
		||||
      s += Extend(utype, abd) + ";";
 | 
			
		||||
    } else {
 | 
			
		||||
      s += Extend(typestr, abd) + ";";
 | 
			
		||||
    }
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
  default:
 | 
			
		||||
    throw "unknown OpKind!";
 | 
			
		||||
    break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,7 +70,9 @@ enum OpKind {
 | 
			
		|||
  OpRev32,
 | 
			
		||||
  OpRev64,
 | 
			
		||||
  OpReinterpret,
 | 
			
		||||
  OpAba
 | 
			
		||||
  OpAbdl,
 | 
			
		||||
  OpAba,
 | 
			
		||||
  OpAbal
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum ClassKind {
 | 
			
		||||
| 
						 | 
				
			
			@ -138,7 +140,9 @@ namespace llvm {
 | 
			
		|||
      OpMap["OP_REV32"] = OpRev32;
 | 
			
		||||
      OpMap["OP_REV64"] = OpRev64;
 | 
			
		||||
      OpMap["OP_REINT"] = OpReinterpret;
 | 
			
		||||
      OpMap["OP_ABDL"]  = OpAbdl;
 | 
			
		||||
      OpMap["OP_ABA"]   = OpAba;
 | 
			
		||||
      OpMap["OP_ABAL"]  = OpAbal;
 | 
			
		||||
 | 
			
		||||
      Record *SI = R.getClass("SInst");
 | 
			
		||||
      Record *II = R.getClass("IInst");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue