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

Side by Side Diff: src/mips64/macro-assembler-mips64.cc

Issue 2871663002: MIPS64: Add/fix bit insertion/extraction instrs. (Closed)
Patch Set: Remove pps variable use Created 3 years, 7 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
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 1943
1944 void MacroAssembler::Ext(Register rt, 1944 void MacroAssembler::Ext(Register rt,
1945 Register rs, 1945 Register rs,
1946 uint16_t pos, 1946 uint16_t pos,
1947 uint16_t size) { 1947 uint16_t size) {
1948 DCHECK(pos < 32); 1948 DCHECK(pos < 32);
1949 DCHECK(pos + size < 33); 1949 DCHECK(pos + size < 33);
1950 ext_(rt, rs, pos, size); 1950 ext_(rt, rs, pos, size);
1951 } 1951 }
1952 1952
1953 void MacroAssembler::ExtractBits(Register rt, Register rs, uint16_t pos, 1953
1954 uint16_t size) { 1954 void MacroAssembler::Dext(Register rt, Register rs, uint16_t pos,
1955 DCHECK(pos < 64); 1955 uint16_t size) {
1956 DCHECK(size > 0 && size <= 64); 1956 DCHECK(pos < 64 && 0 < size && size <= 64 && 0 < pos + size &&
1957 DCHECK(pos + size <= 64); 1957 pos + size <= 64);
1958 if (pos < 32) { 1958 if (size > 32) {
1959 if (size <= 32) { 1959 dextm_(rt, rs, pos, size);
1960 Dext(rt, rs, pos, size); 1960 } else if (pos >= 32) {
1961 } else { 1961 dextu_(rt, rs, pos, size);
1962 Dextm(rt, rs, pos, size); 1962 } else {
1963 } 1963 dext_(rt, rs, pos, size);
1964 } else if (pos < 64) {
1965 DCHECK(size <= 32);
1966 Dextu(rt, rs, pos, size);
1967 } 1964 }
1968 } 1965 }
1969 1966
1970 void MacroAssembler::Dext(Register rt, Register rs, uint16_t pos,
1971 uint16_t size) {
1972 DCHECK(pos < 32);
1973 DCHECK(size > 0 && size <= 32);
1974 dext_(rt, rs, pos, size);
1975 }
1976 1967
1977
1978 void MacroAssembler::Dextm(Register rt, Register rs, uint16_t pos,
1979 uint16_t size) {
1980 DCHECK(pos < 32);
1981 DCHECK(size > 32 && size <= 64);
1982 DCHECK((pos + size) > 32 && (pos + size) <= 64);
1983 dextm(rt, rs, pos, size);
1984 }
1985
1986
1987 void MacroAssembler::Dextu(Register rt, Register rs, uint16_t pos,
1988 uint16_t size) {
1989 DCHECK(pos >= 32 && pos < 64);
1990 DCHECK(size > 0 && size <= 32);
1991 DCHECK((pos + size) > 32 && (pos + size) <= 64);
1992 dextu(rt, rs, pos, size);
1993 }
1994
1995
1996 void MacroAssembler::Dins(Register rt, Register rs, uint16_t pos,
1997 uint16_t size) {
1998 DCHECK(pos < 32);
1999 DCHECK(pos + size <= 32);
2000 DCHECK(size != 0);
2001 dins_(rt, rs, pos, size);
2002 }
2003
2004
2005 void MacroAssembler::Ins(Register rt, 1968 void MacroAssembler::Ins(Register rt,
2006 Register rs, 1969 Register rs,
2007 uint16_t pos, 1970 uint16_t pos,
2008 uint16_t size) { 1971 uint16_t size) {
2009 DCHECK(pos < 32); 1972 DCHECK(pos < 32);
2010 DCHECK(pos + size <= 32); 1973 DCHECK(pos + size <= 32);
2011 DCHECK(size != 0); 1974 DCHECK(size != 0);
2012 ins_(rt, rs, pos, size); 1975 ins_(rt, rs, pos, size);
2013 } 1976 }
2014 1977
1978 void MacroAssembler::Dins(Register rt, Register rs, uint16_t pos,
1979 uint16_t size) {
1980 DCHECK(pos < 64 && 0 < size && size <= 64 && 0 < pos + size &&
1981 pos + size <= 64);
1982 if (pos + size <= 32) {
1983 dins_(rt, rs, pos, size);
1984 } else if (pos < 32) {
1985 dinsm_(rt, rs, pos, size);
1986 } else {
1987 dinsu_(rt, rs, pos, size);
1988 }
1989 }
1990
2015 void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) { 1991 void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) {
2016 if (kArchVariant == kMips64r6) { 1992 if (kArchVariant == kMips64r6) {
2017 // r6 neg_s changes the sign for NaN-like operands as well. 1993 // r6 neg_s changes the sign for NaN-like operands as well.
2018 neg_s(fd, fs); 1994 neg_s(fd, fs);
2019 } else { 1995 } else {
2020 DCHECK(kArchVariant == kMips64r2); 1996 DCHECK(kArchVariant == kMips64r2);
2021 Label is_nan, done; 1997 Label is_nan, done;
2022 Register scratch1 = t8; 1998 Register scratch1 = t8;
2023 Register scratch2 = t9; 1999 Register scratch2 = t9;
2024 BranchF32(nullptr, &is_nan, eq, fs, fs); 2000 BranchF32(nullptr, &is_nan, eq, fs, fs);
(...skipping 4988 matching lines...) Expand 10 before | Expand all | Expand 10 after
7013 if (mag.shift > 0) sra(result, result, mag.shift); 6989 if (mag.shift > 0) sra(result, result, mag.shift);
7014 srl(at, dividend, 31); 6990 srl(at, dividend, 31);
7015 Addu(result, result, Operand(at)); 6991 Addu(result, result, Operand(at));
7016 } 6992 }
7017 6993
7018 6994
7019 } // namespace internal 6995 } // namespace internal
7020 } // namespace v8 6996 } // namespace v8
7021 6997
7022 #endif // V8_TARGET_ARCH_MIPS64 6998 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698