Revision f230a1cf deps/v8/src/ia32/assembler-ia32.h

View differences:

deps/v8/src/ia32/assembler-ia32.h
535 535
  // Check whether a feature is supported by the target CPU.
536 536
  static bool IsSupported(CpuFeature f) {
537 537
    ASSERT(initialized_);
538
    if (Check(f, cross_compile_)) return true;
538 539
    if (f == SSE2 && !FLAG_enable_sse2) return false;
539 540
    if (f == SSE3 && !FLAG_enable_sse3) return false;
540 541
    if (f == SSE4_1 && !FLAG_enable_sse4_1) return false;
541 542
    if (f == CMOV && !FLAG_enable_cmov) return false;
542
    return (supported_ & (static_cast<uint64_t>(1) << f)) != 0;
543
    return Check(f, supported_);
543 544
  }
544 545

  
545 546
  static bool IsFoundByRuntimeProbingOnly(CpuFeature f) {
546 547
    ASSERT(initialized_);
547
    return (found_by_runtime_probing_only_ &
548
            (static_cast<uint64_t>(1) << f)) != 0;
548
    return Check(f, found_by_runtime_probing_only_);
549 549
  }
550 550

  
551 551
  static bool IsSafeForSnapshot(CpuFeature f) {
552
    return (IsSupported(f) &&
552
    return Check(f, cross_compile_) ||
553
           (IsSupported(f) &&
553 554
            (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f)));
554 555
  }
555 556

  
557
  static bool VerifyCrossCompiling() {
558
    return cross_compile_ == 0;
559
  }
560

  
561
  static bool VerifyCrossCompiling(CpuFeature f) {
562
    uint64_t mask = flag2set(f);
563
    return cross_compile_ == 0 ||
564
           (cross_compile_ & mask) == mask;
565
  }
566

  
556 567
 private:
568
  static bool Check(CpuFeature f, uint64_t set) {
569
    return (set & flag2set(f)) != 0;
570
  }
571

  
572
  static uint64_t flag2set(CpuFeature f) {
573
    return static_cast<uint64_t>(1) << f;
574
  }
575

  
557 576
#ifdef DEBUG
558 577
  static bool initialized_;
559 578
#endif
560 579
  static uint64_t supported_;
561 580
  static uint64_t found_by_runtime_probing_only_;
562 581

  
582
  static uint64_t cross_compile_;
583

  
563 584
  friend class ExternalReference;
585
  friend class PlatformFeatureScope;
564 586
  DISALLOW_COPY_AND_ASSIGN(CpuFeatures);
565 587
};
566 588

  
......
852 874
  void test(Register reg, const Operand& op);
853 875
  void test_b(Register reg, const Operand& op);
854 876
  void test(const Operand& op, const Immediate& imm);
855
  void test_b(Register reg, uint8_t imm8) { test_b(Operand(reg), imm8); }
877
  void test_b(Register reg, uint8_t imm8);
856 878
  void test_b(const Operand& op, uint8_t imm8);
857 879

  
858 880
  void xor_(Register dst, int32_t imm32);
......
995 1017

  
996 1018
  void cpuid();
997 1019

  
1020
  // SSE instructions
1021
  void andps(XMMRegister dst, XMMRegister src);
1022
  void xorps(XMMRegister dst, XMMRegister src);
1023

  
998 1024
  // SSE2 instructions
999 1025
  void cvttss2si(Register dst, const Operand& src);
1000 1026
  void cvttsd2si(Register dst, const Operand& src);
......
1012 1038
  void mulsd(XMMRegister dst, const Operand& src);
1013 1039
  void divsd(XMMRegister dst, XMMRegister src);
1014 1040
  void xorpd(XMMRegister dst, XMMRegister src);
1015
  void xorps(XMMRegister dst, XMMRegister src);
1016 1041
  void sqrtsd(XMMRegister dst, XMMRegister src);
1017 1042

  
1018 1043
  void andpd(XMMRegister dst, XMMRegister src);
......
1050 1075
    }
1051 1076
  }
1052 1077

  
1053
  // Use either movsd or movlpd.
1054
  void movdbl(XMMRegister dst, const Operand& src);
1055
  void movdbl(const Operand& dst, XMMRegister src);
1056

  
1057 1078
  void movd(XMMRegister dst, Register src) { movd(dst, Operand(src)); }
1058 1079
  void movd(XMMRegister dst, const Operand& src);
1059 1080
  void movd(Register dst, XMMRegister src) { movd(Operand(dst), src); }
1060 1081
  void movd(const Operand& dst, XMMRegister src);
1061 1082
  void movsd(XMMRegister dst, XMMRegister src);
1083
  void movsd(XMMRegister dst, const Operand& src);
1084
  void movsd(const Operand& dst, XMMRegister src);
1085

  
1062 1086

  
1063 1087
  void movss(XMMRegister dst, const Operand& src);
1064 1088
  void movss(const Operand& dst, XMMRegister src);
......
1136 1160
  // Avoid overflows for displacements etc.
1137 1161
  static const int kMaximalBufferSize = 512*MB;
1138 1162

  
1139
  byte byte_at(int pos)  { return buffer_[pos]; }
1163
  byte byte_at(int pos) { return buffer_[pos]; }
1140 1164
  void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
1141 1165

  
1142 1166
 protected:
1143
  void movsd(XMMRegister dst, const Operand& src);
1144
  void movsd(const Operand& dst, XMMRegister src);
1145

  
1146 1167
  void emit_sse_operand(XMMRegister reg, const Operand& adr);
1147 1168
  void emit_sse_operand(XMMRegister dst, XMMRegister src);
1148 1169
  void emit_sse_operand(Register dst, XMMRegister src);
1170
  void emit_sse_operand(XMMRegister dst, Register src);
1149 1171

  
1150 1172
  byte* addr_at(int pos) { return buffer_ + pos; }
1151 1173

  

Also available in: Unified diff