Move constant instructions into meta.

Add new immediate types for floating point and vector immediates.
Use new immediates to define the constant value instructions in meta.

Split the fconst instruction into two: f32const and f64const. This prevents
confusion about the interpretation of 64 immediate bits when generating an f32
constant.

Add an immvector ImmediateType. This immediate type is variable length, and
provides all the bits of a SIMD vector directly.
This commit is contained in:
Jakob Stoklund Olesen
2016-03-31 14:18:02 -07:00
parent c3233fb332
commit e5305c249b
5 changed files with 87 additions and 30 deletions

View File

@@ -2,7 +2,7 @@ function average(i32, i32) -> f32 {
ss1 = stack_slot 8, align 4 ; Stack slot for ``sum``.
entry ebb1(v1: i32, v2: i32):
v3 = fconst.f64 0.0
v3 = f64const 0x0.0
stack_store v3, ss1
brz v2, ebb3 ; Handle count == 0.
v4 = iconst.i32 0
@@ -26,6 +26,6 @@ ebb2(v5: i32):
return v17
ebb3:
v100 = fconst.f32 0x7fc00000 ; 0/0 = NaN
v100 = f32const qNaN
return v100
}