Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Side by Side Diff: src/IceInstARM32.cpp

Issue 1564393002: Add VCMP{s,sz,d,dz} Instructions to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===// 1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 Ostream &Str = Func->getContext()->getStrEmit(); 1916 Ostream &Str = Func->getContext()->getStrEmit();
1917 assert(getSrcSize() == 2); 1917 assert(getSrcSize() == 2);
1918 Str << "\t" 1918 Str << "\t"
1919 "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType()) 1919 "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType())
1920 << "\t"; 1920 << "\t";
1921 getSrc(0)->emit(Func); 1921 getSrc(0)->emit(Func);
1922 Str << ", "; 1922 Str << ", ";
1923 getSrc(1)->emit(Func); 1923 getSrc(1)->emit(Func);
1924 } 1924 }
1925 1925
1926 void InstARM32Vcmp::emitIAS(const Cfg *Func) const {
1927 assert(getSrcSize() == 2);
1928 const Operand *Src0 = getSrc(0);
1929 Type Ty = Src0->getType();
Jim Stichnoth 2016/01/09 01:34:28 const Type
Karl 2016/01/11 16:42:20 Done.
1930 const Operand *Src1 = getSrc(1);
1931 const CondARM32::Cond Cond = getPredicate();
1932 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1933 if (llvm::isa<OperandARM32FlexFpZero>(Src1)) {
1934 switch (Ty) {
1935 case IceType_f32:
1936 Asm->vcmpsz(Src0, Cond);
1937 break;
1938 case IceType_f64:
1939 Asm->vcmpdz(Src0, Cond);
1940 break;
1941 default:
1942 llvm::report_fatal_error("Vcvt on non floating value");
1943 }
1944 } else {
1945 switch (Ty) {
1946 case IceType_f32:
1947 Asm->vcmps(Src0, Src1, Cond);
1948 break;
1949 case IceType_f64:
1950 Asm->vcmpd(Src0, Src1, Cond);
1951 break;
1952 default:
1953 llvm::report_fatal_error("Vcvt on non floating value");
1954 }
1955 }
1956 assert(!Asm->needsTextFixup());
1957 }
1958
1926 void InstARM32Vcmp::dump(const Cfg *Func) const { 1959 void InstARM32Vcmp::dump(const Cfg *Func) const {
1927 if (!BuildDefs::dump()) 1960 if (!BuildDefs::dump())
1928 return; 1961 return;
1929 Ostream &Str = Func->getContext()->getStrDump(); 1962 Ostream &Str = Func->getContext()->getStrDump();
1930 Str << "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType()); 1963 Str << "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType());
1931 dumpSources(Func); 1964 dumpSources(Func);
1932 } 1965 }
1933 1966
1934 void InstARM32Vmrs::emit(const Cfg *Func) const { 1967 void InstARM32Vmrs::emit(const Cfg *Func) const {
1935 if (!BuildDefs::dump()) 1968 if (!BuildDefs::dump())
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 2275
2243 template class InstARM32FourAddrGPR<InstARM32::Mla>; 2276 template class InstARM32FourAddrGPR<InstARM32::Mla>;
2244 template class InstARM32FourAddrGPR<InstARM32::Mls>; 2277 template class InstARM32FourAddrGPR<InstARM32::Mls>;
2245 2278
2246 template class InstARM32CmpLike<InstARM32::Cmn>; 2279 template class InstARM32CmpLike<InstARM32::Cmn>;
2247 template class InstARM32CmpLike<InstARM32::Cmp>; 2280 template class InstARM32CmpLike<InstARM32::Cmp>;
2248 template class InstARM32CmpLike<InstARM32::Tst>; 2281 template class InstARM32CmpLike<InstARM32::Tst>;
2249 2282
2250 } // end of namespace ARM32 2283 } // end of namespace ARM32
2251 } // end of namespace Ice 2284 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698