HIR: Add opcode SET_ROUNDING_MODE (taking FPSCR as an argument)

This commit is contained in:
Dr. Chat
2017-05-12 14:05:27 -05:00
parent dbece71945
commit 82efbd7bc5
5 changed files with 36 additions and 0 deletions

View File

@@ -1269,6 +1269,12 @@ void HIRBuilder::Prefetch(Value* address, size_t length,
void HIRBuilder::MemoryBarrier() { AppendInstr(OPCODE_MEMORY_BARRIER_info, 0); }
void HIRBuilder::SetRoundingMode(Value* value) {
ASSERT_INTEGER_TYPE(value);
Instr* i = AppendInstr(OPCODE_SET_ROUNDING_MODE_info, 0);
i->set_src1(value);
}
Value* HIRBuilder::Max(Value* value1, Value* value2) {
ASSERT_TYPES_EQUAL(value1, value2);

View File

@@ -153,6 +153,7 @@ class HIRBuilder {
void Prefetch(Value* address, size_t length, uint32_t prefetch_flags = 0);
void MemoryBarrier();
void SetRoundingMode(Value* value);
Value* Max(Value* value1, Value* value2);
Value* VectorMax(Value* value1, Value* value2, TypeName part_type,
uint32_t arithmetic_flags = 0);

View File

@@ -225,6 +225,7 @@ enum Opcode {
OPCODE_UNPACK,
OPCODE_ATOMIC_EXCHANGE,
OPCODE_ATOMIC_COMPARE_EXCHANGE,
OPCODE_SET_ROUNDING_MODE,
__OPCODE_MAX_VALUE, // Keep at end.
};

View File

@@ -649,3 +649,9 @@ DEFINE_OPCODE(
"atomic_compare_exchange",
OPCODE_SIG_V_V_V_V,
OPCODE_FLAG_VOLATILE)
DEFINE_OPCODE(
OPCODE_SET_ROUNDING_MODE,
"set_rounding_mode",
OPCODE_SIG_X_V,
0)