Skip to content

Commit be34c8d

Browse files
committed
Call SetIgnore on all intrinsic types in x86
1 parent 290374e commit be34c8d

File tree

4 files changed

+844
-825
lines changed

4 files changed

+844
-825
lines changed

arch/x86/arch_x86_intrinsics.cpp

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5124,6 +5124,14 @@ vector<uint32_t> X86CommonArchitecture::GetAllIntrinsics()
51245124

51255125
vector<NameAndType> X86CommonArchitecture::GetIntrinsicInputs(uint32_t intrinsic)
51265126
{
5127+
static const vector<NameAndType> singleFloat10 { NameAndType(Type::FloatType(10)->SetIgnored(true)) };
5128+
static const vector<NameAndType> singleInt10 { NameAndType(Type::IntegerType(10, false)->SetIgnored(true)) };
5129+
static const vector<NameAndType> namedDoubleFloat10 { NameAndType("x", Type::FloatType(10)->SetIgnored(true)), NameAndType("y", Type::FloatType(10)->SetIgnored(true)) };
5130+
static const vector<NameAndType> doubleFloat10 { NameAndType(Type::FloatType(10)->SetIgnored(true)), NameAndType(Type::FloatType(10)->SetIgnored(true)) };
5131+
static const vector<NameAndType> singleInt8 { NameAndType(Type::IntegerType(8, false)->SetIgnored(true)) };
5132+
static const vector<NameAndType> singleInt4 { NameAndType(Type::IntegerType(4, false)->SetIgnored(true)) };
5133+
static const vector<NameAndType> singleInt2 { NameAndType(Type::IntegerType(2, false)->SetIgnored(true)) };
5134+
51275135
switch (intrinsic)
51285136
{
51295137
case INTRINSIC_F2XM1:
@@ -5134,37 +5142,37 @@ vector<NameAndType> X86CommonArchitecture::GetIntrinsicInputs(uint32_t intrinsic
51345142
case INTRINSIC_FPTAN:
51355143
case INTRINSIC_FXAM:
51365144
case INTRINSIC_FXTRACT:
5137-
return vector<NameAndType> { NameAndType(Type::FloatType(10)) };
5145+
return singleFloat10;
51385146
case INTRINSIC_FBLD:
5139-
return vector<NameAndType> { NameAndType(Type::IntegerType(10, false)) };
5147+
return singleInt10;
51405148
case INTRINSIC_FPATAN:
51415149
case INTRINSIC_FYL2X:
51425150
case INTRINSIC_FYL2XP1:
5143-
return vector<NameAndType> { NameAndType("x", Type::FloatType(10)), NameAndType("y", Type::FloatType(10)) };
5151+
return namedDoubleFloat10;
51445152
case INTRINSIC_FPREM:
51455153
case INTRINSIC_FPREM1:
51465154
case INTRINSIC_FSCALE:
5147-
return vector<NameAndType> { NameAndType(Type::FloatType(10)), NameAndType(Type::FloatType(10)) };
5155+
return doubleFloat10;
51485156
case INTRINSIC_XED_IFORM_TZCNT_GPR64_GPRMEM64:
5149-
return vector<NameAndType> { NameAndType(Type::IntegerType(8, false)) };
5157+
return singleInt8;
51505158
case INTRINSIC_XED_IFORM_TZCNT_GPR32_GPRMEM32:
5151-
return vector<NameAndType> { NameAndType(Type::IntegerType(4, false)) };
5159+
return singleInt4;
51525160
case INTRINSIC_XED_IFORM_TZCNT_GPR16_GPRMEM16:
5153-
return vector<NameAndType> { NameAndType(Type::IntegerType(2, false)) };
5161+
return singleInt2;
51545162

51555163
case INTRINSIC_XED_IFORM_LZCNT_GPR64_GPRMEM64:
5156-
return vector<NameAndType> { NameAndType(Type::IntegerType(8, false)) };
5164+
return singleInt8;
51575165
case INTRINSIC_XED_IFORM_LZCNT_GPR32_GPRMEM32:
5158-
return vector<NameAndType> { NameAndType(Type::IntegerType(4, false)) };
5166+
return singleInt4;
51595167
case INTRINSIC_XED_IFORM_LZCNT_GPR16_GPRMEM16:
5160-
return vector<NameAndType> { NameAndType(Type::IntegerType(2, false)) };
5168+
return singleInt2;
51615169

51625170
case INTRINSIC_XED_IFORM_POPCNT_GPR64_GPRMEM64:
5163-
return vector<NameAndType> { NameAndType(Type::IntegerType(8, false)) };
5171+
return singleInt8;
51645172
case INTRINSIC_XED_IFORM_POPCNT_GPR32_GPRMEM32:
5165-
return vector<NameAndType> { NameAndType(Type::IntegerType(4, false)) };
5173+
return singleInt4;
51665174
case INTRINSIC_XED_IFORM_POPCNT_GPR16_GPRMEM16:
5167-
return vector<NameAndType> { NameAndType(Type::IntegerType(2, false)) };
5175+
return singleInt2;
51685176

51695177
#include "x86_intrinsic_input_type.include"
51705178

@@ -5175,6 +5183,17 @@ vector<NameAndType> X86CommonArchitecture::GetIntrinsicInputs(uint32_t intrinsic
51755183

51765184
vector<Confidence<Ref<Type>>> X86CommonArchitecture::GetIntrinsicOutputs(uint32_t intrinsic)
51775185
{
5186+
static const vector<Confidence<Ref<Type>>> singleFloat10 { Type::FloatType(10)->SetIgnored(true) };
5187+
static const vector<Confidence<Ref<Type>>> singleInt10 { Type::IntegerType(10, false)->SetIgnored(true) };
5188+
static const vector<Confidence<Ref<Type>>> float10Bool { Type::FloatType(10)->SetIgnored(true), Type::BoolType()->SetIgnored(true) };
5189+
static const vector<Confidence<Ref<Type>>> doubleFloat10Bool { Type::FloatType(10)->SetIgnored(true), Type::FloatType(10)->SetIgnored(true), Type::BoolType()->SetIgnored(true) };
5190+
static const vector<Confidence<Ref<Type>>> float10BoolInt1 { Type::FloatType(10)->SetIgnored(true), Type::BoolType()->SetIgnored(true), Type::IntegerType(1, false)->SetIgnored(true) };
5191+
static const vector<Confidence<Ref<Type>>> quadBool { Type::BoolType()->SetIgnored(true), Type::BoolType()->SetIgnored(true), Type::BoolType()->SetIgnored(true), Type::BoolType()->SetIgnored(true) };
5192+
static const vector<Confidence<Ref<Type>>> doubleFloat10 { Type::FloatType(10)->SetIgnored(true), Type::FloatType(10)->SetIgnored(true) };
5193+
static const vector<Confidence<Ref<Type>>> singleInt8 { Type::IntegerType(8, false)->SetIgnored(true) };
5194+
static const vector<Confidence<Ref<Type>>> singleInt4 { Type::IntegerType(4, false)->SetIgnored(true) };
5195+
static const vector<Confidence<Ref<Type>>> singleInt2 { Type::IntegerType(2, false)->SetIgnored(true) };
5196+
51785197
switch (intrinsic)
51795198
{
51805199
case INTRINSIC_F2XM1:
@@ -5183,43 +5202,43 @@ vector<Confidence<Ref<Type>>> X86CommonArchitecture::GetIntrinsicOutputs(uint32_
51835202
case INTRINSIC_FSCALE:
51845203
case INTRINSIC_FYL2X:
51855204
case INTRINSIC_FYL2XP1:
5186-
return vector<Confidence<Ref<Type>>> { Type::FloatType(10) };
5205+
return singleFloat10;
51875206
case INTRINSIC_FBST:
5188-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(10, false) };
5207+
return singleInt10;
51895208
case INTRINSIC_FSIN:
51905209
case INTRINSIC_FCOS:
51915210
case INTRINSIC_FPTAN:
5192-
return vector<Confidence<Ref<Type>>> { Type::FloatType(10), Type::BoolType() };
5211+
return float10Bool;
51935212
case INTRINSIC_FSINCOS:
5194-
return vector<Confidence<Ref<Type>>> { Type::FloatType(10), Type::FloatType(10), Type::BoolType() };
5213+
return doubleFloat10Bool;
51955214
case INTRINSIC_FPREM:
51965215
case INTRINSIC_FPREM1:
5197-
return vector<Confidence<Ref<Type>>> { Type::FloatType(10), Type::BoolType(), Type::IntegerType(1, false) };
5216+
return float10BoolInt1;
51985217
case INTRINSIC_FXAM:
5199-
return vector<Confidence<Ref<Type>>> { Type::BoolType(), Type::BoolType(), Type::BoolType(), Type::BoolType() };
5218+
return quadBool;
52005219
case INTRINSIC_FXTRACT:
5201-
return vector<Confidence<Ref<Type>>> { Type::FloatType(10), Type::FloatType(10) };
5220+
return doubleFloat10;
52025221

52035222
case INTRINSIC_XED_IFORM_TZCNT_GPR64_GPRMEM64:
5204-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(8, false)};
5223+
return singleInt8;
52055224
case INTRINSIC_XED_IFORM_TZCNT_GPR32_GPRMEM32:
5206-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(4, false)};
5225+
return singleInt4;
52075226
case INTRINSIC_XED_IFORM_TZCNT_GPR16_GPRMEM16:
5208-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(2, false)};
5227+
return singleInt2;
52095228

52105229
case INTRINSIC_XED_IFORM_LZCNT_GPR64_GPRMEM64:
5211-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(8, false)};
5230+
return singleInt8;
52125231
case INTRINSIC_XED_IFORM_LZCNT_GPR32_GPRMEM32:
5213-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(4, false)};
5232+
return singleInt4;
52145233
case INTRINSIC_XED_IFORM_LZCNT_GPR16_GPRMEM16:
5215-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(2, false)};
5234+
return singleInt2;
52165235

52175236
case INTRINSIC_XED_IFORM_POPCNT_GPR64_GPRMEM64:
5218-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(8, false)};
5237+
return singleInt8;
52195238
case INTRINSIC_XED_IFORM_POPCNT_GPR32_GPRMEM32:
5220-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(4, false)};
5239+
return singleInt4;
52215240
case INTRINSIC_XED_IFORM_POPCNT_GPR16_GPRMEM16:
5222-
return vector<Confidence<Ref<Type>>> { Type::IntegerType(2, false)};
5241+
return singleInt2;
52235242

52245243
#include "x86_intrinsic_output_type.include"
52255244

arch/x86/code_generator/parse-iform-types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,18 +415,18 @@ def generate_str(self):
415415
array = False
416416
if self.element_size > 1:
417417
array = True
418-
418+
419419
inner_str = ''
420420
if self.type == 'float':
421-
inner_str = 'Type::FloatType(%d)' % self.element_size_byte
421+
inner_str = 'Type::FloatType(%d)->SetIgnored(true)' % self.element_size_byte
422422
elif self.type == 'int':
423423
signed_str = 'true' if self.signed else 'false'
424-
inner_str = 'Type::IntegerType(%d, %s)' % (self.element_size_byte, signed_str)
424+
inner_str = 'Type::IntegerType(%d, %s)->SetIgnored(true)' % (self.element_size_byte, signed_str)
425425
else:
426-
inner_str = 'Type::BoolType()'
427-
426+
inner_str = 'Type::BoolType()->SetIgnored(true)'
427+
428428
if self.n_element > 1:
429-
s = 'Type::ArrayType(%s, %d)' % (inner_str, self.n_element)
429+
s = 'Type::ArrayType(%s, %d)->SetIgnored(true)' % (inner_str, self.n_element)
430430
else:
431431
s = inner_str
432432

0 commit comments

Comments
 (0)